Просмотр исходного кода

社群 群、好友状态同步

wangyunpeng 4 дней назад
Родитель
Сommit
e41bc040fe

+ 3 - 3
api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComUserDetailJob.java

@@ -120,11 +120,11 @@ public class WeComUserDetailJob {
                 existUser.setUpdateTime(new Date());
                 if (deleteStatusList.contains(contactItem.getStatus())
                         && !deleteStatusList.contains(existUser.getStatus())) {
-                    existUser.setRemoveCustiomerTime(System.currentTimeMillis() / 1000);
+                    existUser.setRemoveCustomerTime(System.currentTimeMillis() / 1000);
                 } else if (deleteStatusList.contains(contactItem.getStatus())
-                        && Objects.isNull(existUser.getRemoveCustiomerTime())) {
+                        && Objects.isNull(existUser.getRemoveCustomerTime())) {
                     // 历史已删除,设为前一天
-                    existUser.setRemoveCustiomerTime((System.currentTimeMillis() / 1000) - 86400);
+                    existUser.setRemoveCustomerTime((System.currentTimeMillis() / 1000) - 86400);
                 }
                 existUser.setAddCustomerTime(contactItem.getAdd_customer_time());
                 existUser.setUnionid(contactItem.getUnionid());

+ 6 - 6
api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComStaffUser.java

@@ -9,7 +9,7 @@ public class ThirdPartWeComStaffUser {
 
     private Long addCustomerTime;
 
-    private Long removeCustiomerTime;
+    private Long removeCustomerTime;
 
     private String unionid;
 
@@ -77,12 +77,12 @@ public class ThirdPartWeComStaffUser {
         this.addCustomerTime = addCustomerTime;
     }
 
-    public Long getRemoveCustiomerTime() {
-        return removeCustiomerTime;
+    public Long getRemoveCustomerTime() {
+        return removeCustomerTime;
     }
 
-    public void setRemoveCustiomerTime(Long removeCustiomerTime) {
-        this.removeCustiomerTime = removeCustiomerTime;
+    public void setRemoveCustomerTime(Long removeCustomerTime) {
+        this.removeCustomerTime = removeCustomerTime;
     }
 
     public String getUnionid() {
@@ -262,7 +262,7 @@ public class ThirdPartWeComStaffUser {
         sb.append(", id=").append(id);
         sb.append(", thirdStaffId=").append(thirdStaffId);
         sb.append(", addCustomerTime=").append(addCustomerTime);
-        sb.append(", removeCustiomerTime=").append(removeCustiomerTime);
+        sb.append(", removeCustomerTime=").append(removeCustomerTime);
         sb.append(", unionid=").append(unionid);
         sb.append(", sex=").append(sex);
         sb.append(", mobile=").append(mobile);

+ 24 - 24
api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComStaffUserExample.java

@@ -296,63 +296,63 @@ public class ThirdPartWeComStaffUserExample {
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeIsNull() {
-            addCriterion("remove_custiomer_time is null");
+        public Criteria andRemoveCustomerTimeIsNull() {
+            addCriterion("remove_customer_time is null");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeIsNotNull() {
-            addCriterion("remove_custiomer_time is not null");
+        public Criteria andRemoveCustomerTimeIsNotNull() {
+            addCriterion("remove_customer_time is not null");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeEqualTo(Long value) {
-            addCriterion("remove_custiomer_time =", value, "removeCustiomerTime");
+        public Criteria andRemoveCustomerTimeEqualTo(Long value) {
+            addCriterion("remove_customer_time =", value, "removeCustomerTime");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeNotEqualTo(Long value) {
-            addCriterion("remove_custiomer_time <>", value, "removeCustiomerTime");
+        public Criteria andRemoveCustomerTimeNotEqualTo(Long value) {
+            addCriterion("remove_customer_time <>", value, "removeCustomerTime");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeGreaterThan(Long value) {
-            addCriterion("remove_custiomer_time >", value, "removeCustiomerTime");
+        public Criteria andRemoveCustomerTimeGreaterThan(Long value) {
+            addCriterion("remove_customer_time >", value, "removeCustomerTime");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeGreaterThanOrEqualTo(Long value) {
-            addCriterion("remove_custiomer_time >=", value, "removeCustiomerTime");
+        public Criteria andRemoveCustomerTimeGreaterThanOrEqualTo(Long value) {
+            addCriterion("remove_customer_time >=", value, "removeCustomerTime");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeLessThan(Long value) {
-            addCriterion("remove_custiomer_time <", value, "removeCustiomerTime");
+        public Criteria andRemoveCustomerTimeLessThan(Long value) {
+            addCriterion("remove_customer_time <", value, "removeCustomerTime");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeLessThanOrEqualTo(Long value) {
-            addCriterion("remove_custiomer_time <=", value, "removeCustiomerTime");
+        public Criteria andRemoveCustomerTimeLessThanOrEqualTo(Long value) {
+            addCriterion("remove_customer_time <=", value, "removeCustomerTime");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeIn(List<Long> values) {
-            addCriterion("remove_custiomer_time in", values, "removeCustiomerTime");
+        public Criteria andRemoveCustomerTimeIn(List<Long> values) {
+            addCriterion("remove_customer_time in", values, "removeCustomerTime");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeNotIn(List<Long> values) {
-            addCriterion("remove_custiomer_time not in", values, "removeCustiomerTime");
+        public Criteria andRemoveCustomerTimeNotIn(List<Long> values) {
+            addCriterion("remove_customer_time not in", values, "removeCustomerTime");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeBetween(Long value1, Long value2) {
-            addCriterion("remove_custiomer_time between", value1, value2, "removeCustiomerTime");
+        public Criteria andRemoveCustomerTimeBetween(Long value1, Long value2) {
+            addCriterion("remove_customer_time between", value1, value2, "removeCustomerTime");
             return (Criteria) this;
         }
 
-        public Criteria andRemoveCustiomerTimeNotBetween(Long value1, Long value2) {
-            addCriterion("remove_custiomer_time not between", value1, value2, "removeCustiomerTime");
+        public Criteria andRemoveCustomerTimeNotBetween(Long value1, Long value2) {
+            addCriterion("remove_customer_time not between", value1, value2, "removeCustomerTime");
             return (Criteria) this;
         }
 

+ 14 - 14
api-module/src/main/resources/mapper/wecom/thirdpart/ThirdPartWeComStaffUserMapper.xml

@@ -5,7 +5,7 @@
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="third_staff_id" jdbcType="BIGINT" property="thirdStaffId" />
     <result column="add_customer_time" jdbcType="BIGINT" property="addCustomerTime" />
-    <result column="remove_custiomer_time" jdbcType="BIGINT" property="removeCustiomerTime" />
+    <result column="remove_customer_time" jdbcType="BIGINT" property="removeCustomerTime" />
     <result column="unionid" jdbcType="VARCHAR" property="unionid" />
     <result column="sex" jdbcType="INTEGER" property="sex" />
     <result column="mobile" jdbcType="VARCHAR" property="mobile" />
@@ -87,7 +87,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, third_staff_id, add_customer_time, remove_custiomer_time, unionid, sex, mobile, 
+    id, third_staff_id, add_customer_time, remove_customer_time, unionid, sex, mobile, 
     company_remark, acctid, avatar, `source`, english_name, remark_phone, realname, real_remarks, 
     labelid, user_id, nickname, `position`, corp_id, remarks, seq, `status`, create_time, 
     update_time
@@ -127,7 +127,7 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaffUser">
     insert into third_part_we_com_staff_user (id, third_staff_id, add_customer_time, 
-      remove_custiomer_time, unionid, sex, 
+      remove_customer_time, unionid, sex, 
       mobile, company_remark, acctid, 
       avatar, `source`, english_name, 
       remark_phone, realname, real_remarks, 
@@ -136,7 +136,7 @@
       seq, `status`, create_time, 
       update_time)
     values (#{id,jdbcType=BIGINT}, #{thirdStaffId,jdbcType=BIGINT}, #{addCustomerTime,jdbcType=BIGINT}, 
-      #{removeCustiomerTime,jdbcType=BIGINT}, #{unionid,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER}, 
+      #{removeCustomerTime,jdbcType=BIGINT}, #{unionid,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER}, 
       #{mobile,jdbcType=VARCHAR}, #{companyRemark,jdbcType=VARCHAR}, #{acctid,jdbcType=VARCHAR}, 
       #{avatar,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, #{englishName,jdbcType=VARCHAR}, 
       #{remarkPhone,jdbcType=VARCHAR}, #{realname,jdbcType=VARCHAR}, #{realRemarks,jdbcType=VARCHAR}, 
@@ -157,8 +157,8 @@
       <if test="addCustomerTime != null">
         add_customer_time,
       </if>
-      <if test="removeCustiomerTime != null">
-        remove_custiomer_time,
+      <if test="removeCustomerTime != null">
+        remove_customer_time,
       </if>
       <if test="unionid != null">
         unionid,
@@ -234,8 +234,8 @@
       <if test="addCustomerTime != null">
         #{addCustomerTime,jdbcType=BIGINT},
       </if>
-      <if test="removeCustiomerTime != null">
-        #{removeCustiomerTime,jdbcType=BIGINT},
+      <if test="removeCustomerTime != null">
+        #{removeCustomerTime,jdbcType=BIGINT},
       </if>
       <if test="unionid != null">
         #{unionid,jdbcType=VARCHAR},
@@ -320,8 +320,8 @@
       <if test="record.addCustomerTime != null">
         add_customer_time = #{record.addCustomerTime,jdbcType=BIGINT},
       </if>
-      <if test="record.removeCustiomerTime != null">
-        remove_custiomer_time = #{record.removeCustiomerTime,jdbcType=BIGINT},
+      <if test="record.removeCustomerTime != null">
+        remove_customer_time = #{record.removeCustomerTime,jdbcType=BIGINT},
       </if>
       <if test="record.unionid != null">
         unionid = #{record.unionid,jdbcType=VARCHAR},
@@ -396,7 +396,7 @@
     set id = #{record.id,jdbcType=BIGINT},
       third_staff_id = #{record.thirdStaffId,jdbcType=BIGINT},
       add_customer_time = #{record.addCustomerTime,jdbcType=BIGINT},
-      remove_custiomer_time = #{record.removeCustiomerTime,jdbcType=BIGINT},
+      remove_customer_time = #{record.removeCustomerTime,jdbcType=BIGINT},
       unionid = #{record.unionid,jdbcType=VARCHAR},
       sex = #{record.sex,jdbcType=INTEGER},
       mobile = #{record.mobile,jdbcType=VARCHAR},
@@ -431,8 +431,8 @@
       <if test="addCustomerTime != null">
         add_customer_time = #{addCustomerTime,jdbcType=BIGINT},
       </if>
-      <if test="removeCustiomerTime != null">
-        remove_custiomer_time = #{removeCustiomerTime,jdbcType=BIGINT},
+      <if test="removeCustomerTime != null">
+        remove_customer_time = #{removeCustomerTime,jdbcType=BIGINT},
       </if>
       <if test="unionid != null">
         unionid = #{unionid,jdbcType=VARCHAR},
@@ -504,7 +504,7 @@
     update third_part_we_com_staff_user
     set third_staff_id = #{thirdStaffId,jdbcType=BIGINT},
       add_customer_time = #{addCustomerTime,jdbcType=BIGINT},
-      remove_custiomer_time = #{removeCustiomerTime,jdbcType=BIGINT},
+      remove_customer_time = #{removeCustomerTime,jdbcType=BIGINT},
       unionid = #{unionid,jdbcType=VARCHAR},
       sex = #{sex,jdbcType=INTEGER},
       mobile = #{mobile,jdbcType=VARCHAR},

+ 21 - 24
api-module/src/main/resources/mapper/wecom/thirdpart/ext/ThirdPartWeComMapperExt.xml

@@ -4,31 +4,29 @@
 
     <insert id="batchInsertThirdPartWeComRoomUser">
         insert into third_part_we_com_room_user (id, third_room_id, unionid, sex, mobile, acctid, join_scene, avatar,
-        english_name, realname, room_notes, join_time, nickname, room_nickname, `position`, uin, invite_user_id,
-        corp_id,
-        create_time, update_time)
+        english_name, realname, room_notes, join_time, quit_time, nickname,
+        room_nickname, `position`, uin, invite_user_id, corp_id, create_time, update_time)
         values
         <foreach collection="records" item="item" separator=",">
             (#{item.id}, #{item.thirdRoomId}, #{item.unionid}, #{item.sex}, #{item.mobile}, #{item.acctid},
-            #{item.joinScene},
-            #{item.avatar}, #{item.englishName}, #{item.realname}, #{item.roomNotes}, #{item.joinTime},
-            #{item.nickname},
-            #{item.roomNickname}, #{item.position}, #{item.uin}, #{item.inviteUserId}, #{item.corpId},
-            #{item.createTime},
-            #{item.updateTime})
+            #{item.joinScene}, #{item.avatar}, #{item.englishName}, #{item.realname}, #{item.roomNotes},
+            #{item.joinTime}, #{item.quitTime}, #{item.nickname}, #{item.roomNickname}, #{item.position},
+            #{item.uin}, #{item.inviteUserId}, #{item.corpId}, #{item.createTime}, #{item.updateTime})
         </foreach>
     </insert>
 
     <insert id="batchInsertThirdPartWeComStaffUser">
-        insert into third_part_we_com_staff_user (id, third_staff_id, unionid, sex, mobile, company_remark,
-        acctid, avatar, `source`, english_name, remark_phone, realname, real_remarks, labelid, user_id,
-        nickname, `position`, corp_id, remarks, seq, `status`, create_time, update_time)
+        insert into third_part_we_com_staff_user (id, third_staff_id, add_customer_time, remove_customer_time, unionid,
+        sex, mobile, company_remark, acctid, avatar, `source`, english_name,
+        remark_phone, realname, real_remarks, labelid, user_id, nickname,
+        `position`, corp_id, remarks, seq, `status`, create_time, update_time)
         values
         <foreach collection="records" item="item" separator=",">
-            (#{item.id}, #{item.thirdStaffId}, #{item.unionid}, #{item.sex}, #{item.mobile}, #{item.companyRemark},
-            #{item.acctid}, #{item.avatar}, #{item.source}, #{item.englishName}, #{item.remarkPhone}, #{item.realname},
-            #{item.realRemarks}, #{item.labelid}, #{item.userId}, #{item.nickname}, #{item.position}, #{item.corpId},
-            #{item.remarks}, #{item.seq}, #{item.status}, #{item.createTime}, #{item.updateTime})
+            (#{item.id}, #{item.thirdStaffId}, #{item.addCustomerTime}, #{item.removeCustomerTime}, #{item.unionid},
+            #{item.sex}, #{item.mobile}, #{item.companyRemark}, #{item.acctid}, #{item.avatar}, #{item.source},
+            #{item.englishName}, #{item.remarkPhone}, #{item.realname}, #{item.realRemarks}, #{item.labelid},
+            #{item.userId}, #{item.nickname}, #{item.position}, #{item.corpId}, #{item.remarks}, #{item.seq},
+            #{item.status}, #{item.createTime}, #{item.updateTime})
         </foreach>
     </insert>
 
@@ -36,14 +34,13 @@
             resultType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaffUser">
         select staff_user.*
         from third_part_we_com_staff staff
-                 join third_part_we_com_staff_user staff_user on staff.third_staff_id = staff_user.third_staff_id
-                 left join (select distinct room_user.uin
-                            from third_part_we_com_staff staff
-                                     join third_part_we_com_room room on staff.id = room.staff_id
-                                     join third_part_we_com_room_user room_user
-                                          on room.third_room_id = room_user.third_room_id
-                            where staff.third_staff_id = #{thirdStaffId}) room_user
-                           on staff_user.user_id = room_user.uin
+        join third_part_we_com_staff_user staff_user on staff.third_staff_id = staff_user.third_staff_id
+        left join (select distinct room_user.uin
+            from third_part_we_com_staff staff
+                     join third_part_we_com_room room on staff.id = room.staff_id
+                     join third_part_we_com_room_user room_user
+                      on room.third_room_id = room_user.third_room_id
+            where staff.third_staff_id = #{thirdStaffId}) room_user on staff_user.user_id = room_user.uin
         where staff.third_staff_id = #{thirdStaffId}
           and room_user.uin is null
     </select>