wangyunpeng 4 tygodni temu
rodzic
commit
8652d7e0f1

+ 1 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/wecom/thirdpart/ext/ThirdPartWeComRoomMapperExt.java

@@ -15,4 +15,5 @@ public interface ThirdPartWeComRoomMapperExt {
                                          @Param("offset") int offset, @Param("pageSize") Integer pageSize);
                                          @Param("offset") int offset, @Param("pageSize") Integer pageSize);
 
 
     List<ThirdPartWeComRoom> getNoConfigRoomList(@Param("staffId") Long id);
     List<ThirdPartWeComRoom> getNoConfigRoomList(@Param("staffId") Long id);
+
 }
 }

+ 11 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComStaffConfig.java

@@ -19,6 +19,8 @@ public class ThirdPartWeComStaffConfig {
 
 
     private Long secondThirdStaffId;
     private Long secondThirdStaffId;
 
 
+    private Integer configSync;
+
     private Integer status;
     private Integer status;
 
 
     private Date createTime;
     private Date createTime;
@@ -89,6 +91,14 @@ public class ThirdPartWeComStaffConfig {
         this.secondThirdStaffId = secondThirdStaffId;
         this.secondThirdStaffId = secondThirdStaffId;
     }
     }
 
 
+    public Integer getConfigSync() {
+        return configSync;
+    }
+
+    public void setConfigSync(Integer configSync) {
+        this.configSync = configSync;
+    }
+
     public Integer getStatus() {
     public Integer getStatus() {
         return status;
         return status;
     }
     }
