Procházet zdrojové kódy

Merge branch 'test' of jishutao/kede-server into prod

anderx před 4 roky
rodič
revize
cbe67b347e

+ 1 - 1
GeneratorConfig.xml

@@ -43,7 +43,7 @@
     <property name="enableSubPackages" value="false"/>
      <property name="nullCatalogMeansCurrent" value="true"/>
     </javaClientGenerator>
-    <table schema="aft" tableName="public_release_log"
+    <table schema="aft" tableName="user_names"
 	enableCountByExample="false" enableUpdateByExample="false"
 	enableDeleteByExample="false" enableSelectByExample="false"
 	selectByExampleQueryId="false" enableSelectByPrimaryKey="true"

+ 67 - 0
src/main/java/com/goafanti/common/dao/UserNamesMapper.java

@@ -0,0 +1,67 @@
+package com.goafanti.common.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.goafanti.common.model.UserNames;
+import com.goafanti.customer.bo.UserNamesListBo;
+import com.goafanti.user.bo.InputUserChannel;
+
+public interface UserNamesMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_names
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_names
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    int insert(UserNames record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_names
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    int insertSelective(UserNames record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_names
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    UserNames selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_names
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    int updateByPrimaryKeySelective(UserNames record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_names
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    int updateByPrimaryKey(UserNames record);
+
+	List<UserNamesListBo> getUserList(String uid);
+
+	int updateAddUserName(@Param("uid") String uid, @Param("userName")String userName);
+
+	int checkUserName(String userName);
+
+	void insertBatch(List<InputUserChannel> list);
+}

+ 54 - 35
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -327,7 +327,7 @@
 	<select id="selectOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
 		select 
 			a.id as uid,
-			a.identify_name as name,
+			a.nickname as name,
 			date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
 			dg1.name as province,
 			dg2.name as city, 
@@ -338,6 +338,7 @@
 			a.channel ,
 			a.information_maintainer as mid 		
 		from `user` a 
+		left join user_names un on a.id=un.uid 
 		left join organization_identity b on a.id = b.uid
 		left join district_glossory dg1 on b.location_province = dg1.id
 		left join district_glossory dg2 on b.location_city = dg2.id
@@ -345,10 +346,10 @@
 		left join admin d on a.aid = d.id 
 		where a.type = 1 and a.status != 1
 	<if test="role == 0">
-		and a.identify_name = #{name}
+		and un.name = #{name}
 	</if>
 	<if test="role == 1">
-		and a.identify_name like concat('%', #{name},'%')
+		and a.nickname like concat('%', #{name},'%')
 	</if>	
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
@@ -379,6 +380,7 @@
 		select 
 			count(0)
 		from user a 
+		left join user_names un on a.id=un.uid 
 		left join organization_identity b on a.id = b.uid
 		<if test="departmentId != null and departmentId !=''">
 		INNER join (select id
@@ -387,11 +389,11 @@
 		</if>
 		where a.type = 1 and a.status != 1
 		<if test="role == 0">
-		and a.identify_name = #{name}
+		and un.name = #{name}
 	</if>
 	<if test="role == 1">
-		and a.identify_name like concat('%', #{name},'%')
-	</if>
+		and a.nickname like concat('%', #{name},'%')
+	</if>	
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
@@ -413,7 +415,7 @@
 	</select>
 	
 	<select id="selectPrivateOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
-	select a.id uid,a.aid,a.identify_name name,a.society_tag societyTag,a.`level`,b.name aName,dg1.name as province,dg2.name as city,
+	select a.id uid,a.aid,a.nickname name,a.society_tag societyTag,a.`level`,b.name aName,dg1.name as province,dg2.name as city,
 	a.guidance, dg3.name as area,
 	date_format(um.last_sign_time,'%Y-%m-%d %H:%i:%S') lastSignTime,
 	date_format(a.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime, 
@@ -430,13 +432,18 @@
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="power ==1  or power ==2">
-			and a.aid in
+			and a.aid
+			<if test="alist2 !=null">
 			<foreach item="item" collection="alist" separator="," open="(" close=")" index="">
-		       #{item}
+		      in #{item}
 		     </foreach> 
+			</if>
+			<if test="alist2 !=null">
+			 is null
+			 </if>
 		</if>
 		<if test="name != null and name != ''">
-			and a.identify_name like concat('%',#{name},'%')
+			and a.nickname like concat('%',#{name},'%')
 		</if>
 		<if test="startDate != null and startDate != ''">
 			and a.transfer_time &gt; #{startDate}
@@ -465,6 +472,7 @@
 		 <if test="sortType == 1">
 		 		desc
 		 </if>
+		 ,a.`number`
 		 <if test="page_sql != null">
     		${page_sql}
    		 </if> 
@@ -478,14 +486,19 @@
 		<if test="power ==0">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
-		<if test="power ==1 or power ==2">
-			and a.aid in
+			<if test="power ==1  or power ==2">
+			and a.aid
+			<if test="alist2 !=null">
 			<foreach item="item" collection="alist" separator="," open="(" close=")" index="">
-		       #{item}
+		      in #{item}
 		     </foreach> 
+			</if>
+			<if test="alist2 !=null">
+			 is null
+			 </if>
 		</if>
 		<if test="name != null and name != ''">
-			and a.identify_name like concat('%',#{name},'%')
+			and a.nickname like concat('%',#{name},'%')
 		</if>
 		<if test="startDate != null and startDate != ''">
 			and a.transfer_time &gt; #{startDate}
@@ -509,7 +522,7 @@
 	<select id="selectPublicOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
 		select
 			a.id as uid,
-			a.identify_name as name,
+			a.nickname as name,
 			a.create_time as createTime,
 			a.transfer_time as transferTime,
 			dg1.name as province,
@@ -527,7 +540,7 @@
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="name != null and name != ''">
-			and a.identify_name like concat('%',#{name},'%')
+			and a.nickname like concat('%',#{name},'%')
 		</if>	
 		<if test="startDate != null and startDate != ''">
 			and a.transfer_time &gt; #{startDate}
@@ -572,7 +585,7 @@
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="name != null and name != ''">
-			and a.identify_name like concat('%',#{name},'%')
+			and a.nickname like concat('%',#{name},'%')
 		</if>	
 		<if test="startDate != null and startDate != ''">
 			and a.transfer_time &gt; #{startDate}
@@ -594,7 +607,7 @@
 			select 	
 			a.id as uid,
 			a.society_tag as societyTag,
-			a.identify_name as name,
+			a.nickname as name,
 			a.share_type as shareType,
 			date_format(a.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime, 
 			dg1.name as province,
@@ -617,7 +630,7 @@
 			and a.channel= #{channel}
 		</if>
 		<if test="name != null and name != ''">
-			and a.identify_name like concat('%',#{name},'%')
+			and a.nickname like concat('%',#{name},'%')
 		</if>
 		<if test="shareType != null">
 			and a.share_type = #{shareType,jdbcType=VARCHAR}
@@ -637,7 +650,7 @@
 		<if test="area != null">
 			and b.location_area = #{area,jdbcType=INTEGER}
 		</if>
-		order by a.transfer_time desc
+		order by a.transfer_time desc,a.`number`
 		 <if test="page_sql != null">
     		${page_sql}
    		 </if>
@@ -677,7 +690,7 @@
 	</select>
 	
 	<select id="findCustomerByName" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
-		select id,identify_name as name from user where identify_name like
+		select id,nickname as name from user where identify_name like
 		concat('%',#{identifyName},'%') and status <![CDATA[!= ]]> 1 and audit_status = 1
 	</select>
 	
@@ -784,7 +797,7 @@
 	
 	<select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">
 		select a.id as followId, a.aid,date_format( a.create_time,'%Y-%m-%d %H:%i:%S') as followTime, a.contact_type as contactType,
-			a.result,a.guidance, b.identify_name as identifyName, c.name as contacts, c.mobile as contactMobile,
+			a.result,a.guidance, b.nickname,b.identify_name as identifyName, c.name as contacts, c.mobile as contactMobile,
 			d.name as adminName,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%S') as guidanceTime
 		<if test="businessProjectId != null and businessProjectId != ''"><!--  客户甲项目A所有的跟进记录 -->
 			,e.id as ufbId,e.follow_situation as followSituation,e.customer_status as customerStatus
@@ -852,7 +865,7 @@
 	
 	<select id="findCustomerContacts" parameterType="java.lang.String" resultType="com.goafanti.common.model.OrganizationContactBook">
 	select a.id,a.name,a.mobile,a.email,a.qq,a.wechat,a.department,a.position,a.major,a.fixed_tel fixedTel,a.aname,b.location_province,
-	d1.name provinceName,d2.name cityName,d3.name areaName,date_format(a.create_time,'%Y-%m-%d')createTimes,aid 
+	d1.name provinceName,d2.name cityName,d3.name areaName,date_format(a.create_time,'%Y-%m-%d')createTimes,a.aid 
 	from organization_contact_book a 
 	left join organization_identity b on a.uid=b.uid left join district_glossory d1 on b.location_province=d1.id 
 	left join district_glossory d2 on b.location_city=d2.id left join district_glossory d3 on b.location_area=d3.id 
@@ -1417,7 +1430,7 @@
 			a.type,
 			a.status, 
 			date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
-			a.identify_name as name,
+			a.nickname as name,
 			a.society_tag as societyTag,
 			share_type as shareType,
 			b.contacts,
@@ -1439,7 +1452,7 @@
 			and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
 		</if>
 		<if test="name != null and name != ''">
-			and a.identify_name like concat('%',#{name},'%')
+			and a.nickname like concat('%',#{name},'%')
 		</if>
 		<if test="shareType != null">
 			and a.share_type = #{shareType,jdbcType=VARCHAR}
@@ -1481,7 +1494,7 @@
 			and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))
 		</if>
 		<if test="name != null and name != ''">
-			and a.identify_name like concat('%',#{name},'%')
+			and a.nickname like concat('%',#{name},'%')
 		</if>
 		<if test="shareType != null">
 			and a.share_type = #{shareType,jdbcType=VARCHAR}
@@ -1627,14 +1640,14 @@
     </select>
     
     <select id="selectPrivateCustomerByName" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
-		select b.id,b.identify_name as name from 
+		select b.id,b.nickname as name from 
 			(select uid from user_lock_release  where type = 0  and status = 0 and aid = #{aid} group by uid) a
 		inner join user b on a.uid = b.id
-			where b.status != 1 and b.channel =0 and b.identify_name like concat('%',#{name},'%')
+			where b.status != 1 and b.channel =0 and b.nickname like concat('%',#{name},'%')
     </select>
     
     <select id="selectSignedCustomerByName"  resultType="com.goafanti.customer.bo.CustomerSimpleBo">
-   	 	select b.id,b.identify_name as name from user b  
+   	 	select b.id,b.nickname as name from user b  
 	where b.status != 1
 	<if test="type==2">
 	and b.channel=1
@@ -1642,7 +1655,7 @@
 	<if test="type==1">
 	and b.share_type=2
 	</if>  
-	and b.aid = #{aid}  and b.identify_name like concat('%',#{name},'%')
+	and b.aid = #{aid}  and b.nickname like concat('%',#{name},'%')
     </select>
     
     <update id="updateReleaseLock" parameterType="java.lang.String">
@@ -2077,12 +2090,12 @@ inner join(
 	
 	<insert id="insertBatch" parameterType="com.goafanti.user.bo.InputUserChannel">
 	INSERT INTO `user` (id, mobile, password,
-	nickname,identify_name,
+	nickname,identify_name,username,
 	share_type,type,society_tag,channel,source,status)VALUES
 	<foreach item="item" index="index" collection="list"
 		separator=",">
 		(#{item.uid,jdbcType=VARCHAR}, #{item.contactMobile,jdbcType=VARCHAR},#{item.password,jdbcType=VARCHAR},
-		#{item.userName},#{item.userName},
+		#{item.userName},#{item.userName},#{item.userName},
 		#{item.shareType,jdbcType=TIMESTAMP}, 1,#{item.societyTag},1,1 ,#{item.userStatus})
     </foreach>
   </insert>
@@ -2154,7 +2167,7 @@ inner join(
   <if test="startTime!=null and endTime !=null">
  	and a.create_time between #{startTime} and #{endTime}
  	</if>
- 	order by a.status ,a.create_time desc
+ 	order by a.status ,a.create_time desc,a.id
  	<if test="page_sql != null">
     		${page_sql}
    		 </if>
@@ -2286,7 +2299,13 @@ inner join(
 	where r.role_type=80
   </select>
   
-  <select id="getUserByName" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
-		select id,nickname name from `user` where nickname like concat('%',#{name},'%')
+  <select id="getUserByNameList" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
+  	select id,nickname name from `user` where nickname like concat('%',#{name},'%')
+  	<if test="page_sql != null">
+   		${page_sql}
+	</if>
+    </select>
+    <select id="getUserByNameCount" resultType="java.lang.Integer" >
+  	select count(*) from `user` where nickname like concat('%',#{name},'%')
     </select>
 </mapper>

+ 154 - 0
src/main/java/com/goafanti/common/mapper/UserNamesMapper.xml

@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.UserNamesMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserNames">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 05 11:40:49 CST 2021.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="uid" jdbcType="VARCHAR" property="uid" />
+    <result column="aid" jdbcType="VARCHAR" property="aid" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 05 11:40:49 CST 2021.
+    -->
+    id, `uid`, aid, `name`, create_time
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 05 11:40:49 CST 2021.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from user_names
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 05 11:40:49 CST 2021.
+    -->
+    delete from user_names
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.UserNames">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 05 11:40:49 CST 2021.
+    -->
+    insert into user_names (id, `uid`, aid, 
+      `name`, create_time)
+    values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, 
+      #{name,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.UserNames">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 05 11:40:49 CST 2021.
+    -->
+    insert into user_names
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="uid != null">
+        `uid`,
+      </if>
+      <if test="aid != null">
+        aid,
+      </if>
+      <if test="name != null">
+        `name`,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="uid != null">
+        #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="aid != null">
+        #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserNames">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 05 11:40:49 CST 2021.
+    -->
+    update user_names
+    <set>
+      <if test="uid != null">
+        `uid` = #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="name != null">
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserNames">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Jul 05 11:40:49 CST 2021.
+    -->
+    update user_names
+    set `uid` = #{uid,jdbcType=VARCHAR},
+      aid = #{aid,jdbcType=VARCHAR},
+      `name` = #{name,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateAddUserName">
+  update `user`  set nickname=concat(#{userName},'[',username ,']'),username = #{userName}
+	where id= #{uid};
+  </update>
+  <select id="getUserList" resultType="com.goafanti.customer.bo.UserNamesListBo">
+	  select a.id,a.uid,a.aid,a.name ,date_format(a.create_time,'%Y-%m-%d %H:%i:%S') createTimes ,b.name  adminName
+	from user_names a left join admin b on a.aid =b.id 
+	where a.uid = #{uid}
+	order by a.create_time 
+  </select>
+  <select id="checkUserName" resultType="java.lang.Integer">
+  select count(*) from user_names where name= #{userName}
+  </select>
+  
+  <insert id="insertBatch" parameterType="com.goafanti.user.bo.InputUserChannel">
+	INSERT INTO `user_names` (uid,name)VALUES
+	<foreach item="item" index="index" collection="list"
+		separator=",">
+		(#{item.uid,jdbcType=VARCHAR},#{item.userName})
+    </foreach>
+  </insert>
+</mapper>

+ 201 - 0
src/main/java/com/goafanti/common/model/UserNames.java

@@ -0,0 +1,201 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class UserNames implements Serializable {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_names.id
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_names.uid
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    private String uid;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_names.aid
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    private String aid;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_names.name
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    private String name;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_names.create_time
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    private Date createTime;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table user_names
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column user_names.id
+     *
+     * @return the value of user_names.id
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_names.id
+     *
+     * @param id the value for user_names.id
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column user_names.uid
+     *
+     * @return the value of user_names.uid
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    public String getUid() {
+        return uid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_names.uid
+     *
+     * @param uid the value for user_names.uid
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    public void setUid(String uid) {
+        this.uid = uid == null ? null : uid.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column user_names.aid
+     *
+     * @return the value of user_names.aid
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    public String getAid() {
+        return aid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_names.aid
+     *
+     * @param aid the value for user_names.aid
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    public void setAid(String aid) {
+        this.aid = aid == null ? null : aid.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column user_names.name
+     *
+     * @return the value of user_names.name
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_names.name
+     *
+     * @param name the value for user_names.name
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    public void setName(String name) {
+        this.name = name == null ? null : name.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column user_names.create_time
+     *
+     * @return the value of user_names.create_time
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_names.create_time
+     *
+     * @param createTime the value for user_names.create_time
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_names
+     *
+     * @mbg.generated Mon Jul 05 11:40:49 CST 2021
+     */
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", uid=").append(uid);
+        sb.append(", aid=").append(aid);
+        sb.append(", name=").append(name);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 0 - 2
src/main/java/com/goafanti/common/task/OrderDunTask.java

@@ -92,7 +92,6 @@ public class OrderDunTask {
 	public void updateNewOrderDun(){
   		try {
   			LoggerUtils.debug(logger, "======================新催款任务轮询启动===================");
-  		
   		List<OutNewOrderDunBo> list= newOrderDunService.selectAllOrderDun();
   		Calendar calendar=Calendar.getInstance();   
   		Calendar calendar2=Calendar.getInstance();
@@ -285,7 +284,6 @@ public class OrderDunTask {
 	*	旧催款处理
 	*
 	*/
-  	@Transactional(rollbackFor=Exception.class)
 	public void updateorderDun(){
   		try {
   			LoggerUtils.debug(logger, "======================催款任务轮询启动===================");

+ 7 - 0
src/main/java/com/goafanti/customer/bo/FollowListBo.java

@@ -12,6 +12,7 @@ public class FollowListBo {
 	
 	/** 客户名 **/
 	private String identifyName;
+	private String nickname;
 	
 	/** 联系人 **/
 	private String contacts;
@@ -134,4 +135,10 @@ public class FollowListBo {
 	public void setGuidanceTime(String guidanceTime) {
 		this.guidanceTime = guidanceTime;
 	}
+	public String getNickname() {
+		return nickname;
+	}
+	public void setNickname(String nickname) {
+		this.nickname = nickname;
+	}
 }

+ 31 - 0
src/main/java/com/goafanti/customer/bo/UserNamesListBo.java

@@ -0,0 +1,31 @@
+package com.goafanti.customer.bo;
+
+import com.goafanti.common.model.UserNames;
+
+public class UserNamesListBo  extends UserNames{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L; 
+
+	private String adminName;
+	private String createTimes;
+
+	public String getAdminName() {
+		return adminName;
+	}
+
+	public void setAdminName(String adminName) {
+		this.adminName = adminName;
+	}
+
+	public String getCreateTimes() {
+		return createTimes;
+	}
+
+	public void setCreateTimes(String createTimes) {
+		this.createTimes = createTimes;
+	}
+
+}

+ 49 - 16
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -96,6 +96,14 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 	
+	/** 签单的个人客户 **/
+	@RequestMapping(value = "/listSignPersonalCustomer", method = RequestMethod.POST)
+	public Result listSignPersonalCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(customerService.listSignPersonalCustomer(cli, pageNo, pageSize));
+		return res;
+	}
+	
 	/** 管理个人客户查询 **/
 	@RequestMapping(value = "/listAllManagePersonalCustomer" , method = RequestMethod.POST)
 	public Result listAllManagePersonalCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
@@ -115,6 +123,14 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 	
+	/** 个人客户详情信息 **/
+	@RequestMapping(value = "/findPersonalCustomerDetail" ,method = RequestMethod.GET)
+	public Result findPersonalCustomerDetail(String uid){
+		Result res = new Result();
+		res.setData(customerService.findPersonalCustomerDetail(uid));
+		return res;
+	}
+	
 	/**
 	 *  私有单位客户列表
 	 *  私有客户列表 
@@ -202,13 +218,7 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 	
-	/** 签单的个人客户 **/
-	@RequestMapping(value = "/listSignPersonalCustomer", method = RequestMethod.POST)
-	public Result listSignPersonalCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
-		Result res = new Result();
-		res.setData(customerService.listSignPersonalCustomer(cli, pageNo, pageSize));
-		return res;
-	}
+	
 	/** 签单客户转交 **/
 	@RequestMapping(value = "/customerHandOver", method = RequestMethod.POST)
 	public Result listSignPersonalCustomer(String userIds ,String receiveId){
@@ -243,14 +253,14 @@ public class AdminCustomerApiController extends BaseApiController{
 	
 	/** 客户查询 **/
 	@RequestMapping(value = "/getUserByName",method = RequestMethod.GET)
-	public Result getUserByName(String name){
+	public Result getUserByName(String name,Integer pageNo,Integer pageSize){
 		Result res = new Result();
 		if(StringUtils.isEmpty(name)){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "名称","名称"));
 			return res;
 		}
 		if(name.length()<2) return res;
-		res.data(customerService.getUserByName(name));
+		res.data(customerService.getUserByName(name,pageNo,pageSize));
 		return res;
 	}
 	
@@ -275,13 +285,7 @@ public class AdminCustomerApiController extends BaseApiController{
 		return res;
 	}
 	
-	/** 个人客户详情信息 **/
-	@RequestMapping(value = "/findPersonalCustomerDetail" ,method = RequestMethod.GET)
-	public Result findPersonalCustomerDetail(String uid){
-		Result res = new Result();
-		res.setData(customerService.findPersonalCustomerDetail(uid));
-		return res;
-	}
+	
 	
 	/** 单位客户详情信息 **/
 	@RequestMapping(value = "/findOrganizationCustomerDetail", method = RequestMethod.GET)
@@ -1331,6 +1335,35 @@ public class AdminCustomerApiController extends BaseApiController{
 		res.setData(customerService.pushChannelDeliver( uids , receiveId,remarks,type));
 		return res;
 	}
+	
+	/** 修改客户名称 **/
+	@RequestMapping(value = "/updateUserName", method = RequestMethod.POST)
+	public Result updateUserName(String uid,String userName){
+		Result res = new Result();
+		if(StringUtils.isBlank(uid) || StringUtils.isBlank(userName)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,null,"uid或者名称"));
+			return res;
+		}
+		if(customerService.checkUserName(userName)){
+			res.getError().add(buildError(ErrorConstants.CUSTOMER_ALREADY_EXIST,null,"["+userName+"]"));
+			return res;
+		} 
+		res.data(customerService.updateUserName(uid,userName));
+		return res;
+	}
+	
+	
+	/** 客户名称列表 **/
+	@RequestMapping(value = "/listUserName", method = RequestMethod.GET)
+	public Result listUserName(String uid){
+		Result res = new Result();
+		if(StringUtils.isBlank(uid) || StringUtils.isBlank(uid)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"uid","uid"));
+			return res;
+		} 
+		res.data(customerService.listUserName(uid));
+		return res;
+	}
 }
 
 

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

@@ -28,6 +28,7 @@ import com.goafanti.customer.bo.InputChannelCounts;
 import com.goafanti.customer.bo.InputListChannel;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.bo.StatisticBo;
+import com.goafanti.customer.bo.UserNamesListBo;
 import com.goafanti.customer.bo.transferListBo;
 
 public interface CustomerService {
@@ -129,9 +130,11 @@ public interface CustomerService {
 	/**
 	 * 客户全查询
 	 * @param name
+	 * @param pageSize 
+	 * @param pageNo 
 	 * @return
 	 */
-	List<CustomerSimpleBo> getUserByName(String name);
+	Object getUserByName(String name, Integer pageNo, Integer pageSize);
 	
 	/**
 	 * 判断是否存在某个单位客户
@@ -565,4 +568,7 @@ public interface CustomerService {
 	boolean checkRecovery(List<String> uids);
 	List<userDaysBo> selectChannelNotFollow(String string);
 	Object listChannelCounts(InputChannelCounts in);
+	int updateUserName(String uid, String userName);
+	List<UserNamesListBo> listUserName(String uid);
+	boolean checkUserName(String userName);
 }

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

@@ -45,6 +45,7 @@ import com.goafanti.common.dao.UserFollowMapper;
 import com.goafanti.common.dao.UserIdentityMapper;
 import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.dao.UserNamesMapper;
 import com.goafanti.common.dao.UserTransferLogMapper;
 import com.goafanti.common.enums.ChannelStatus;
 import com.goafanti.common.enums.CustomerStatusFiled;
@@ -66,6 +67,7 @@ import com.goafanti.common.model.UserFollow;
 import com.goafanti.common.model.UserFollowBusiness;
 import com.goafanti.common.model.UserIdentity;
 import com.goafanti.common.model.UserLockRelease;
+import com.goafanti.common.model.UserNames;
 import com.goafanti.common.model.UserTransferLog;
 import com.goafanti.common.utils.BeanUtilsExt;
 import com.goafanti.common.utils.DateUtils;
@@ -89,6 +91,7 @@ import com.goafanti.customer.bo.InputChannelCounts;
 import com.goafanti.customer.bo.InputListChannel;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.bo.StatisticBo;
+import com.goafanti.customer.bo.UserNamesListBo;
 import com.goafanti.customer.bo.transferListBo;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.user.bo.OutUserChannel;
@@ -137,6 +140,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	private UserTransferLogMapper userTransferLogMapper;
 	@Resource
 	private UserChannelMapper userChannelMapper;
+	@Resource
+	private UserNamesMapper	userNamesMapper;
+	
 	@Value(value = "${upload.path}")
 	private String uploadPath = null;
 
@@ -346,9 +352,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		String uid = UUID.randomUUID().toString();
 		String identifyId = UUID.randomUUID().toString();
 		user.setId(uid);
-		user.setIdentifyName(name);
 		user.setSource(1);// 客户来源为录入
+		user.setIdentifyName(name);
 		user.setNickname(name);
+		user.setUsername(name);
 		user.setStatus(AFTConstants.USER_STATUS_NORMAL);
 		user.setShareType(AFTConstants.NO);
 		user.setAid(TokenManager.getAdminId());
@@ -403,6 +410,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			organizationIdentityMapper.insert(oi);
 		}
 		userMapper.insert(user);
+		UserNames un=new UserNames();
+		un.setUid(user.getId());
+		un.setName(user.getNickname());
+		userNamesMapper.insertSelective(un);
 		// 新增企业联系人
 		OrganizationContactBook cob = new OrganizationContactBook();
 		cob.setAid(TokenManager.getAdminId());
@@ -1655,7 +1666,6 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 				}
 				// 另外一个时间取转换时间
 				s2 = clo.getTransferTime();
-				System.out.println(clo.getName());
 				l1 = DateUtils.parseDate(s1, AFTConstants.YYYYMMDDHHMMSS).getTime();
 				l2 = DateUtils.parseDate(s2, AFTConstants.YYYYMMDDHHMMSS).getTime();
 				if (i == 0) {
@@ -2200,8 +2210,40 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	}
 
 	@Override
-	public List<CustomerSimpleBo> getUserByName(String name) {
-		return userMapper.getUserByName(name);
+	public Object getUserByName(String name, Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<>();
+		params.put("name", name);
+		return  findPage("getUserByNameList", "getUserByNameCount", params, pageNo,pageSize);
+				
+				
+	}
+
+	@Override
+	public int updateUserName(String uid, String userName) {
+		userNamesMapper.updateAddUserName(uid,userName);
+		UserNames un=new UserNames();
+		un.setAid(TokenManager.getAdminId());
+		un.setUid(uid);
+		un.setName(userName);
+		userNamesMapper.insertSelective(un);
+		return 1;
+	}
+	
+	@Override
+	public boolean checkUserName(String userName) {
+		int i=userNamesMapper.checkUserName(userName);
+		if (i>0) {
+			return true;
+		}
+		return false;
+	}
+
+	@Override
+	public List<UserNamesListBo> listUserName(String uid) {
+		List<UserNamesListBo> list=userNamesMapper.getUserList(uid);
+		return list;
 	}
 
+	
+
 }

+ 4 - 0
src/main/java/com/goafanti/user/service/impl/UserChannelServiceImpl.java

@@ -32,6 +32,7 @@ import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
 import com.goafanti.common.dao.UserChannelMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.dao.UserNamesMapper;
 import com.goafanti.common.dao.UserTransferLogMapper;
 import com.goafanti.common.enums.ChannelStatus;
 import com.goafanti.common.enums.SocietyTag;
@@ -64,6 +65,8 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
 	private UserTransferLogMapper userTransferLogMapper;
 	@Autowired
 	private UserChannelMapper userChannelMapper;
+	@Autowired
+	private UserNamesMapper	userNamesMapper;
 	@Resource(name = "passwordUtil")
 	private PasswordUtil	passwordUtil;
 	
@@ -249,6 +252,7 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
         //已存在则是不用新增直接关联,非法名称则不用关联也不用新增
         if (!list.isEmpty()) {
         	userMapper.insertBatch(list);
+        	userNamesMapper.insertBatch(list);
         	organizationIdentityMapper.insertBatch(list);
         	organizationContactBookMapper.insertBatch(list);
         	userChannelMapper.insertBatch(list);

+ 10 - 8
src/main/resources/props/config_local.properties

@@ -2,13 +2,13 @@ dev.name=local
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #本地
-#jdbc.url=jdbc\:mysql://localhost:3306/aft20210528?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.url=jdbc\:mysql://localhost:3306/aft20210528?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
 #\u68c0\u6d4b\u6570\u636e\u5e93\u94fe\u63a5\u662f\u5426\u6709\u6548\uff0c\u5fc5\u987b\u914d\u7f6e
 jdbc.validationQuery=SELECT 'x'
 #\u521d\u59cb\u8fde\u63a5\u6570
@@ -68,6 +68,10 @@ avatar.upload.host=//sb.jishutao.com/upload
 #static.host=//172.16.0.253/1.1.74
 #avatar.host=//172.16.0.253
 
+
+avatar.host=//static.jishutao.com
+static.host=//static.jishutao.com/1.1.76
+
 wx.appId=wxff2f5720ed7d7f63
 wx.appSecret=081744369d42405be58fe37f892631f7
 #developer为开发版;trial为体验版;formal为正式版;
@@ -75,8 +79,6 @@ wx.state=trial
 
 
 •
-avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.1.75
 
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -60,7 +60,7 @@ user.private.max=1000
 #客户释放提醒
 user_remind_days=15
 
-static.host=//static.jishutao.com/1.1.75
+static.host=//static.jishutao.com/1.1.76
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload