Browse Source

客户线索列表修改

anderx 1 year ago
parent
commit
2da52c0e5f

+ 0 - 16
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -14,7 +14,6 @@ import com.goafanti.report.bo.marketingESBo;
 import com.goafanti.report.bo.userDataListBo;
 import com.goafanti.user.bo.*;
 import org.apache.ibatis.annotations.Param;
-import org.springframework.data.domain.Pageable;
 
 import java.util.Date;
 import java.util.List;
@@ -37,22 +36,7 @@ public interface UserMapper {
     User queryById(String id);
 
 
-    /**
-     * 查询指定行数据
-     *
-     * @param user     查询条件
-     * @param pageable 分页对象
-     * @return 对象列表
-     */
-    List<User> findUserList(User user, @Param("pageable") Pageable pageable);
 
-    /**
-     * 统计总行数
-     *
-     * @param user 查询条件
-     * @return 总行数
-     */
-    int findUserCount(User user);
 
     /**
      * 新增数据

+ 1 - 388
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -63,303 +63,6 @@
         where id = #{id}
     </select>
 
-    <!--查询指定行数据-->
-    <select id="findUserList" resultMap="UserMap">
-        select
-        <include refid="UserAllSql"/>
-
-        from user
-        <where>
-            <if test="id != null and id != ''">
-                and id = #{id}
-            </if>
-            <if test="mobile != null and mobile != ''">
-                and mobile = #{mobile}
-            </if>
-            <if test="password != null and password != ''">
-                and password = #{password}
-            </if>
-            <if test="nickname != null and nickname != ''">
-                and nickname = #{nickname}
-            </if>
-            <if test="email != null and email != ''">
-                and email = #{email}
-            </if>
-            <if test="createTime != null">
-                and create_time = #{createTime}
-            </if>
-            <if test="number != null">
-                and number = #{number}
-            </if>
-            <if test="lvl != null">
-                and lvl = #{lvl}
-            </if>
-            <if test="type != null">
-                and type = #{type}
-            </if>
-            <if test="aid != null and aid != ''">
-                and aid = #{aid}
-            </if>
-            <if test="mid != null and mid != ''">
-                and mid = #{mid}
-            </if>
-            <if test="status != null">
-                and status = #{status}
-            </if>
-            <if test="source != null">
-                and source = #{source}
-            </if>
-            <if test="updateTime != null">
-                and update_time = #{updateTime}
-            </if>
-            <if test="companyLogoUrl != null and companyLogoUrl != ''">
-                and company_logo_url = #{companyLogoUrl}
-            </if>
-            <if test="headPortraitUrl != null and headPortraitUrl != ''">
-                and head_portrait_url = #{headPortraitUrl}
-            </if>
-            <if test="societyTag != null and societyTag != ''">
-                and society_tag = #{societyTag}
-            </if>
-            <if test="introduction != null and introduction != ''">
-                and introduction = #{introduction}
-            </if>
-            <if test="valueAddedTag != null and valueAddedTag != ''">
-                and value_added_tag = #{valueAddedTag}
-            </if>
-            <if test="organizationId != null and organizationId != ''">
-                and organization_id = #{organizationId}
-            </if>
-            <if test="shareType != null">
-                and share_type = #{shareType}
-            </if>
-            <if test="identifyName != null and identifyName != ''">
-                and identify_name = #{identifyName}
-            </if>
-            <if test="backgroundUrl != null and backgroundUrl != ''">
-                and background_url = #{backgroundUrl}
-            </if>
-            <if test="auditStatus != null">
-                and audit_status = #{auditStatus}
-            </if>
-            <if test="auditOpinion != null and auditOpinion != ''">
-                and audit_opinion = #{auditOpinion}
-            </if>
-            <if test="transferTime != null">
-                and transfer_time = #{transferTime}
-            </if>
-            <if test="informationMaintainer != null and informationMaintainer != ''">
-                and information_maintainer = #{informationMaintainer}
-            </if>
-            <if test="coreTechnology != null and coreTechnology != ''">
-                and core_technology = #{coreTechnology}
-            </if>
-            <if test="accomplishSituation != null and accomplishSituation != ''">
-                and accomplish_situation = #{accomplishSituation}
-            </if>
-            <if test="intellectualProperty != null and intellectualProperty != ''">
-                and intellectual_property = #{intellectualProperty}
-            </if>
-            <if test="creditRating != null">
-                and credit_rating = #{creditRating}
-            </if>
-            <if test="level != null">
-                and level = #{level}
-            </if>
-            <if test="authentication != null">
-                and authentication = #{authentication}
-            </if>
-            <if test="username != null and username != ''">
-                and username = #{username}
-            </if>
-            <if test="integrity != null">
-                and integrity = #{integrity}
-            </if>
-            <if test="toInviteCode != null and toInviteCode != ''">
-                and to_invite_code = #{toInviteCode}
-            </if>
-            <if test="beInviteCode != null and beInviteCode != ''">
-                and be_invite_code = #{beInviteCode}
-            </if>
-            <if test="guidance != null">
-                and guidance = #{guidance}
-            </if>
-            <if test="signBills != null">
-                and sign_bills = #{signBills}
-            </if>
-            <if test="channel != null">
-                and channel = #{channel}
-            </if>
-            <if test="newChannel != null">
-                and new_channel = #{newChannel}
-            </if>
-            <if test="signTime != null">
-                and sign_time = #{signTime}
-            </if>
-            <if test="callStatus != null">
-                and call_status = #{callStatus}
-            </if>
-            <if test="clueStatus != null">
-                and clue_status = #{clueStatus}
-            </if>
-            <if test="clueProcess != null">
-                and clue_process = #{clueProcess}
-            </if>
-            <if test="clueTime != null">
-                and clue_time = #{clueTime}
-            </if>
-        </where>
-        <if test="page_sql != null">
-            ${page_sql}
-        </if>
-    </select>
-
-    <!--统计总行数-->
-    <select id="findUserCounts" resultType="java.lang.Integer">
-        select count(1)
-        from user
-        <where>
-            <if test="id != null and id != ''">
-                and id = #{id}
-            </if>
-            <if test="mobile != null and mobile != ''">
-                and mobile = #{mobile}
-            </if>
-            <if test="password != null and password != ''">
-                and password = #{password}
-            </if>
-            <if test="nickname != null and nickname != ''">
-                and nickname = #{nickname}
-            </if>
-            <if test="email != null and email != ''">
-                and email = #{email}
-            </if>
-            <if test="createTime != null">
-                and create_time = #{createTime}
-            </if>
-            <if test="number != null">
-                and number = #{number}
-            </if>
-            <if test="lvl != null">
-                and lvl = #{lvl}
-            </if>
-            <if test="type != null">
-                and type = #{type}
-            </if>
-            <if test="aid != null and aid != ''">
-                and aid = #{aid}
-            </if>
-            <if test="mid != null and mid != ''">
-                and mid = #{mid}
-            </if>
-            <if test="status != null">
-                and status = #{status}
-            </if>
-            <if test="source != null">
-                and source = #{source}
-            </if>
-            <if test="updateTime != null">
-                and update_time = #{updateTime}
-            </if>
-            <if test="companyLogoUrl != null and companyLogoUrl != ''">
-                and company_logo_url = #{companyLogoUrl}
-            </if>
-            <if test="headPortraitUrl != null and headPortraitUrl != ''">
-                and head_portrait_url = #{headPortraitUrl}
-            </if>
-            <if test="societyTag != null and societyTag != ''">
-                and society_tag = #{societyTag}
-            </if>
-            <if test="introduction != null and introduction != ''">
-                and introduction = #{introduction}
-            </if>
-            <if test="valueAddedTag != null and valueAddedTag != ''">
-                and value_added_tag = #{valueAddedTag}
-            </if>
-            <if test="organizationId != null and organizationId != ''">
-                and organization_id = #{organizationId}
-            </if>
-            <if test="shareType != null">
-                and share_type = #{shareType}
-            </if>
-            <if test="identifyName != null and identifyName != ''">
-                and identify_name = #{identifyName}
-            </if>
-            <if test="backgroundUrl != null and backgroundUrl != ''">
-                and background_url = #{backgroundUrl}
-            </if>
-            <if test="auditStatus != null">
-                and audit_status = #{auditStatus}
-            </if>
-            <if test="auditOpinion != null and auditOpinion != ''">
-                and audit_opinion = #{auditOpinion}
-            </if>
-            <if test="transferTime != null">
-                and transfer_time = #{transferTime}
-            </if>
-            <if test="informationMaintainer != null and informationMaintainer != ''">
-                and information_maintainer = #{informationMaintainer}
-            </if>
-            <if test="coreTechnology != null and coreTechnology != ''">
-                and core_technology = #{coreTechnology}
-            </if>
-            <if test="accomplishSituation != null and accomplishSituation != ''">
-                and accomplish_situation = #{accomplishSituation}
-            </if>
-            <if test="intellectualProperty != null and intellectualProperty != ''">
-                and intellectual_property = #{intellectualProperty}
-            </if>
-            <if test="creditRating != null">
-                and credit_rating = #{creditRating}
-            </if>
-            <if test="level != null">
-                and level = #{level}
-            </if>
-            <if test="authentication != null">
-                and authentication = #{authentication}
-            </if>
-            <if test="username != null and username != ''">
-                and username = #{username}
-            </if>
-            <if test="integrity != null">
-                and integrity = #{integrity}
-            </if>
-            <if test="toInviteCode != null and toInviteCode != ''">
-                and to_invite_code = #{toInviteCode}
-            </if>
-            <if test="beInviteCode != null and beInviteCode != ''">
-                and be_invite_code = #{beInviteCode}
-            </if>
-            <if test="guidance != null">
-                and guidance = #{guidance}
-            </if>
-            <if test="signBills != null">
-                and sign_bills = #{signBills}
-            </if>
-            <if test="channel != null">
-                and channel = #{channel}
-            </if>
-            <if test="newChannel != null">
-                and new_channel = #{newChannel}
-            </if>
-            <if test="signTime != null">
-                and sign_time = #{signTime}
-            </if>
-            <if test="callStatus != null">
-                and call_status = #{callStatus}
-            </if>
-            <if test="clueStatus != null">
-                and clue_status = #{clueStatus}
-            </if>
-            <if test="clueProcess != null">
-                and clue_process = #{clueProcess}
-            </if>
-            <if test="clueTime != null">
-                and clue_time = #{clueTime}
-            </if>
-        </where>
-    </select>
-
     <!--新增所有列-->
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
         insert into user(mobile, password, nickname, email, create_time, number, lvl, type, aid, mid, status, source,
@@ -378,96 +81,6 @@
                 #{newChannel}, #{signTime}, #{callStatus}, #{clueStatus}, #{clueProcess}, #{clueTime})
     </insert>
 
-    <insert id="insertBatch">
-        insert into user(mobile, password, nickname, email, create_time, number, lvl, type, aid, mid, status, source,
-        update_time, company_logo_url, head_portrait_url, society_tag, introduction, value_added_tag, organization_id,
-        share_type, identify_name, background_url, audit_status, audit_opinion, transfer_time, information_maintainer,
-        core_technology, accomplish_situation, intellectual_property, credit_rating, level, authentication, username,
-        integrity, to_invite_code, be_invite_code, guidance, sign_bills, channel, new_channel, sign_time, call_status,
-        clue_status, clue_process, clue_time)
-        values
-        <foreach collection="entities" item="entity" separator=",">
-            (#{entity.mobile}, #{entity.password}, #{entity.nickname}, #{entity.email}, #{entity.createTime},
-            #{entity.number}, #{entity.lvl}, #{entity.type}, #{entity.aid}, #{entity.mid}, #{entity.status},
-            #{entity.source}, #{entity.updateTime}, #{entity.companyLogoUrl}, #{entity.headPortraitUrl},
-            #{entity.societyTag}, #{entity.introduction}, #{entity.valueAddedTag}, #{entity.organizationId},
-            #{entity.shareType}, #{entity.identifyName}, #{entity.backgroundUrl}, #{entity.auditStatus},
-            #{entity.auditOpinion}, #{entity.transferTime}, #{entity.informationMaintainer}, #{entity.coreTechnology},
-            #{entity.accomplishSituation}, #{entity.intellectualProperty}, #{entity.creditRating}, #{entity.level},
-            #{entity.authentication}, #{entity.username}, #{entity.integrity}, #{entity.toInviteCode},
-            #{entity.beInviteCode}, #{entity.guidance}, #{entity.signBills}, #{entity.channel}, #{entity.newChannel},
-            #{entity.signTime}, #{entity.callStatus}, #{entity.clueStatus}, #{entity.clueProcess}, #{entity.clueTime})
-        </foreach>
-    </insert>
-
-    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
-        insert into user(mobile, password, nickname, email, create_time, number, lvl, type, aid, mid, status, source,
-        update_time, company_logo_url, head_portrait_url, society_tag, introduction, value_added_tag, organization_id,
-        share_type, identify_name, background_url, audit_status, audit_opinion, transfer_time, information_maintainer,
-        core_technology, accomplish_situation, intellectual_property, credit_rating, level, authentication, username,
-        integrity, to_invite_code, be_invite_code, guidance, sign_bills, channel, new_channel, sign_time, call_status,
-        clue_status, clue_process, clue_time)
-        values
-        <foreach collection="entities" item="entity" separator=",">
-            (#{entity.mobile}, #{entity.password}, #{entity.nickname}, #{entity.email}, #{entity.createTime},
-            #{entity.number}, #{entity.lvl}, #{entity.type}, #{entity.aid}, #{entity.mid}, #{entity.status},
-            #{entity.source}, #{entity.updateTime}, #{entity.companyLogoUrl}, #{entity.headPortraitUrl},
-            #{entity.societyTag}, #{entity.introduction}, #{entity.valueAddedTag}, #{entity.organizationId},
-            #{entity.shareType}, #{entity.identifyName}, #{entity.backgroundUrl}, #{entity.auditStatus},
-            #{entity.auditOpinion}, #{entity.transferTime}, #{entity.informationMaintainer}, #{entity.coreTechnology},
-            #{entity.accomplishSituation}, #{entity.intellectualProperty}, #{entity.creditRating}, #{entity.level},
-            #{entity.authentication}, #{entity.username}, #{entity.integrity}, #{entity.toInviteCode},
-            #{entity.beInviteCode}, #{entity.guidance}, #{entity.signBills}, #{entity.channel}, #{entity.newChannel},
-            #{entity.signTime}, #{entity.callStatus}, #{entity.clueStatus}, #{entity.clueProcess}, #{entity.clueTime})
-        </foreach>
-        on duplicate key update
-        mobile = values(mobile),
-        password = values(password),
-        nickname = values(nickname),
-        email = values(email),
-        create_time = values(create_time),
-        number = values(number),
-        lvl = values(lvl),
-        type = values(type),
-        aid = values(aid),
-        mid = values(mid),
-        status = values(status),
-        source = values(source),
-        update_time = values(update_time),
-        company_logo_url = values(company_logo_url),
-        head_portrait_url = values(head_portrait_url),
-        society_tag = values(society_tag),
-        introduction = values(introduction),
-        value_added_tag = values(value_added_tag),
-        organization_id = values(organization_id),
-        share_type = values(share_type),
-        identify_name = values(identify_name),
-        background_url = values(background_url),
-        audit_status = values(audit_status),
-        audit_opinion = values(audit_opinion),
-        transfer_time = values(transfer_time),
-        information_maintainer = values(information_maintainer),
-        core_technology = values(core_technology),
-        accomplish_situation = values(accomplish_situation),
-        intellectual_property = values(intellectual_property),
-        credit_rating = values(credit_rating),
-        level = values(level),
-        authentication = values(authentication),
-        username = values(username),
-        integrity = values(integrity),
-        to_invite_code = values(to_invite_code),
-        be_invite_code = values(be_invite_code),
-        guidance = values(guidance),
-        sign_bills = values(sign_bills),
-        channel = values(channel),
-        new_channel = values(new_channel),
-        sign_time = values(sign_time),
-        call_status = values(call_status),
-        clue_status = values(clue_status),
-        clue_process = values(clue_process),
-        clue_time = values(clue_time)
-    </insert>
-
     <!--通过主键修改数据-->
     <update id="update">
         update user
@@ -1895,7 +1508,7 @@
           and datediff(now(),if(u.transfer_time  &lt; um.last_follow_time,um.last_follow_time,u.transfer_time))>30
     </select>
 
-    <select id="selectUserClueList" resultType="com.goafanti.customer.bo.OutUserClueBo">
+    <select id="selectUserClueList" resultType="com.goafanti.customer.bo.OutUserClueList">
         select a.id,a.nickname ,b.contacts ,b.contact_mobile contactMobile,c.name adminName,
                a.clue_process clueProcess,a.clue_time clueTime
         from `user` a left join organization_identity b on a.id =b.uid

+ 34 - 0
src/main/java/com/goafanti/customer/bo/InputUserClueBo.java

@@ -0,0 +1,34 @@
+package com.goafanti.customer.bo;
+
+public class InputUserClueBo {
+
+    private String userName;
+
+    private String contacts;
+
+    private String contactMobile;
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(String contacts) {
+        this.contacts = contacts;
+    }
+
+    public String getContactMobile() {
+        return contactMobile;
+    }
+
+    public void setContactMobile(String contactMobile) {
+        this.contactMobile = contactMobile;
+    }
+}

+ 76 - 0
src/main/java/com/goafanti/customer/bo/OutUserClueList.java

@@ -0,0 +1,76 @@
+package com.goafanti.customer.bo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.goafanti.common.utils.excel.Excel;
+
+public class OutUserClueList {
+
+    private String id;
+    @Excel(name = "客户姓名")
+    private String nickname;
+    @Excel(name = "联系人")
+    private String contacts;
+    @Excel(name = "联系人手机号")
+    private String contactMobile;
+    private String adminName;
+    private String clueProcess;
+    private String clueTime;
+
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getNickname() {
+        return nickname;
+    }
+
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+
+    public String getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(String contacts) {
+        this.contacts = contacts;
+    }
+
+    public String getContactMobile() {
+        return contactMobile;
+    }
+
+    public void setContactMobile(String contactMobile) {
+        this.contactMobile = contactMobile;
+    }
+
+    public String getAdminName() {
+        return adminName;
+    }
+
+    public void setAdminName(String adminName) {
+        this.adminName = adminName;
+    }
+
+    public String getClueProcess() {
+        return clueProcess;
+    }
+
+    public void setClueProcess(String clueProcess) {
+        this.clueProcess = clueProcess;
+    }
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    public String getClueTime() {
+        return clueTime;
+    }
+
+    public void setClueTime(String clueTime) {
+        this.clueTime = clueTime;
+    }
+}

+ 21 - 0
src/main/java/com/goafanti/customer/controller/UserClueApiController.java

@@ -3,11 +3,13 @@ package com.goafanti.customer.controller;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.utils.excel.NewExcelUtil;
+import com.goafanti.customer.bo.InputUserClueBo;
 import com.goafanti.customer.bo.InputUserClueList;
 import com.goafanti.customer.bo.OutUserClueExcel;
 import com.goafanti.customer.service.UserClueService;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -23,14 +25,33 @@ public class UserClueApiController extends BaseApiController{
 	private String			uploadPath	= null;
 
 
+	/**
+	 * 客户线索列表
+	 * @param in
+	 * @return
+	 */
 	@GetMapping("/list")
 	public Result list(InputUserClueList in) {
 		return new Result(userClueService.list(in));
 	}
 
+	/**
+	 * 导出客户线索模版
+	 * @return
+	 */
 	@GetMapping("/exportTemplate")
 	public Result exportList( ) {
 		NewExcelUtil<OutUserClueExcel> excelUtil=new NewExcelUtil<>(OutUserClueExcel.class);
 		return excelUtil.exportExcel(null,"签单客户统计表",uploadPath);
 	}
+
+	/**
+	 * 新增客户线索
+	 * @return
+	 */
+	@PostMapping("/add")
+	public Result add( InputUserClueBo in) {
+		Result res = new Result();
+		return res.data(userClueService.add(in));
+	}
 }