@@ -127,6 +137,7 @@ public class ThirdPartWeComStaffConfig {
         sb.append(", openRoomSendSwitchNum=").append(openRoomSendSwitchNum);
         sb.append(", openRoomSendSwitchNum=").append(openRoomSendSwitchNum);
         sb.append(", primaryThirdStaffId=").append(primaryThirdStaffId);
         sb.append(", primaryThirdStaffId=").append(primaryThirdStaffId);
         sb.append(", secondThirdStaffId=").append(secondThirdStaffId);
         sb.append(", secondThirdStaffId=").append(secondThirdStaffId);
+        sb.append(", configSync=").append(configSync);
         sb.append(", status=").append(status);
         sb.append(", status=").append(status);
         sb.append(", createTime=").append(createTime);
         sb.append(", createTime=").append(createTime);
         sb.append(", updateTime=").append(updateTime);
         sb.append(", updateTime=").append(updateTime);

+ 60 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/wecom/thirdpart/ThirdPartWeComStaffConfigExample.java

@@ -626,6 +626,66 @@ public class ThirdPartWeComStaffConfigExample {
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
+        public Criteria andConfigSyncIsNull() {
+            addCriterion("config_sync is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncIsNotNull() {
+            addCriterion("config_sync is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncEqualTo(Integer value) {
+            addCriterion("config_sync =", value, "configSync");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncNotEqualTo(Integer value) {
+            addCriterion("config_sync <>", value, "configSync");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncGreaterThan(Integer value) {
+            addCriterion("config_sync >", value, "configSync");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncGreaterThanOrEqualTo(Integer value) {
+            addCriterion("config_sync >=", value, "configSync");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncLessThan(Integer value) {
+            addCriterion("config_sync <", value, "configSync");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncLessThanOrEqualTo(Integer value) {
+            addCriterion("config_sync <=", value, "configSync");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncIn(List<Integer> values) {
+            addCriterion("config_sync in", values, "configSync");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncNotIn(List<Integer> values) {
+            addCriterion("config_sync not in", values, "configSync");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncBetween(Integer value1, Integer value2) {
+            addCriterion("config_sync between", value1, value2, "configSync");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfigSyncNotBetween(Integer value1, Integer value2) {
+            addCriterion("config_sync not between", value1, value2, "configSync");
+            return (Criteria) this;
+        }
+
         public Criteria andStatusIsNull() {
         public Criteria andStatusIsNull() {
             addCriterion("`status` is null");
             addCriterion("`status` is null");
             return (Criteria) this;
             return (Criteria) this;

+ 5 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/wecom/thirdpart/ThirdPartyAccountConfigVO.java

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.api.model.vo.wecom.thirdpart;
 package com.tzld.piaoquan.api.model.vo.wecom.thirdpart;
 
 
+import com.tzld.piaoquan.api.model.vo.IdNameVO;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
@@ -28,5 +29,9 @@ public class ThirdPartyAccountConfigVO {
     private String secondThirdStaffName;
     private String secondThirdStaffName;
     @ApiModelProperty(value = "任务列表")
     @ApiModelProperty(value = "任务列表")
     private List<ThirdPartyAccountConfigTaskVO> taskList;
     private List<ThirdPartyAccountConfigTaskVO> taskList;
+    @ApiModelProperty(value = "配置同步 0-仅对新建群生效 1-所有群 2-指定群生效")
+    private Integer configSync;
+    @ApiModelProperty(value = "指定群生效列表")
+    private List<IdNameVO<Long>> configSyncRoomIdList;
 
 
 }
 }

+ 4 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/wecom/thirdparty/WeComThirdPartyRoomService.java

@@ -34,4 +34,8 @@ public interface WeComThirdPartyRoomService {
     void saveRoomConfig(ThirdPartWeComRoom room, String accountConfigId, ThirdPartyAccountConfigVO configVO);
     void saveRoomConfig(ThirdPartWeComRoom room, String accountConfigId, ThirdPartyAccountConfigVO configVO);
 
 
     List<ThirdPartWeComRoomConfig> getRoomConfigListByRoomIds(List<Long> roomIds);
     List<ThirdPartWeComRoomConfig> getRoomConfigListByRoomIds(List<Long> roomIds);
+
+    List<ThirdPartWeComRoom> getRoomListByRoomIds(List<Long> roomIds);
+
+    List<ThirdPartWeComRoomConfig> getAccountConfigRoomConfigList(String accountConfigId);
 }
 }

+ 7 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/wecom/thirdparty/impl/WeComThirdPartyAccountServiceImpl.java

@@ -200,12 +200,19 @@ public class WeComThirdPartyAccountServiceImpl implements WeComThirdPartyAccount
         List<ThirdPartWeComStaffConfigTaskContent> contentList = getStaffConfigTaskContents(taskIds);
         List<ThirdPartWeComStaffConfigTaskContent> contentList = getStaffConfigTaskContents(taskIds);
         Map<String, List<ThirdPartWeComStaffConfigTaskContent>> taskContentMap = contentList.stream()
         Map<String, List<ThirdPartWeComStaffConfigTaskContent>> taskContentMap = contentList.stream()
                 .collect(Collectors.groupingBy(ThirdPartWeComStaffConfigTaskContent::getTaskId));
                 .collect(Collectors.groupingBy(ThirdPartWeComStaffConfigTaskContent::getTaskId));
+        List<ThirdPartWeComRoomConfig> roomConfigList = roomService.getAccountConfigRoomConfigList(config.getId());
+        List<Long> roomIds = roomConfigList.stream().map(ThirdPartWeComRoomConfig::getRoomId).collect(Collectors.toList());
+        List<ThirdPartWeComRoom> roomList = roomService.getRoomListByRoomIds(roomIds);
+        List<IdNameVO<Long>> roomIdNameList = roomList.stream().map(room -> new IdNameVO<>(room.getId(), room.getName()))
+                .collect(Collectors.toList());
         ThirdPartyAccountConfigVO result = new ThirdPartyAccountConfigVO();
         ThirdPartyAccountConfigVO result = new ThirdPartyAccountConfigVO();
         result.setId(config.getId());
         result.setId(config.getId());
         result.setPutScene(config.getPutScene());
         result.setPutScene(config.getPutScene());
         result.setChannel(config.getChannel());
         result.setChannel(config.getChannel());
         result.setSwitchFlag(config.getSwitchFlag());
         result.setSwitchFlag(config.getSwitchFlag());
         result.setOpenRoomSendSwitchNum(config.getOpenRoomSendSwitchNum());
         result.setOpenRoomSendSwitchNum(config.getOpenRoomSendSwitchNum());
+        result.setConfigSync(config.getConfigSync());
+        result.setConfigSyncRoomIdList(roomIdNameList);
         if (Objects.nonNull(config.getPrimaryThirdStaffId())) {
         if (Objects.nonNull(config.getPrimaryThirdStaffId())) {
             result.setPrimaryThirdStaffId(config.getPrimaryThirdStaffId());
             result.setPrimaryThirdStaffId(config.getPrimaryThirdStaffId());
             result.setPrimaryThirdStaffName(pushStaffMap.get(config.getPrimaryThirdStaffId()));
             result.setPrimaryThirdStaffName(pushStaffMap.get(config.getPrimaryThirdStaffId()));

+ 17 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/wecom/thirdparty/impl/WeComThirdPartyRoomServiceImpl.java

@@ -7,6 +7,7 @@ import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomConfigMapper;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomConfigMapper;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomConfigTaskContentMapper;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomConfigTaskContentMapper;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomConfigTaskMapper;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomConfigTaskMapper;
+import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomMapper;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ext.ThirdPartWeComRoomMapperExt;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ext.ThirdPartWeComRoomMapperExt;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ext.ThirdPartWeComStaffMapperExt;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ext.ThirdPartWeComStaffMapperExt;
 import com.tzld.piaoquan.api.job.wecom.thirdpart.WeComSendMsgJob;
 import com.tzld.piaoquan.api.job.wecom.thirdpart.WeComSendMsgJob;
@@ -37,6 +38,8 @@ public class WeComThirdPartyRoomServiceImpl implements WeComThirdPartyRoomServic
     @Autowired
     @Autowired
     private WeComSendMsgJob weComSendMsgJob;
     private WeComSendMsgJob weComSendMsgJob;
     @Autowired
     @Autowired
+    private ThirdPartWeComRoomMapper roomMapper;
+    @Autowired
     private ThirdPartWeComRoomConfigMapper roomConfigMapper;
     private ThirdPartWeComRoomConfigMapper roomConfigMapper;
     @Autowired
     @Autowired
     private ThirdPartWeComRoomConfigTaskMapper roomConfigTaskMapper;
     private ThirdPartWeComRoomConfigTaskMapper roomConfigTaskMapper;
@@ -395,4 +398,18 @@ public class WeComThirdPartyRoomServiceImpl implements WeComThirdPartyRoomServic
         example.createCriteria().andRoomIdIn(roomIds).andStatusEqualTo(1);
         example.createCriteria().andRoomIdIn(roomIds).andStatusEqualTo(1);
         return roomConfigMapper.selectByExample(example);
         return roomConfigMapper.selectByExample(example);
     }
     }
+
+    @Override
+    public List<ThirdPartWeComRoom> getRoomListByRoomIds(List<Long> roomIds) {
+        ThirdPartWeComRoomExample example = new ThirdPartWeComRoomExample();
+        example.createCriteria().andIdIn(roomIds).andIsDeleteEqualTo(0);
+        return roomMapper.selectByExample(example);
+    }
+
+    @Override
+    public List<ThirdPartWeComRoomConfig> getAccountConfigRoomConfigList(String accountConfigId) {
+        ThirdPartWeComRoomConfigExample example = new ThirdPartWeComRoomConfigExample();
+        example.createCriteria().andAccountConfigIdEqualTo(accountConfigId).andStatusEqualTo(1);
+        return roomConfigMapper.selectByExample(example);
+    }
 }
 }

+ 20 - 5
api-module/src/main/resources/mapper/wecom/thirdpart/ThirdPartWeComStaffConfigMapper.xml

@@ -10,6 +10,7 @@
     <result column="open_room_send_switch_num" jdbcType="INTEGER" property="openRoomSendSwitchNum" />
     <result column="open_room_send_switch_num" jdbcType="INTEGER" property="openRoomSendSwitchNum" />
     <result column="primary_third_staff_id" jdbcType="BIGINT" property="primaryThirdStaffId" />
     <result column="primary_third_staff_id" jdbcType="BIGINT" property="primaryThirdStaffId" />
     <result column="second_third_staff_id" jdbcType="BIGINT" property="secondThirdStaffId" />
     <result column="second_third_staff_id" jdbcType="BIGINT" property="secondThirdStaffId" />
+    <result column="config_sync" jdbcType="INTEGER" property="configSync" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
@@ -74,7 +75,7 @@
   </sql>
   </sql>
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     id, staff_id, put_scene, channel, switch_flag, open_room_send_switch_num, primary_third_staff_id, 
     id, staff_id, put_scene, channel, switch_flag, open_room_send_switch_num, primary_third_staff_id, 
-    second_third_staff_id, `status`, create_time, update_time
+    second_third_staff_id, config_sync, `status`, create_time, update_time
   </sql>
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaffConfigExample" resultMap="BaseResultMap">
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaffConfigExample" resultMap="BaseResultMap">
     select
     select
@@ -113,13 +114,13 @@
     insert into third_part_we_com_staff_config (id, staff_id, put_scene, 
     insert into third_part_we_com_staff_config (id, staff_id, put_scene, 
       channel, switch_flag, open_room_send_switch_num, 
       channel, switch_flag, open_room_send_switch_num, 
       primary_third_staff_id, second_third_staff_id, 
       primary_third_staff_id, second_third_staff_id, 
-      `status`, create_time, update_time
-      )
+      config_sync, `status`, create_time, 
+      update_time)
     values (#{id,jdbcType=VARCHAR}, #{staffId,jdbcType=BIGINT}, #{putScene,jdbcType=VARCHAR}, 
     values (#{id,jdbcType=VARCHAR}, #{staffId,jdbcType=BIGINT}, #{putScene,jdbcType=VARCHAR}, 
       #{channel,jdbcType=VARCHAR}, #{switchFlag,jdbcType=INTEGER}, #{openRoomSendSwitchNum,jdbcType=INTEGER}, 
       #{channel,jdbcType=VARCHAR}, #{switchFlag,jdbcType=INTEGER}, #{openRoomSendSwitchNum,jdbcType=INTEGER}, 
       #{primaryThirdStaffId,jdbcType=BIGINT}, #{secondThirdStaffId,jdbcType=BIGINT}, 
       #{primaryThirdStaffId,jdbcType=BIGINT}, #{secondThirdStaffId,jdbcType=BIGINT}, 
-      #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
-      )
+      #{configSync,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaffConfig">
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaffConfig">
     insert into third_part_we_com_staff_config
     insert into third_part_we_com_staff_config
@@ -148,6 +149,9 @@
       <if test="secondThirdStaffId != null">
       <if test="secondThirdStaffId != null">
         second_third_staff_id,
         second_third_staff_id,
       </if>
       </if>
+      <if test="configSync != null">
+        config_sync,
+      </if>
       <if test="status != null">
       <if test="status != null">
         `status`,
         `status`,
       </if>
       </if>
@@ -183,6 +187,9 @@
       <if test="secondThirdStaffId != null">
       <if test="secondThirdStaffId != null">
         #{secondThirdStaffId,jdbcType=BIGINT},
         #{secondThirdStaffId,jdbcType=BIGINT},
       </if>
       </if>
+      <if test="configSync != null">
+        #{configSync,jdbcType=INTEGER},
+      </if>
       <if test="status != null">
       <if test="status != null">
         #{status,jdbcType=INTEGER},
         #{status,jdbcType=INTEGER},
       </if>
       </if>
@@ -227,6 +234,9 @@
       <if test="record.secondThirdStaffId != null">
       <if test="record.secondThirdStaffId != null">
         second_third_staff_id = #{record.secondThirdStaffId,jdbcType=BIGINT},
         second_third_staff_id = #{record.secondThirdStaffId,jdbcType=BIGINT},
       </if>
       </if>
+      <if test="record.configSync != null">
+        config_sync = #{record.configSync,jdbcType=INTEGER},
+      </if>
       <if test="record.status != null">
       <if test="record.status != null">
         `status` = #{record.status,jdbcType=INTEGER},
         `status` = #{record.status,jdbcType=INTEGER},
       </if>
       </if>
@@ -251,6 +261,7 @@
       open_room_send_switch_num = #{record.openRoomSendSwitchNum,jdbcType=INTEGER},
       open_room_send_switch_num = #{record.openRoomSendSwitchNum,jdbcType=INTEGER},
       primary_third_staff_id = #{record.primaryThirdStaffId,jdbcType=BIGINT},
       primary_third_staff_id = #{record.primaryThirdStaffId,jdbcType=BIGINT},
       second_third_staff_id = #{record.secondThirdStaffId,jdbcType=BIGINT},
       second_third_staff_id = #{record.secondThirdStaffId,jdbcType=BIGINT},
+      config_sync = #{record.configSync,jdbcType=INTEGER},
       `status` = #{record.status,jdbcType=INTEGER},
       `status` = #{record.status,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       update_time = #{record.updateTime,jdbcType=TIMESTAMP}
       update_time = #{record.updateTime,jdbcType=TIMESTAMP}
@@ -282,6 +293,9 @@
       <if test="secondThirdStaffId != null">
       <if test="secondThirdStaffId != null">
         second_third_staff_id = #{secondThirdStaffId,jdbcType=BIGINT},
         second_third_staff_id = #{secondThirdStaffId,jdbcType=BIGINT},
       </if>
       </if>
+      <if test="configSync != null">
+        config_sync = #{configSync,jdbcType=INTEGER},
+      </if>
       <if test="status != null">
       <if test="status != null">
         `status` = #{status,jdbcType=INTEGER},
         `status` = #{status,jdbcType=INTEGER},
       </if>
       </if>
@@ -303,6 +317,7 @@
       open_room_send_switch_num = #{openRoomSendSwitchNum,jdbcType=INTEGER},
       open_room_send_switch_num = #{openRoomSendSwitchNum,jdbcType=INTEGER},
       primary_third_staff_id = #{primaryThirdStaffId,jdbcType=BIGINT},
       primary_third_staff_id = #{primaryThirdStaffId,jdbcType=BIGINT},
       second_third_staff_id = #{secondThirdStaffId,jdbcType=BIGINT},
       second_third_staff_id = #{secondThirdStaffId,jdbcType=BIGINT},
+      config_sync = #{configSync,jdbcType=INTEGER},
       `status` = #{status,jdbcType=INTEGER},
       `status` = #{status,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       update_time = #{updateTime,jdbcType=TIMESTAMP}
       update_time = #{updateTime,jdbcType=TIMESTAMP}