Browse Source

Merge branch '20250912-wyp-illegalNotice' into test

wangyunpeng 1 day ago
parent
commit
0c53052303
48 changed files with 3147 additions and 243 deletions
  1. 2 1
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/SecretEnum.java
  2. 14 2
      api-module/src/main/java/com/tzld/piaoquan/api/controller/WeComThirdPartyController.java
  3. 52 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformNoticeController.java
  4. 30 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformIllegalMsgMapper.java
  5. 36 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformIllegalVideoMapper.java
  6. 14 2
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java
  7. 0 12
      api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformDatastatJob.java
  8. 172 0
      api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformIllegalVideoJob.java
  9. 33 21
      api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java
  10. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComAccountJob.java
  11. 143 92
      api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComCreateRoomJob.java
  12. 23 4
      api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComSendMsgJob.java
  13. 55 33
      api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComUserDetailJob.java
  14. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/PageParam.java
  15. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/NoticeListParam.java
  16. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/NoticeReadParam.java
  17. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/wecom/thirdpart/UpdateAutoCreateRoomStatusRequest.java
  18. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/wecom/thirdpart/UpdateStaffStatusRequest.java
  19. 101 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformIllegalMsg.java
  20. 711 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformIllegalMsgExample.java
  21. 79 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformIllegalVideo.java
  22. 531 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformIllegalVideoExample.java
  23. 12 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/PlanIllegalVideoDTO.java
  24. 23 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/NoticeItemVO.java
  25. 15 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/WeComThirdPartyService.java
  26. 15 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformNoticeService.java
  27. 6 6
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformDatastatServiceImpl.java
  28. 71 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformNoticeServiceImpl.java
  29. 114 16
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/WeComThirdPartyServiceImpl.java
  30. 261 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformIllegalMsgMapper.xml
  31. 276 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformIllegalVideoMapper.xml
  32. 30 2
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml
  33. 4 2
      api-module/src/main/resources/mapper/wecom/thirdpart/ThirdPartWeComRoomMapper.xml
  34. 25 23
      api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml
  35. 1 1
      api-module/src/main/resources/mybatis-generator-config.xml
  36. 5 0
      api-module/src/test/java/com/tzld/piaoquan/api/WeComThirdPartTest.java
  37. 2 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/bo/VideoDetail.java
  38. 11 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/StaffGroupStatisticsTotal.java
  39. 70 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/StaffGroupStatisticsTotalExample.java
  40. 11 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/StaffStatisticsTotal.java
  41. 70 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/StaffStatisticsTotalExample.java
  42. 15 1
      common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/MessageAttachmentServiceImpl.java
  43. 2 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/service/MessageAttachmentService.java
  44. 10 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/DateUtil.java
  45. 10 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/RedisUtils.java
  46. 26 11
      common-module/src/main/resources/mapper/StaffGroupStatisticsTotalMapper.xml
  47. 24 9
      common-module/src/main/resources/mapper/StaffStatisticsTotalMapper.xml
  48. 2 0
      offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComStaffDataJob.java

+ 2 - 1
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/SecretEnum.java