+ 3 - 1
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -118,7 +118,9 @@ public interface CustomerService {
 	int addCustomer(InputAddCustomer in)  throws BusinessException;
 
 
-	/**
+    void checkUserName(InputAddCustomer in);
+
+    /**
 	 * 查询单位客户详情
 	 * @param uid 用户ID
 	 * @return

+ 3 - 0
src/main/java/com/goafanti/customer/service/UserClueService.java

@@ -1,7 +1,10 @@
 package com.goafanti.customer.service;
 
+import com.goafanti.customer.bo.InputUserClueBo;
 import com.goafanti.customer.bo.InputUserClueList;
 
 public interface UserClueService {
     Object list(InputUserClueList in);
+
+    Object add(InputUserClueBo in);
 }

+ 2 - 2
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -504,8 +504,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	}
 
 
-
-    private void checkUserName(InputAddCustomer in) {
+	@Override
+	public void checkUserName(InputAddCustomer in) {
 		if (!userMapper.checkUser("", in.getName(), "", in.getType(), null, null).isEmpty())
 			throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_EXIST, in.getName(), ""));
 		String name2=null;

+ 134 - 3
src/main/java/com/goafanti/customer/service/impl/UserClueServiceImpl.java

@@ -1,16 +1,147 @@
 package com.goafanti.customer.service.impl;
 
-import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.*;
+import com.goafanti.common.enums.IdentityProcess;
+import com.goafanti.common.enums.UserLevel;
+import com.goafanti.common.model.*;
+import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.customer.bo.InputAddCustomer;
+import com.goafanti.customer.bo.InputUserClueBo;
 import com.goafanti.customer.bo.InputUserClueList;
+import com.goafanti.customer.bo.OutUserClueList;
+import com.goafanti.customer.service.CustomerService;
 import com.goafanti.customer.service.UserClueService;
+import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.UUID;
+
+@Service
 public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements UserClueService {
+
+    @Resource
+    private UserMapper userMapper;
+    @Resource
+    private UserMidMapper userMidMapper;
+    @Resource
+    private UserTransferLogMapper userTransferLogMapper;
+    @Resource
+    private AdminMapper adminMapper;
+    @Resource
+    private CustomerService customerService;
+    @Resource
+    private UserNamesMapper userNamesMapper;
+    @Resource
+    private OrganizationContactBookMapper organizationContactBookMapper;
+    @Resource
+    private OrganizationIdentityMapper organizationIdentityMapper;
+
+
+
+
+    @Resource(name = "passwordUtil")
+    private PasswordUtil					passwordUtil;
+
     @Override
     public Object list(InputUserClueList in) {
-
-        Pagination<?> page = findPage("selectUserClueList", "selectUserClueCount", in);
+        Pagination<OutUserClueList> page = (Pagination<OutUserClueList>) findPage("selectUserClueList", "selectUserClueCount", in);
         return page;
     }
+
+    @Override
+    public Object add(InputUserClueBo in) {
+        User user = new User();
+        Date now = new Date();
+        String aid= TokenManager.getAdminId();
+        String uid = UUID.randomUUID().toString();
+        String identifyId = UUID.randomUUID().toString();
+        user.setId(uid);
+        user.setSource(1);// 客户来源为录入
+        user.setIdentifyName(in.getUserName());
+        user.setNickname(in.getUserName());
+        user.setUsername(in.getUserName());
+        user.setStatus(AFTConstants.USER_STATUS_NORMAL);
+        user.setShareType(1);
+        user.setAid(TokenManager.getAdminId());
+//		user.setAid("1");
+        user.setType(1);
+        user.setLvl(UserLevel.CERTIFIED.getCode());
+        user.setCreateTime(now);
+        user.setTransferTime(now);
+        user.setUpdateTime(now);
+        user.setSignBills(0);
+        user.setNewChannel(0);
+        user.setMobile(in.getContactMobile());
+        user.setPassword(AFTConstants.INITIALPASSWORD);
+        user.setInformationMaintainer(TokenManager.getAdminId());
+        double f = 0;
+        user.setIntegrity(f);
+//		user.setInformationMaintainer("1");
+        user.setChannel(0);
+        user.setClueProcess(0);
+        user.setClueStatus(1);
+        user.setClueTime(now);
+        passwordUtil.encryptPassword(user);
+        String aname = adminMapper.queryById(TokenManager.getAdminId()).getName();
+
+            //判定客户名称
+            checkUserName(in);
+            UserMid um=new UserMid();
+            um.setAid(user.getAid());
+            um.setUid(uid);
+            userMidMapper.insertSelective(um);
+            // 创建企业认证信息
+            OrganizationIdentity oi = new OrganizationIdentity();
+            oi.setUnitName(in.getUserName());
+            oi.setId(identifyId);
+            oi.setUid(uid);
+            oi.setContacts(in.getContacts());
+            oi.setContactMobile(in.getContactMobile());
+            oi.setHighTechZone(AFTConstants.NO);
+            oi.setInternational(AFTConstants.NO);
+            oi.setListed(AFTConstants.NO);
+            oi.setAuditStatus(IdentityProcess.SUCCESS.getCode()); // 实名企业
+            organizationIdentityMapper.insert(oi);
+        userMapper.insertSelective(user);
+        UserNames un=new UserNames();
+        un.setUid(uid);
+        un.setAid(aid);
+        un.setName(user.getNickname());
+        userNamesMapper.insertSelective(un);
+        // 新增企业联系人
+        OrganizationContactBook cob = new OrganizationContactBook();
+        cob.setAid(TokenManager.getAdminId());
+        cob.setAname(aname);
+        cob.setId(UUID.randomUUID().toString());
+        cob.setUid(uid);
+        cob.setName(in.getContacts());
+        cob.setMobile(in.getContactMobile());
+        cob.setMajor(AFTConstants.YES);
+        organizationContactBookMapper.insert(cob);
+        addUserTransferLog(user);
+
+
+        return 1;
+    }
+
+    private void addUserTransferLog(User user) {
+        UserTransferLog u = new UserTransferLog();
+        u.setUid(user.getId());
+        u.setAid(TokenManager.getAdminId());
+//        22=导入线索客户,23=转交线索客户,24=退回线索客户,25=移除线索客户,26=领取线索客户
+        u.setType(22);
+        userTransferLogMapper.insertSelective(u);
+    }
+
+    private void checkUserName(InputUserClueBo in) {
+        InputAddCustomer in1=new InputAddCustomer();
+        in1.setName(in.getUserName());
+        in1.setType(1);
+        customerService.checkUserName(in1);
+    }
 }

+ 5 - 5
src/main/resources/props/config_local.properties

@@ -4,13 +4,13 @@ jdbc.driverClassName=com.mysql.jdbc.Driver
 static.host=//static.jishutao.com/1.3.29
 #static.host=//172.16.1.187/1.3.29
 
-jdbc.url=jdbc\:mysql://localhost:3306/aft20241122?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft20241122?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-jdbc.username=root
-jdbc.password=123456
-#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.username=root
-#jdbc.password=aftdev
+#jdbc.password=123456
+jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.username=root
+jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20