Kaynağa Gözat

各接口操作数据同步到客户统计表

anderx 3 yıl önce
ebeveyn
işleme
6e95e4f55e

+ 55 - 5
src/main/java/com/goafanti/common/mapper/UserMidMapper.xml

@@ -23,12 +23,15 @@
     <result column="sign_amount" jdbcType="DECIMAL" property="signAmount" />
     <result column="last_signing_time" jdbcType="DATE" property="lastSigningTime" />
     <result column="first_signing_time" jdbcType="DATE" property="firstSigningTime" />
+    <result column="follow_dep" jdbcType="VARCHAR" property="followDep" />
+    <result column="follow_explain" jdbcType="VARCHAR" property="followExplain" />
+    <result column="follow_aname" jdbcType="VARCHAR" property="followAname" />
   </resultMap>
   <sql id="Base_Column_List">
     id, `uid`, aid, last_follow_time, last_sign_time, create_time, big_customer, update_aid,
     update_name, date_update_time, channel_type, chargeback, `member`, last_sales_type,
     last_follow_type, follow_number, task_names, sign_number, sign_amount, last_signing_time,
-    first_signing_time
+    first_signing_time, follow_dep, follow_explain, follow_aname
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -47,7 +50,8 @@
       date_update_time, channel_type, chargeback,
       `member`, last_sales_type, last_follow_type,
       follow_number, task_names, sign_number,
-      sign_amount, last_signing_time, first_signing_time
+      sign_amount, last_signing_time, first_signing_time,
+      follow_dep, follow_explain, follow_aname
       )
     values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
       #{lastFollowTime,jdbcType=TIMESTAMP}, #{lastSignTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
@@ -55,7 +59,8 @@
       #{dateUpdateTime,jdbcType=TIMESTAMP}, #{channelType,jdbcType=INTEGER}, #{chargeback,jdbcType=INTEGER},
       #{member,jdbcType=INTEGER}, #{lastSalesType,jdbcType=INTEGER}, #{lastFollowType,jdbcType=INTEGER},
       #{followNumber,jdbcType=INTEGER}, #{taskNames,jdbcType=VARCHAR}, #{signNumber,jdbcType=INTEGER},
-      #{signAmount,jdbcType=DECIMAL}, #{lastSigningTime,jdbcType=DATE}, #{firstSigningTime,jdbcType=DATE}
+      #{signAmount,jdbcType=DECIMAL}, #{lastSigningTime,jdbcType=DATE}, #{firstSigningTime,jdbcType=DATE},
+      #{followDep,jdbcType=VARCHAR}, #{followExplain,jdbcType=VARCHAR}, #{followAname,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.UserMid">
@@ -124,6 +129,15 @@
       <if test="firstSigningTime != null">
         first_signing_time,
       </if>
+      <if test="followDep != null">
+        follow_dep,
+      </if>
+      <if test="followExplain != null">
+        follow_explain,
+      </if>
+      <if test="followAname != null">
+        follow_aname,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -189,6 +203,15 @@
       <if test="firstSigningTime != null">
         #{firstSigningTime,jdbcType=DATE},
       </if>
+      <if test="followDep != null">
+        #{followDep,jdbcType=VARCHAR},
+      </if>
+      <if test="followExplain != null">
+        #{followExplain,jdbcType=VARCHAR},
+      </if>
+      <if test="followAname != null">
+        #{followAname,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserMid">
@@ -254,6 +277,15 @@
       <if test="firstSigningTime != null">
         first_signing_time = #{firstSigningTime,jdbcType=DATE},
       </if>
+      <if test="followDep != null">
+        follow_dep = #{followDep,jdbcType=VARCHAR},
+      </if>
+      <if test="followExplain != null">
+        follow_explain = #{followExplain,jdbcType=VARCHAR},
+      </if>
+      <if test="followAname != null">
+        follow_aname = #{followAname,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -278,7 +310,10 @@
       sign_number = #{signNumber,jdbcType=INTEGER},
       sign_amount = #{signAmount,jdbcType=DECIMAL},
       last_signing_time = #{lastSigningTime,jdbcType=DATE},
-      first_signing_time = #{firstSigningTime,jdbcType=DATE}
+      first_signing_time = #{firstSigningTime,jdbcType=DATE},
+      follow_dep = #{followDep,jdbcType=VARCHAR},
+      follow_explain = #{followExplain,jdbcType=VARCHAR},
+      follow_aname = #{followAname,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -342,6 +377,15 @@
       <if test="firstSigningTime != null">
         first_signing_time = #{firstSigningTime,jdbcType=DATE},
       </if>
+      <if test="followDep != null">
+        follow_dep = #{followDep,jdbcType=VARCHAR},
+      </if>
+      <if test="followExplain != null">
+        follow_explain = #{followExplain,jdbcType=VARCHAR},
+      </if>
+      <if test="followAname != null">
+        follow_aname = #{followAname,jdbcType=VARCHAR},
+      </if>
     </set>
     where `uid` = #{uid,jdbcType=VARCHAR}
   </update>