@@ -18,7 +18,8 @@ public enum SecretEnum {
     SECRET_ENUM_10("57a1c09a209445fc83a5fba81b0194bc", "博虎", "bh"),
     SECRET_ENUM_11("232bab5faeb54acfbbcef3dc693c4639", "守望", "sw"),
     SECRET_ENUM_12("41512383ac8543239dc539306f72b8bc", "令视", "ls"),
-    SECRET_ENUM_13("17fe375058184fdcb2aed35678aeb4d4", "杭州奇风", "hzqf");
+    SECRET_ENUM_13("17fe375058184fdcb2aed35678aeb4d4", "杭州奇风", "hzqf"),
+    SECRET_ENUM_14("d8694855dec94945acb8b2b08ffe72d4", "云誉高质", "yygz");
 
 
     SecretEnum(String secret, String desc, String channel) {

+ 14 - 2
api-module/src/main/java/com/tzld/piaoquan/api/controller/WeComThirdPartyController.java

@@ -21,8 +21,8 @@ public class WeComThirdPartyController {
     private WeComThirdPartyService service;
 
     @PostMapping("/init")
-    public CommonResponse<InitResponse> init() {
-        return CommonResponse.success(service.init());
+    public CommonResponse<InitResponse> init(@RequestBody InitRequest request) {
+        return CommonResponse.success(service.init(request));
     }
 
     @PostMapping("/setCallbackUrl")
@@ -78,4 +78,16 @@ public class WeComThirdPartyController {
         return CommonResponse.success();
     }
 
+    @PostMapping("/updateStaffStatus")
+    public CommonResponse<Void> updateStaffStatus(@RequestBody UpdateStaffStatusRequest request) {
+        service.updateStaffStatus(request);
+        return CommonResponse.success();
+    }
+
+    @PostMapping("/updateAutoCreateRoomStatus")
+    public CommonResponse<Void> updateAutoCreateRoomStatus(@RequestBody UpdateAutoCreateRoomStatusRequest request) {
+        service.updateAutoCreateRoomStatus(request);
+        return CommonResponse.success();
+    }
+
 }

+ 52 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformNoticeController.java

@@ -0,0 +1,52 @@
+package com.tzld.piaoquan.api.controller.contentplatform;
+
+import com.tzld.piaoquan.api.annotation.JwtIgnore;
+import com.tzld.piaoquan.api.job.contentplatform.ContentPlatformIllegalVideoJob;
+import com.tzld.piaoquan.api.model.param.contentplatform.NoticeListParam;
+import com.tzld.piaoquan.api.model.param.contentplatform.NoticeReadParam;
+import com.tzld.piaoquan.api.model.vo.contentplatform.NoticeItemVO;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformNoticeService;
+import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/contentPlatform/notice")
+@CrossOrigin(origins = "*")
+public class ContentPlatformNoticeController {
+
+    @Autowired
+    ContentPlatformNoticeService noticeService;
+
+    @Autowired
+    private ContentPlatformIllegalVideoJob job;
+
+    @ApiOperation(value = "通知列表")
+    @PostMapping("/list")
+    public CommonResponse<Page<NoticeItemVO>> noticeList(@RequestBody NoticeListParam param) {
+        return CommonResponse.success(noticeService.noticeList(param));
+    }
+
+    @ApiOperation(value = "获取未读通知数量")
+    @PostMapping("/getNotReadCount")
+    public CommonResponse<Long> getNotReadCount() {
+        return CommonResponse.success(noticeService.getNotReadCount());
+    }
+
+    @ApiOperation(value = "通知已读")
+    @PostMapping("/read")
+    public CommonResponse<Void> noticeRead(@RequestBody NoticeReadParam param) {
+        noticeService.noticeRead(param);
+        return CommonResponse.success();
+    }
+
+    @ApiOperation(value = "检查违规视频发送通知", hidden = true)
+    @JwtIgnore
+    @GetMapping("/job/checkContentPlatformIllegalVideoJob")
+    public CommonResponse<Void> checkContentPlatformIllegalVideoJob(String dateStr) {
+        job.checkContentPlatformIllegalVideoJob(dateStr);
+        return CommonResponse.success();
+    }
+}

+ 30 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformIllegalMsgMapper.java

@@ -0,0 +1,30 @@
+package com.tzld.piaoquan.api.dao.mapper.contentplatform;
+
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsg;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsgExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface ContentPlatformIllegalMsgMapper {
+    long countByExample(ContentPlatformIllegalMsgExample example);
+
+    int deleteByExample(ContentPlatformIllegalMsgExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(ContentPlatformIllegalMsg record);
+
+    int insertSelective(ContentPlatformIllegalMsg record);
+
+    List<ContentPlatformIllegalMsg> selectByExample(ContentPlatformIllegalMsgExample example);
+
+    ContentPlatformIllegalMsg selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") ContentPlatformIllegalMsg record, @Param("example") ContentPlatformIllegalMsgExample example);
+
+    int updateByExample(@Param("record") ContentPlatformIllegalMsg record, @Param("example") ContentPlatformIllegalMsgExample example);
+
+    int updateByPrimaryKeySelective(ContentPlatformIllegalMsg record);
+
+    int updateByPrimaryKey(ContentPlatformIllegalMsg record);
+}

+ 36 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformIllegalVideoMapper.java

@@ -0,0 +1,36 @@
+package com.tzld.piaoquan.api.dao.mapper.contentplatform;
+
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideo;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideoExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface ContentPlatformIllegalVideoMapper {
+    long countByExample(ContentPlatformIllegalVideoExample example);
+
+    int deleteByExample(ContentPlatformIllegalVideoExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(ContentPlatformIllegalVideo record);
+
+    int insertSelective(ContentPlatformIllegalVideo record);
+
+    List<ContentPlatformIllegalVideo> selectByExampleWithBLOBs(ContentPlatformIllegalVideoExample example);
+
+    List<ContentPlatformIllegalVideo> selectByExample(ContentPlatformIllegalVideoExample example);
+
+    ContentPlatformIllegalVideo selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") ContentPlatformIllegalVideo record, @Param("example") ContentPlatformIllegalVideoExample example);
+
+    int updateByExampleWithBLOBs(@Param("record") ContentPlatformIllegalVideo record, @Param("example") ContentPlatformIllegalVideoExample example);
+
+    int updateByExample(@Param("record") ContentPlatformIllegalVideo record, @Param("example") ContentPlatformIllegalVideoExample example);
+
+    int updateByPrimaryKeySelective(ContentPlatformIllegalVideo record);
+
+    int updateByPrimaryKeyWithBLOBs(ContentPlatformIllegalVideo record);
+
+    int updateByPrimaryKey(ContentPlatformIllegalVideo record);
+}

+ 14 - 2
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java

@@ -64,6 +64,8 @@ public interface ContentPlatformPlanMapperExt {
 
     void batchInsertContentPlatformVideo(@Param("records") List<ContentPlatformVideo> saveList);
 
+    void batchInsertContentPlatformIllegalVideo(@Param("records") List<ContentPlatformIllegalVideo> saveList);
+
     void batchInsertContentPlatformVideoAgg(@Param("records") List<ContentPlatformVideoAgg> saveList);
 
     int getQwPlanCount(@Param("param") QwPlanListParam param,
@@ -80,9 +82,15 @@ public interface ContentPlatformPlanMapperExt {
 
     List<ContentPlatformGzhPlanVideo> getGzhPlanVideoListByCooperateAccountId(@Param("ghId") String ghId);
 
-    void updateVideoStatus(@Param("videoId") Long videoId, @Param("status") Integer status, @Param("now") Long now);
+    void updateVideoStatusWithOldStatus(@Param("videoId") Long videoId,
+                                        @Param("status") Integer status,
+                                        @Param("oldStatus") Integer oldStatus,
+                                        @Param("now") Long now);
 
-    void updateVideoAggStatus(@Param("videoId") Long videoId, @Param("status") Integer status, @Param("now") Long now);
+    void updateVideoAggStatusWithOldStatus(@Param("videoId") Long videoId,
+                                           @Param("status") Integer status,
+                                           @Param("oldStatus") Integer oldStatus,
+                                           @Param("now") Long now);
 
     List<ContentPlatformVideoAgg> getVideoAggList(@Param("dtList") List<String> dtList);
 
@@ -101,4 +109,8 @@ public interface ContentPlatformPlanMapperExt {
     void batchInsertContentPlatformVideoDatastatAgg(@Param("records") List<ContentPlatformVideoDataStatAgg> saveAggList);
 
     void updateOtherVideoStatus(@Param("dt") String dt, @Param("videoIdList") List<Long> videoIdList, @Param("now") Long now);
+
+    List<PlanIllegalVideoDTO> getGzhPlanIllegalVideoList(@Param("videoId") Long videoId);
+
+    List<PlanIllegalVideoDTO> getQwPlanIllegalVideoList(@Param("videoId") Long videoId);
 }

+ 0 - 12
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformDatastatJob.java

@@ -567,18 +567,6 @@ public class ContentPlatformDatastatJob {
         return gzhAccountMapper.selectByExample(example);
     }
 
-    private long getGzhDatastatCount(String dt) {
-        ContentPlatformGzhDataStatExample example = new ContentPlatformGzhDataStatExample();
-        example.createCriteria().andDateStrEqualTo(dt);
-        return gzhDataStatMapper.countByExample(example);
-    }
-
-    private long getFwhDatastatCount(String dt) {
-        ContentPlatformFwhDataStatExample example = new ContentPlatformFwhDataStatExample();
-        example.createCriteria().andDateStrEqualTo(dt);
-        return fwhDataStatMapper.countByExample(example);
-    }
-
     private List<ContentPlatformQwDataStat> getQwDatastatCount(String dt) {
         ContentPlatformQwDataStatExample example = new ContentPlatformQwDataStatExample();
         example.createCriteria().andDateStrEqualTo(dt);

+ 172 - 0
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformIllegalVideoJob.java

@@ -0,0 +1,172 @@
+package com.tzld.piaoquan.api.job.contentplatform;
+
+import com.aliyun.odps.data.Record;
+import com.tzld.piaoquan.api.common.enums.contentplatform.ContentPlatformGzhPlanTypeEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.QwPlanTypeEnum;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformIllegalMsgMapper;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformIllegalVideoMapper;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
+import com.tzld.piaoquan.api.model.po.contentplatform.*;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
+import com.tzld.piaoquan.growth.common.utils.OdpsUtil;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Component
+public class ContentPlatformIllegalVideoJob {
+
+    @Resource
+    private ContentPlatformIllegalVideoMapper illegalVideoMapper;
+    @Resource
+    private ContentPlatformIllegalMsgMapper illegalMsgMapper;
+    @Resource
+    private ContentPlatformPlanMapperExt planMapperExt;
+
+    @XxlJob("checkContentPlatformIllegalVideoJob")
+    public ReturnT<String> checkContentPlatformIllegalVideoJob(String param) {
+        String dtMin = DateUtil.getBeforeDayDateString(1, "yyyyMMdd") + "000000";
+        if (StringUtils.isNotBlank(param)) {
+            dtMin = param;
+        }
+        String sql = String.format("select dt, content, title from loghubods.wxgzh_message_log_per5min where dt > %s and title like '%%封禁%%';", dtMin);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        Long now = System.currentTimeMillis();
+        if (CollectionUtils.isNotEmpty(dataList)) {
+            List<ContentPlatformIllegalVideo> saveList = new ArrayList<>();
+            for (Record record : dataList) {
+                ContentPlatformIllegalVideo item = new ContentPlatformIllegalVideo();
+                Long dt = Long.parseLong((String) record.get(0));
+                String content = (String) record.get(1);
+                String title = (String) record.get(2);
+                item.setDateStr(String.valueOf(dt));
+                String videoId = getVideoIdFromContent(content);
+                if (Objects.isNull(videoId)) {
+                    continue;
+                }
+                item.setVideoId(Long.parseLong(videoId));
+                item.setContent(content);
+                item.setTitle(title);
+                item.setCreateTimestamp(now);
+                saveList.add(item);
+            }
+            List<Long> videoIdList = saveList.stream().map(ContentPlatformIllegalVideo::getVideoId).collect(Collectors.toList());
+            List<ContentPlatformIllegalVideo> existIllegalVideo = getIllegalVideoList(videoIdList);
+            List<Long> existVideoIdList = existIllegalVideo.stream().map(ContentPlatformIllegalVideo::getVideoId).collect(Collectors.toList());
+            List<ContentPlatformIllegalVideo> filterList = saveList.stream().filter(item -> !existVideoIdList.contains(item.getVideoId())).collect(Collectors.toList());
+            // save
+            if (CollectionUtils.isNotEmpty(filterList)) {
+                planMapperExt.batchInsertContentPlatformIllegalVideo(filterList);
+            }
+        }
+        // 发送违规通知
+        sendIllegalVideoNotify(dtMin);
+
+        return ReturnT.SUCCESS;
+    }
+
+    private void sendIllegalVideoNotify(String dtMin) {
+        List<ContentPlatformIllegalVideo> illegalVideoList = getIllegalVideoListByDt(dtMin);
+        if (CollectionUtils.isEmpty(illegalVideoList)) {
+            return;
+        }
+        for (ContentPlatformIllegalVideo item : illegalVideoList) {
+            // 公众号-自动回复、公众号-服务号推送、公众号-公众号推送、企微-社群、企微-自动回复
+            List<PlanIllegalVideoDTO> gzhPlanIllegalVideoList = planMapperExt.getGzhPlanIllegalVideoList(item.getVideoId());
+            List<PlanIllegalVideoDTO> qwPlanIllegalVideoList = planMapperExt.getQwPlanIllegalVideoList(item.getVideoId());
+            List<PlanIllegalVideoDTO> allPlanIllegalVideoList = new ArrayList<>();
+            allPlanIllegalVideoList.addAll(gzhPlanIllegalVideoList);
+            allPlanIllegalVideoList.addAll(qwPlanIllegalVideoList);
+            if (CollectionUtils.isEmpty(allPlanIllegalVideoList)) {
+                continue;
+            }
+            Map<Long, Map<Long, List<PlanIllegalVideoDTO>>> accountVideoPlanMap = allPlanIllegalVideoList.stream()
+                    .collect(Collectors.groupingBy(PlanIllegalVideoDTO::getAccountId, Collectors.groupingBy(PlanIllegalVideoDTO::getVideoId)));
+            for (Map.Entry<Long, Map<Long, List<PlanIllegalVideoDTO>>> accountEntry : accountVideoPlanMap.entrySet()) {
+                Long accountId = accountEntry.getKey();
+                Map<Long, List<PlanIllegalVideoDTO>> videoPlanMap = accountEntry.getValue();
+                for (Map.Entry<Long, List<PlanIllegalVideoDTO>> videoEntry : videoPlanMap.entrySet()) {
+                    Long videoId = videoEntry.getKey();
+                    List<PlanIllegalVideoDTO> planList = videoEntry.getValue();
+                    // 发送通知
+                    sendNotifyMsg(accountId, videoId, planList);
+                }
+            }
+        }
+    }
+
+    private void sendNotifyMsg(Long accountId, Long videoId, List<PlanIllegalVideoDTO> planList) {
+        ContentPlatformIllegalMsg existMsg = getIllegalMsg(accountId, videoId);
+        if (Objects.nonNull(existMsg)) {
+            return;
+        }
+        Set<String> businessTypeList = new HashSet<>();
+        for (PlanIllegalVideoDTO plan : planList) {
+            String channel = plan.getChannel();
+            if (StringUtils.equals(channel, "公众号")) {
+                // 公众号-自动回复、公众号-服务号推送、公众号-公众号推送
+                ContentPlatformGzhPlanTypeEnum gzhPlanTypeEnum = ContentPlatformGzhPlanTypeEnum.from(plan.getType());
+                businessTypeList.add("“" + channel + "-" + gzhPlanTypeEnum.getDescription() + "”");
+            } else if (StringUtils.equals(channel, "企微")) {
+                // 企微-社群、企微-自动回复
+                QwPlanTypeEnum qwPlanTypeEnum = QwPlanTypeEnum.from(plan.getType());
+                businessTypeList.add("“" + channel + "-" + qwPlanTypeEnum.getDescription() + "”");
+            }
+        }
+        String businessType = String.join("、", businessTypeList);
+        Long now = System.currentTimeMillis();
+        ContentPlatformIllegalMsg illegalMsg = new ContentPlatformIllegalMsg();
+        illegalMsg.setAccountId(accountId);
+        illegalMsg.setVideoId(videoId);
+        illegalMsg.setTitle(planList.get(0).getTitle());
+        illegalMsg.setBusinessType(businessType);
+        illegalMsg.setStatus(0);
+        illegalMsg.setCreateTimestamp(now);
+        illegalMsg.setUpdateTimestamp(now);
+        illegalMsgMapper.insertSelective(illegalMsg);
+    }
+
+    private ContentPlatformIllegalMsg getIllegalMsg(Long accountId, Long videoId) {
+        ContentPlatformIllegalMsgExample example = new ContentPlatformIllegalMsgExample();
+        example.createCriteria().andAccountIdEqualTo(accountId).andVideoIdEqualTo(videoId);
+        List<ContentPlatformIllegalMsg> list = illegalMsgMapper.selectByExample(example);
+        return CollectionUtils.isNotEmpty(list) ? list.get(0) : null;
+    }
+
+    private List<ContentPlatformIllegalVideo> getIllegalVideoListByDt(String dtMin) {
+        ContentPlatformIllegalVideoExample example = new ContentPlatformIllegalVideoExample();
+        example.createCriteria().andDateStrGreaterThan(dtMin);
+        return illegalVideoMapper.selectByExample(example);
+    }
+
+    private List<ContentPlatformIllegalVideo> getIllegalVideoList(List<Long> videoIdList) {
+        ContentPlatformIllegalVideoExample example = new ContentPlatformIllegalVideoExample();
+        example.createCriteria().andVideoIdIn(videoIdList);
+        return illegalVideoMapper.selectByExample(example);
+    }
+
+
+    public static String getVideoIdFromContent(String content) {
+        if (content == null || content.isEmpty()) {
+            return null;
+        }
+        // 匹配 "id=数字" 部分
+        Pattern pattern = Pattern.compile("id%3D(\\d+)");
+        Matcher matcher = pattern.matcher(content);
+        if (matcher.find()) {
+            return matcher.group(1);
+        }
+        return null;
+    }
+
+}

+ 33 - 21
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java

@@ -2,12 +2,10 @@ package com.tzld.piaoquan.api.job.contentplatform;
 
 import com.aliyun.odps.data.Record;
 import com.google.common.collect.Lists;
-import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoAggMapper;
-import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoDataStatAggMapper;
-import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoDataStatMapper;
-import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoMapper;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
 import com.tzld.piaoquan.api.model.po.contentplatform.*;
+import com.tzld.piaoquan.api.util.CdnUtil;
 import com.tzld.piaoquan.growth.common.model.bo.VideoDetail;
 import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
 import com.tzld.piaoquan.growth.common.utils.DateUtil;
@@ -43,7 +41,7 @@ public class ContentPlatformVideoJob {
     private ContentPlatformVideoDataStatMapper videoDataStatMapper;
 
     @Autowired
-    private ContentPlatformVideoDataStatAggMapper videoDataStatAggMapper;
+    private ContentPlatformIllegalVideoMapper illegalVideoMapper;
 
     @Autowired
     private MessageAttachmentService messageAttachmentService;
@@ -99,6 +97,11 @@ public class ContentPlatformVideoJob {
                 // save
                 if (CollectionUtils.isNotEmpty(saveList)) {
                     List<ContentPlatformVideo> videoList = getVideoList(dt);
+                    List<ContentPlatformIllegalVideo> illegalVideoList = getAllIllegalVideoList();
+                    List<Long> illegalVideoIds = illegalVideoList.stream().map(ContentPlatformIllegalVideo::getVideoId).collect(Collectors.toList());
+                    if (CollectionUtils.isNotEmpty(illegalVideoIds)) {
+                        saveList = saveList.stream().filter(item -> !illegalVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
+                    }
                     if (CollectionUtils.isNotEmpty(videoList)) {
                         List<Long> existVideoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
                         List<Long> videoIdList = saveList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
@@ -125,6 +128,11 @@ public class ContentPlatformVideoJob {
                         continue;
                     }
                     String cover = detail.getCover().substring(0, detail.getCover().indexOf("/watermark"));
+                    if (!cover.startsWith(CdnUtil.VIDEO_CDN_URL_HOST)
+                            && StringUtils.hasText(detail.getVideoCoverSnapshotPath())
+                            && detail.getVideoCoverSnapshotPath().startsWith(CdnUtil.VIDEO_CDN_URL_HOST)) {
+                        cover = detail.getVideoCoverSnapshotPath() + cover.substring(cover.indexOf("?"));
+                    }
                     item.setCover(cover);
                     if (detail.getAuditStatus() != 5) {
                         item.setStatus(0);
@@ -150,18 +158,17 @@ public class ContentPlatformVideoJob {
         return ReturnT.SUCCESS;
     }
 
+    private List<ContentPlatformIllegalVideo> getAllIllegalVideoList() {
+        ContentPlatformIllegalVideoExample example = new ContentPlatformIllegalVideoExample();
+        return illegalVideoMapper.selectByExample(example);
+    }
+
     private List<ContentPlatformVideo> getVideoNullCover() {
         ContentPlatformVideoExample example = new ContentPlatformVideoExample();
         example.createCriteria().andCoverIsNull();
         return videoMapper.selectByExample(example);
     }
 
-    private long getVideoCount(String dt) {
-        ContentPlatformVideoExample example = new ContentPlatformVideoExample();
-        example.createCriteria().andDtEqualTo(dt);
-        return videoMapper.countByExample(example);
-    }
-
     private List<ContentPlatformVideo> getVideoList(String dt) {
         ContentPlatformVideoExample example = new ContentPlatformVideoExample();
         example.createCriteria().andDtEqualTo(dt);
@@ -189,17 +196,28 @@ public class ContentPlatformVideoJob {
                 VideoDetail videoDetail = videoDetailMap.get(video.getVideoId());
                 if (videoDetail == null
                         || videoDetail.getAuditStatus() != 5) {
-                    planMapperExt.updateVideoStatus(video.getVideoId(), 0, now);
-                    planMapperExt.updateVideoAggStatus(video.getVideoId(), 0, now);
+                    updateVideoStatusWithOldStatus(video.getVideoId(), 0, 1, now);
                 } else if (videoDetail.getRecommendStatus() == -6 && video.getStatus() == 0) {
-                    planMapperExt.updateVideoStatus(video.getVideoId(), 1, now);
-                    planMapperExt.updateVideoAggStatus(video.getVideoId(), 1, now);
+                    updateVideoStatusWithOldStatus(video.getVideoId(), 1, 0, now);
                 }
             }
         }
+        // 检查视频是否违规
+        List<ContentPlatformIllegalVideo> illegalVideoList = getAllIllegalVideoList();
+        List<Long> illegalVideoIds = illegalVideoList.stream().map(ContentPlatformIllegalVideo::getVideoId).collect(Collectors.toList());
+        if (CollectionUtils.isNotEmpty(illegalVideoIds)) {
+            for (Long illegalVideoId : illegalVideoIds) {
+                updateVideoStatusWithOldStatus(illegalVideoId, 0, 1, now);
+            }
+        }
         return ReturnT.SUCCESS;
     }
 
+    private void updateVideoStatusWithOldStatus(Long videoId, Integer status, Integer oldStatus, Long now) {
+        planMapperExt.updateVideoStatusWithOldStatus(videoId, status, oldStatus, now);
+        planMapperExt.updateVideoAggStatusWithOldStatus(videoId, status, oldStatus, now);
+    }
+
     private List<ContentPlatformVideoAgg> getVideoListByDt(String dt) {
         ContentPlatformVideoAggExample example = new ContentPlatformVideoAggExample();
         example.createCriteria().andDtEqualTo(dt);
@@ -255,12 +273,6 @@ public class ContentPlatformVideoJob {
         return ReturnT.SUCCESS;
     }
 
-    private long getVideoGroupScoreCount(String dt) {
-        ContentPlatformVideoDataStatExample example = new ContentPlatformVideoDataStatExample();
-        example.createCriteria().andDtEqualTo(dt);
-        return videoDataStatMapper.countByExample(example);
-    }
-
     private List<ContentPlatformVideoDataStatAgg> buildVideoDataStatAggList(String aggDt, List<String> dtList) {
         Long now = System.currentTimeMillis();
         List<ContentPlatformVideoDataStat> dataStatList = getVideoDatastatList(dtList);

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComAccountJob.java

@@ -44,8 +44,8 @@ public class WeComAccountJob {
             CommonResponse<LoginInfo> commonResponse =
                     JSONObject.parseObject(response, new TypeReference<CommonResponse<LoginInfo>>() {});
             if (commonResponse.getErrcode() != 0
-                    && (Objects.isNull(commonResponse.getData().getUser_info())
-                    || Objects.isNull(commonResponse.getData().getUser_info().getObject()))) {
+                    || Objects.isNull(commonResponse.getData().getUser_info())
+                    || Objects.isNull(commonResponse.getData().getUser_info().getObject())) {
                 redisUtils.set(offLineKey, "1", 30 * 60);
                 LarkRobotUtil.sendWeComThirdPartMessage(
                         "【账号掉线检测通知】\n" +

+ 143 - 92
api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComCreateRoomJob.java

@@ -2,7 +2,6 @@ package com.tzld.piaoquan.api.job.wecom.thirdpart;
 
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import com.tzld.piaoquan.api.component.WeComThirdPartyApiClient;
-import com.tzld.piaoquan.api.controller.GetRoomUserListResponse;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomMapper;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ext.ThirdPartWeComMapperExt;
 import com.tzld.piaoquan.api.model.param.wecom.thirdpart.*;
@@ -11,6 +10,8 @@ import com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoomUser;
 import com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaff;
 import com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaffUser;
 import com.tzld.piaoquan.api.service.WeComThirdPartyService;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
+import com.tzld.piaoquan.growth.common.utils.RedisUtils;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import lombok.extern.slf4j.Slf4j;
@@ -20,10 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import java.util.*;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -41,25 +39,44 @@ public class WeComCreateRoomJob {
     @Autowired
     ThirdPartWeComMapperExt thirdPartWeComMapperExt;
 
-    @Value("${create.room.send.msg.status.nums:20}")
-    private Integer sendMsgStatusNums;
+    @Autowired
+    private RedisUtils redisUtils;
 
-    @Value("${create.room.member.max.nums:40}")
+    @Value("${create.room.member.max.nums:39}")
     private Integer memberMaxNums;
+    @Value("${create.room.daily.max.num:5}")
+    private Integer dailyMaxNum;
+    @Value("${create.room.daily.max.add.user.times:5}")
+    private Integer dailyMaxAddUserTimes;
 
     private final static ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.SECONDS,
             new LinkedBlockingQueue<>(1000),
-            new ThreadFactoryBuilder().setNameFormat("AutoCreateRoomJob-%d").build(),
+            new ThreadFactoryBuilder().setNameFormat("WeComCreateRoomJob-%d").build(),
             new ThreadPoolExecutor.AbortPolicy());
 
     @XxlJob("autoCreateRoom")
     public ReturnT<String> autoCreateRoomJob(String param) {
         List<ThirdPartWeComStaff> activeStaffList = weComThirdPartyService.getActiveStaffList();
+        CountDownLatch cdl = new CountDownLatch(activeStaffList.size());
         for (ThirdPartWeComStaff staff : activeStaffList) {
             if (staff.getAutoCreateRoom() != 1) {
+                cdl.countDown();
                 continue;
             }
-            pool.execute(() -> createStaffRoom(staff));
+            pool.execute(() -> {
+                try {
+                    createStaffRoom(staff);
+                } catch (Exception e) {
+                    log.error("autoCreateRoomJob error", e);
+                } finally {
+                    cdl.countDown();
+                }
+            });
+        }
+        try {
+            cdl.await();
+        } catch (InterruptedException e) {
+            log.error("autoCreateRoomJob error", e);
         }
         return ReturnT.SUCCESS;
     }
@@ -71,7 +88,7 @@ public class WeComCreateRoomJob {
             return;
         }
         // 已创建群添加群成员
-        List<ThirdPartWeComRoom> roomList = weComThirdPartyService.getStaffRoomList(staff.getId());
+        List<ThirdPartWeComRoom> roomList = weComThirdPartyService.getAllStaffRoomList(staff.getId());
         List<Integer> roomNums = roomList.stream()
                 .map(o -> {
                     try {
@@ -88,105 +105,85 @@ public class WeComCreateRoomJob {
                 .sorted(Comparator.comparing(Integer::intValue).reversed())
                 .collect(Collectors.toList());
         Integer maxRoomNum = CollectionUtils.isNotEmpty(roomNums) ? roomNums.get(0) : 0;
-        for (ThirdPartWeComRoom room : roomList) {
-            if (room.getAddUserStatus() != 1) {
-                continue;
-            }
-            List<Long> vids = new ArrayList<>();
-            List<ThirdPartWeComStaffUser> addUserList = new ArrayList<>();
-            Iterator<ThirdPartWeComStaffUser> iterator = staffUserList.iterator();
-            int size = memberMaxNums - room.getMemberCount();
-            while (iterator.hasNext() && size > 0) {
-                ThirdPartWeComStaffUser item = iterator.next();
-                vids.add(item.getUserId());
-                size--;
-                iterator.remove();
-                addUserList.add(item);
-            }
-            addRoomUser(staff, room, vids);
-            // 群成员添加存储
-            saveRoomUser(room, addUserList);
+        // 获取当日新创建群 达到上限 不创建
+        Long roomCount = weComThirdPartyService.getTodayCreateRoomCount(staff.getId());
+        if (roomCount >= dailyMaxNum) {
+            return;
         }
         // 未加群客户创建新群
         if (CollectionUtils.isNotEmpty(staffUserList)) {
             createNewRoom(staff, staffUserList, maxRoomNum);
         }
-        userDetailJob.syncRoomList(staff.getThirdUuid(), staff);
+        userDetailJob.syncRoomList(staff);
     }
 
-    private void addRoomUser(ThirdPartWeComStaff staff,
-                             ThirdPartWeComRoom room,
-                             List<Long> vids) {
+    private CommonResponse<String> addRoomUser(ThirdPartWeComStaff staff,
+                                               ThirdPartWeComRoom room,
+                                               List<Long> vids,
+                                               List<ThirdPartWeComStaffUser> addUserList) {
         if (room.getAddUserStatus() != 1 || room.getMemberCount() >= memberMaxNums) {
-            return;
+            return null;
+        }
+        String dateStr = DateUtil.getCurrentDateStr("yyyyMMdd");
+        String key = "addRoomUserTimes:" + dateStr + ":" + staff.getThirdStaffId() + ":" + room.getThirdRoomId();
+        int addRoomUserTimes = redisUtils.getInteger(key);
+        if (addRoomUserTimes >= dailyMaxAddUserTimes) {
+            return null;
         }
         InvitationToRoomRequest request = new InvitationToRoomRequest();
         request.setUuid(staff.getThirdUuid());
         request.setRoomid(Long.parseLong(room.getThirdRoomId()));
         request.setVids(vids);
-        apiClient.invitationToRoom(request);
+        CommonResponse<String> commonResponse = weComThirdPartyService.invitationToRoom(request);
+        if (Objects.nonNull(commonResponse)) {
+            // 群成员添加存储
+            saveRoomUser(room, addUserList);
+        }
+        redisUtils.setIncrementValue(key, 1, 24 * 60 * 60L);
+        return commonResponse;
     }
 
     private void createNewRoom(ThirdPartWeComStaff staff,
                                List<ThirdPartWeComStaffUser> staffUserList,
                                Integer roomNum) {
         Iterator<ThirdPartWeComStaffUser> iterator = staffUserList.iterator();
-        while (iterator.hasNext()) {
-            List<Long> vids = new ArrayList<>();
-            List<ThirdPartWeComStaffUser> addUserList = new ArrayList<>();
-            int size = staffUserList.size() > memberMaxNums ? memberMaxNums : staffUserList.size();
-            while (iterator.hasNext() && size > 0) {
-                ThirdPartWeComStaffUser item = iterator.next();
-                vids.add(item.getUserId());
-                size--;
-                iterator.remove();
-                addUserList.add(item);
-            }
-            // 群创建
-            CreateRoomWxRequest request = new CreateRoomWxRequest();
-            request.setUuid(staff.getThirdUuid());
-            request.setRoomName("票圈快讯" + (++roomNum));
-            request.setVids(vids);
-            CreateRoomWxResponse createRoomWxResponse = weComThirdPartyService.createRoom(request);
-            // 群管理设置 防骚扰
-            updateRoomManagement(staff, createRoomWxResponse);
-            // add room save
-            ThirdPartWeComRoom roomDetail = new ThirdPartWeComRoom();
-            roomDetail.setCorpId(staff.getCorpId());
-            roomDetail.setStaffId(staff.getId());
-            roomDetail.setThirdRoomId(createRoomWxResponse.getRoomid());
-            roomDetail.setThirdCreateUserId(createRoomWxResponse.getCreateid());
-            roomDetail.setName(createRoomWxResponse.getRoomname());
-            roomDetail.setCreateTime(new Date());
-            roomDetail.setUpdateTime(new Date());
-            roomMapper.insertSelective(roomDetail);
-            // 群成员添加存储
-            saveRoomUser(roomDetail, addUserList);
-            // 循环添加群成员
-            while (true) {
-                GetRoomUserListRequest roomUserListRequest = new GetRoomUserListRequest(staff.getThirdUuid(),
-                        Long.valueOf(createRoomWxResponse.getRoomid()));
-                List<GetRoomUserListResponse.Member> userList = weComThirdPartyService.getRoomUserList(roomUserListRequest);
-                roomDetail.setMemberCount(userList.size());
-                roomDetail.setAddUserStatus(userList.size() == memberMaxNums ? 0 : 1);
-                roomDetail.setSendStatus(userList.size() > sendMsgStatusNums ? 1 : 0);
-                roomMapper.updateByPrimaryKeySelective(roomDetail);
-                if (!iterator.hasNext() || userList.size() == memberMaxNums) {
-                    break;
-                }
-                vids = new ArrayList<>();
-                size = Math.min(staffUserList.size(), memberMaxNums - userList.size());
-                while (iterator.hasNext() && size > 0) {
-                    ThirdPartWeComStaffUser item = iterator.next();
-                    vids.add(item.getUserId());
-                    size--;
-                    iterator.remove();
-                }
-                addRoomUser(staff, roomDetail, vids);
-                // 群成员添加存储
-                saveRoomUser(roomDetail, addUserList);
-            }
+        // todo 暂时每次任务仅创建一个群
+        //while (iterator.hasNext()) {
+        List<Long> vids = new ArrayList<>();
+        List<ThirdPartWeComStaffUser> addUserList = new ArrayList<>();
+        int size = staffUserList.size() > memberMaxNums ? memberMaxNums : staffUserList.size();
+        size--;
+        while (iterator.hasNext() && size > 0) {
+            ThirdPartWeComStaffUser item = iterator.next();
+            vids.add(item.getUserId());
+            size--;
+            iterator.remove();
+            addUserList.add(item);
         }
+        // 群创建
+        CreateRoomWxRequest request = new CreateRoomWxRequest();
+        request.setUuid(staff.getThirdUuid());
+        request.setRoomName("票圈快讯" + (++roomNum));
+        request.setVids(vids);
+        CreateRoomWxResponse createRoomWxResponse = weComThirdPartyService.createRoom(request);
+        if (Objects.isNull(createRoomWxResponse)) {
+            return;
+        }
+        // 群管理设置 防骚扰
+        updateRoomManagement(staff, createRoomWxResponse);
+        // add room save
+        ThirdPartWeComRoom roomDetail = new ThirdPartWeComRoom();
+        roomDetail.setCorpId(staff.getCorpId());
+        roomDetail.setStaffId(staff.getId());
+        roomDetail.setThirdRoomId(createRoomWxResponse.getRoomid());
+        roomDetail.setThirdCreateUserId(createRoomWxResponse.getCreateid());
+        roomDetail.setName(createRoomWxResponse.getRoomname());
+        roomDetail.setCreateTime(new Date());
+        roomDetail.setUpdateTime(new Date());
+        roomMapper.insertSelective(roomDetail);
+        // 群成员添加存储
+        saveRoomUser(roomDetail, addUserList);
+        //}
     }
 
     private void updateRoomManagement(ThirdPartWeComStaff staff, CreateRoomWxResponse createRoomWxResponse) {
@@ -211,7 +208,7 @@ public class WeComCreateRoomJob {
         //apiClient.addRoomAdmins();
     }
 
-    private void saveRoomUser(ThirdPartWeComRoom roomDetail,
+    private void saveRoomUser(ThirdPartWeComRoom room,
                               List<ThirdPartWeComStaffUser> addUserList) {
         if (CollectionUtils.isEmpty(addUserList)) {
             return;
@@ -219,7 +216,7 @@ public class WeComCreateRoomJob {
         List<ThirdPartWeComRoomUser> saveList = new ArrayList<>();
         for (ThirdPartWeComStaffUser staffUser : addUserList) {
             ThirdPartWeComRoomUser roomUser = new ThirdPartWeComRoomUser();
-            roomUser.setThirdRoomId(roomDetail.getThirdRoomId());
+            roomUser.setThirdRoomId(room.getThirdRoomId());
             roomUser.setCreateTime(new Date());
             roomUser.setUpdateTime(new Date());
             roomUser.setUin(staffUser.getUserId());
@@ -230,4 +227,58 @@ public class WeComCreateRoomJob {
         }
     }
 
+    @XxlJob("autoAddRoomUser")
+    public ReturnT<String> autoAddRoomUserJob(String param) {
+        List<ThirdPartWeComStaff> activeStaffList = weComThirdPartyService.getActiveStaffList();
+        CountDownLatch cdl = new CountDownLatch(activeStaffList.size());
+        for (ThirdPartWeComStaff staff : activeStaffList) {
+            if (staff.getAutoCreateRoom() != 1) {
+                cdl.countDown();
+                continue;
+            }
+            pool.execute(() -> {
+                try {
+                    addStaffRoomUser(staff);
+                } catch (Exception e) {
+                    log.error("addStaffRoomUser error", e);
+                } finally {
+                    cdl.countDown();
+                }
+            });
+        }
+        try {
+            cdl.await();
+        } catch (InterruptedException e) {
+            log.error("autoAddRoomUserJob error", e);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private void addStaffRoomUser(ThirdPartWeComStaff staff) {
+        // 获取所有未加群客户
+        List<ThirdPartWeComStaffUser> staffUserList = thirdPartWeComMapperExt.getNoGroupStaffUserList(staff.getThirdStaffId());
+        if (CollectionUtils.isEmpty(staffUserList)) {
+            return;
+        }
+        List<ThirdPartWeComRoom> roomList = weComThirdPartyService.getStaffRoomList(staff.getId());
+        for (ThirdPartWeComRoom room : roomList) {
+            if (room.getAddUserStatus() != 1) {
+                continue;
+            }
+            List<Long> vids = new ArrayList<>();
+            List<ThirdPartWeComStaffUser> addUserList = new ArrayList<>();
+            Iterator<ThirdPartWeComStaffUser> iterator = staffUserList.iterator();
+            int size = memberMaxNums - room.getMemberCount();
+            while (iterator.hasNext() && size > 0) {
+                ThirdPartWeComStaffUser item = iterator.next();
+                vids.add(item.getUserId());
+                size--;
+                iterator.remove();
+                addUserList.add(item);
+            }
+            addRoomUser(staff, room, vids, addUserList);
+        }
+        userDetailJob.syncRoomList(staff);
+    }
+
 }

+ 23 - 4
api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComSendMsgJob.java

@@ -1,6 +1,7 @@
 package com.tzld.piaoquan.api.job.wecom.thirdpart;
 
 import com.alibaba.fastjson.JSONObject;
+import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
 import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComMsgMapper;
@@ -13,6 +14,7 @@ import com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsgExample;
 import com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoom;
 import com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaff;
 import com.tzld.piaoquan.api.service.WeComThirdPartyService;
+import com.tzld.piaoquan.api.util.CdnUtil;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
 import com.tzld.piaoquan.growth.common.model.po.Staff;
 import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
@@ -52,6 +54,8 @@ public class WeComSendMsgJob {
     private Integer duplicateDays;
     @Value("${send.room.msg.video.num:2}")
     private Integer videoNum;
+    @ApolloJsonValue("${send.room.msg.test.roomList:[\"10724205295120197\"]}")
+    private List<String> testRoomList;
 
     private final static ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.SECONDS,
             new LinkedBlockingQueue<>(1000),
@@ -75,7 +79,7 @@ public class WeComSendMsgJob {
                         List<CgiReplyBucketData> cgiReplyBucketDataList = getCgiReplyBucketData(room.getThirdRoomId(), staff);
                         for (CgiReplyBucketData cgiReplyBucketData : cgiReplyBucketDataList) {
                             // build发送体
-                            SendAppMsgRequest request = buildSendAppMsgRequest(cgiReplyBucketData, staff, room.getThirdRoomId());
+                            SendAppMsgRequest request = buildSendAppMsgRequest(cgiReplyBucketData, staff, room);
                             // 发送消息
                             weComThirdPartyService.sendAppMsg(request);
                             // 存储消息
@@ -90,7 +94,8 @@ public class WeComSendMsgJob {
 
     private SendAppMsgRequest buildSendAppMsgRequest(CgiReplyBucketData cgiReplyBucketData,
                                                      ThirdPartWeComStaff staff,
-                                                     String thirdRoomId) {
+                                                     ThirdPartWeComRoom room) {
+        String thirdRoomId = room.getThirdRoomId();
         SendAppMsgRequest request = new SendAppMsgRequest();
         request.setUuid(staff.getThirdUuid());
         request.setSend_userid(Long.valueOf(thirdRoomId));
@@ -101,11 +106,16 @@ public class WeComSendMsgJob {
         request.setTitle("票圈 l 3亿人喜欢的视频平台");
         request.setWeappIconUrl("http://rescdn.yishihui.com/temp/1755515422185_%E7%A5%A8%E5%9C%88Vlog_logo.jpg");
         // 填充视频信息
+        String coverUrl = cgiReplyBucketData.getCoverUrl();
+        // 实验 封面添加播放按钮水印
+        if (testRoomList.contains(thirdRoomId)) {
+            coverUrl = addPlayWatermark(cgiReplyBucketData.getCoverUrl());
+        }
         request.setDesc(cgiReplyBucketData.getTitle());
         request.setPagepath(cgiReplyBucketData.getMiniPagePath());
         CdnUploadImgLinkRequest cdnUploadImgLinkRequest = new CdnUploadImgLinkRequest();
         cdnUploadImgLinkRequest.setUuid(staff.getThirdUuid());
-        cdnUploadImgLinkRequest.setUrl(cgiReplyBucketData.getCoverUrl());
+        cdnUploadImgLinkRequest.setUrl(coverUrl);
         CdnUploadImgLinkResponse uploadResponse = weComThirdPartyService.cdnUploadImgLink(cdnUploadImgLinkRequest);
         request.setCdnkey(uploadResponse.getCdn_key());
         request.setMd5(uploadResponse.getMd5());
@@ -114,6 +124,15 @@ public class WeComSendMsgJob {
         return request;
     }
 
+    private String addPlayWatermark(String coverUrl) {
+        if (!coverUrl.startsWith(CdnUtil.VIDEO_CDN_URL_HOST)) {
+            return coverUrl;
+        }
+        String waterMark = "?x-oss-process=image/resize,m_fill,w_600,h_480,limit_0/format,jpg/watermark,image_eXNoL3BpYy93YXRlcm1hcmtlci9pY29uX3BsYXlfd2hpdGUucG5nP3gtb3NzLXByb2Nlc3M9aW1hZ2UvcmVzaXplLHdfMTQ0,g_center";
+        coverUrl = coverUrl.substring(0, coverUrl.indexOf("?"));
+        return coverUrl + waterMark;
+    }
+
     private List<CgiReplyBucketData> getCgiReplyBucketData(String roomId, ThirdPartWeComStaff thirdPartWeComStaff) {
         String dt = planMapperExt.getVideoMaxDt();
         String datastatDt = planMapperExt.getVideoDatastatMaxDt();
@@ -134,7 +153,7 @@ public class WeComSendMsgJob {
             Staff staff = new Staff();
             staff.setCarrierId(String.valueOf(thirdPartWeComStaff.getThirdStaffId()));
             staff.setRemark(thirdPartWeComStaff.getName());
-            String page = messageAttachmentService.getPage(staff, video.getVideoId(), "企微", "社群");
+            String page = messageAttachmentService.getPageNoCache(staff, video.getVideoId(), "企微", "社群");
 
             CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();
             cgiReplyBucketData.setMiniVideoId(video.getVideoId());

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

@@ -23,10 +23,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 import java.util.*;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -57,6 +54,9 @@ public class WeComUserDetailJob {
     @Value("${create.room.member.max.nums:40}")
     private Integer memberMaxNums;
 
+    @Value("${create.room.auto.send.msg:false}")
+    private Boolean autoSendMsg;
+
     private final static ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.SECONDS,
             new LinkedBlockingQueue<>(1000),
             new ThreadFactoryBuilder().setNameFormat("SyncUserDetailJob-%d").build(),
@@ -65,35 +65,45 @@ public class WeComUserDetailJob {
     @XxlJob("syncUserDetail")
     public ReturnT<String> syncUserDetail(String param) {
         List<ThirdPartWeComStaff> activeStaffList = thirdPartyService.getActiveStaffList();
+        CountDownLatch cdl = new CountDownLatch(activeStaffList.size());
         for (ThirdPartWeComStaff staff : activeStaffList) {
             pool.execute(() -> {
-                String uuid = staff.getThirdUuid();
-                String offLineKey = "wecom:thirdpart:offline:" + uuid;
-                if (redisUtils.containsKey(offLineKey)) {
-                    return;
-                }
-                String response = apiClient.getRunClientByUuid(new UuidRequest(uuid));
-                CommonResponse<LoginInfo> commonResponse =
-                        JSONObject.parseObject(response, new TypeReference<CommonResponse<LoginInfo>>() {});
-                if (commonResponse.getErrcode() != 0) {
-                    return;
-                } else {
-                    LoginInfo loginInfo = commonResponse.getData();
-                    staff.setAvatar(loginInfo.getUser_info().getObject().getAvatar());
-                    staff.setName(loginInfo.getUser_info().getObject().getNickname());
-                    staff.setUpdateTime(new Date());
-                    staffMapper.updateByPrimaryKeySelective(staff);
+                try {
+                    String uuid = staff.getThirdUuid();
+                    String offLineKey = "wecom:thirdpart:offline:" + uuid;
+                    if (redisUtils.containsKey(offLineKey)) {
+                        return;
+                    }
+                    String response = apiClient.getRunClientByUuid(new UuidRequest(uuid));
+                    CommonResponse<LoginInfo> commonResponse =
+                            JSONObject.parseObject(response, new TypeReference<CommonResponse<LoginInfo>>() {});
+                    if (commonResponse.getErrcode() == 0) {
+                        LoginInfo loginInfo = commonResponse.getData();
+                        staff.setAvatar(loginInfo.getUser_info().getObject().getAvatar());
+                        staff.setName(loginInfo.getUser_info().getObject().getNickname());
+                        staff.setUpdateTime(new Date());
+                        staffMapper.updateByPrimaryKeySelective(staff);
+                    }
+                    syncRoomList(staff);
+                    syncStaffUserList(staff);
+                } catch (Exception e) {
+                    log.error("syncUserDetail error", e);
+                } finally {
+                    cdl.countDown();
                 }
-                syncRoomList(uuid, staff);
-                syncStaffUserList(uuid, staff);
             });
         }
+        try {
+            cdl.await();
+        } catch (InterruptedException e) {
+            log.error("syncUserDetail error", e);
+        }
         return ReturnT.SUCCESS;
     }
 
-    private void syncStaffUserList(String uuid, ThirdPartWeComStaff staff) {
+    private void syncStaffUserList(ThirdPartWeComStaff staff) {
         List<ExternalContactsResponse.ContactItem> contactItemList = thirdPartyService.getExternalContacts(
-                new GetExternalContactsRequest(uuid, 100, 0));
+                new GetExternalContactsRequest(staff.getThirdUuid(), 100, 0));
         if (CollectionUtils.isEmpty(contactItemList)) {
             return;
         }
@@ -172,15 +182,27 @@ public class WeComUserDetailJob {
     @XxlJob("syncRoomDetail")
     public ReturnT<String> syncRoomDetail(String param) {
         List<ThirdPartWeComStaff> activeStaffList = thirdPartyService.getActiveStaffList();
+        CountDownLatch cdl = new CountDownLatch(activeStaffList.size());
         for (ThirdPartWeComStaff staff : activeStaffList) {
-            pool.execute(() -> syncRoomList(staff.getThirdUuid(), staff));
+            pool.execute(() -> {
+                try {
+                    syncRoomList(staff);
+                } finally {
+                    cdl.countDown();
+                }
+            });
+        }
+        try {
+            cdl.await();
+        } catch (InterruptedException e) {
+            log.error("syncRoomDetail error", e);
         }
         return ReturnT.SUCCESS;
     }
 
-    public void syncRoomList(String uuid, ThirdPartWeComStaff staff) {
+    public void syncRoomList(ThirdPartWeComStaff staff) {
         List<GetChatroomMembersResponse.RoomInfo> roomInfoList =
-                thirdPartyService.getChatroomMembers(new GetChatroomMembersRequest(uuid, 100, 0));
+                thirdPartyService.getChatroomMembers(new GetChatroomMembersRequest(staff.getThirdUuid(), 100, 0));
         List<ThirdPartWeComRoom> roomList = thirdPartyService.getStaffRoomList(staff.getId());
         Map<String, ThirdPartWeComRoom> roomMap = roomList.stream()
                 .collect(Collectors.toMap(ThirdPartWeComRoom::getThirdRoomId, room -> room));
@@ -197,7 +219,7 @@ public class WeComUserDetailJob {
                 roomDetail.setMemberCount(roomInfo.getTotal());
                 roomDetail.setName(roomInfo.getNickname());
                 roomDetail.setAddUserStatus(0);
-                roomDetail.setSendStatus(1);
+                roomDetail.setSendStatus(0);
                 roomDetail.setCreateTime(new Date());
                 roomDetail.setUpdateTime(new Date());
                 roomMapper.insertSelective(roomDetail);
@@ -209,20 +231,20 @@ public class WeComUserDetailJob {
                 roomDetail.setName(roomInfo.getNickname());
                 roomDetail.setUpdateTime(new Date());
                 if (staff.getAutoCreateRoom() == 1) {
-                    if (roomDetail.getMemberCount() >= memberMaxNums){
+                    if (roomDetail.getMemberCount() >= memberMaxNums) {
                         roomDetail.setAddUserStatus(0);
                     }
-                    if (roomDetail.getMemberCount() >= sendMsgStatusNums) {
+                    if (roomDetail.getMemberCount() >= sendMsgStatusNums && autoSendMsg) {
                         roomDetail.setSendStatus(1);
                     }
                 }
                 roomMapper.updateByPrimaryKeySelective(roomDetail);
             }
-            syncRoomUserList(uuid, roomDetail.getThirdRoomId());
+            syncRoomUserList(staff.getThirdUuid(), roomDetail.getThirdRoomId());
         }
         List<String> roomIds = roomInfoList.stream().map(GetChatroomMembersResponse.RoomInfo::getRoom_id).collect(Collectors.toList());
         roomList.removeIf(room -> roomIds.contains(room.getThirdRoomId()));
-        if (CollectionUtils.isNotEmpty(roomList)) {
+        if (CollectionUtils.isNotEmpty(roomList) && CollectionUtils.isNotEmpty(roomInfoList)) {
             roomList.forEach(room -> {
                 room.setIsDelete(1);
                 room.setUpdateTime(new Date());
@@ -237,7 +259,7 @@ public class WeComUserDetailJob {
         List<ThirdPartWeComRoomUser> existUserList = getThirdPartWeComRoomUserListByRoomId(thirdRoomId);
         List<Long> existUserIdList = existUserList.stream().map(ThirdPartWeComRoomUser::getUin).collect(Collectors.toList());
         Map<Long, ThirdPartWeComRoomUser> existUserMap = existUserList.stream()
-                .collect(Collectors.toMap(ThirdPartWeComRoomUser::getUin, roomUser -> roomUser));
+                .collect(Collectors.toMap(ThirdPartWeComRoomUser::getUin, roomUser -> roomUser, (a, b) -> a));
 
         List<ThirdPartWeComRoomUser> saveList = new ArrayList<>();
         for (GetRoomUserListResponse.Member user : userList) {

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/model/param/PageParam.java

@@ -12,8 +12,8 @@ import lombok.Setter;
 public class PageParam {
 
     @ApiModelProperty(value = "页码")
-    private Integer pageNum;
+    private Integer pageNum = 1;
     @ApiModelProperty(value = "每页个数")
-    private Integer pageSize;
+    private Integer pageSize = 20;
 
 }

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/NoticeListParam.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.api.model.param.contentplatform;
+
+
+import com.tzld.piaoquan.api.model.param.PageParam;
+import lombok.Data;
+
+@Data
+public class NoticeListParam extends PageParam {
+}

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/NoticeReadParam.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.api.model.param.contentplatform;
+
+
+import lombok.Data;
+
+@Data
+public class NoticeReadParam {
+    private Long id;
+}

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/wecom/thirdpart/UpdateAutoCreateRoomStatusRequest.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.api.model.param.wecom.thirdpart;
+
+import lombok.Data;
+
+@Data
+public class UpdateAutoCreateRoomStatusRequest {
+    private String staffName;
+    private Integer autoCreateRoomStatus;
+}

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/wecom/thirdpart/UpdateStaffStatusRequest.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.api.model.param.wecom.thirdpart;
+
+import lombok.Data;
+
+@Data
+public class UpdateStaffStatusRequest {
+    private String staffName;
+    private Integer status;
+}

+ 101 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformIllegalMsg.java

@@ -0,0 +1,101 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+public class ContentPlatformIllegalMsg {
+    private Long id;
+
+    private Long accountId;
+
+    private Long videoId;
+
+    private String title;
+
+    private String businessType;
+
+    private Integer status;
+
+    private Long createTimestamp;
+
+    private Long updateTimestamp;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getBusinessType() {
+        return businessType;
+    }
+
+    public void setBusinessType(String businessType) {
+        this.businessType = businessType;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Long getCreateTimestamp() {
+        return createTimestamp;
+    }
+
+    public void setCreateTimestamp(Long createTimestamp) {
+        this.createTimestamp = createTimestamp;
+    }
+
+    public Long getUpdateTimestamp() {
+        return updateTimestamp;
+    }
+
+    public void setUpdateTimestamp(Long updateTimestamp) {
+        this.updateTimestamp = updateTimestamp;
+    }
+
+    @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(", accountId=").append(accountId);
+        sb.append(", videoId=").append(videoId);
+        sb.append(", title=").append(title);
+        sb.append(", businessType=").append(businessType);
+        sb.append(", status=").append(status);
+        sb.append(", createTimestamp=").append(createTimestamp);
+        sb.append(", updateTimestamp=").append(updateTimestamp);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 711 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformIllegalMsgExample.java

@@ -0,0 +1,711 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ContentPlatformIllegalMsgExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public ContentPlatformIllegalMsgExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNull() {
+            addCriterion("account_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNotNull() {
+            addCriterion("account_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdEqualTo(Long value) {
+            addCriterion("account_id =", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotEqualTo(Long value) {
+            addCriterion("account_id <>", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThan(Long value) {
+            addCriterion("account_id >", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("account_id >=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThan(Long value) {
+            addCriterion("account_id <", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThanOrEqualTo(Long value) {
+            addCriterion("account_id <=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIn(List<Long> values) {
+            addCriterion("account_id in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotIn(List<Long> values) {
+            addCriterion("account_id not in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdBetween(Long value1, Long value2) {
+            addCriterion("account_id between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotBetween(Long value1, Long value2) {
+            addCriterion("account_id not between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNull() {
+            addCriterion("video_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNotNull() {
+            addCriterion("video_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdEqualTo(Long value) {
+            addCriterion("video_id =", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotEqualTo(Long value) {
+            addCriterion("video_id <>", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThan(Long value) {
+            addCriterion("video_id >", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("video_id >=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThan(Long value) {
+            addCriterion("video_id <", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThanOrEqualTo(Long value) {
+            addCriterion("video_id <=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIn(List<Long> values) {
+            addCriterion("video_id in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotIn(List<Long> values) {
+            addCriterion("video_id not in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdBetween(Long value1, Long value2) {
+            addCriterion("video_id between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotBetween(Long value1, Long value2) {
+            addCriterion("video_id not between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIsNull() {
+            addCriterion("title is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIsNotNull() {
+            addCriterion("title is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleEqualTo(String value) {
+            addCriterion("title =", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotEqualTo(String value) {
+            addCriterion("title <>", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleGreaterThan(String value) {
+            addCriterion("title >", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleGreaterThanOrEqualTo(String value) {
+            addCriterion("title >=", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLessThan(String value) {
+            addCriterion("title <", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLessThanOrEqualTo(String value) {
+            addCriterion("title <=", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLike(String value) {
+            addCriterion("title like", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotLike(String value) {
+            addCriterion("title not like", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIn(List<String> values) {
+            addCriterion("title in", values, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotIn(List<String> values) {
+            addCriterion("title not in", values, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleBetween(String value1, String value2) {
+            addCriterion("title between", value1, value2, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotBetween(String value1, String value2) {
+            addCriterion("title not between", value1, value2, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeIsNull() {
+            addCriterion("business_type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeIsNotNull() {
+            addCriterion("business_type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeEqualTo(String value) {
+            addCriterion("business_type =", value, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeNotEqualTo(String value) {
+            addCriterion("business_type <>", value, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeGreaterThan(String value) {
+            addCriterion("business_type >", value, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeGreaterThanOrEqualTo(String value) {
+            addCriterion("business_type >=", value, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeLessThan(String value) {
+            addCriterion("business_type <", value, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeLessThanOrEqualTo(String value) {
+            addCriterion("business_type <=", value, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeLike(String value) {
+            addCriterion("business_type like", value, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeNotLike(String value) {
+            addCriterion("business_type not like", value, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeIn(List<String> values) {
+            addCriterion("business_type in", values, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeNotIn(List<String> values) {
+            addCriterion("business_type not in", values, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeBetween(String value1, String value2) {
+            addCriterion("business_type between", value1, value2, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andBusinessTypeNotBetween(String value1, String value2) {
+            addCriterion("business_type not between", value1, value2, "businessType");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNull() {
+            addCriterion("`status` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("`status` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(Integer value) {
+            addCriterion("`status` =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Integer value) {
+            addCriterion("`status` <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Integer value) {
+            addCriterion("`status` >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`status` >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Integer value) {
+            addCriterion("`status` <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("`status` <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Integer> values) {
+            addCriterion("`status` in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Integer> values) {
+            addCriterion("`status` not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Integer value1, Integer value2) {
+            addCriterion("`status` between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("`status` not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNull() {
+            addCriterion("create_timestamp is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNotNull() {
+            addCriterion("create_timestamp is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampEqualTo(Long value) {
+            addCriterion("create_timestamp =", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotEqualTo(Long value) {
+            addCriterion("create_timestamp <>", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThan(Long value) {
+            addCriterion("create_timestamp >", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp >=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThan(Long value) {
+            addCriterion("create_timestamp <", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp <=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIn(List<Long> values) {
+            addCriterion("create_timestamp in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotIn(List<Long> values) {
+            addCriterion("create_timestamp not in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp not between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampIsNull() {
+            addCriterion("update_timestamp is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampIsNotNull() {
+            addCriterion("update_timestamp is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampEqualTo(Long value) {
+            addCriterion("update_timestamp =", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampNotEqualTo(Long value) {
+            addCriterion("update_timestamp <>", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampGreaterThan(Long value) {
+            addCriterion("update_timestamp >", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampGreaterThanOrEqualTo(Long value) {
+            addCriterion("update_timestamp >=", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampLessThan(Long value) {
+            addCriterion("update_timestamp <", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampLessThanOrEqualTo(Long value) {
+            addCriterion("update_timestamp <=", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampIn(List<Long> values) {
+            addCriterion("update_timestamp in", values, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampNotIn(List<Long> values) {
+            addCriterion("update_timestamp not in", values, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampBetween(Long value1, Long value2) {
+            addCriterion("update_timestamp between", value1, value2, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampNotBetween(Long value1, Long value2) {
+            addCriterion("update_timestamp not between", value1, value2, "updateTimestamp");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 79 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformIllegalVideo.java

@@ -0,0 +1,79 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+public class ContentPlatformIllegalVideo {
+    private Long id;
+
+    private String dateStr;
+
+    private Long videoId;
+
+    private String title;
+
+    private Long createTimestamp;
+
+    private String content;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDateStr() {
+        return dateStr;
+    }
+
+    public void setDateStr(String dateStr) {
+        this.dateStr = dateStr;
+    }
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public Long getCreateTimestamp() {
+        return createTimestamp;
+    }
+
+    public void setCreateTimestamp(Long createTimestamp) {
+        this.createTimestamp = createTimestamp;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    @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(", dateStr=").append(dateStr);
+        sb.append(", videoId=").append(videoId);
+        sb.append(", title=").append(title);
+        sb.append(", createTimestamp=").append(createTimestamp);
+        sb.append(", content=").append(content);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 531 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformIllegalVideoExample.java

@@ -0,0 +1,531 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ContentPlatformIllegalVideoExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public ContentPlatformIllegalVideoExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrIsNull() {
+            addCriterion("date_str is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrIsNotNull() {
+            addCriterion("date_str is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrEqualTo(String value) {
+            addCriterion("date_str =", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotEqualTo(String value) {
+            addCriterion("date_str <>", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrGreaterThan(String value) {
+            addCriterion("date_str >", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrGreaterThanOrEqualTo(String value) {
+            addCriterion("date_str >=", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrLessThan(String value) {
+            addCriterion("date_str <", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrLessThanOrEqualTo(String value) {
+            addCriterion("date_str <=", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrLike(String value) {
+            addCriterion("date_str like", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotLike(String value) {
+            addCriterion("date_str not like", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrIn(List<String> values) {
+            addCriterion("date_str in", values, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotIn(List<String> values) {
+            addCriterion("date_str not in", values, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrBetween(String value1, String value2) {
+            addCriterion("date_str between", value1, value2, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotBetween(String value1, String value2) {
+            addCriterion("date_str not between", value1, value2, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNull() {
+            addCriterion("video_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNotNull() {
+            addCriterion("video_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdEqualTo(Long value) {
+            addCriterion("video_id =", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotEqualTo(Long value) {
+            addCriterion("video_id <>", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThan(Long value) {
+            addCriterion("video_id >", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("video_id >=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThan(Long value) {
+            addCriterion("video_id <", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThanOrEqualTo(Long value) {
+            addCriterion("video_id <=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIn(List<Long> values) {
+            addCriterion("video_id in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotIn(List<Long> values) {
+            addCriterion("video_id not in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdBetween(Long value1, Long value2) {
+            addCriterion("video_id between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotBetween(Long value1, Long value2) {
+            addCriterion("video_id not between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIsNull() {
+            addCriterion("title is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIsNotNull() {
+            addCriterion("title is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleEqualTo(String value) {
+            addCriterion("title =", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotEqualTo(String value) {
+            addCriterion("title <>", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleGreaterThan(String value) {
+            addCriterion("title >", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleGreaterThanOrEqualTo(String value) {
+            addCriterion("title >=", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLessThan(String value) {
+            addCriterion("title <", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLessThanOrEqualTo(String value) {
+            addCriterion("title <=", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLike(String value) {
+            addCriterion("title like", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotLike(String value) {
+            addCriterion("title not like", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIn(List<String> values) {
+            addCriterion("title in", values, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotIn(List<String> values) {
+            addCriterion("title not in", values, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleBetween(String value1, String value2) {
+            addCriterion("title between", value1, value2, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotBetween(String value1, String value2) {
+            addCriterion("title not between", value1, value2, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNull() {
+            addCriterion("create_timestamp is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNotNull() {
+            addCriterion("create_timestamp is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampEqualTo(Long value) {
+            addCriterion("create_timestamp =", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotEqualTo(Long value) {
+            addCriterion("create_timestamp <>", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThan(Long value) {
+            addCriterion("create_timestamp >", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp >=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThan(Long value) {
+            addCriterion("create_timestamp <", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp <=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIn(List<Long> values) {
+            addCriterion("create_timestamp in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotIn(List<Long> values) {
+            addCriterion("create_timestamp not in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp not between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 12 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/PlanIllegalVideoDTO.java

@@ -0,0 +1,12 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+import lombok.Data;
+
+@Data
+public class PlanIllegalVideoDTO {
+    private Long accountId;
+    private String channel;
+    private Integer type;
+    private Long videoId;
+    private String title;
+}

+ 23 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/NoticeItemVO.java

@@ -0,0 +1,23 @@
+package com.tzld.piaoquan.api.model.vo.contentplatform;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class NoticeItemVO {
+
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "消息内容")
+    private String msg;
+
+    @ApiModelProperty(value = "状态 0-未读 1-已读")
+    private Integer status;
+
+    @ApiModelProperty(value = "创建时间")
+    private Long createTimestamp;
+}

+ 15 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/WeComThirdPartyService.java

@@ -9,7 +9,7 @@ import java.util.List;
 
 public interface WeComThirdPartyService {
 
-    InitResponse init();
+    InitResponse init(InitRequest request);
 
     void setCallbackUrl(SetCallbackUrlRequest request);
 
@@ -35,6 +35,8 @@ public interface WeComThirdPartyService {
 
     List<ThirdPartWeComStaff> getActiveStaffList();
 
+    List<ThirdPartWeComRoom> getAllStaffRoomList(Long staffId);
+
     List<ThirdPartWeComRoom> getStaffRoomList(Long staffId);
 
     CreateRoomWxResponse createRoom(CreateRoomWxRequest request);
@@ -42,4 +44,16 @@ public interface WeComThirdPartyService {
     List<AntiSpamRuleResponse.AntiSpamRule> queryCRMAntiSpamRule(QueryCRMAntiSpamRuleRequest request);
 
     void updateRoomSendStatus(UpdateRoomSendStatusRequest request);
+
+    Long getTodayCreateRoomCount(Long staffId);
+
+    CommonResponse<String> invitationToRoom(InvitationToRoomRequest request);
+
+    ThirdPartWeComRoom getRoomByRoomId(Long roomid);
+
+    ThirdPartWeComStaff getStaffByUuid(String uuid);
+
+    void updateStaffStatus(UpdateStaffStatusRequest request);
+
+    void updateAutoCreateRoomStatus(UpdateAutoCreateRoomStatusRequest request);
 }

+ 15 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformNoticeService.java

@@ -0,0 +1,15 @@
+package com.tzld.piaoquan.api.service.contentplatform;
+
+import com.tzld.piaoquan.api.model.param.contentplatform.NoticeListParam;
+import com.tzld.piaoquan.api.model.param.contentplatform.NoticeReadParam;
+import com.tzld.piaoquan.api.model.vo.contentplatform.NoticeItemVO;
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
+public interface ContentPlatformNoticeService {
+
+    Page<NoticeItemVO> noticeList(NoticeListParam param);
+
+    Long getNotReadCount();
+
+    void noticeRead(NoticeReadParam param);
+}

+ 6 - 6
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformDatastatServiceImpl.java

@@ -245,14 +245,14 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
         ContentPlatformAccount user = LoginUserContext.getUser();
         Page<GzhDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
         int offset = (param.getPageNum() - 1) * param.getPageSize();
-        int count = dataStatMapperExt.getGzhPushTotalDatastatCount(param, user.getId());
+        int count = dataStatMapperExt.getGzhPushAccountDatastatCount(param, user.getId());
         result.setTotalSize(count);
         if (count == 0) {
             return result;
         }
-        List<ContentPlatformGzhPushDataStatTotal> datastatList = dataStatMapperExt.getGzhPushTotalDatastatList(param,
+        List<ContentPlatformGzhDataStat> datastatList = dataStatMapperExt.getGzhPushAccountDatastatList(param,
                 user.getId(), offset, param.getPageSize());
-        List<GzhDatastatItemVO> list = buildGzhPushDatastatTotalItemVOList(datastatList);
+        List<GzhDatastatItemVO> list = buildGzhDatastatItemVOList(param.getType(), datastatList);
         result.setObjs(list);
         return result;
     }
@@ -284,14 +284,14 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
         ContentPlatformAccount user = LoginUserContext.getUser();
         Page<GzhDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
         int offset = (param.getPageNum() - 1) * param.getPageSize();
-        int count = dataStatMapperExt.getGzhPushAccountDatastatCount(param, user.getId());
+        int count = dataStatMapperExt.getGzhPushTotalDatastatCount(param, user.getId());
         result.setTotalSize(count);
         if (count == 0) {
             return result;
         }
-        List<ContentPlatformGzhDataStat> datastatList = dataStatMapperExt.getGzhPushAccountDatastatList(param,
+        List<ContentPlatformGzhPushDataStatTotal> datastatList = dataStatMapperExt.getGzhPushTotalDatastatList(param,
                 user.getId(), offset, param.getPageSize());
-        List<GzhDatastatItemVO> list = buildGzhDatastatItemVOList(param.getType(), datastatList);
+        List<GzhDatastatItemVO> list = buildGzhPushDatastatTotalItemVOList(datastatList);
         result.setObjs(list);
         return result;
     }

+ 71 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformNoticeServiceImpl.java

@@ -0,0 +1,71 @@
+package com.tzld.piaoquan.api.service.contentplatform.impl;
+
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformIllegalMsgMapper;
+import com.tzld.piaoquan.api.model.config.LoginUserContext;
+import com.tzld.piaoquan.api.model.param.contentplatform.NoticeListParam;
+import com.tzld.piaoquan.api.model.param.contentplatform.NoticeReadParam;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsg;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsgExample;
+import com.tzld.piaoquan.api.model.vo.contentplatform.NoticeItemVO;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformNoticeService;
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Service
+public class ContentPlatformNoticeServiceImpl implements ContentPlatformNoticeService {
+
+    @Autowired
+    private ContentPlatformIllegalMsgMapper msgMapper;
+
+    @Override
+    public Page<NoticeItemVO> noticeList(NoticeListParam param) {
+        ContentPlatformAccount loginAccount = LoginUserContext.getUser();
+        ContentPlatformIllegalMsgExample example = new ContentPlatformIllegalMsgExample();
+        example.createCriteria().andAccountIdEqualTo(loginAccount.getId());
+        example.setOrderByClause("create_timestamp desc");
+        Page<NoticeItemVO> page = new Page<>(param.getPageNum(), param.getPageSize());
+        example.setPage(page);
+        long totalCount = msgMapper.countByExample(example);
+        page.setTotalSize((int) totalCount);
+        List<ContentPlatformIllegalMsg> list = msgMapper.selectByExample(example);
+        List<NoticeItemVO> records = new ArrayList<>();
+        for (ContentPlatformIllegalMsg item : list) {
+            NoticeItemVO vo = new NoticeItemVO();
+            vo.setId(item.getId());
+            String title = "视频“" + item.getTitle() + "”被封禁,请及时替换";
+            vo.setTitle(title);
+            String msg = "您在" + item.getBusinessType() + "栏目中使用的视频“" +
+                    item.getTitle() + "”(视频ID:" + item.getVideoId() + ")被微信封禁,请及时替换为其他视频。";
+            vo.setMsg(msg);
+            vo.setStatus(item.getStatus());
+            vo.setCreateTimestamp(item.getCreateTimestamp());
+            records.add(vo);
+        }
+        page.setObjs(records);
+        return page;
+    }
+
+    @Override
+    public Long getNotReadCount() {
+        ContentPlatformAccount loginAccount = LoginUserContext.getUser();
+        ContentPlatformIllegalMsgExample example = new ContentPlatformIllegalMsgExample();
+        example.createCriteria().andAccountIdEqualTo(loginAccount.getId()).andStatusEqualTo(0);
+        return msgMapper.countByExample(example);
+    }
+
+    @Override
+    public void noticeRead(NoticeReadParam param) {
+        ContentPlatformIllegalMsg illegalMsg = new ContentPlatformIllegalMsg();
+        illegalMsg.setId(param.getId());
+        illegalMsg.setStatus(1);
+        illegalMsg.setUpdateTimestamp(System.currentTimeMillis());
+        msgMapper.updateByPrimaryKeySelective(illegalMsg);
+    }
+}

+ 114 - 16
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/WeComThirdPartyServiceImpl.java

@@ -15,6 +15,9 @@ import com.tzld.piaoquan.api.service.WeComThirdPartyService;
 import com.tzld.piaoquan.growth.common.dao.mapper.CorpMapper;
 import com.tzld.piaoquan.growth.common.model.po.Corp;
 import com.tzld.piaoquan.growth.common.model.po.CorpExample;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
+import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
+import com.tzld.piaoquan.growth.common.utils.RedisUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -22,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 
@@ -40,16 +44,21 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
     @Autowired
     private CorpMapper corpMapper;
 
+    @Autowired
+    private RedisUtils redisUtils;
+
     @Override
-    public InitResponse init() {
-        InitRequest request = new InitRequest();
+    public InitResponse init(InitRequest request) {
+        if (Objects.isNull(request)) {
+            request = new InitRequest();
+        }
         request.setProxySituation(0);
         request.setDeverType("ipad");
         String response = apiClient.init(request);
         CommonResponse<InitResponse> commonResponse =
                 JSONObject.parseObject(response, new TypeReference<CommonResponse<InitResponse>>() {});
         if (commonResponse.getErrcode() != 0) {
-            log.error("init failed, response: {}", response);
+            log.error("WeComThirdPartyService init failed, request: {}, response: {}", request, response);
             return null;
         }
         return commonResponse.getData();
@@ -66,7 +75,7 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
         CommonResponse<QrCodeResponse> commonResponse =
                 JSONObject.parseObject(response, new TypeReference<CommonResponse<QrCodeResponse>>() {});
         if (commonResponse.getErrcode() != 0) {
-            log.error("get qr code failed, response: {}", response);
+            log.error("WeComThirdPartyService get qr code failed, request: {}, response: {}", request, response);
             return null;
         }
         return commonResponse.getData();
@@ -83,7 +92,7 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
         CommonResponse<SecondaryValidationResponse> commonResponse =
                 JSONObject.parseObject(response, new TypeReference<CommonResponse<SecondaryValidationResponse>>() {});
         if (commonResponse.getErrcode() != 0) {
-            log.error("secondary validation failed, response: {}", response);
+            log.error("WeComThirdPartyService secondary validation failed, request: {}, response: {}", request, response);
             return null;
         }
         return commonResponse.getData().getQrcode();
@@ -95,7 +104,7 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
         CommonResponse<LoginInfo> commonResponse =
                 JSONObject.parseObject(response, new TypeReference<CommonResponse<LoginInfo>>() {});
         if (commonResponse.getErrcode() != 0) {
-            log.error("get run client by uuid failed, response: {}", response);
+            log.error("WeComThirdPartyService get run client by uuid failed, request: {}, response: {}", request, response);
             return null;
         }
         new Thread(() -> saveStaffDetail(commonResponse.getData())).start();
@@ -152,6 +161,9 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
             existStaff.setStatus(0);
             thirdPartWeComStaffMapper.updateByPrimaryKeySelective(existStaff);
         }
+
+        String offLineKey = "wecom:thirdpart:offline:" + uuid;
+        redisUtils.del(offLineKey);
     }
 
     private Corp getCorpByName(String corpName) {
@@ -198,7 +210,7 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
             CommonResponse<GetInnerContactsResponse> commonResponse =
                     JSONObject.parseObject(response, new TypeReference<CommonResponse<GetInnerContactsResponse>>() {});
             if (commonResponse.getErrcode() != 0) {
-                log.error("get inner contacts failed, response: {}", response);
+                log.error("WeComThirdPartyService get inner contacts failed, request: {}, response: {}", request, response);
                 return result;
             }
             result.addAll(commonResponse.getData().getList());
@@ -221,7 +233,7 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
             CommonResponse<ExternalContactsResponse> commonResponse =
                     JSONObject.parseObject(response, new TypeReference<CommonResponse<ExternalContactsResponse>>() {});
             if (commonResponse.getErrcode() != 0) {
-                log.error("get external contacts failed, response: {}", response);
+                log.error("WeComThirdPartyService get external contacts failed, request: {}, response: {}", request, response);
                 return result;
             }
             result.addAll(commonResponse.getData().getList());
@@ -244,7 +256,7 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
             CommonResponse<GetChatroomMembersResponse> commonResponse =
                     JSONObject.parseObject(response, new TypeReference<CommonResponse<GetChatroomMembersResponse>>() {});
             if (commonResponse.getErrcode() != 0) {
-                log.error("get chatroom members failed, response: {}", response);
+                log.error("WeComThirdPartyService get chatroom members failed, request: {}, response: {}", request, response);
                 return result;
             }
             result.addAll(commonResponse.getData().getRoomList());
@@ -260,7 +272,7 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
         CommonResponse<GetRoomUserListResponse> commonResponse =
                 JSONObject.parseObject(response, new TypeReference<CommonResponse<GetRoomUserListResponse>>() {});
         if (commonResponse.getErrcode() != 0) {
-            log.error("get room user list failed, response: {}", response);
+            log.error("WeComThirdPartyService get room user list failed, request: {}, response: {}", request, response);
             return result;
         }
         result.addAll(commonResponse.getData().getMember_list());
@@ -273,7 +285,7 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
         CommonResponse<CdnUploadImgLinkResponse> commonResponse =
                 JSONObject.parseObject(response, new TypeReference<CommonResponse<CdnUploadImgLinkResponse>>() {});
         if (commonResponse.getErrcode() != 0) {
-            log.error("cdn upload img link failed, response: {}", response);
+            log.error("WeComThirdPartyService cdn upload img link failed, request: {}, response: {}", request, response);
             return null;
         }
         return commonResponse.getData();
@@ -285,7 +297,7 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
         CommonResponse<SendAppMsgResponse> commonResponse =
                 JSONObject.parseObject(response, new TypeReference<CommonResponse<SendAppMsgResponse>>() {});
         if (commonResponse.getErrcode() != 0) {
-            log.error("send app msg failed, response: {}", response);
+            log.error("WeComThirdPartyService send app msg failed, request: {}, response: {}", request, response);
         }
     }
 
@@ -296,6 +308,13 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
         return thirdPartWeComStaffMapper.selectByExample(example);
     }
 
+    @Override
+    public List<ThirdPartWeComRoom> getAllStaffRoomList(Long staffId) {
+        ThirdPartWeComRoomExample example = new ThirdPartWeComRoomExample();
+        example.createCriteria().andStaffIdEqualTo(staffId);
+        return thirdPartWeComRoomMapper.selectByExample(example);
+    }
+
     @Override
     public List<ThirdPartWeComRoom> getStaffRoomList(Long staffId) {
         ThirdPartWeComRoomExample example = new ThirdPartWeComRoomExample();
@@ -309,7 +328,15 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
         CommonResponse<CreateRoomWxResponse> commonResponse =
                 JSONObject.parseObject(response, new TypeReference<CommonResponse<CreateRoomWxResponse>>() {});
         if (commonResponse.getErrcode() != 0) {
-            log.error("create room failed, response: {}", response);
+            log.error("WeComThirdPartyService create room failed, request: {}, response: {}", request, response);
+            ThirdPartWeComStaff staff = getStaffByUuid(request.getUuid());
+            LarkRobotUtil.sendWeComThirdPartMessage(
+                    "【建群失败通知】\n" +
+                            "账号UUID:" + request.getUuid() + "\n" +
+                            "账号名称:" + (Objects.nonNull(staff) ? staff.getName() : "") + "\n" +
+                            "群名称:" + request.getRoomName() + "\n" +
+                            "邀请用户:" + request.getVids() + "\n" +
+                            "错误信息:" + response);
             return null;
         }
         return commonResponse.getData();
@@ -323,10 +350,9 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
             request.setLastIndexInfo(lastIndexInfo);
             String response = apiClient.queryCRMAntiSpamRule(request);
             CommonResponse<AntiSpamRuleResponse> commonResponse =
-                    JSONObject.parseObject(response, new TypeReference<CommonResponse<AntiSpamRuleResponse>>() {
-                    });
+                    JSONObject.parseObject(response, new TypeReference<CommonResponse<AntiSpamRuleResponse>>() {});
             if (commonResponse.getErrcode() != 0) {
-                log.error("query crm AntiSpamRule failed, response: {}", response);
+                log.error("WeComThirdPartyService query crm AntiSpamRule failed, request: {}, response: {}", request, response);
                 return result;
             }
             result.addAll(commonResponse.getData().getList());
@@ -369,4 +395,76 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
         return staffList.get(0);
     }
 
+    @Override
+    public Long getTodayCreateRoomCount(Long staffId) {
+        Date todayStart = DateUtil.getTodayStartDate();
+        ThirdPartWeComRoomExample example = new ThirdPartWeComRoomExample();
+        example.createCriteria().andStaffIdEqualTo(staffId).andCreateTimeBetween(todayStart, new Date());
+        return thirdPartWeComRoomMapper.countByExample(example);
+    }
+
+    @Override
+    public CommonResponse<String> invitationToRoom(InvitationToRoomRequest request) {
+        String res = apiClient.invitationToRoom(request);
+        CommonResponse<String> commonResponse = JSONObject.parseObject(res, new TypeReference<CommonResponse<String>>() {});
+        if (commonResponse.getErrcode() != 0) {
+            log.error("WeComThirdPartyService invitationToRoom error, roomId: {}, vids: {}, errMsg: {}",
+                    request.getRoomid(), request.getVids(), commonResponse.getErrmsg());
+            ThirdPartWeComStaff staff = getStaffByUuid(request.getUuid());
+            ThirdPartWeComRoom room = getRoomByRoomId(request.getRoomid());
+            LarkRobotUtil.sendWeComThirdPartMessage(
+                    "【邀请群成员失败通知】\n" +
+                            "账号UUID:" + request.getUuid() + "\n" +
+                            "账号名称:" + (Objects.nonNull(staff) ? staff.getName() : "") + "\n" +
+                            "群ID:" + request.getRoomid() + "\n" +
+                            "群名称:" + (Objects.nonNull(room) ? room.getName() : "") + "\n" +
+                            "邀请用户:" + request.getVids() + "\n" +
+                            "错误信息:" + res);
+            return null;
+        }
+        return commonResponse;
+    }
+
+    @Override
+    public ThirdPartWeComRoom getRoomByRoomId(Long roomid) {
+        ThirdPartWeComRoomExample example = new ThirdPartWeComRoomExample();
+        example.createCriteria().andThirdRoomIdEqualTo(String.valueOf(roomid));
+        List<ThirdPartWeComRoom> roomList = thirdPartWeComRoomMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(roomList)) {
+            return null;
+        }
+        return roomList.get(0);
+    }
+
+    @Override
+    public ThirdPartWeComStaff getStaffByUuid(String uuid) {
+        ThirdPartWeComStaffExample example = new ThirdPartWeComStaffExample();
+        example.createCriteria().andThirdUuidEqualTo(uuid);
+        List<ThirdPartWeComStaff> staffList = thirdPartWeComStaffMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(staffList)) {
+            return null;
+        }
+        return staffList.get(0);
+    }
+
+    @Override
+    public void updateStaffStatus(UpdateStaffStatusRequest request) {
+        ThirdPartWeComStaff staff = getStaffByName(request.getStaffName());
+        if (Objects.isNull(staff)) {
+            throw new CommonException(ExceptionEnum.THIRD_PART_STAFF_NOT_FOUND);
+        }
+        staff.setStatus(request.getStatus());
+        thirdPartWeComStaffMapper.updateByPrimaryKeySelective(staff);
+    }
+
+    @Override
+    public void updateAutoCreateRoomStatus(UpdateAutoCreateRoomStatusRequest request) {
+        ThirdPartWeComStaff staff = getStaffByName(request.getStaffName());
+        if (Objects.isNull(staff)) {
+            throw new CommonException(ExceptionEnum.THIRD_PART_STAFF_NOT_FOUND);
+        }
+        staff.setAutoCreateRoom(request.getAutoCreateRoomStatus());
+        thirdPartWeComStaffMapper.updateByPrimaryKeySelective(staff);
+    }
+
 }

+ 261 - 0
api-module/src/main/resources/mapper/contentplatform/ContentPlatformIllegalMsgMapper.xml

@@ -0,0 +1,261 @@
+<?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.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformIllegalMsgMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsg">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="account_id" jdbcType="BIGINT" property="accountId" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="business_type" jdbcType="VARCHAR" property="businessType" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
+    <result column="update_timestamp" jdbcType="BIGINT" property="updateTimestamp" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, account_id, video_id, title, business_type, `status`, create_timestamp, update_timestamp
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsgExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from content_platform_illegal_msg
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from content_platform_illegal_msg
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from content_platform_illegal_msg
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsgExample">
+    delete from content_platform_illegal_msg
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsg">
+    insert into content_platform_illegal_msg (id, account_id, video_id, 
+      title, business_type, `status`, 
+      create_timestamp, update_timestamp)
+    values (#{id,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, 
+      #{title,jdbcType=VARCHAR}, #{businessType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
+      #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsg">
+    insert into content_platform_illegal_msg
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="accountId != null">
+        account_id,
+      </if>
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="title != null">
+        title,
+      </if>
+      <if test="businessType != null">
+        business_type,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp,
+      </if>
+      <if test="updateTimestamp != null">
+        update_timestamp,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="accountId != null">
+        #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="title != null">
+        #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="businessType != null">
+        #{businessType,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTimestamp != null">
+        #{createTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="updateTimestamp != null">
+        #{updateTimestamp,jdbcType=BIGINT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsgExample" resultType="java.lang.Long">
+    select count(*) from content_platform_illegal_msg
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update content_platform_illegal_msg
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.accountId != null">
+        account_id = #{record.accountId,jdbcType=BIGINT},
+      </if>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.title != null">
+        title = #{record.title,jdbcType=VARCHAR},
+      </if>
+      <if test="record.businessType != null">
+        business_type = #{record.businessType,jdbcType=VARCHAR},
+      </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTimestamp != null">
+        create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="record.updateTimestamp != null">
+        update_timestamp = #{record.updateTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update content_platform_illegal_msg
+    set id = #{record.id,jdbcType=BIGINT},
+      account_id = #{record.accountId,jdbcType=BIGINT},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      title = #{record.title,jdbcType=VARCHAR},
+      business_type = #{record.businessType,jdbcType=VARCHAR},
+      `status` = #{record.status,jdbcType=INTEGER},
+      create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
+      update_timestamp = #{record.updateTimestamp,jdbcType=BIGINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsg">
+    update content_platform_illegal_msg
+    <set>
+      <if test="accountId != null">
+        account_id = #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="title != null">
+        title = #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="businessType != null">
+        business_type = #{businessType,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="updateTimestamp != null">
+        update_timestamp = #{updateTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsg">
+    update content_platform_illegal_msg
+    set account_id = #{accountId,jdbcType=BIGINT},
+      video_id = #{videoId,jdbcType=BIGINT},
+      title = #{title,jdbcType=VARCHAR},
+      business_type = #{businessType,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      update_timestamp = #{updateTimestamp,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 276 - 0
api-module/src/main/resources/mapper/contentplatform/ContentPlatformIllegalVideoMapper.xml

@@ -0,0 +1,276 @@
+<?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.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformIllegalVideoMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideo">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="date_str" jdbcType="VARCHAR" property="dateStr" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideo">
+    <result column="content" jdbcType="LONGVARCHAR" property="content" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, date_str, video_id, title, create_timestamp
+  </sql>
+  <sql id="Blob_Column_List">
+    content
+  </sql>
+  <select id="selectByExampleWithBLOBs" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideoExample" resultMap="ResultMapWithBLOBs">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from content_platform_illegal_video
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideoExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from content_platform_illegal_video
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from content_platform_illegal_video
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from content_platform_illegal_video
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideoExample">
+    delete from content_platform_illegal_video
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideo">
+    insert into content_platform_illegal_video (id, date_str, video_id, 
+      title, create_timestamp, content
+      )
+    values (#{id,jdbcType=BIGINT}, #{dateStr,jdbcType=VARCHAR}, #{videoId,jdbcType=BIGINT}, 
+      #{title,jdbcType=VARCHAR}, #{createTimestamp,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideo">
+    insert into content_platform_illegal_video
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="dateStr != null">
+        date_str,
+      </if>
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="title != null">
+        title,
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp,
+      </if>
+      <if test="content != null">
+        content,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="dateStr != null">
+        #{dateStr,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="title != null">
+        #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="createTimestamp != null">
+        #{createTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="content != null">
+        #{content,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideoExample" resultType="java.lang.Long">
+    select count(*) from content_platform_illegal_video
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update content_platform_illegal_video
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.dateStr != null">
+        date_str = #{record.dateStr,jdbcType=VARCHAR},
+      </if>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.title != null">
+        title = #{record.title,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTimestamp != null">
+        create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="record.content != null">
+        content = #{record.content,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExampleWithBLOBs" parameterType="map">
+    update content_platform_illegal_video
+    set id = #{record.id,jdbcType=BIGINT},
+      date_str = #{record.dateStr,jdbcType=VARCHAR},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      title = #{record.title,jdbcType=VARCHAR},
+      create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
+      content = #{record.content,jdbcType=LONGVARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update content_platform_illegal_video
+    set id = #{record.id,jdbcType=BIGINT},
+      date_str = #{record.dateStr,jdbcType=VARCHAR},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      title = #{record.title,jdbcType=VARCHAR},
+      create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideo">
+    update content_platform_illegal_video
+    <set>
+      <if test="dateStr != null">
+        date_str = #{dateStr,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="title != null">
+        title = #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="content != null">
+        content = #{content,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideo">
+    update content_platform_illegal_video
+    set date_str = #{dateStr,jdbcType=VARCHAR},
+      video_id = #{videoId,jdbcType=BIGINT},
+      title = #{title,jdbcType=VARCHAR},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      content = #{content,jdbcType=LONGVARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalVideo">
+    update content_platform_illegal_video
+    set date_str = #{dateStr,jdbcType=VARCHAR},
+      video_id = #{videoId,jdbcType=BIGINT},
+      title = #{title,jdbcType=VARCHAR},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 30 - 2
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

@@ -171,6 +171,14 @@
         </foreach>
     </insert>
 
+    <insert id="batchInsertContentPlatformIllegalVideo">
+        insert into content_platform_illegal_video (date_str, video_id, content, title, create_timestamp)
+        values
+        <foreach collection="records" item="item" separator=",">
+            (#{item.dateStr}, #{item.videoId}, #{item.content}, #{item.title}, #{item.createTimestamp})
+        </foreach>
+    </insert>
+
     <insert id="batchInsertContentPlatformVideoAgg">
         insert into content_platform_video_agg (dt, video_id, category, title, cover, video, score, create_timestamp)
         values
@@ -267,18 +275,20 @@
         WHERE t.rn = 1;
     </select>
 
-    <update id="updateVideoStatus">
+    <update id="updateVideoStatusWithOldStatus">
         update content_platform_video
         set status = #{status},
             update_timestamp = #{now}
         where video_id = #{videoId}
+        and status = #{oldStatus}
     </update>
 
-    <update id="updateVideoAggStatus">
+    <update id="updateVideoAggStatusWithOldStatus">
         update content_platform_video_agg
         set status = #{status},
             update_timestamp = #{now}
         where video_id = #{videoId}
+        and status = #{oldStatus}
     </update>
 
     <select id="getVideoListByIds"
@@ -343,4 +353,22 @@
         </foreach>
     </update>
 
+    <select id="getGzhPlanIllegalVideoList"
+            resultType="com.tzld.piaoquan.api.model.po.contentplatform.PlanIllegalVideoDTO">
+        select plan.create_account_id as account_id, plan.type, video.video_id, '公众号' as channel,
+               coalesce(nullif(video.custom_title, ''), video.title) as title
+        from content_platform_gzh_plan plan
+        join content_platform_gzh_plan_video video on plan.id = video.plan_id
+        where video.video_id = #{videoId} and plan.`status` = 1
+    </select>
+
+    <select id="getQwPlanIllegalVideoList"
+            resultType="com.tzld.piaoquan.api.model.po.contentplatform.PlanIllegalVideoDTO">
+        select plan.create_account_id as account_id, plan.type, video.video_id, '企微' as channel, video.title
+        from content_platform_qw_plan plan
+        join content_platform_qw_plan_video video on plan.id = video.plan_id
+        where video.video_id = #{videoId} and plan.`status` = 1
+    </select>
+
+
 </mapper>

+ 4 - 2
api-module/src/main/resources/mapper/wecom/thirdpart/ThirdPartWeComRoomMapper.xml

@@ -112,7 +112,8 @@
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
-  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoom">
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoom"
+          useGeneratedKeys="true" keyProperty="id">
     insert into third_part_we_com_room (id, corp_id, staff_id, 
       third_room_id, third_create_user_id, member_count, 
       `name`, room_url, add_user_status, 
@@ -124,7 +125,8 @@
       #{sendStatus,jdbcType=INTEGER}, #{sendTime,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, 
       #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
   </insert>
-  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoom">
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoom"
+          useGeneratedKeys="true" keyProperty="id">
     insert into third_part_we_com_room
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">

+ 25 - 23
api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml

@@ -50,29 +50,31 @@
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
 
-        <table tableName="content_platform_account" domainObjectName="ContentPlatformAccount" alias=""/>
-        <table tableName="content_platform_gzh_account" domainObjectName="ContentPlatformGzhAccount" alias=""/>
-        <table tableName="content_platform_gzh_datastat" domainObjectName="ContentPlatformGzhDataStat" alias=""/>
-        <table tableName="content_platform_gzh_video_datastat" domainObjectName="ContentPlatformGzhVideoDataStat" alias=""/>
-        <table tableName="content_platform_gzh_datastat_total" domainObjectName="ContentPlatformGzhDataStatTotal" alias=""/>
-        <table tableName="content_platform_fwh_datastat" domainObjectName="ContentPlatformFwhDataStat" alias=""/>
-        <table tableName="content_platform_fwh_datastat_total" domainObjectName="ContentPlatformFwhDataStatTotal" alias=""/>
-        <table tableName="content_platform_gzh_push_datastat" domainObjectName="ContentPlatformGzhPushDataStat" alias=""/>
-        <table tableName="content_platform_gzh_push_datastat_total" domainObjectName="ContentPlatformGzhPushDataStatTotal" alias=""/>
-        <table tableName="content_platform_gzh_plan" domainObjectName="ContentPlatformGzhPlan" alias=""/>
-        <table tableName="content_platform_gzh_plan_video" domainObjectName="ContentPlatformGzhPlanVideo" alias=""/>
-        <table tableName="content_platform_gzh_plan_change_log" domainObjectName="ContentPlatformGzhPlanChangeLog" alias=""/>
-        <table tableName="content_platform_qw_datastat" domainObjectName="ContentPlatformQwDataStat" alias=""/>
-        <table tableName="content_platform_qw_datastat_total" domainObjectName="ContentPlatformQwDataStatTotal" alias=""/>
-        <table tableName="content_platform_qw_datastat_reply_total" domainObjectName="ContentPlatformQwDataStatReplyTotal" alias=""/>
-        <table tableName="content_platform_qw_datastat_sub_channel" domainObjectName="ContentPlatformQwDataStatSubChannel" alias=""/>
-        <table tableName="content_platform_qw_plan" domainObjectName="ContentPlatformQwPlan" alias=""/>
-        <table tableName="content_platform_qw_plan_video" domainObjectName="ContentPlatformQwPlanVideo" alias=""/>
-        <table tableName="content_platform_verify_code" domainObjectName="ContentPlatformVerifyCode" alias=""/>
-        <table tableName="content_platform_video" domainObjectName="ContentPlatformVideo" alias=""/>
-        <table tableName="content_platform_video_agg" domainObjectName="ContentPlatformVideoAgg" alias=""/>
-        <table tableName="content_platform_video_datastat" domainObjectName="ContentPlatformVideoDataStat" alias=""/>
-        <table tableName="content_platform_video_datastat_agg" domainObjectName="ContentPlatformVideoDataStatAgg" alias=""/>
+<!--        <table tableName="content_platform_account" domainObjectName="ContentPlatformAccount" alias=""/>-->
+<!--        <table tableName="content_platform_gzh_account" domainObjectName="ContentPlatformGzhAccount" alias=""/>-->
+<!--        <table tableName="content_platform_gzh_datastat" domainObjectName="ContentPlatformGzhDataStat" alias=""/>-->
+<!--        <table tableName="content_platform_gzh_video_datastat" domainObjectName="ContentPlatformGzhVideoDataStat" alias=""/>-->
+<!--        <table tableName="content_platform_gzh_datastat_total" domainObjectName="ContentPlatformGzhDataStatTotal" alias=""/>-->
+<!--        <table tableName="content_platform_fwh_datastat" domainObjectName="ContentPlatformFwhDataStat" alias=""/>-->
+<!--        <table tableName="content_platform_fwh_datastat_total" domainObjectName="ContentPlatformFwhDataStatTotal" alias=""/>-->
+<!--        <table tableName="content_platform_gzh_push_datastat" domainObjectName="ContentPlatformGzhPushDataStat" alias=""/>-->
+<!--        <table tableName="content_platform_gzh_push_datastat_total" domainObjectName="ContentPlatformGzhPushDataStatTotal" alias=""/>-->
+<!--        <table tableName="content_platform_gzh_plan" domainObjectName="ContentPlatformGzhPlan" alias=""/>-->
+<!--        <table tableName="content_platform_gzh_plan_video" domainObjectName="ContentPlatformGzhPlanVideo" alias=""/>-->
+<!--        <table tableName="content_platform_gzh_plan_change_log" domainObjectName="ContentPlatformGzhPlanChangeLog" alias=""/>-->
+<!--        <table tableName="content_platform_qw_datastat" domainObjectName="ContentPlatformQwDataStat" alias=""/>-->
+<!--        <table tableName="content_platform_qw_datastat_total" domainObjectName="ContentPlatformQwDataStatTotal" alias=""/>-->
+<!--        <table tableName="content_platform_qw_datastat_reply_total" domainObjectName="ContentPlatformQwDataStatReplyTotal" alias=""/>-->
+<!--        <table tableName="content_platform_qw_datastat_sub_channel" domainObjectName="ContentPlatformQwDataStatSubChannel" alias=""/>-->
+<!--        <table tableName="content_platform_qw_plan" domainObjectName="ContentPlatformQwPlan" alias=""/>-->
+<!--        <table tableName="content_platform_qw_plan_video" domainObjectName="ContentPlatformQwPlanVideo" alias=""/>-->
+<!--        <table tableName="content_platform_verify_code" domainObjectName="ContentPlatformVerifyCode" alias=""/>-->
+<!--        <table tableName="content_platform_video" domainObjectName="ContentPlatformVideo" alias=""/>-->
+<!--        <table tableName="content_platform_video_agg" domainObjectName="ContentPlatformVideoAgg" alias=""/>-->
+<!--        <table tableName="content_platform_video_datastat" domainObjectName="ContentPlatformVideoDataStat" alias=""/>-->
+<!--        <table tableName="content_platform_video_datastat_agg" domainObjectName="ContentPlatformVideoDataStatAgg" alias=""/>-->
+        <table tableName="content_platform_illegal_video" domainObjectName="ContentPlatformIllegalVideo" alias=""/>
+        <table tableName="content_platform_illegal_msg" domainObjectName="ContentPlatformIllegalMsg" alias=""/>
     </context>
 
 </generatorConfiguration>

+ 1 - 1
api-module/src/main/resources/mybatis-generator-config.xml

@@ -63,7 +63,7 @@
 <!--        <table tableName="we_com_moment_send_message" domainObjectName="MomentSendMessage" alias=""/>-->
 <!--        <table tableName="we_com_staff_with_user" domainObjectName="StaffWithUser" alias=""/>-->
 <!--        <table tableName="we_com_corp_statistics_total" domainObjectName="CorpStatisticsTotal" alias=""/>-->
-<!--        <table tableName="we_com_staff_statistics_total" domainObjectName="StaffStatisticsTotal" alias=""/>-->
+        <table tableName="we_com_staff_statistics_total" domainObjectName="StaffStatisticsTotal" alias=""/>
         <table tableName="we_com_staff_group_statistics_total" domainObjectName="StaffGroupStatisticsTotal" alias=""/>
 
 

+ 5 - 0
api-module/src/test/java/com/tzld/piaoquan/api/WeComThirdPartTest.java

@@ -47,4 +47,9 @@ public class WeComThirdPartTest {
         weComCreateRoomJob.autoCreateRoomJob("");
     }
 
+    @Test
+    public void autoAddRoomUserJob() {
+        weComCreateRoomJob.autoAddRoomUserJob("");
+    }
+
 }

+ 2 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/bo/VideoDetail.java

@@ -11,6 +11,8 @@ public class VideoDetail {
 
     private String videoPath;
 
+    private String videoCoverSnapshotPath;
+
     // 审核状态  1 审核中,2 不通过 3 待修改,4 自己可见 5 通过
     private Integer auditStatus;
 

+ 11 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/StaffGroupStatisticsTotal.java

@@ -11,6 +11,8 @@ public class StaffGroupStatisticsTotal {
 
     private Long staffId;
 
+    private String userId;
+
     private Long statTime;
 
     private Integer newChatCnt;
@@ -65,6 +67,14 @@ public class StaffGroupStatisticsTotal {
         this.staffId = staffId;
     }
 
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
     public Long getStatTime() {
         return statTime;
     }
@@ -163,6 +173,7 @@ public class StaffGroupStatisticsTotal {
         sb.append(", date=").append(date);
         sb.append(", corpId=").append(corpId);
         sb.append(", staffId=").append(staffId);
+        sb.append(", userId=").append(userId);
         sb.append(", statTime=").append(statTime);
         sb.append(", newChatCnt=").append(newChatCnt);
         sb.append(", chatTotal=").append(chatTotal);

+ 70 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/StaffGroupStatisticsTotalExample.java

@@ -366,6 +366,76 @@ public class StaffGroupStatisticsTotalExample {
             return (Criteria) this;
         }
 
+        public Criteria andUserIdIsNull() {
+            addCriterion("user_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIsNotNull() {
+            addCriterion("user_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdEqualTo(String value) {
+            addCriterion("user_id =", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotEqualTo(String value) {
+            addCriterion("user_id <>", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdGreaterThan(String value) {
+            addCriterion("user_id >", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdGreaterThanOrEqualTo(String value) {
+            addCriterion("user_id >=", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLessThan(String value) {
+            addCriterion("user_id <", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLessThanOrEqualTo(String value) {
+            addCriterion("user_id <=", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLike(String value) {
+            addCriterion("user_id like", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotLike(String value) {
+            addCriterion("user_id not like", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIn(List<String> values) {
+            addCriterion("user_id in", values, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotIn(List<String> values) {
+            addCriterion("user_id not in", values, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdBetween(String value1, String value2) {
+            addCriterion("user_id between", value1, value2, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotBetween(String value1, String value2) {
+            addCriterion("user_id not between", value1, value2, "userId");
+            return (Criteria) this;
+        }
+
         public Criteria andStatTimeIsNull() {
             addCriterion("stat_time is null");
             return (Criteria) this;

+ 11 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/StaffStatisticsTotal.java

@@ -11,6 +11,8 @@ public class StaffStatisticsTotal {
 
     private Long staffId;
 
+    private String userId;
+
     private Long statTime;
 
     private Integer chatCnt;
@@ -59,6 +61,14 @@ public class StaffStatisticsTotal {
         this.staffId = staffId;
     }
 
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
     public Long getStatTime() {
         return statTime;
     }
@@ -133,6 +143,7 @@ public class StaffStatisticsTotal {
         sb.append(", date=").append(date);
         sb.append(", corpId=").append(corpId);
         sb.append(", staffId=").append(staffId);
+        sb.append(", userId=").append(userId);
         sb.append(", statTime=").append(statTime);
         sb.append(", chatCnt=").append(chatCnt);
         sb.append(", messageCnt=").append(messageCnt);

+ 70 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/StaffStatisticsTotalExample.java

@@ -366,6 +366,76 @@ public class StaffStatisticsTotalExample {
             return (Criteria) this;
         }
 
+        public Criteria andUserIdIsNull() {
+            addCriterion("user_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIsNotNull() {
+            addCriterion("user_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdEqualTo(String value) {
+            addCriterion("user_id =", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotEqualTo(String value) {
+            addCriterion("user_id <>", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdGreaterThan(String value) {
+            addCriterion("user_id >", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdGreaterThanOrEqualTo(String value) {
+            addCriterion("user_id >=", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLessThan(String value) {
+            addCriterion("user_id <", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLessThanOrEqualTo(String value) {
+            addCriterion("user_id <=", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLike(String value) {
+            addCriterion("user_id like", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotLike(String value) {
+            addCriterion("user_id not like", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIn(List<String> values) {
+            addCriterion("user_id in", values, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotIn(List<String> values) {
+            addCriterion("user_id not in", values, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdBetween(String value1, String value2) {
+            addCriterion("user_id between", value1, value2, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotBetween(String value1, String value2) {
+            addCriterion("user_id not between", value1, value2, "userId");
+            return (Criteria) this;
+        }
+
         public Criteria andStatTimeIsNull() {
             addCriterion("stat_time is null");
             return (Criteria) this;

+ 15 - 1
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/MessageAttachmentServiceImpl.java

@@ -322,9 +322,11 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
                 String shareImgPath = jsonObject.getString("shareImgPath");
                 String title = jsonObject.getString("title");
                 String videoPath = jsonObject.getString("videoPath");
+                String videoCoverSnapshotPath = jsonObject.getString("videoCoverSnapshotPath");
                 videoDetail.setCover(shareImgPath);
                 videoDetail.setTitle(title);
                 videoDetail.setVideoPath(videoPath);
+                videoDetail.setVideoCoverSnapshotPath(videoCoverSnapshotPath);
                 videoDetail.setAuditStatus(jsonObject.getInteger("auditStatus"));
                 videoDetail.setRecommendStatus(jsonObject.getInteger("recommendStatus"));
                 map.put(videoId, videoDetail);
@@ -386,7 +388,6 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
 
     }
 
-
     @Override
     public String getPage(Staff staff, Long videoId, String typeOne, String typeTwo) {
         try {
@@ -404,6 +405,19 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
         return null;
     }
 
+    @Override
+    public String getPageNoCache(Staff staff, Long videoId, String typeOne, String typeTwo) {
+        try {
+            if (staff == null || staff.getCarrierId() == null) {
+                return "";
+            }
+            return insertPage(staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo);
+        } catch (IOException e) {
+            log.error("MessageAttachmentService getPageNoCache error", e);
+        }
+        return null;
+    }
+
     private String insertPage(String carrierId, Long videoId, String remark, String typeOne, String typeTwo) throws IOException {
         AdPutFlowParam param = new AdPutFlowParam();
         param.setChannel("tencentqw");

+ 2 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/MessageAttachmentService.java

@@ -27,6 +27,8 @@ public interface MessageAttachmentService {
 
     String getPage(Staff staff, Long videoId, String typeOne, String typeTwo);
 
+    String getPageNoCache(Staff staff, Long videoId, String typeOne, String typeTwo);
+
     String getPage(String channel, String carrierId, String scene, String putTypeOne, String putTypeTwo, String putTypeThree, Long videoId);
 
     CommonResponse<Long> createAttachment(Integer type, MultipartFile file, String url, String picUrl, String page, String title, String desc, String appId, Integer extType);

+ 10 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/DateUtil.java

@@ -149,6 +149,16 @@ public class DateUtil {
         return calendar.getTime().getTime() / 1000;
     }
 
+    public static Date getTodayStartDate() {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        return calendar.getTime();
+    }
+
     public static Date getDate(String dateString) {
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         LocalDate localDate = LocalDate.parse(dateString, formatter);

+ 10 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/RedisUtils.java

@@ -78,6 +78,16 @@ public class RedisUtils {
         }
     }
 
+    public void setIncrementValue(String key, Integer value, Long expireTime) {
+        // 只在第一次进行设置过期时间
+        if (!containsKey(key)) {
+            redisTemplate.opsForValue().increment(key, value);
+            redisTemplate.expire(key, expireTime, TimeUnit.SECONDS);
+        } else {
+            redisTemplate.opsForValue().increment(key, value);
+        }
+    }
+
     public void setDecrementValue(String key, double value) {
         redisTemplate.opsForValue().increment(key, -value);
     }

+ 26 - 11
common-module/src/main/resources/mapper/StaffGroupStatisticsTotalMapper.xml

@@ -6,6 +6,7 @@
     <result column="date" jdbcType="VARCHAR" property="date" />
     <result column="corp_id" jdbcType="BIGINT" property="corpId" />
     <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="user_id" jdbcType="VARCHAR" property="userId" />
     <result column="stat_time" jdbcType="BIGINT" property="statTime" />
     <result column="new_chat_cnt" jdbcType="INTEGER" property="newChatCnt" />
     <result column="chat_total" jdbcType="INTEGER" property="chatTotal" />
@@ -77,7 +78,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, `date`, corp_id, staff_id, stat_time, new_chat_cnt, chat_total, chat_has_msg, 
+    id, `date`, corp_id, staff_id, user_id, stat_time, new_chat_cnt, chat_total, chat_has_msg, 
     new_member_cnt, member_total, member_has_msg, msg_total, migrate_trainee_chat_cnt, 
     create_time, update_time
   </sql>
@@ -116,17 +117,17 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.StaffGroupStatisticsTotal">
     insert into we_com_staff_group_statistics_total (id, `date`, corp_id, 
-      staff_id, stat_time, new_chat_cnt, 
-      chat_total, chat_has_msg, new_member_cnt, 
-      member_total, member_has_msg, msg_total, 
-      migrate_trainee_chat_cnt, create_time, update_time
-      )
+      staff_id, user_id, stat_time, 
+      new_chat_cnt, chat_total, chat_has_msg, 
+      new_member_cnt, member_total, member_has_msg, 
+      msg_total, migrate_trainee_chat_cnt, create_time, 
+      update_time)
     values (#{id,jdbcType=BIGINT}, #{date,jdbcType=VARCHAR}, #{corpId,jdbcType=BIGINT}, 
-      #{staffId,jdbcType=BIGINT}, #{statTime,jdbcType=BIGINT}, #{newChatCnt,jdbcType=INTEGER}, 
-      #{chatTotal,jdbcType=INTEGER}, #{chatHasMsg,jdbcType=INTEGER}, #{newMemberCnt,jdbcType=INTEGER}, 
-      #{memberTotal,jdbcType=INTEGER}, #{memberHasMsg,jdbcType=INTEGER}, #{msgTotal,jdbcType=INTEGER}, 
-      #{migrateTraineeChatCnt,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
-      )
+      #{staffId,jdbcType=BIGINT}, #{userId,jdbcType=VARCHAR}, #{statTime,jdbcType=BIGINT}, 
+      #{newChatCnt,jdbcType=INTEGER}, #{chatTotal,jdbcType=INTEGER}, #{chatHasMsg,jdbcType=INTEGER}, 
+      #{newMemberCnt,jdbcType=INTEGER}, #{memberTotal,jdbcType=INTEGER}, #{memberHasMsg,jdbcType=INTEGER}, 
+      #{msgTotal,jdbcType=INTEGER}, #{migrateTraineeChatCnt,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.StaffGroupStatisticsTotal">
     insert into we_com_staff_group_statistics_total
@@ -143,6 +144,9 @@
       <if test="staffId != null">
         staff_id,
       </if>
+      <if test="userId != null">
+        user_id,
+      </if>
       <if test="statTime != null">
         stat_time,
       </if>
@@ -190,6 +194,9 @@
       <if test="staffId != null">
         #{staffId,jdbcType=BIGINT},
       </if>
+      <if test="userId != null">
+        #{userId,jdbcType=VARCHAR},
+      </if>
       <if test="statTime != null">
         #{statTime,jdbcType=BIGINT},
       </if>
@@ -246,6 +253,9 @@
       <if test="record.staffId != null">
         staff_id = #{record.staffId,jdbcType=BIGINT},
       </if>
+      <if test="record.userId != null">
+        user_id = #{record.userId,jdbcType=VARCHAR},
+      </if>
       <if test="record.statTime != null">
         stat_time = #{record.statTime,jdbcType=BIGINT},
       </if>
@@ -290,6 +300,7 @@
       `date` = #{record.date,jdbcType=VARCHAR},
       corp_id = #{record.corpId,jdbcType=BIGINT},
       staff_id = #{record.staffId,jdbcType=BIGINT},
+      user_id = #{record.userId,jdbcType=VARCHAR},
       stat_time = #{record.statTime,jdbcType=BIGINT},
       new_chat_cnt = #{record.newChatCnt,jdbcType=INTEGER},
       chat_total = #{record.chatTotal,jdbcType=INTEGER},
@@ -317,6 +328,9 @@
       <if test="staffId != null">
         staff_id = #{staffId,jdbcType=BIGINT},
       </if>
+      <if test="userId != null">
+        user_id = #{userId,jdbcType=VARCHAR},
+      </if>
       <if test="statTime != null">
         stat_time = #{statTime,jdbcType=BIGINT},
       </if>
@@ -358,6 +372,7 @@
     set `date` = #{date,jdbcType=VARCHAR},
       corp_id = #{corpId,jdbcType=BIGINT},
       staff_id = #{staffId,jdbcType=BIGINT},
+      user_id = #{userId,jdbcType=VARCHAR},
       stat_time = #{statTime,jdbcType=BIGINT},
       new_chat_cnt = #{newChatCnt,jdbcType=INTEGER},
       chat_total = #{chatTotal,jdbcType=INTEGER},

+ 24 - 9
common-module/src/main/resources/mapper/StaffStatisticsTotalMapper.xml

@@ -6,6 +6,7 @@
     <result column="date" jdbcType="VARCHAR" property="date" />
     <result column="corp_id" jdbcType="BIGINT" property="corpId" />
     <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="user_id" jdbcType="VARCHAR" property="userId" />
     <result column="stat_time" jdbcType="BIGINT" property="statTime" />
     <result column="chat_cnt" jdbcType="INTEGER" property="chatCnt" />
     <result column="message_cnt" jdbcType="INTEGER" property="messageCnt" />
@@ -74,7 +75,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, `date`, corp_id, staff_id, stat_time, chat_cnt, message_cnt, negative_feedback_cnt, 
+    id, `date`, corp_id, staff_id, user_id, stat_time, chat_cnt, message_cnt, negative_feedback_cnt, 
     new_apply_cnt, new_contact_cnt, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.StaffStatisticsTotalExample" resultMap="BaseResultMap">
@@ -112,15 +113,15 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.StaffStatisticsTotal">
     insert into we_com_staff_statistics_total (id, `date`, corp_id, 
-      staff_id, stat_time, chat_cnt, 
-      message_cnt, negative_feedback_cnt, new_apply_cnt, 
-      new_contact_cnt, create_time, update_time
-      )
+      staff_id, user_id, stat_time, 
+      chat_cnt, message_cnt, negative_feedback_cnt, 
+      new_apply_cnt, new_contact_cnt, create_time, 
+      update_time)
     values (#{id,jdbcType=BIGINT}, #{date,jdbcType=VARCHAR}, #{corpId,jdbcType=BIGINT}, 
-      #{staffId,jdbcType=BIGINT}, #{statTime,jdbcType=BIGINT}, #{chatCnt,jdbcType=INTEGER}, 
-      #{messageCnt,jdbcType=INTEGER}, #{negativeFeedbackCnt,jdbcType=INTEGER}, #{newApplyCnt,jdbcType=INTEGER}, 
-      #{newContactCnt,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
-      )
+      #{staffId,jdbcType=BIGINT}, #{userId,jdbcType=VARCHAR}, #{statTime,jdbcType=BIGINT}, 
+      #{chatCnt,jdbcType=INTEGER}, #{messageCnt,jdbcType=INTEGER}, #{negativeFeedbackCnt,jdbcType=INTEGER}, 
+      #{newApplyCnt,jdbcType=INTEGER}, #{newContactCnt,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.StaffStatisticsTotal">
     insert into we_com_staff_statistics_total
@@ -137,6 +138,9 @@
       <if test="staffId != null">
         staff_id,
       </if>
+      <if test="userId != null">
+        user_id,
+      </if>
       <if test="statTime != null">
         stat_time,
       </if>
@@ -175,6 +179,9 @@
       <if test="staffId != null">
         #{staffId,jdbcType=BIGINT},
       </if>
+      <if test="userId != null">
+        #{userId,jdbcType=VARCHAR},
+      </if>
       <if test="statTime != null">
         #{statTime,jdbcType=BIGINT},
       </if>
@@ -222,6 +229,9 @@
       <if test="record.staffId != null">
         staff_id = #{record.staffId,jdbcType=BIGINT},
       </if>
+      <if test="record.userId != null">
+        user_id = #{record.userId,jdbcType=VARCHAR},
+      </if>
       <if test="record.statTime != null">
         stat_time = #{record.statTime,jdbcType=BIGINT},
       </if>
@@ -257,6 +267,7 @@
       `date` = #{record.date,jdbcType=VARCHAR},
       corp_id = #{record.corpId,jdbcType=BIGINT},
       staff_id = #{record.staffId,jdbcType=BIGINT},
+      user_id = #{record.userId,jdbcType=VARCHAR},
       stat_time = #{record.statTime,jdbcType=BIGINT},
       chat_cnt = #{record.chatCnt,jdbcType=INTEGER},
       message_cnt = #{record.messageCnt,jdbcType=INTEGER},
@@ -281,6 +292,9 @@
       <if test="staffId != null">
         staff_id = #{staffId,jdbcType=BIGINT},
       </if>
+      <if test="userId != null">
+        user_id = #{userId,jdbcType=VARCHAR},
+      </if>
       <if test="statTime != null">
         stat_time = #{statTime,jdbcType=BIGINT},
       </if>
@@ -313,6 +327,7 @@
     set `date` = #{date,jdbcType=VARCHAR},
       corp_id = #{corpId,jdbcType=BIGINT},
       staff_id = #{staffId,jdbcType=BIGINT},
+      user_id = #{userId,jdbcType=VARCHAR},
       stat_time = #{statTime,jdbcType=BIGINT},
       chat_cnt = #{chatCnt,jdbcType=INTEGER},
       message_cnt = #{messageCnt,jdbcType=INTEGER},

+ 2 - 0
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComStaffDataJob.java

@@ -225,6 +225,7 @@ public class WeComStaffDataJob {
                     statisticsTotal.setDate(date);
                     statisticsTotal.setCorpId(corpId);
                     statisticsTotal.setStaffId(staff.getId());
+                    statisticsTotal.setUserId(staff.getCarrierId());
                     staffStatisticsTotalMapper.insertSelective(statisticsTotal);
                 }
             }
@@ -277,6 +278,7 @@ public class WeComStaffDataJob {
                     statisticsTotal.setDate(date);
                     statisticsTotal.setCorpId(corpId);
                     statisticsTotal.setStaffId(staff.getId());
+                    statisticsTotal.setUserId(staff.getCarrierId());
                     staffGroupStatisticsTotalMapper.insertSelective(statisticsTotal);
                 }
             }