@@ -403,7 +447,7 @@
            b.last_sales_type  lastSalesType,c.name,b.follow_dep followDep,
            b.last_follow_type lastFollowType,b.follow_explain followExplain ,b.follow_number followNumber ,
            date_format(b.last_follow_time ,'%Y-%m-%d %H:%i:%S') lastFollowTime ,b.task_names taskNames ,
-           b.`member` ,b.chargeback ,b.big_customer bigCustomer
+           b.`member` ,b.chargeback ,b.big_customer bigCustomer,b.follow_aname followAname
     from user a left join user_mid b on a.id=b.uid  left join admin c on a.aid=c.id
     where 1=1
       <if test="userName != null">
@@ -412,6 +456,9 @@
     <if test="adminName != null">
       and c.name  like concat('%',#{adminName},'%')
     </if>
+    <if test="followAname != null">
+      and b.follow_aname  like concat('%',#{followAname},'%')
+    </if>
     <if test="member != null">
       and b.`member` = #{member}
     </if>
@@ -456,6 +503,9 @@
     <if test="adminName != null">
       and c.name  like concat('%',#{adminName},'%')
     </if>
+    <if test="followAname != null">
+      and b.follow_aname  like concat('%',#{followAname},'%')
+    </if>
     <if test="member != null">
       and b.`member` = #{member}
     </if>

+ 39 - 0
src/main/java/com/goafanti/common/model/UserMid.java

@@ -114,6 +114,21 @@ public class UserMid implements Serializable {
      */
     private Date firstSigningTime;
 
+    /**
+     * 跟进部门
+     */
+    private String followDep;
+
+    /**
+     * 跟进说明
+     */
+    private String followExplain;
+
+    /**
+     * 跟进人
+     */
+    private String followAname;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -283,4 +298,28 @@ public class UserMid implements Serializable {
     public void setFirstSigningTime(Date firstSigningTime) {
         this.firstSigningTime = firstSigningTime;
     }
+
+    public String getFollowDep() {
+        return followDep;
+    }
+
+    public void setFollowDep(String followDep) {
+        this.followDep = followDep;
+    }
+
+    public String getFollowExplain() {
+        return followExplain;
+    }
+
+    public void setFollowExplain(String followExplain) {
+        this.followExplain = followExplain;
+    }
+
+    public String getFollowAname() {
+        return followAname;
+    }
+
+    public void setFollowAname(String followAname) {
+        this.followAname = followAname;
+    }
 }

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

@@ -697,8 +697,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		um.setUid(userFollow.getUid());
 		um.setLastFollowTime(userFollow.getCreateTime());
 		um.setFollowNumber(followCount);
-		um.set
+		um.setFollowExplain(userFollow.getResult());
+		um.setFollowDep(userFollow.getFollowDep());
 		um.setLastFollowType(userFollow.getContactType());
+		um.setFollowAname(a.getName());
 		userMidMapper.updateByUid(um);
 		userFollowMapper.insert(userFollow);
 		// 检查客户锁定情况

+ 9 - 0
src/main/java/com/goafanti/order/bo/InputSignSummary.java

@@ -4,6 +4,7 @@ public class InputSignSummary {
 
     private String userName;
     private String adminName;
+    private String followAname;
     private Integer member;
     private Integer chargeback;
     private Integer bigCustomer;
@@ -20,6 +21,14 @@ public class InputSignSummary {
     private Integer pageNo;
     private Integer pageSize;
 
+    public String getFollowAname() {
+        return followAname;
+    }
+
+    public void setFollowAname(String followAname) {
+        this.followAname = followAname;
+    }
+
     public Integer getPageNo() {
         return pageNo;
     }

+ 11 - 1
src/main/java/com/goafanti/order/bo/OutSignSummary.java

@@ -17,8 +17,10 @@ public class OutSignSummary {
     private String lastSigningTime;
     @Excel(name = "签单类型")
     private Integer lastSalesType;
-    @Excel(name = "跟进人")
+    @Excel(name = "客户所属人")
     private String name;
+    @Excel(name = "跟进人")
+    private String followAname;
     @Excel(name = "跟进部门")
     private String followDep;
     @Excel(name = "跟进类型")
@@ -38,6 +40,14 @@ public class OutSignSummary {
     @Excel(name = "大客户")
     private Integer bigCustomer;
 
+    public String getFollowAname() {
+        return followAname;
+    }
+
+    public void setFollowAname(String followAname) {
+        this.followAname = followAname;
+    }
+
     public String getId() {
         return id;
     }

+ 1 - 0
src/main/java/com/goafanti/order/service/impl/UserStatisticsServiceImpl.java

@@ -28,6 +28,7 @@ public class UserStatisticsServiceImpl extends BaseMybatisDao<UserMidMapper> imp
 		Map<String, Object> map = new HashMap<>();
 		if (in.getUserName()!=null)map.put("userName",in.getUserName());
 		if (in.getAdminName()!=null)map.put("adminName",in.getAdminName());
+		if (in.getFollowAname()!=null)map.put("followAname",in.getFollowAname());
 		if (in.getMember()!=null)map.put("member",in.getMember());
 		if (in.getChargeback()!=null)map.put("chargeback",in.getChargeback());
 		if (in.getBigCustomer()!=null)map.put("bigCustomer",in.getBigCustomer());