소스 검색

Merge branch 'master' into dev-xym-add-url

# Conflicts:
#	api-module/src/main/resources/application-test.properties
xueyiming 3 달 전
부모
커밋
95452419a9
79개의 변경된 파일6237개의 추가작업 그리고 249개의 파일을 삭제
  1. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/ReplyStrategyServiceEnum.java
  2. 4 2
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/SecretEnum.java
  3. 17 0
      api-module/src/main/java/com/tzld/piaoquan/api/component/TouLiuHttpClient.java
  4. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/controller/AccountDetailController.java
  5. 27 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/CgiReplyController.java
  6. 39 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/WeComUserController.java
  7. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/ApiMybatisGeneratorMain.java
  8. 7 13
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/ReplyStaffMapper.java
  9. 24 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/bo/FilterData.java
  10. 10 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/bo/ReplyBucketData.java
  11. 29 2
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/ReplyStaff.java
  12. 99 16
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/ReplyStaffExample.java
  13. 13 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/WeComUserNameAvatarParam.java
  14. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/CgiReplyService.java
  15. 87 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/CgiReplyServiceImpl.java
  16. 5 5
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/GhDetailServiceImpl.java
  17. 11 19
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/ThirdPartyServiceImpl.java
  18. 26 11
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/WeComServiceImpl.java
  19. 310 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/BuckStrategyV1.java
  20. 4 4
      api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/ThirdPartyPushMessageStrategyV1.java
  21. 79 40
      api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/WeComPushMessageStrategyV1.java
  22. 1 0
      api-module/src/main/resources/application-prod.properties
  23. 5 3
      api-module/src/main/resources/application-test.properties
  24. 4 0
      api-module/src/main/resources/application.properties
  25. 47 29
      api-module/src/main/resources/mapper/ReplyStaffMapper.xml
  26. 64 0
      api-module/src/main/resources/mybatis-api-generator-config.xml
  27. 3 3
      api-module/src/main/resources/mybatis-generator-config.xml
  28. 3 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/constant/WeComConstant.java
  29. 28 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/enums/FieshuTableColumnDataTypeEnum.java
  30. 1 1
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/enums/GhTypeEnum.java
  31. 10 7
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/enums/MessageAttachmentTypeEnum.java
  32. 1 1
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/enums/StrategyStatusEnum.java
  33. 38 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/AttachmentWithMsgResultMapper.java
  34. 7 3
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/CgiReplyBucketDataMapper.java
  35. 10 4
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/GhDetailMapper.java
  36. 4 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/SendMsgResultMapper.java
  37. 35 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/TagMapper.java
  38. 35 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/UserCountMapper.java
  39. 35 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/UserWithTagMapper.java
  40. 16 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/ext/WeComUserMapperExt.java
  41. 148 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/bo/FeishuTableDTO.java
  42. 8 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/bo/GroupSendWeComUserParam.java
  43. 70 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/AttachmentWithMsgResult.java
  44. 513 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/AttachmentWithMsgResultExample.java
  45. 1 1
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/CgiReplyBucketData.java
  46. 1 1
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/CgiReplyBucketDataExample.java
  47. 1 1
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/GhDetail.java
  48. 1 1
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/GhDetailExample.java
  49. 22 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/MessageAttachment.java
  50. 140 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/MessageAttachmentExample.java
  51. 11 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/SendMsgResult.java
  52. 103 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/Tag.java
  53. 733 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/TagExample.java
  54. 103 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/UserCount.java
  55. 713 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/UserCountExample.java
  56. 81 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/UserWithTag.java
  57. 573 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/UserWithTagExample.java
  58. 24 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/vo/WeComUserVo.java
  59. 48 13
      common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/MessageAttachmentServiceImpl.java
  60. 42 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/WeComUserServiceImpl.java
  61. 1 1
      common-module/src/main/java/com/tzld/piaoquan/growth/common/service/MessageAttachmentService.java
  62. 9 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/service/WeComUserService.java
  63. 16 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/DateUtil.java
  64. 28 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/LarkRobotUtil.java
  65. 229 0
      common-module/src/main/resources/mapper/AttachmentWithMsgResultMapper.xml
  66. 15 9
      common-module/src/main/resources/mapper/CgiReplyBucketDataMapper.xml
  67. 9 9
      common-module/src/main/resources/mapper/GhDetailMapper.xml
  68. 42 7
      common-module/src/main/resources/mapper/MessageAttachmentMapper.xml
  69. 77 6
      common-module/src/main/resources/mapper/SendMsgResultMapper.xml
  70. 261 0
      common-module/src/main/resources/mapper/TagMapper.xml
  71. 261 0
      common-module/src/main/resources/mapper/UserCountMapper.xml
  72. 231 0
      common-module/src/main/resources/mapper/UserWithTagMapper.xml
  73. 30 0
      common-module/src/main/resources/mapper/ext/WeComUserMapperExt.xml
  74. 224 0
      offline-module/src/main/java/com/tzld/piaoquan/offline/job/AutoReplyVideoDataJob.java
  75. 1 1
      offline-module/src/main/java/com/tzld/piaoquan/offline/job/PushMessageDataJob.java
  76. 89 28
      offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComHistoryDataJob.java
  77. 2 1
      offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComMessageDataJob.java
  78. 187 4
      offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComUserDataJob.java
  79. 8 0
      pom.xml

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

@@ -2,7 +2,7 @@ package com.tzld.piaoquan.api.common.enums;
 
 public enum ReplyStrategyServiceEnum {
 
-
+    BUCKET_STRATEGY_V1("BUCKET_STRATEGY_V1", "分桶策略v1"),
     THIRD_PARTY_PUSH_MESSAGE_STRATEGY_V1("THIRD_PARTY_PUSH_MESSAGE_STRATEGY_V1", "第三方微信公众号推送策略V1"),
     WE_COM_PUSH_MESSAGE_STRATEGY_V1("WE_COM_PUSH_MESSAGE_STRATEGY_V1", "企业微信推送策略V1"),
     ;

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

@@ -9,12 +9,14 @@ public enum SecretEnum {
     SECRET_ENUM_1("3b83574b477d4c5b8508a6e33f6e35ec", "魅力", "ml"),
     SECRET_ENUM_2("70d342bf11a84ac7aca6b3e99541e085", "老来福", "llf"),
     SECRET_ENUM_3("595db67618174499b2bed23d8be6a3c1", "微小盟", "wxm"),
-    SECRET_ENUM_4("9a48498757774ddf8a3878b9c02d0fef", "福州像素", "xs"),
+    SECRET_ENUM_4("9a48498757774ddf8a3878b9c02d0fef", "像素", "xs"),
     SECRET_ENUM_5("35afea64fd374477bb32999120b91637", "泽火", "zh"),
     SECRET_ENUM_6("ee93a44c4be4448ab0ac9334a296016e", "云誉", "yy"),
     SECRET_ENUM_7("da2c526d31d14430b49af808e90542dc", "创易", "cy"),
     SECRET_ENUM_8("e5758dbc43204434b71b8e025023170f", "微讯", "wx"),
-    SECRET_ENUM_9("1e836616178a4c32a9e8abea47eb6edd", "莱墘", "lq");
+    SECRET_ENUM_9("1e836616178a4c32a9e8abea47eb6edd", "莱墘", "lq"),
+    SECRET_ENUM_10("57a1c09a209445fc83a5fba81b0194bc", "博虎", "bh"),
+    SECRET_ENUM_11("232bab5faeb54acfbbcef3dc693c4639", "守望", "sw");
 
 
     SecretEnum(String secret, String desc, String channel) {

+ 17 - 0
api-module/src/main/java/com/tzld/piaoquan/api/component/TouLiuHttpClient.java

@@ -1,12 +1,16 @@
 package com.tzld.piaoquan.api.component;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.api.model.bo.GroupData;
 import com.tzld.piaoquan.api.model.bo.VideoDetail;
 import com.tzld.piaoquan.growth.common.component.HttpPoolClient;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.stereotype.Component;
+import reactor.core.publisher.Mono;
 
 import java.util.HashMap;
 import java.util.List;
@@ -79,4 +83,17 @@ public class TouLiuHttpClient {
         }
         return map;
     }
+
+    public List<GroupData> sendPenGongBaseRequest(String ghId) {
+        try {
+            String url = "http://47.99.132.47:8813/VideoRank";
+            JSONObject params = new JSONObject();
+            params.put("ghId", ghId);
+            String res = httpPoolClient.post(url, JSONObject.toJSONString(params));
+            return JSON.parseArray(res, GroupData.class);
+        } catch (Exception e) {
+            log.error("getVideoDetailRequest error", e);
+        }
+        return null;
+    }
 }

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

@@ -1,7 +1,7 @@
 package com.tzld.piaoquan.api.controller;
 
-import com.tzld.piaoquan.api.common.enums.GhTypeEnum;
-import com.tzld.piaoquan.api.common.enums.StrategyStatusEnum;
+import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
+import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
 import com.tzld.piaoquan.api.model.vo.GhDetailVo;
 import com.tzld.piaoquan.api.model.vo.GhTypeVo;
 import com.tzld.piaoquan.api.model.vo.StrategyStatusVo;

+ 27 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/CgiReplyController.java

@@ -0,0 +1,27 @@
+package com.tzld.piaoquan.api.controller;
+
+import com.tzld.piaoquan.api.model.bo.BucketDataParam;
+import com.tzld.piaoquan.api.model.bo.ReplyBucketData;
+import com.tzld.piaoquan.api.service.CgiReplyService;
+import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/cgi/reply")
+@Slf4j
+public class CgiReplyController {
+
+    @Autowired
+    private CgiReplyService cgiReplyService;
+
+    @PostMapping("/bucketData")
+    public CommonResponse<ReplyBucketData> getBucketData(@RequestBody BucketDataParam bucketDataParam) {
+        ReplyBucketData replyBucketData = cgiReplyService.getRgiReplyData(bucketDataParam);
+        return CommonResponse.success(replyBucketData);
+    }
+}

+ 39 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/WeComUserController.java

@@ -0,0 +1,39 @@
+package com.tzld.piaoquan.api.controller;
+
+import com.tzld.piaoquan.api.model.vo.WeComUserNameAvatarParam;
+import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
+import com.tzld.piaoquan.growth.common.model.bo.GroupSendWeComUserParam;
+import com.tzld.piaoquan.growth.common.model.vo.WeComUserVo;
+import com.tzld.piaoquan.growth.common.service.WeComUserService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Slf4j
+@RestController
+@RequestMapping("/wecom/user")
+public class WeComUserController {
+
+
+    @Autowired
+    private WeComUserService service;
+
+
+    @PostMapping("/getByNameAvatar")
+    public CommonResponse<List<WeComUserVo>> getByNameAvatar(@RequestBody WeComUserNameAvatarParam param) {
+        log.info("param={}", param);
+        return CommonResponse.success(service.getWeComUserByNameAvatar(param.getName(), param.getAvatar()));
+    }
+
+
+    @PostMapping("/getGroupSendUsers")
+    public CommonResponse<List<WeComUserVo>> getGroupSendUsers(@RequestBody GroupSendWeComUserParam param) {
+        log.info("param={}", param);
+        return CommonResponse.success(service.getGroupSendWeComUser(param));
+    }
+}

+ 31 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/ApiMybatisGeneratorMain.java

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.dao.generator;
+
+import org.mybatis.generator.api.MyBatisGenerator;
+import org.mybatis.generator.config.Configuration;
+import org.mybatis.generator.config.xml.ConfigurationParser;
+import org.mybatis.generator.exception.InvalidConfigurationException;
+import org.mybatis.generator.exception.XMLParserException;
+import org.mybatis.generator.internal.DefaultShellCallback;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class ApiMybatisGeneratorMain {
+
+    public static void main(String[] args)
+            throws SQLException, IOException, InterruptedException, InvalidConfigurationException, XMLParserException {
+        List<String> warnings = new ArrayList<>();
+
+        File configFile = new File(ApiMybatisGeneratorMain.class.getResource("/mybatis-api-generator-config.xml").getFile());
+        ConfigurationParser cp = new ConfigurationParser(warnings);
+        Configuration config = cp.parseConfiguration(configFile);
+        DefaultShellCallback callback = new DefaultShellCallback(true);
+        MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
+        myBatisGenerator.generate(null);
+        System.out.println("genreate finish");
+    }
+}

+ 7 - 13
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/ReplyStaffMapper.java

@@ -1,16 +1,10 @@
 package com.tzld.piaoquan.api.dao.mapper;
 
-
 import com.tzld.piaoquan.api.model.po.ReplyStaff;
 import com.tzld.piaoquan.api.model.po.ReplyStaffExample;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
 import java.util.List;
+import org.apache.ibatis.annotations.Param;
 
-@Mapper
-@Repository
 public interface ReplyStaffMapper {
     long countByExample(ReplyStaffExample example);
 
@@ -18,19 +12,19 @@ public interface ReplyStaffMapper {
 
     int deleteByPrimaryKey(Long id);
 
-    int insert(ReplyStaff row);
+    int insert(ReplyStaff record);
 
-    int insertSelective(ReplyStaff row);
+    int insertSelective(ReplyStaff record);
 
     List<ReplyStaff> selectByExample(ReplyStaffExample example);
 
     ReplyStaff selectByPrimaryKey(Long id);
 
-    int updateByExampleSelective(@Param("row") ReplyStaff row, @Param("example") ReplyStaffExample example);
+    int updateByExampleSelective(@Param("record") ReplyStaff record, @Param("example") ReplyStaffExample example);
 
-    int updateByExample(@Param("row") ReplyStaff row, @Param("example") ReplyStaffExample example);
+    int updateByExample(@Param("record") ReplyStaff record, @Param("example") ReplyStaffExample example);
 
-    int updateByPrimaryKeySelective(ReplyStaff row);
+    int updateByPrimaryKeySelective(ReplyStaff record);
 
-    int updateByPrimaryKey(ReplyStaff row);
+    int updateByPrimaryKey(ReplyStaff record);
 }

+ 24 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/bo/FilterData.java

@@ -0,0 +1,24 @@
+package com.tzld.piaoquan.api.model.bo;
+
+public class FilterData {
+
+    private String publishContentId;
+
+    private String filterReason;
+
+    public String getPublishContentId() {
+        return publishContentId;
+    }
+
+    public void setPublishContentId(String publishContentId) {
+        this.publishContentId = publishContentId;
+    }
+
+    public String getFilterReason() {
+        return filterReason;
+    }
+
+    public void setFilterReason(String filterReason) {
+        this.filterReason = filterReason;
+    }
+}

+ 10 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/bo/ReplyBucketData.java

@@ -4,8 +4,18 @@ import java.util.List;
 
 public class ReplyBucketData {
 
+    private List<FilterData> filterList;
+
     private List<GroupData> groupList;
 
+    public List<FilterData> getFilterList() {
+        return filterList;
+    }
+
+    public void setFilterList(List<FilterData> filterList) {
+        this.filterList = filterList;
+    }
+
     public List<GroupData> getGroupList() {
         return groupList;
     }

+ 29 - 2
api-module/src/main/java/com/tzld/piaoquan/api/model/po/ReplyStaff.java

@@ -9,6 +9,8 @@ public class ReplyStaff {
 
     private String name;
 
+    private String videoIds;
+
     private Integer isDelete;
 
     private Date createTime;
@@ -28,7 +30,7 @@ public class ReplyStaff {
     }
 
     public void setUserId(String userId) {
-        this.userId = userId == null ? null : userId.trim();
+        this.userId = userId;
     }
 
     public String getName() {
@@ -36,7 +38,15 @@ public class ReplyStaff {
     }
 
     public void setName(String name) {
-        this.name = name == null ? null : name.trim();
+        this.name = name;
+    }
+
+    public String getVideoIds() {
+        return videoIds;
+    }
+
+    public void setVideoIds(String videoIds) {
+        this.videoIds = videoIds;
     }
 
     public Integer getIsDelete() {
@@ -62,4 +72,21 @@ public class ReplyStaff {
     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
+
+    @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(", userId=").append(userId);
+        sb.append(", name=").append(name);
+        sb.append(", videoIds=").append(videoIds);
+        sb.append(", isDelete=").append(isDelete);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
 }

+ 99 - 16
api-module/src/main/java/com/tzld/piaoquan/api/model/po/ReplyStaffExample.java

@@ -1,5 +1,7 @@
 package com.tzld.piaoquan.api.model.po;
 
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -11,8 +13,10 @@ public class ReplyStaffExample {
 
     protected List<Criteria> oredCriteria;
 
+    protected Page page;
+
     public ReplyStaffExample() {
-        oredCriteria = new ArrayList<>();
+        oredCriteria = new ArrayList<Criteria>();
     }
 
     public void setOrderByClause(String orderByClause) {
@@ -64,12 +68,20 @@ public class ReplyStaffExample {
         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<>();
+            criteria = new ArrayList<Criterion>();
         }
 
         public boolean isValid() {
@@ -236,72 +248,142 @@ public class ReplyStaffExample {
         }
 
         public Criteria andNameIsNull() {
-            addCriterion("name is null");
+            addCriterion("`name` is null");
             return (Criteria) this;
         }
 
         public Criteria andNameIsNotNull() {
-            addCriterion("name is not null");
+            addCriterion("`name` is not null");
             return (Criteria) this;
         }
 
         public Criteria andNameEqualTo(String value) {
-            addCriterion("name =", value, "name");
+            addCriterion("`name` =", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameNotEqualTo(String value) {
-            addCriterion("name <>", value, "name");
+            addCriterion("`name` <>", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameGreaterThan(String value) {
-            addCriterion("name >", value, "name");
+            addCriterion("`name` >", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameGreaterThanOrEqualTo(String value) {
-            addCriterion("name >=", value, "name");
+            addCriterion("`name` >=", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameLessThan(String value) {
-            addCriterion("name <", value, "name");
+            addCriterion("`name` <", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameLessThanOrEqualTo(String value) {
-            addCriterion("name <=", value, "name");
+            addCriterion("`name` <=", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameLike(String value) {
-            addCriterion("name like", value, "name");
+            addCriterion("`name` like", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameNotLike(String value) {
-            addCriterion("name not like", value, "name");
+            addCriterion("`name` not like", value, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameIn(List<String> values) {
-            addCriterion("name in", values, "name");
+            addCriterion("`name` in", values, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameNotIn(List<String> values) {
-            addCriterion("name not in", values, "name");
+            addCriterion("`name` not in", values, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameBetween(String value1, String value2) {
-            addCriterion("name between", value1, value2, "name");
+            addCriterion("`name` between", value1, value2, "name");
             return (Criteria) this;
         }
 
         public Criteria andNameNotBetween(String value1, String value2) {
-            addCriterion("name not between", value1, value2, "name");
+            addCriterion("`name` not between", value1, value2, "name");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsIsNull() {
+            addCriterion("video_ids is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsIsNotNull() {
+            addCriterion("video_ids is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsEqualTo(String value) {
+            addCriterion("video_ids =", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotEqualTo(String value) {
+            addCriterion("video_ids <>", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsGreaterThan(String value) {
+            addCriterion("video_ids >", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsGreaterThanOrEqualTo(String value) {
+            addCriterion("video_ids >=", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsLessThan(String value) {
+            addCriterion("video_ids <", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsLessThanOrEqualTo(String value) {
+            addCriterion("video_ids <=", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsLike(String value) {
+            addCriterion("video_ids like", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotLike(String value) {
+            addCriterion("video_ids not like", value, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsIn(List<String> values) {
+            addCriterion("video_ids in", values, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotIn(List<String> values) {
+            addCriterion("video_ids not in", values, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsBetween(String value1, String value2) {
+            addCriterion("video_ids between", value1, value2, "videoIds");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdsNotBetween(String value1, String value2) {
+            addCriterion("video_ids not between", value1, value2, "videoIds");
             return (Criteria) this;
         }
 
@@ -487,6 +569,7 @@ public class ReplyStaffExample {
     }
 
     public static class Criteria extends GeneratedCriteria {
+
         protected Criteria() {
             super();
         }

+ 13 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/WeComUserNameAvatarParam.java

@@ -0,0 +1,13 @@
+package com.tzld.piaoquan.api.model.vo;
+
+import lombok.Data;
+import lombok.ToString;
+
+@Data
+@ToString
+public class WeComUserNameAvatarParam {
+
+    private String name;
+
+    private String avatar;
+}

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/CgiReplyService.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.api.service;
+
+import com.tzld.piaoquan.api.model.bo.BucketDataParam;
+import com.tzld.piaoquan.api.model.bo.ReplyBucketData;
+
+public interface CgiReplyService {
+    ReplyBucketData getRgiReplyData(BucketDataParam bucketDataParam);
+
+}

+ 87 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/CgiReplyServiceImpl.java

@@ -0,0 +1,87 @@
+package com.tzld.piaoquan.api.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
+import com.tzld.piaoquan.api.common.enums.ReplyStrategyServiceEnum;
+import com.tzld.piaoquan.growth.common.dao.mapper.GhDetailMapper;
+import com.tzld.piaoquan.api.model.bo.BucketDataParam;
+import com.tzld.piaoquan.api.model.bo.ReplyBucketData;
+import com.tzld.piaoquan.growth.common.model.po.GhDetail;
+import com.tzld.piaoquan.growth.common.model.po.GhDetailExample;
+import com.tzld.piaoquan.api.service.CgiReplyService;
+import com.tzld.piaoquan.api.service.strategy.ReplyStrategyService;
+import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.PostConstruct;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+@Service
+public class CgiReplyServiceImpl implements CgiReplyService {
+
+    @Autowired
+    private ApplicationContext applicationContext;
+
+    private Map<String, ReplyStrategyService> strategyServiceMap;
+
+    @Autowired
+    private GhDetailMapper ghDetailMapper;
+
+    @PostConstruct
+    public void init() {
+        strategyServiceMap = applicationContext.getBeansOfType(ReplyStrategyService.class);
+    }
+
+
+    @Override
+    public ReplyBucketData getRgiReplyData(BucketDataParam bucketDataParam) {
+        String ghId = bucketDataParam.getGhId();
+        GhDetailExample example = new GhDetailExample();
+        example.createCriteria().andGhIdEqualTo(ghId).andIsDeleteEqualTo(0);
+        List<GhDetail> ghDetails = ghDetailMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(ghDetails)) {
+            LarkRobotUtil.sendMessage("公众号信息查询失败 ghId=" + ghId);
+            return null;
+        }
+        GhDetail ghDetail = ghDetails.get(0);
+        if (Objects.equals(ghDetail.getType(), GhTypeEnum.THIRD_PARTY_GH.type)) {
+            bucketDataParam.setChannel(ghDetail.getChannel());
+            bucketDataParam.setStrategyStatus(ghDetail.getStrategyStatus());
+            if (StringUtils.isNotEmpty(ghDetail.getVideoIds())) {
+                bucketDataParam.setVideos(JSONArray.parseArray(ghDetail.getVideoIds(), Long.class));
+            }
+            return getPushMessageData(bucketDataParam);
+        }
+        return getRgiBucketData(bucketDataParam);
+    }
+
+    private ReplyBucketData getRgiBucketData(BucketDataParam bucketDataParam) {
+        for (Map.Entry<String, ReplyStrategyService> stringReplyStrategyServiceEntry : strategyServiceMap.entrySet()) {
+            ReplyStrategyService replyStrategyService = stringReplyStrategyServiceEntry.getValue();
+            // 使用策略层
+            if (replyStrategyService.support(ReplyStrategyServiceEnum.BUCKET_STRATEGY_V1)) {
+                return replyStrategyService.getResult(bucketDataParam);
+            }
+        }
+        // 无执行策略 不会走到这里
+        return null;
+    }
+
+    private ReplyBucketData getPushMessageData(BucketDataParam bucketDataParam) {
+        for (Map.Entry<String, ReplyStrategyService> stringReplyStrategyServiceEntry : strategyServiceMap.entrySet()) {
+            ReplyStrategyService replyStrategyService = stringReplyStrategyServiceEntry.getValue();
+            // 使用策略层
+            if (replyStrategyService.support(ReplyStrategyServiceEnum.THIRD_PARTY_PUSH_MESSAGE_STRATEGY_V1)) {
+                return replyStrategyService.getResult(bucketDataParam);
+            }
+        }
+        // 无执行策略 不会走到这里
+        return null;
+    }
+}

+ 5 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/GhDetailServiceImpl.java

@@ -1,11 +1,11 @@
 package com.tzld.piaoquan.api.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
-import com.tzld.piaoquan.api.common.enums.GhTypeEnum;
-import com.tzld.piaoquan.api.common.enums.StrategyStatusEnum;
-import com.tzld.piaoquan.api.dao.mapper.GhDetailMapper;
-import com.tzld.piaoquan.api.model.po.GhDetail;
-import com.tzld.piaoquan.api.model.po.GhDetailExample;
+import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
+import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
+import com.tzld.piaoquan.growth.common.dao.mapper.GhDetailMapper;
+import com.tzld.piaoquan.growth.common.model.po.GhDetail;
+import com.tzld.piaoquan.growth.common.model.po.GhDetailExample;
 import com.tzld.piaoquan.api.model.vo.GhDetailVo;
 import com.tzld.piaoquan.api.service.GhDetailService;
 import com.tzld.piaoquan.growth.common.common.base.CommonResponse;

+ 11 - 19
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/ThirdPartyServiceImpl.java

@@ -3,13 +3,13 @@ package com.tzld.piaoquan.api.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.aliyun.odps.data.Record;
-import com.tzld.piaoquan.api.common.enums.GhTypeEnum;
+import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
 import com.tzld.piaoquan.api.common.enums.ReplyStrategyServiceEnum;
 import com.tzld.piaoquan.api.common.enums.SecretEnum;
-import com.tzld.piaoquan.api.dao.mapper.GhDetailMapper;
+import com.tzld.piaoquan.growth.common.dao.mapper.GhDetailMapper;
 import com.tzld.piaoquan.api.model.bo.*;
-import com.tzld.piaoquan.api.model.po.GhDetail;
-import com.tzld.piaoquan.api.model.po.GhDetailExample;
+import com.tzld.piaoquan.growth.common.model.po.GhDetail;
+import com.tzld.piaoquan.growth.common.model.po.GhDetailExample;
 import com.tzld.piaoquan.api.model.vo.PushMessageParam;
 import com.tzld.piaoquan.api.model.vo.PushMessageVo;
 import com.tzld.piaoquan.api.model.vo.ReportUvVo;
@@ -80,7 +80,8 @@ public class ThirdPartyServiceImpl implements ThirdPartyService {
         }
         log.info("getPushMessage param={} secretEnum desc={}", param, secretEnum.desc);
         GhDetailExample example = new GhDetailExample();
-        example.createCriteria().andTypeEqualTo(GhTypeEnum.THIRD_PARTY_GH.type).andGhIdEqualTo(param.getGhId());
+        example.createCriteria().andTypeEqualTo(GhTypeEnum.THIRD_PARTY_GH.type).andGhIdEqualTo(param.getGhId())
+                .andIsDeleteEqualTo(0);
         List<GhDetail> ghDetails = ghDetailMapper.selectByExample(example);
         if (CollectionUtils.isEmpty(ghDetails)) {
             return CommonResponse.create(404, "ghId不存在,请联系管理员配置");
@@ -137,26 +138,17 @@ public class ThirdPartyServiceImpl implements ThirdPartyService {
         if (!DateUtil.isValidDate(canViewReportDate)) {
             return CommonResponse.create(ExceptionCodeEnum.PARAMS_ERROR, "系统异常");
         }
-        //llf只返回2024-11-30后的数据
-        if (secretEnum == SecretEnum.SECRET_ENUM_2) {
-            long targetTime = DateUtil.dateStrToTimestamp(date, "yyyy-MM-dd");
-            long limitTime = DateUtil.dateStrToTimestamp("2024-11-30", "yyyy-MM-dd");
-            if (targetTime < limitTime) {
-                return CommonResponse.create(500, "数据不存在");
-            }
-        }
-
         //10点后可查询前一天数据
         long nowTimestamp = System.currentTimeMillis() / 1000;
         long limitTime = nowTimestamp - 34L * TimeConstant.HOUR;
         long targetTime = DateUtil.dateStrToTimestamp(date, "yyyy-MM-dd");
-        String channel = secretEnum.channel;
+        String desc = secretEnum.desc;
         if (targetTime > limitTime) {
             return CommonResponse.create(500, "数据不存在");
         }
         String dt = date.replace("-", "").substring(0, 8);
-        String sql = String.format("SELECT * FROM alg_growth_3rd_gh_reply_uv_report WHERE dt = %s AND channel = '%s';",
-                dt, channel);
+        String sql = String.format("SELECT * FROM gzh_autoreply_behavior_uv_total WHERE dt = %s AND 合作方 = '%s';",
+                dt, desc);
         List<ReportUvVo> res = new ArrayList<>();
         List<Record> recordList = odpsManager.query(sql);
         if (CollectionUtils.isEmpty(recordList)) {
@@ -164,8 +156,8 @@ public class ThirdPartyServiceImpl implements ThirdPartyService {
         }
         for (Record record : recordList) {
             ReportUvVo reportUvVo = new ReportUvVo();
-            reportUvVo.setGhId(record.getString(0));
-            reportUvVo.setUv(record.getBigint(1));
+            reportUvVo.setGhId(record.getString(1));
+            reportUvVo.setUv(record.getBigint(3));
             res.add(reportUvVo);
         }
         return CommonResponse.success(res);

+ 26 - 11
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/WeComServiceImpl.java

@@ -2,6 +2,7 @@ package com.tzld.piaoquan.api.service.impl;
 
 import com.alibaba.fastjson.JSON;
 
+import com.alibaba.fastjson.JSONArray;
 import com.tzld.piaoquan.api.common.enums.ReplyStrategyServiceEnum;
 import com.tzld.piaoquan.api.dao.mapper.ReplyStaffMapper;
 import com.tzld.piaoquan.api.model.bo.BucketDataParam;
@@ -16,6 +17,7 @@ import com.tzld.piaoquan.api.service.WeComService;
 import com.tzld.piaoquan.api.service.strategy.ReplyStrategyService;
 import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
 import com.tzld.piaoquan.growth.common.common.enums.ExceptionCodeEnum;
+import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,9 +58,17 @@ public class WeComServiceImpl implements WeComService {
         if (param == null || StringUtils.isEmpty(param.getCorpId()) || !CORP_ID.equals(param.getCorpId()) || StringUtils.isEmpty(param.getUserId())) {
             return CommonResponse.create(ExceptionCodeEnum.PARAMS_ERROR, "参数错误");
         }
+
+        ReplyStaffExample example = new ReplyStaffExample();
+        example.createCriteria().andUserIdEqualTo(param.getUserId()).andIsDeleteEqualTo(0);
+        List<ReplyStaff> replyStaffs = replyStaffMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(replyStaffs)) {
+            return CommonResponse.create(ExceptionCodeEnum.PARAMS_ERROR, "用户查询不到");
+        }
+        ReplyStaff replyStaff = replyStaffs.get(0);
         List<WeComPushMessageVo> res = new ArrayList<>();
-        ReplyBucketData replyBucketData = getPushMessageData(param);
-        if(replyBucketData == null){
+        ReplyBucketData replyBucketData = getPushMessageData(param, replyStaff.getVideoIds());
+        if (replyBucketData == null) {
             return CommonResponse.create(500, "数据异常");
         }
         List<GroupData> groupList = replyBucketData.getGroupList();
@@ -66,13 +76,7 @@ public class WeComServiceImpl implements WeComService {
         if (CollectionUtils.isEmpty(groupList)) {
             return CommonResponse.create(500, "数据异常");
         }
-        ReplyStaffExample example = new ReplyStaffExample();
-        example.createCriteria().andUserIdEqualTo(param.getUserId()).andIsDeleteEqualTo(0);
-        List<ReplyStaff> replyStaffs = replyStaffMapper.selectByExample(example);
-        if (CollectionUtils.isEmpty(replyStaffs)) {
-            return CommonResponse.create(ExceptionCodeEnum.PARAMS_ERROR, "用户查询不到");
-        }
-        String name = replyStaffs.get(0).getName();
+        String name = replyStaff.getName();
         for (GroupData groupData : groupList) {
             if (CollectionUtils.isEmpty(groupData.getMsgDataList())) {
                 continue;
@@ -88,7 +92,14 @@ public class WeComServiceImpl implements WeComService {
             }
             MsgData msgData = new MsgData();
             msgData.setMsgType(3);
-            msgData.setTitle(String.format("很高兴认识您!我是%s,每天给您推荐精彩视频~", name));
+            if (replyStaff.getId() == 1) {
+                msgData.setTitle("你好呀~我是智能助手芳华,专门陪您唠唠嗑、解解闷的!\uD83C\uDF39\n" +
+                        "刚发现好多有趣视频想分享给您!偷偷告诉我——您平时最爱看【健康养生】、【历史故事】这类知识干货,还是【人生智慧】【怀旧经典】这些暖心内容呀?\n" +
+                        "(悄悄加个选项\uD83D\uDC49【祝福音乐】\uD83C\uDFB5,马上帮您找!)");
+            } else {
+                msgData.setTitle(String.format("很高兴认识您!我是%s,每天给您推荐精彩视频~", name));
+            }
+
             msgDataList.add(0, msgData);
             weComPushMessageVo.setMsgDataList(msgDataList);
             res.add(weComPushMessageVo);
@@ -97,7 +108,7 @@ public class WeComServiceImpl implements WeComService {
         return CommonResponse.success(res);
     }
 
-    private ReplyBucketData getPushMessageData(WeComPushMessageParam param) {
+    private ReplyBucketData getPushMessageData(WeComPushMessageParam param, String videoIds) {
         log.info("strategyServiceMap={}", JSON.toJSONString(strategyServiceMap));
         for (Map.Entry<String, ReplyStrategyService> stringReplyStrategyServiceEntry : strategyServiceMap.entrySet()) {
             ReplyStrategyService replyStrategyService = stringReplyStrategyServiceEntry.getValue();
@@ -105,6 +116,10 @@ public class WeComServiceImpl implements WeComService {
             if (replyStrategyService.support(ReplyStrategyServiceEnum.WE_COM_PUSH_MESSAGE_STRATEGY_V1)) {
                 BucketDataParam bucketDataParam = new BucketDataParam();
                 bucketDataParam.setGhId(param.getUserId());
+                if (StringUtils.isNotEmpty(videoIds)) {
+                    bucketDataParam.setStrategyStatus(StrategyStatusEnum.DEFAULT.status);
+                    bucketDataParam.setVideos(JSONArray.parseArray(videoIds, Long.class));
+                }
                 return replyStrategyService.getResult(bucketDataParam);
             }
         }

+ 310 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/BuckStrategyV1.java

@@ -0,0 +1,310 @@
+package com.tzld.piaoquan.api.service.strategy.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.api.common.enums.ReplyStrategyServiceEnum;
+import com.tzld.piaoquan.api.component.TouLiuHttpClient;
+import com.tzld.piaoquan.api.dao.mapper.AlgGhAutoreplyVideoRankDataMapper;
+import com.tzld.piaoquan.growth.common.dao.mapper.CgiReplyBucketDataMapper;
+import com.tzld.piaoquan.growth.common.dao.mapper.GhDetailMapper;
+import com.tzld.piaoquan.api.model.bo.*;
+import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankData;
+import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankDataExample;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
+import com.tzld.piaoquan.api.service.strategy.ReplyStrategyService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class BuckStrategyV1 implements ReplyStrategyService {
+
+    /**
+     * 实验分桶数量
+     */
+//    private static final Integer bucketNum = 10;
+
+    /**
+     * 分桶实验策略,key为策略,arr为对应桶
+     * {"base":[0,1,2,3],"stg0909-base":[4,5],"stg0909-explore1":[6,7,8],"stg0909-explore2":[9]}
+     * {"stg0909-base":[5,6],"stg0909-explore1":[7],"stg0909-explore2":[8,9]}
+     */
+    private static final String bucketStrategyConfig = "{\"stg0909-base\":[5,6],\"stg0909-explore1\":[7],\"stg0909-explore2\":[8,9]}";
+
+    @Value("${bucketStrategyConfig:{}}")
+    private String bucketStrategyConfigV2;
+
+    /**
+     * 自动回复使用小程序Id
+     */
+    private static final String SMALL_APP_Id = "wxbdd2a2e93d9a6e25";
+
+    private static final String CDN_URL = "https://rescdn.piaoquantv.com/";
+
+    @Value("${small_page_url}")
+    private String GET_SMALL_PAGE_URL;
+
+    @Autowired
+    private AlgGhAutoreplyVideoRankDataMapper algGhAutoreplyVideoRankDataMapper;
+    @Autowired
+    private CgiReplyBucketDataMapper cgiReplyBucketDataMapper;
+    @Autowired
+    private TouLiuHttpClient touLiuHttpClient;
+    @Autowired
+    private GhDetailMapper ghDetailMapper;
+
+    @Override
+    public ReplyBucketData getResult(BucketDataParam bucketDataParam) {
+        // 0 获取策略key
+        JSONObject bucketStrategyConfigJsonObject = getStrategyConfig(bucketDataParam.getGhId());
+        Set<String> keyedSet = bucketStrategyConfigJsonObject.keySet();
+        // 1 处理文章--算法引擎--排序文章数据
+//        getWenzhangData();
+        // 2 处理小程序--读取离线数据表--获取策略排序小程序数据
+        List<CgiReplyBucketData> smallDataCgiReplyList = readStrategyOrderSmallData(keyedSet, bucketDataParam);
+        // 2.1 获取小程序落地页地址 http调用
+        smallDataCgiReplyList = setSmallPageUrl(smallDataCgiReplyList);
+        log.info(JSON.toJSONString(smallDataCgiReplyList));
+        // 3 入库读表
+        insertSmallData(smallDataCgiReplyList, keyedSet);
+        // 4 组装分桶数据
+        return getReplyBucketData(bucketStrategyConfigJsonObject, keyedSet, bucketDataParam.getGhId());
+    }
+
+    private JSONObject getStrategyConfig(String ghId) {
+        JSONObject allStrategyConfigs = JSON.parseObject(bucketStrategyConfigV2);
+        JSONObject currentGhIdStrategyConfig = null;
+        if (allStrategyConfigs.containsKey(ghId)) {
+            currentGhIdStrategyConfig = allStrategyConfigs.getJSONObject(ghId);
+        } else if (allStrategyConfigs.containsKey("default")) {
+            currentGhIdStrategyConfig = allStrategyConfigs.getJSONObject("default");
+        } else {
+            log.error("invalid strategy config: default key does not exist");
+            throw new RuntimeException("Default strategy config does not exist");
+        }
+        // check param
+        if (!currentGhIdStrategyConfig.containsKey("base")) {
+            throw new RuntimeException("Strategy config does not have manual base");
+        }
+        return currentGhIdStrategyConfig;
+    }
+
+    private ReplyBucketData getReplyBucketData(JSONObject bucketStrategyConfigJsonObject, Set<String> keyedSet, String ghId) {
+        // 策略小程序数据
+        ReplyBucketData replyBucketData = new ReplyBucketData();
+        List<GroupData> groupDataList = new ArrayList<>();
+        for (String key : keyedSet) {
+            if ("base".equals(key)) {
+                continue;
+            }
+            CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
+            cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andStrategyEqualTo(key).andGhIdEqualTo(ghId);
+            cgiReplyBucketDataExample.setOrderByClause("sort");
+            List<CgiReplyBucketData> cgiReplyBucketData = cgiReplyBucketDataMapper.selectByExample(cgiReplyBucketDataExample);
+            if (CollectionUtils.isEmpty(cgiReplyBucketData)) {
+                CgiReplyBucketDataExample cgiReplyBucketDataExampleNull = new CgiReplyBucketDataExample();
+                cgiReplyBucketDataExampleNull.createCriteria().andIsDeleteEqualTo(0).andStrategyEqualTo(key).andGhIdEqualTo("default");
+                cgiReplyBucketDataExampleNull.setOrderByClause("sort");
+                cgiReplyBucketData = cgiReplyBucketDataMapper.selectByExample(cgiReplyBucketDataExampleNull);
+            }
+            if (CollectionUtils.isEmpty(cgiReplyBucketData)) {
+                log.error("getReplyBucketData get data is null,key:" + key);
+                return null;
+            }
+
+            List<Integer> groupList = bucketStrategyConfigJsonObject.getJSONArray(key).toJavaList(Integer.class);
+            for (Integer group : groupList) {
+                GroupData groupData = new GroupData();
+                groupData.setGroupIndex(group);
+                List<MsgData> msgDataList = new ArrayList<>();
+                for (CgiReplyBucketData cgiReplyBucketDatum : cgiReplyBucketData) {
+                    MsgData msgData = new MsgData();
+                    BeanUtils.copyProperties(cgiReplyBucketDatum, msgData);
+                    if (cgiReplyBucketDatum.getMsgType().equals(1)) {
+                        msgData.setMiniAppId(SMALL_APP_Id);
+                    }
+                    msgDataList.add(msgData);
+                }
+                groupData.setMsgDataList(msgDataList);
+                groupDataList.add(groupData);
+            }
+        }
+        // 获取人工实验数据
+        List<GroupData> groupDataBaseList = touLiuHttpClient.sendPenGongBaseRequest(ghId);
+        if (!CollectionUtils.isEmpty(groupDataBaseList)) {
+            int baseBucketNum = bucketStrategyConfigJsonObject.getJSONArray("base").size();
+            if (groupDataBaseList.size() > baseBucketNum) {
+                groupDataBaseList = groupDataBaseList.subList(0, baseBucketNum);
+            }
+            if (!CollectionUtils.isEmpty(groupDataBaseList)) {
+                GroupData groupData = groupDataBaseList.get(0);
+                List<MsgData> msgDataList = groupData.getMsgDataList();
+                List<MsgData> changwenBase = msgDataList.stream().filter(x -> x.getMsgType().equals(2)).collect(Collectors.toList());
+                if (CollectionUtils.isEmpty(changwenBase)) {
+                    log.error("get base changwenBase is null,data:" + JSON.toJSONString(msgDataList));
+                } else {
+                    // 策略拼接base数据
+                    for (GroupData data : groupDataList) {
+                        List<MsgData> msgDataList1 = data.getMsgDataList();
+                        MsgData msgData = changwenBase.get(0);
+//                    msgData.setSort(3);
+                        msgDataList1.add(msgData);
+                    }
+                }
+                // 补充人工数据
+                groupDataList.addAll(groupDataBaseList);
+            } else {
+                log.error("get base data is null,ghId:" + ghId);
+            }
+        }
+        // groupDataList排序
+        replyBucketData.setGroupList(groupDataList.stream().sorted(Comparator.comparingInt(GroupData::getGroupIndex)).collect(Collectors.toList()));
+        return replyBucketData;
+    }
+
+
+    private void insertSmallData(List<CgiReplyBucketData> smallDataCgiReplyList, Set<String> keyedSet) {
+        if (CollectionUtils.isEmpty(smallDataCgiReplyList)) {
+            return;
+        }
+        for (String key : keyedSet) {
+            if ("base".equals(key)) {
+                continue;
+            }
+            List<CgiReplyBucketData> collect = smallDataCgiReplyList.stream().filter(x -> x.getStrategy().equals(key)).collect(Collectors.toList());
+            if (CollectionUtils.isEmpty(collect)) {
+                log.error("insertSmallData 算法排序数据异常,data:" + JSON.toJSONString(smallDataCgiReplyList));
+                continue;
+            }
+            // 清上个版本的策略数据
+            CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
+            cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andMsgTypeEqualTo(1).andStrategyEqualTo(key);
+            List<CgiReplyBucketData> cgiReplyBucketData1 = cgiReplyBucketDataMapper.selectByExample(cgiReplyBucketDataExample);
+            for (CgiReplyBucketData cgiReplyBucketData : cgiReplyBucketData1) {
+                cgiReplyBucketData.setIsDelete(1);
+                cgiReplyBucketDataMapper.updateByPrimaryKeySelective(cgiReplyBucketData);
+            }
+            // 入库
+            for (CgiReplyBucketData cgiReplyBucketData : collect) {
+                cgiReplyBucketDataMapper.insertSelective(cgiReplyBucketData);
+            }
+        }
+    }
+
+    private List<CgiReplyBucketData> setSmallPageUrl(List<CgiReplyBucketData> smallDataCgiReplyList) {
+        if (CollectionUtils.isEmpty(smallDataCgiReplyList)) {
+            return smallDataCgiReplyList;
+        }
+        Set<String> keys = smallDataCgiReplyList.stream().map(x -> x.getGhId() + "&" + x.getMiniVideoId() + "&" + x.getSort()).collect(Collectors.toSet());
+        Map<String, SmallPageUrlDetail> keyPageUrl = new HashMap<>();
+        // gh-id + videoId + sort 复用同一page_url及落地页id
+        for (String key : keys) {
+            String[] keyArr = key.split("&");
+            String ghId = keyArr[0];
+            String videoId = keyArr[1];
+            String sort = keyArr[2];
+            // 查询库里是否存在,如果存在即复用
+            CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
+            cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andMiniVideoIdEqualTo(Long.valueOf(videoId)).andGhIdEqualTo(ghId);
+            List<CgiReplyBucketData> cgiReplyBucketData = cgiReplyBucketDataMapper.selectByExample(cgiReplyBucketDataExample);
+            SmallPageUrlDetail smallPageUrlDetail = new SmallPageUrlDetail();
+            if (CollectionUtils.isEmpty(cgiReplyBucketData)) {
+                // 库里不存在,调用新生成
+                String putScene = "touliu";
+                String channel = "tencentgzh";
+                String response = touLiuHttpClient.sendAdFlowAddRequest(GET_SMALL_PAGE_URL, videoId, putScene, channel, "自动", "公众号", "自动回复小程序", "位置" + sort, ghId);
+                JSONObject jsonObject = JSON.parseObject(response);
+                if (jsonObject.getInteger("code").equals(0)) {
+                    smallPageUrlDetail = jsonObject.getObject("data", SmallPageUrlDetail.class);
+                    keyPageUrl.put(key, smallPageUrlDetail);
+                } else {
+                    log.error("httpClientService get page url error,response:" + response);
+                    throw new RuntimeException("httpClientService get page url error");
+                }
+            } else {
+                // 复用
+                CgiReplyBucketData cgiReplyBucketData1 = cgiReplyBucketData.get(0);
+                smallPageUrlDetail.setId(cgiReplyBucketData1.getPagePathUrlId());
+                smallPageUrlDetail.setUrl(cgiReplyBucketData1.getMiniPagePath());
+            }
+            keyPageUrl.put(key, smallPageUrlDetail);
+        }
+        // 处理数据
+        for (CgiReplyBucketData cgiReplyBucketData : smallDataCgiReplyList) {
+            String key = cgiReplyBucketData.getGhId() + "&" + cgiReplyBucketData.getMiniVideoId() + "&" + cgiReplyBucketData.getSort();
+            SmallPageUrlDetail smallPageUrlDetail = keyPageUrl.get(key);
+            if (Objects.isNull(smallPageUrlDetail)) {
+                log.error("setSmallPageUrl get map url is null" + JSON.toJSONString(keyPageUrl));
+                throw new RuntimeException("setSmallPageUrl get map url is null");
+            }
+            cgiReplyBucketData.setPagePathUrlId(smallPageUrlDetail.getId());
+            cgiReplyBucketData.setMiniPagePath(smallPageUrlDetail.getUrl());
+        }
+        return smallDataCgiReplyList;
+    }
+
+
+    private List<CgiReplyBucketData> readStrategyOrderSmallData(Set<String> keyedSet, BucketDataParam bucketDataParam) {
+        List<CgiReplyBucketData> result = new ArrayList<>();
+        for (String key : keyedSet) {
+            if ("base".equals(key)) {
+                // base作为人工控制
+                continue;
+            }
+            // 获取最新dt的策略
+            String dtVersion = algGhAutoreplyVideoRankDataMapper.selectLatestDtVersionByStrategyKey(key);
+            // 判断当前的dtVersion是否已经处理过了
+            CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
+            cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andStrategyDtEqualTo(dtVersion).andStrategyEqualTo(key);
+            long count = cgiReplyBucketDataMapper.countByExample(cgiReplyBucketDataExample);
+            if (count != 0) {
+                // 说明已处理过该dtVersion数据
+                continue;
+            }
+            // 获取最新dt数据
+            List<AlgGhAutoreplyVideoRankData> dtVersionStrategyData = getDtVersionStrategyData(key, dtVersion);
+            List<Long> videoIds = dtVersionStrategyData.stream().map(AlgGhAutoreplyVideoRankData::getVideoId).collect(Collectors.toList());
+            Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(videoIds);
+            result.addAll(dtVersionStrategyData.stream().map(x -> {
+                CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();
+                cgiReplyBucketData.setStrategy(key);
+                cgiReplyBucketData.setSort(x.getSort());
+                cgiReplyBucketData.setStrategyDt(x.getDtVersion());
+                cgiReplyBucketData.setGhId(x.getGhId());
+                cgiReplyBucketData.setMsgType(1);
+                cgiReplyBucketData.setTitle(x.getTitle());
+                VideoDetail videoDetail = videoDetailMap.get(x.getVideoId());
+                if (videoDetail != null && StringUtils.isNotEmpty(videoDetail.getCover())) {
+                    cgiReplyBucketData.setCoverUrl(videoDetail.getCover());
+                } else {
+                    cgiReplyBucketData.setCoverUrl(CDN_URL + x.getCoverUrl());
+                }
+                cgiReplyBucketData.setMiniAppId(SMALL_APP_Id);
+                cgiReplyBucketData.setMiniVideoId(x.getVideoId());
+                return cgiReplyBucketData;
+            }).collect(Collectors.toList()));
+        }
+        // 获取最新数据版本
+        return CollectionUtils.isEmpty(result) ? null : result;
+    }
+
+    private List<AlgGhAutoreplyVideoRankData> getDtVersionStrategyData(String key, String dtVersion) {
+        AlgGhAutoreplyVideoRankDataExample algGhAutoreplyVideoRankDataExample = new AlgGhAutoreplyVideoRankDataExample();
+        algGhAutoreplyVideoRankDataExample.createCriteria().andIsDeleteEqualTo(0).andDtVersionEqualTo(dtVersion).andStrategyKeyEqualTo(key);
+        return algGhAutoreplyVideoRankDataMapper.selectByExample(algGhAutoreplyVideoRankDataExample);
+    }
+
+    @Override
+    public Boolean support(ReplyStrategyServiceEnum key) {
+        return ReplyStrategyServiceEnum.BUCKET_STRATEGY_V1.equals(key);
+    }
+}

+ 4 - 4
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/ThirdPartyPushMessageStrategyV1.java

@@ -4,15 +4,15 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 
 import com.tzld.piaoquan.api.common.enums.ReplyStrategyServiceEnum;
-import com.tzld.piaoquan.api.common.enums.StrategyStatusEnum;
+import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
 import com.tzld.piaoquan.api.component.TouLiuHttpClient;
 import com.tzld.piaoquan.api.dao.mapper.AlgGhAutoreplyVideoRankDataMapper;
-import com.tzld.piaoquan.api.dao.mapper.CgiReplyBucketDataMapper;
+import com.tzld.piaoquan.growth.common.dao.mapper.CgiReplyBucketDataMapper;
 import com.tzld.piaoquan.api.model.bo.*;
 import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankData;
 import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankDataExample;
-import com.tzld.piaoquan.api.model.po.CgiReplyBucketData;
-import com.tzld.piaoquan.api.model.po.CgiReplyBucketDataExample;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
 import com.tzld.piaoquan.api.service.strategy.ReplyStrategyService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;

+ 79 - 40
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/WeComPushMessageStrategyV1.java

@@ -5,12 +5,13 @@ import com.alibaba.fastjson.JSONObject;
 import com.tzld.piaoquan.api.common.enums.ReplyStrategyServiceEnum;
 import com.tzld.piaoquan.api.component.TouLiuHttpClient;
 import com.tzld.piaoquan.api.dao.mapper.AlgGhAutoreplyVideoRankDataMapper;
-import com.tzld.piaoquan.api.dao.mapper.CgiReplyBucketDataMapper;
+import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
+import com.tzld.piaoquan.growth.common.dao.mapper.CgiReplyBucketDataMapper;
 import com.tzld.piaoquan.api.model.bo.*;
 import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankData;
 import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankDataExample;
-import com.tzld.piaoquan.api.model.po.CgiReplyBucketData;
-import com.tzld.piaoquan.api.model.po.CgiReplyBucketDataExample;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
 import com.tzld.piaoquan.api.service.strategy.ReplyStrategyService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -39,6 +40,8 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
      */
     private static final String bucketStrategyConfig = "{\"we-com-base\":[0,1,2,3,4,5,6],\"we-com-explore1\":[7],\"we-com-explore2\":[8,9]}";
 
+
+    private static final String manualConfig = "{\"we-com-manual\":[0,1,2,3,4,5,6,7,8,9]}";
     /**
      * 自动回复使用小程序Id
      */
@@ -60,8 +63,13 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
     public ReplyBucketData getResult(BucketDataParam bucketDataParam) {
         log.info("ThirdPartyPushMessageStrategyV1 start");
         // 0 获取策略key
-        JSONObject bucketStrategyConfigJsonObject = JSON.parseObject(bucketStrategyConfig);
-        Set<String> keyedSet = bucketStrategyConfigJsonObject.keySet();
+        JSONObject configJsonObject;
+        if (Objects.equals(StrategyStatusEnum.DEFAULT.status, bucketDataParam.getStrategyStatus())) {
+            configJsonObject = JSON.parseObject(manualConfig);
+        } else {
+            configJsonObject = JSON.parseObject(bucketStrategyConfig);
+        }
+        Set<String> keyedSet = configJsonObject.keySet();
         // 1 处理文章--算法引擎--排序文章数据
 //        getWenzhangData();
         // 2 处理小程序--读取离线数据表--获取策略排序小程序数据
@@ -72,7 +80,7 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
         // 3 入库读表
         insertSmallData(smallDataCgiReplyList, keyedSet, bucketDataParam);
         // 4 组装分桶数据
-        return getReplyBucketData(bucketStrategyConfigJsonObject, keyedSet, bucketDataParam.getGhId());
+        return getReplyBucketData(configJsonObject, keyedSet, bucketDataParam.getGhId());
     }
 
     private ReplyBucketData getReplyBucketData(JSONObject bucketStrategyConfigJsonObject, Set<String> keyedSet, String ghId) {
@@ -207,41 +215,72 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
                 // base作为人工控制
                 continue;
             }
-            // 获取最新dt的策略
-            String dtVersion = algGhAutoreplyVideoRankDataMapper.selectLatestDtVersionByStrategyKeyAndGhId(key, bucketDataParam.getGhId());
-            if (StringUtils.isEmpty(dtVersion)) {
-                continue;
-            }
-            // 判断当前的dtVersion是否已经处理过了
-            CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
-            cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andStrategyDtEqualTo(dtVersion).andStrategyEqualTo(key).andGhIdEqualTo(bucketDataParam.getGhId());
-            long count = cgiReplyBucketDataMapper.countByExample(cgiReplyBucketDataExample);
-            if (count != 0) {
-                // 说明已处理过该dtVersion数据
-                continue;
-            }
-            // 获取最新dt数据
-            List<AlgGhAutoreplyVideoRankData> dtVersionStrategyData = getDtVersionStrategyData(key, dtVersion, bucketDataParam.getGhId());
-            List<Long> videoIds = dtVersionStrategyData.stream().map(AlgGhAutoreplyVideoRankData::getVideoId).collect(Collectors.toList());
-            Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(videoIds);
-            result.addAll(dtVersionStrategyData.stream().map(x -> {
-                CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();
-                cgiReplyBucketData.setStrategy(key);
-                cgiReplyBucketData.setSort(x.getSort());
-                cgiReplyBucketData.setStrategyDt(x.getDtVersion());
-                cgiReplyBucketData.setGhId(x.getGhId());
-                cgiReplyBucketData.setMsgType(1);
-                cgiReplyBucketData.setTitle(x.getTitle());
-                VideoDetail videoDetail = videoDetailMap.get(x.getVideoId());
-                if (videoDetail != null && StringUtils.isNotEmpty(videoDetail.getCover())) {
-                    cgiReplyBucketData.setCoverUrl(videoDetail.getCover());
-                } else {
-                    cgiReplyBucketData.setCoverUrl(CDN_URL + x.getCoverUrl());
+            if (Objects.equals(StrategyStatusEnum.DEFAULT.status, bucketDataParam.getStrategyStatus())) {
+                if (CollectionUtils.isEmpty(bucketDataParam.getVideos())) {
+                    return null;
                 }
-                cgiReplyBucketData.setMiniAppId(SMALL_APP_Id);
-                cgiReplyBucketData.setMiniVideoId(x.getVideoId());
-                return cgiReplyBucketData;
-            }).collect(Collectors.toList()));
+                CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
+                cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andStrategyEqualTo(key)
+                        .andGhIdEqualTo(bucketDataParam.getGhId()).andMiniVideoIdIn(bucketDataParam.getVideos());
+                long count = cgiReplyBucketDataMapper.countByExample(cgiReplyBucketDataExample);
+                if (count == bucketDataParam.getVideos().size()) {
+                    // 已经存在就不处理
+                    continue;
+                }
+                Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(bucketDataParam.getVideos());
+                int sort = 1;
+                for (Long videoId : bucketDataParam.getVideos()) {
+                    CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();
+                    cgiReplyBucketData.setStrategy(key);
+                    cgiReplyBucketData.setSort(sort);
+                    cgiReplyBucketData.setGhId(bucketDataParam.getGhId());
+                    cgiReplyBucketData.setMsgType(1);
+                    VideoDetail videoDetail = videoDetailMap.get(videoId);
+                    if (videoDetail != null && StringUtils.isNotEmpty(videoDetail.getCover())) {
+                        cgiReplyBucketData.setCoverUrl(videoDetail.getCover());
+                    }
+                    if (videoDetail != null && StringUtils.isNotEmpty(videoDetail.getTitle())) {
+                        cgiReplyBucketData.setTitle(videoDetail.getTitle());
+                    }
+                    cgiReplyBucketData.setMiniAppId(SMALL_APP_Id);
+                    cgiReplyBucketData.setMiniVideoId(videoId);
+                    result.add(cgiReplyBucketData);
+                    sort++;
+                }
+            } else {
+                // 获取最新dt的策略
+                String dtVersion = algGhAutoreplyVideoRankDataMapper.selectLatestDtVersionByStrategyKeyAndGhId(key, bucketDataParam.getGhId());
+                // 判断当前的dtVersion是否已经处理过了
+                CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
+                cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andStrategyDtEqualTo(dtVersion).andStrategyEqualTo(key).andGhIdEqualTo(bucketDataParam.getGhId());
+                long count = cgiReplyBucketDataMapper.countByExample(cgiReplyBucketDataExample);
+                if (count != 0) {
+                    // 说明已处理过该dtVersion数据
+                    continue;
+                }
+                // 获取最新dt数据
+                List<AlgGhAutoreplyVideoRankData> dtVersionStrategyData = getDtVersionStrategyData(key, dtVersion, bucketDataParam.getGhId());
+                List<Long> videoIds = dtVersionStrategyData.stream().map(AlgGhAutoreplyVideoRankData::getVideoId).collect(Collectors.toList());
+                Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(videoIds);
+                result.addAll(dtVersionStrategyData.stream().map(x -> {
+                    CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();
+                    cgiReplyBucketData.setStrategy(key);
+                    cgiReplyBucketData.setSort(x.getSort());
+                    cgiReplyBucketData.setStrategyDt(x.getDtVersion());
+                    cgiReplyBucketData.setGhId(x.getGhId());
+                    cgiReplyBucketData.setMsgType(1);
+                    cgiReplyBucketData.setTitle(x.getTitle());
+                    VideoDetail videoDetail = videoDetailMap.get(x.getVideoId());
+                    if (videoDetail != null && StringUtils.isNotEmpty(videoDetail.getCover())) {
+                        cgiReplyBucketData.setCoverUrl(videoDetail.getCover());
+                    } else {
+                        cgiReplyBucketData.setCoverUrl(CDN_URL + x.getCoverUrl());
+                    }
+                    cgiReplyBucketData.setMiniAppId(SMALL_APP_Id);
+                    cgiReplyBucketData.setMiniVideoId(x.getVideoId());
+                    return cgiReplyBucketData;
+                }).collect(Collectors.toList()));
+            }
         }
         // 获取最新数据版本
         return CollectionUtils.isEmpty(result) ? null : result;

+ 1 - 0
api-module/src/main/resources/application-prod.properties

@@ -14,5 +14,6 @@ pushMessage.callback.topic=3rd_party_push_message_callback_prod
 pushMessage.callback.groupId=GID_3RD_PARTY_PUSH_MESSAGE_CALLBACK_PROD
 pushMessage.callback.tag=mini
 
+apollo.meta: http://apolloconfig-internal.piaoquantv.com
 
 

+ 5 - 3
api-module/src/main/resources/application-test.properties

@@ -12,6 +12,8 @@ xxl.job.admin.addresses=http://xxl-job-test-internal.piaoquantv.com/xxl-job-admi
 
 small_page_url=https://testapi.piaoquantv.com
 
-pushMessage.callback.topic=3rd_party_push_message_callback_prod_test
-pushMessage.callback.groupId=GID_3RD_PARTY_PUSH_MESSAGE_CALLBACK_PROD_TEST
-pushMessage.callback.tag=mini
+pushMessage.callback.topic=3rd_party_push_message_callback_dev
+pushMessage.callback.groupId=GID_3RD_PARTY_PUSH_MESSAGE_CALLBACK_DEV
+pushMessage.callback.tag=mini
+
+apollo.meta: http://apolloconfig-internal.piaoquantv.com

+ 4 - 0
api-module/src/main/resources/application.properties

@@ -39,3 +39,7 @@ rocketmq.secretKey=nEbq3xWNQd1qLpdy2u71qFweHkZjSG
 rocketmq.nameSrvAddr=http://MQ_INST_1894469520484605_BXhXuzkZ.mq-internet-access.mq-internet.aliyuncs.com:80
 
 
+app.id=growth-manager
+apollo.bootstrap.enabled=true
+apollo.bootstrap.namespaces=application
+apollo.cacheDir=/datalog/apollo-cache-dir

+ 47 - 29
api-module/src/main/resources/mapper/ReplyStaffMapper.xml

@@ -5,6 +5,7 @@
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="user_id" jdbcType="VARCHAR" property="userId" />
     <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="video_ids" jdbcType="VARCHAR" property="videoIds" />
     <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
@@ -68,7 +69,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, user_id, name, is_delete, create_time, update_time
+    id, user_id, `name`, video_ids, is_delete, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.ReplyStaffExample" resultMap="BaseResultMap">
     select
@@ -83,6 +84,9 @@
     <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 
@@ -101,12 +105,12 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.ReplyStaff">
-    insert into reply_staff (id, user_id, name, 
-      is_delete, create_time, update_time
-      )
+    insert into reply_staff (id, user_id, `name`, 
+      video_ids, is_delete, create_time, 
+      update_time)
     values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
-      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
-      )
+      #{videoIds,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.ReplyStaff">
     insert into reply_staff
@@ -118,7 +122,10 @@
         user_id,
       </if>
       <if test="name != null">
-        name,
+        `name`,
+      </if>
+      <if test="videoIds != null">
+        video_ids,
       </if>
       <if test="isDelete != null">
         is_delete,
@@ -140,6 +147,9 @@
       <if test="name != null">
         #{name,jdbcType=VARCHAR},
       </if>
+      <if test="videoIds != null">
+        #{videoIds,jdbcType=VARCHAR},
+      </if>
       <if test="isDelete != null">
         #{isDelete,jdbcType=INTEGER},
       </if>
@@ -160,38 +170,42 @@
   <update id="updateByExampleSelective" parameterType="map">
     update reply_staff
     <set>
-      <if test="row.id != null">
-        id = #{row.id,jdbcType=BIGINT},
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.userId != null">
+        user_id = #{record.userId,jdbcType=VARCHAR},
       </if>
-      <if test="row.userId != null">
-        user_id = #{row.userId,jdbcType=VARCHAR},
+      <if test="record.name != null">
+        `name` = #{record.name,jdbcType=VARCHAR},
       </if>
-      <if test="row.name != null">
-        name = #{row.name,jdbcType=VARCHAR},
+      <if test="record.videoIds != null">
+        video_ids = #{record.videoIds,jdbcType=VARCHAR},
       </if>
-      <if test="row.isDelete != null">
-        is_delete = #{row.isDelete,jdbcType=INTEGER},
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
       </if>
-      <if test="row.createTime != null">
-        create_time = #{row.createTime,jdbcType=TIMESTAMP},
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="row.updateTime != null">
-        update_time = #{row.updateTime,jdbcType=TIMESTAMP},
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
       </if>
     </set>
-    <if test="example != null">
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
   <update id="updateByExample" parameterType="map">
     update reply_staff
-    set id = #{row.id,jdbcType=BIGINT},
-      user_id = #{row.userId,jdbcType=VARCHAR},
-      name = #{row.name,jdbcType=VARCHAR},
-      is_delete = #{row.isDelete,jdbcType=INTEGER},
-      create_time = #{row.createTime,jdbcType=TIMESTAMP},
-      update_time = #{row.updateTime,jdbcType=TIMESTAMP}
-    <if test="example != null">
+    set id = #{record.id,jdbcType=BIGINT},
+      user_id = #{record.userId,jdbcType=VARCHAR},
+      `name` = #{record.name,jdbcType=VARCHAR},
+      video_ids = #{record.videoIds,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
@@ -202,7 +216,10 @@
         user_id = #{userId,jdbcType=VARCHAR},
       </if>
       <if test="name != null">
-        name = #{name,jdbcType=VARCHAR},
+        `name` = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="videoIds != null">
+        video_ids = #{videoIds,jdbcType=VARCHAR},
       </if>
       <if test="isDelete != null">
         is_delete = #{isDelete,jdbcType=INTEGER},
@@ -219,7 +236,8 @@
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.ReplyStaff">
     update reply_staff
     set user_id = #{userId,jdbcType=VARCHAR},
-      name = #{name,jdbcType=VARCHAR},
+      `name` = #{name,jdbcType=VARCHAR},
+      video_ids = #{videoIds,jdbcType=VARCHAR},
       is_delete = #{isDelete,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       update_time = #{updateTime,jdbcType=TIMESTAMP}

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

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE generatorConfiguration
+        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
+        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
+<!-- 配置生成器 -->
+<generatorConfiguration>
+    <context id="mysql" defaultModelType="flat">
+        <property name="autoDelimitKeywords" value="true"/>
+        <!-- 生成的Java文件的编码 -->
+        <property name="javaFileEncoding" value="UTF-8"/>
+        <!-- 格式化java代码 -->
+        <property name="javaFormatter" value="org.mybatis.generator.api.dom.DefaultJavaFormatter"/>
+        <!-- 格式化XML代码 -->
+        <property name="xmlFormatter" value="org.mybatis.generator.api.dom.DefaultXmlFormatter"/>
+        <!-- beginningDelimiter和endingDelimiter:指明数据库的用于标记数据库对象名的符号,比如ORACLE就是双引号,MYSQL默认是`反引号; -->
+        <property name="beginningDelimiter" value="`"/>
+        <property name="endingDelimiter" value="`"/>
+
+        <plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
+        <plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin"/>
+        <plugin type="com.tzld.piaoquan.api.dao.generator.PaginationPlugin"/>
+
+        <commentGenerator>
+<!--            <property name="addRemarkComments" value="true"/>-->
+            <property name="suppressDate" value="true"/>
+            <property name="suppressAllComments" value="true"/>
+        </commentGenerator>
+
+        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
+                        connectionURL="jdbc:mysql://rm-bp17q95335a99272b.mysql.rds.aliyuncs.com:3306/growth?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=false"
+                        userId="crawler" password="crawler123456@">
+        </jdbcConnection>
+
+        <javaTypeResolver type="org.mybatis.generator.internal.types.JavaTypeResolverDefaultImpl">
+            <property name="forceBigDecimals" value="false"/>
+        </javaTypeResolver>
+
+        <javaModelGenerator targetPackage="com.tzld.piaoquan.api.model.po" targetProject="/Users/shimeng/Desktop/project/growth-manager/api-module/src/main/java">
+            <property name="constructorBased" value="false"/>
+            <property name="enableSubPackages" value="true"/>
+            <property name="immutable" value="false"/>
+        </javaModelGenerator>
+
+        <sqlMapGenerator targetPackage="mapper" targetProject="/Users/shimeng/Desktop/project/growth-manager/api-module/src/main/resources">
+            <property name="enableSubPackages" value="true"/>
+        </sqlMapGenerator>
+
+        <javaClientGenerator targetPackage="com.tzld.piaoquan.api.dao.mapper" type="XMLMAPPER"
+                             targetProject="/Users/shimeng/Desktop/project/growth-manager/api-module/src/main/java">
+            <property name="enableSubPackages" value="true"/>
+        </javaClientGenerator>
+
+<!--        <table tableName="we_com_alert_message" domainObjectName="AlertMessage" alias=""/>-->
+<!--        <table tableName="gh_detail" domainObjectName="GhDetail" alias=""/>-->
+<!--        <table tableName="we_com_guarantees_video" domainObjectName="GuaranteesVideo" alias=""/>-->
+<!--        <table tableName="we_com_staff" domainObjectName="Staff" alias=""/>-->
+<!--        <table tableName="we_com_message_attachment" domainObjectName="MessageAttachment" alias=""/>-->
+        <table tableName="reply_staff" domainObjectName="ReplyStaff" alias=""/>
+<!--        <table tableName="we_com_send_msg_result" domainObjectName="SendMsgResult" alias=""/>-->
+<!--        <table tableName="we_com_corp" domainObjectName="Corp" alias=""/>-->
+
+    </context>
+
+</generatorConfiguration>

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

@@ -54,9 +54,9 @@
 <!--        <table tableName="gh_detail" domainObjectName="GhDetail" alias=""/>-->
 <!--        <table tableName="we_com_guarantees_video" domainObjectName="GuaranteesVideo" alias=""/>-->
 <!--        <table tableName="we_com_staff" domainObjectName="Staff" alias=""/>-->
-<!--        <table tableName="we_com_staff_with_user" domainObjectName="StaffWithUser" alias=""/>-->
-<!--        <table tableName="we_com_send_message" domainObjectName="SendMessage" alias=""/>-->
-        <table tableName="we_com_send_msg_result" domainObjectName="SendMsgResult" alias=""/>
+<!--        <table tableName="we_com_message_attachment" domainObjectName="MessageAttachment" alias=""/>-->
+        <table tableName="we_com_user_with_tag" domainObjectName="UserWithTag" alias=""/>
+<!--        <table tableName="we_com_send_msg_result" domainObjectName="SendMsgResult" alias=""/>-->
 <!--        <table tableName="we_com_corp" domainObjectName="Corp" alias=""/>-->
 
     </context>

+ 3 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/common/constant/WeComConstant.java

@@ -31,4 +31,7 @@ public interface WeComConstant {
 
     //获取配置了客户联系功能的成员列表
     String GET_WE_COM_FOLLOW_USER_LIST = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_follow_user_list";
+
+    //获取企业客户标签详情
+    String POST_CORP_TAG_LIST = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_corp_tag_list";
 }

+ 28 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/common/enums/FieshuTableColumnDataTypeEnum.java

@@ -0,0 +1,28 @@
+package com.tzld.piaoquan.growth.common.common.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum FieshuTableColumnDataTypeEnum {
+    TEXT("text"),
+    LARK_MD("lark_md"),
+    NUMBER("number"),
+    DATE("date"),
+    OPTIONS("options"),
+    ;
+
+    private String type;
+
+    FieshuTableColumnDataTypeEnum(String type) {
+        this.type = type;
+    }
+
+    public static FieshuTableColumnDataTypeEnum from(String type) {
+        for (FieshuTableColumnDataTypeEnum typeEnum : FieshuTableColumnDataTypeEnum.values()) {
+            if (typeEnum.getType().equals(type)) {
+                return typeEnum;
+            }
+        }
+        return null;
+    }
+}

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/GhTypeEnum.java → common-module/src/main/java/com/tzld/piaoquan/growth/common/common/enums/GhTypeEnum.java

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.api.common.enums;
+package com.tzld.piaoquan.growth.common.common.enums;
 
 import java.util.Objects;
 

+ 10 - 7
common-module/src/main/java/com/tzld/piaoquan/growth/common/common/enums/MessageAttachmentTypeEnum.java

@@ -5,15 +5,18 @@ import lombok.Getter;
 @Getter
 public enum MessageAttachmentTypeEnum {
 
-    DEFAULT(0,"未知"),
-    IMAGE(1,"图片"),
-    LINK(2,"链接"),
-    MINI_PROGRAM(3, "小程序"),
-    VIDEO(4, "视频");
+    DEFAULT(0, "", "未知"),
+    IMAGE(1, "image", "图片"),
+    LINK(2, "link", "链接"),
+    MINI_PROGRAM(3, "miniprogram", "小程序"),
+    VIDEO(4, "video", "视频");
 
-    final Integer type;
+    final Integer code;
+    final String type;
     final String desc;
-    MessageAttachmentTypeEnum(Integer type, String desc){
+
+    MessageAttachmentTypeEnum(Integer code, String type, String desc) {
+        this.code = code;
         this.type = type;
         this.desc = desc;
     }

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/StrategyStatusEnum.java → common-module/src/main/java/com/tzld/piaoquan/growth/common/common/enums/StrategyStatusEnum.java

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.api.common.enums;
+package com.tzld.piaoquan.growth.common.common.enums;
 
 import java.util.Objects;
 

+ 38 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/AttachmentWithMsgResultMapper.java

@@ -0,0 +1,38 @@
+package com.tzld.piaoquan.growth.common.dao.mapper;
+
+import com.tzld.piaoquan.growth.common.model.po.AttachmentWithMsgResult;
+import com.tzld.piaoquan.growth.common.model.po.AttachmentWithMsgResultExample;
+import java.util.List;
+
+import com.tzld.piaoquan.growth.common.model.po.HistoryMessage;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface AttachmentWithMsgResultMapper {
+    long countByExample(AttachmentWithMsgResultExample example);
+
+    int deleteByExample(AttachmentWithMsgResultExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(AttachmentWithMsgResult record);
+
+    int insertSelective(AttachmentWithMsgResult record);
+
+    List<AttachmentWithMsgResult> selectByExample(AttachmentWithMsgResultExample example);
+
+    AttachmentWithMsgResult selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") AttachmentWithMsgResult record, @Param("example") AttachmentWithMsgResultExample example);
+
+    int updateByExample(@Param("record") AttachmentWithMsgResult record, @Param("example") AttachmentWithMsgResultExample example);
+
+    int updateByPrimaryKeySelective(AttachmentWithMsgResult record);
+
+    int updateByPrimaryKey(AttachmentWithMsgResult record);
+
+    void insertList(@Param("list") List<AttachmentWithMsgResult> list);
+}

+ 7 - 3
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/CgiReplyBucketDataMapper.java → common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/CgiReplyBucketDataMapper.java

@@ -1,12 +1,14 @@
-package com.tzld.piaoquan.api.dao.mapper;
+package com.tzld.piaoquan.growth.common.dao.mapper;
 
 
-import com.tzld.piaoquan.api.model.po.CgiReplyBucketData;
-import com.tzld.piaoquan.api.model.po.CgiReplyBucketDataExample;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
+
 @Mapper
 public interface CgiReplyBucketDataMapper {
     long countByExample(CgiReplyBucketDataExample example);
@@ -30,4 +32,6 @@ public interface CgiReplyBucketDataMapper {
     int updateByPrimaryKeySelective(CgiReplyBucketData row);
 
     int updateByPrimaryKey(CgiReplyBucketData row);
+
+    List<Long> selectVideoId(@Param("createTime") Date createTime);
 }

+ 10 - 4
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/GhDetailMapper.java → common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/GhDetailMapper.java

@@ -1,10 +1,16 @@
-package com.tzld.piaoquan.api.dao.mapper;
+package com.tzld.piaoquan.growth.common.dao.mapper;
 
-import com.tzld.piaoquan.api.model.po.GhDetail;
-import com.tzld.piaoquan.api.model.po.GhDetailExample;
-import java.util.List;
+
+import com.tzld.piaoquan.growth.common.model.po.GhDetail;
+import com.tzld.piaoquan.growth.common.model.po.GhDetailExample;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
 
+@Mapper
+@Repository
 public interface GhDetailMapper {
     long countByExample(GhDetailExample example);
 

+ 4 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/SendMsgResultMapper.java

@@ -27,9 +27,13 @@ public interface SendMsgResultMapper {
 
     int updateByExampleSelective(@Param("record") SendMsgResult record, @Param("example") SendMsgResultExample example);
 
+    int updateByExampleWithBLOBs(@Param("record") SendMsgResult record, @Param("example") SendMsgResultExample example);
+
     int updateByExample(@Param("record") SendMsgResult record, @Param("example") SendMsgResultExample example);
 
     int updateByPrimaryKeySelective(SendMsgResult record);
 
+    int updateByPrimaryKeyWithBLOBs(SendMsgResult record);
+
     int updateByPrimaryKey(SendMsgResult record);
 }

+ 35 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/TagMapper.java

@@ -0,0 +1,35 @@
+package com.tzld.piaoquan.growth.common.dao.mapper;
+
+import com.tzld.piaoquan.growth.common.model.po.Tag;
+import com.tzld.piaoquan.growth.common.model.po.TagExample;
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface TagMapper {
+    long countByExample(TagExample example);
+
+    int deleteByExample(TagExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(Tag record);
+
+    int insertSelective(Tag record);
+
+    List<Tag> selectByExample(TagExample example);
+
+    Tag selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") Tag record, @Param("example") TagExample example);
+
+    int updateByExample(@Param("record") Tag record, @Param("example") TagExample example);
+
+    int updateByPrimaryKeySelective(Tag record);
+
+    int updateByPrimaryKey(Tag record);
+}

+ 35 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/UserCountMapper.java

@@ -0,0 +1,35 @@
+package com.tzld.piaoquan.growth.common.dao.mapper;
+
+import com.tzld.piaoquan.growth.common.model.po.UserCount;
+import com.tzld.piaoquan.growth.common.model.po.UserCountExample;
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface UserCountMapper {
+    long countByExample(UserCountExample example);
+
+    int deleteByExample(UserCountExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(UserCount record);
+
+    int insertSelective(UserCount record);
+
+    List<UserCount> selectByExample(UserCountExample example);
+
+    UserCount selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") UserCount record, @Param("example") UserCountExample example);
+
+    int updateByExample(@Param("record") UserCount record, @Param("example") UserCountExample example);
+
+    int updateByPrimaryKeySelective(UserCount record);
+
+    int updateByPrimaryKey(UserCount record);
+}

+ 35 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/UserWithTagMapper.java

@@ -0,0 +1,35 @@
+package com.tzld.piaoquan.growth.common.dao.mapper;
+
+import com.tzld.piaoquan.growth.common.model.po.UserWithTag;
+import com.tzld.piaoquan.growth.common.model.po.UserWithTagExample;
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface UserWithTagMapper {
+    long countByExample(UserWithTagExample example);
+
+    int deleteByExample(UserWithTagExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(UserWithTag record);
+
+    int insertSelective(UserWithTag record);
+
+    List<UserWithTag> selectByExample(UserWithTagExample example);
+
+    UserWithTag selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") UserWithTag record, @Param("example") UserWithTagExample example);
+
+    int updateByExample(@Param("record") UserWithTag record, @Param("example") UserWithTagExample example);
+
+    int updateByPrimaryKeySelective(UserWithTag record);
+
+    int updateByPrimaryKey(UserWithTag record);
+}

+ 16 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/ext/WeComUserMapperExt.java

@@ -0,0 +1,16 @@
+package com.tzld.piaoquan.growth.common.dao.mapper.ext;
+
+import com.tzld.piaoquan.growth.common.model.po.WeComUser;
+import com.tzld.piaoquan.growth.common.model.po.WeComUserExample;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.List;
+
+@Mapper
+@Repository
+public interface WeComUserMapperExt {
+    List<WeComUser> getGroupSendUserByDate(@Param("start") Date start, @Param("end") Date end);
+}

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

@@ -0,0 +1,148 @@
+package com.tzld.piaoquan.growth.common.model.bo;
+
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.growth.common.common.enums.FieshuTableColumnDataTypeEnum;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class FeishuTableDTO {
+    private Header header;
+    private List<Element> elements;
+
+    @Data
+    public static class Element {
+        private String tag;
+        private JSONObject text;
+        private long page_size;
+        private String row_height;
+        private HeaderStyle header_style;
+        private List<Column> columns;
+        private List<JSONObject> rows;
+    }
+
+    @Data
+    public static class Column {
+        private String name;
+        private String display_name;
+        private String data_type;
+        private String horizontal_align;
+        private String vertical_align;
+        private String width;
+        private String format;
+        private String dateFormat;
+    }
+
+    @Data
+    public static class HeaderStyle {
+        private String text_align;
+        private String text_size;
+        private String background_style;
+        private String text_color;
+        private boolean bold;
+        private long lines;
+    }
+
+    @Data
+    public static class Header {
+        private String template;
+        private Title title;
+    }
+
+    @Data
+    public static class Title {
+        private String content;
+        private String tag;
+    }
+
+    public static FeishuTableDTO createTable(String title, List<Column> columns, List<JSONObject> rows, boolean atAll) {
+        String tableStr = "{\n" +
+                "    \"header\":\n" +
+                "    {\n" +
+                "        \"template\": \"blue\",\n" +
+                "        \"title\":\n" +
+                "        {\n" +
+                "            \"content\": \"" + title + "\",\n " +
+                "            \"tag\": \"plain_text\"\n" +
+                "        }\n" +
+                "    },\n" +
+                "    \"elements\":\n" +
+                "    [\n" +
+                "        {\n" +
+                "            \"tag\": \"table\",\n" +
+                "            \"page_size\": " + rows.size() + ",\n" +
+                "            \"row_height\": \"low\",\n" +
+                "            \"header_style\":\n" +
+                "            {\n" +
+                "                \"text_align\": \"left\",\n" +
+                "                \"text_size\": \"normal\",\n" +
+                "                \"background_style\": \"none\",\n" +
+                "                \"text_color\": \"grey\",\n" +
+                "                \"bold\": true,\n" +
+                "                \"lines\": 1\n" +
+                "            },\n" +
+                "            \"columns\":\n" +
+                JSONObject.toJSONString(columns) +
+                "            ,\n" +
+                "            \"rows\":\n" +
+                JSONObject.toJSONString(rows) +
+                "        }\n" +
+                "    ]\n" +
+                "}";
+        FeishuTableDTO result =  JSONObject.parseObject(tableStr, FeishuTableDTO.class);
+        if (atAll) {
+            FeishuTableDTO.Element atAllElement = new FeishuTableDTO.Element();
+            atAllElement.setTag("div");
+            JSONObject atAllElementText = new JSONObject();
+            atAllElementText.put("content", "<at id=all></at>");
+            atAllElementText.put("tag", "lark_md");
+            atAllElement.setText(atAllElementText);
+            result.getElements().add(atAllElement);
+        }
+        return result;
+    }
+
+    public static Column createFeishuColumns(
+            String dataType,
+            String columnName,
+            String displayName,
+            String numberFormat) {
+
+        String width = "auto";
+        String verticalAlign = "top";
+        String horizontalAlign = "left";
+        Column column = new Column();
+
+        if (FieshuTableColumnDataTypeEnum.TEXT.getType().equals(dataType)) {
+            column.setName(columnName);
+            column.setDisplay_name(displayName);
+            column.setWidth(width);
+            column.setData_type(dataType);
+            column.setVertical_align(verticalAlign);
+            column.setHorizontal_align(horizontalAlign);
+        } else if (FieshuTableColumnDataTypeEnum.LARK_MD.getType().equals(dataType)) {
+            column.setName(columnName);
+            column.setDisplay_name(displayName);
+            column.setData_type(dataType);
+        } else if (FieshuTableColumnDataTypeEnum.NUMBER.getType().equals(dataType)) {
+            column.setName(columnName);
+            column.setDisplay_name(displayName);
+            column.setData_type(dataType);
+            column.setFormat(numberFormat);
+            column.setWidth(width);
+        } else if (FieshuTableColumnDataTypeEnum.DATE.getType().equals(dataType)) {
+            column.setName(columnName);
+            column.setDisplay_name(displayName);
+            column.setData_type(dataType);
+            column.setDateFormat("YYYY/MM/DD");
+        } else if (FieshuTableColumnDataTypeEnum.OPTIONS.getType().equals(dataType)) {
+            column.setName(columnName);
+            column.setDisplay_name(displayName);
+            column.setData_type(dataType);
+        }
+
+        return column;
+    }
+}
+

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

@@ -0,0 +1,8 @@
+package com.tzld.piaoquan.growth.common.model.bo;
+
+import lombok.Data;
+
+@Data
+public class GroupSendWeComUserParam {
+    String dateStr;
+}

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

@@ -0,0 +1,70 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import java.util.Date;
+
+public class AttachmentWithMsgResult {
+    private Long id;
+
+    private Long attachmentId;
+
+    private Long msgResultId;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getAttachmentId() {
+        return attachmentId;
+    }
+
+    public void setAttachmentId(Long attachmentId) {
+        this.attachmentId = attachmentId;
+    }
+
+    public Long getMsgResultId() {
+        return msgResultId;
+    }
+
+    public void setMsgResultId(Long msgResultId) {
+        this.msgResultId = msgResultId;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @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(", attachmentId=").append(attachmentId);
+        sb.append(", msgResultId=").append(msgResultId);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,513 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class AttachmentWithMsgResultExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public AttachmentWithMsgResultExample() {
+        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 andAttachmentIdIsNull() {
+            addCriterion("attachment_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdIsNotNull() {
+            addCriterion("attachment_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdEqualTo(Long value) {
+            addCriterion("attachment_id =", value, "attachmentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdNotEqualTo(Long value) {
+            addCriterion("attachment_id <>", value, "attachmentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdGreaterThan(Long value) {
+            addCriterion("attachment_id >", value, "attachmentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("attachment_id >=", value, "attachmentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdLessThan(Long value) {
+            addCriterion("attachment_id <", value, "attachmentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdLessThanOrEqualTo(Long value) {
+            addCriterion("attachment_id <=", value, "attachmentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdIn(List<Long> values) {
+            addCriterion("attachment_id in", values, "attachmentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdNotIn(List<Long> values) {
+            addCriterion("attachment_id not in", values, "attachmentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdBetween(Long value1, Long value2) {
+            addCriterion("attachment_id between", value1, value2, "attachmentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAttachmentIdNotBetween(Long value1, Long value2) {
+            addCriterion("attachment_id not between", value1, value2, "attachmentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdIsNull() {
+            addCriterion("msg_result_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdIsNotNull() {
+            addCriterion("msg_result_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdEqualTo(Long value) {
+            addCriterion("msg_result_id =", value, "msgResultId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdNotEqualTo(Long value) {
+            addCriterion("msg_result_id <>", value, "msgResultId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdGreaterThan(Long value) {
+            addCriterion("msg_result_id >", value, "msgResultId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("msg_result_id >=", value, "msgResultId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdLessThan(Long value) {
+            addCriterion("msg_result_id <", value, "msgResultId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdLessThanOrEqualTo(Long value) {
+            addCriterion("msg_result_id <=", value, "msgResultId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdIn(List<Long> values) {
+            addCriterion("msg_result_id in", values, "msgResultId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdNotIn(List<Long> values) {
+            addCriterion("msg_result_id not in", values, "msgResultId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdBetween(Long value1, Long value2) {
+            addCriterion("msg_result_id between", value1, value2, "msgResultId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgResultIdNotBetween(Long value1, Long value2) {
+            addCriterion("msg_result_id not between", value1, value2, "msgResultId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("update_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("update_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("update_time =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("update_time <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("update_time >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("update_time >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("update_time <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("update_time <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("update_time in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("update_time not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("update_time between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("update_time not between", value1, value2, "updateTime");
+            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);
+        }
+    }
+}

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/po/CgiReplyBucketData.java → common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/CgiReplyBucketData.java

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.api.model.po;
+package com.tzld.piaoquan.growth.common.model.po;
 
 import java.util.Date;
 

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/po/CgiReplyBucketDataExample.java → common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/CgiReplyBucketDataExample.java

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.api.model.po;
+package com.tzld.piaoquan.growth.common.model.po;
 
 import java.util.ArrayList;
 import java.util.Date;

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/po/GhDetail.java → common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/GhDetail.java

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.api.model.po;
+package com.tzld.piaoquan.growth.common.model.po;
 
 import java.util.Date;
 

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/po/GhDetailExample.java → common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/GhDetailExample.java

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.api.model.po;
+package com.tzld.piaoquan.growth.common.model.po;
 
 
 import com.tzld.piaoquan.growth.common.utils.page.Page;

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

@@ -11,10 +11,14 @@ public class MessageAttachment {
 
     private String url;
 
+    private String picUrl;
+
     private String title;
 
     private String desc;
 
+    private String mediaId;
+
     private String appid;
 
     private String page;
@@ -63,6 +67,14 @@ public class MessageAttachment {
         this.url = url;
     }
 
+    public String getPicUrl() {
+        return picUrl;
+    }
+
+    public void setPicUrl(String picUrl) {
+        this.picUrl = picUrl;
+    }
+
     public String getTitle() {
         return title;
     }
@@ -79,6 +91,14 @@ public class MessageAttachment {
         this.desc = desc;
     }
 
+    public String getMediaId() {
+        return mediaId;
+    }
+
+    public void setMediaId(String mediaId) {
+        this.mediaId = mediaId;
+    }
+
     public String getAppid() {
         return appid;
     }
@@ -153,8 +173,10 @@ public class MessageAttachment {
         sb.append(", staffId=").append(staffId);
         sb.append(", type=").append(type);
         sb.append(", url=").append(url);
+        sb.append(", picUrl=").append(picUrl);
         sb.append(", title=").append(title);
         sb.append(", desc=").append(desc);
+        sb.append(", mediaId=").append(mediaId);
         sb.append(", appid=").append(appid);
         sb.append(", page=").append(page);
         sb.append(", cover=").append(cover);

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

@@ -367,6 +367,76 @@ public class MessageAttachmentExample {
             return (Criteria) this;
         }
 
+        public Criteria andPicUrlIsNull() {
+            addCriterion("pic_url is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlIsNotNull() {
+            addCriterion("pic_url is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlEqualTo(String value) {
+            addCriterion("pic_url =", value, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlNotEqualTo(String value) {
+            addCriterion("pic_url <>", value, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlGreaterThan(String value) {
+            addCriterion("pic_url >", value, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlGreaterThanOrEqualTo(String value) {
+            addCriterion("pic_url >=", value, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlLessThan(String value) {
+            addCriterion("pic_url <", value, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlLessThanOrEqualTo(String value) {
+            addCriterion("pic_url <=", value, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlLike(String value) {
+            addCriterion("pic_url like", value, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlNotLike(String value) {
+            addCriterion("pic_url not like", value, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlIn(List<String> values) {
+            addCriterion("pic_url in", values, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlNotIn(List<String> values) {
+            addCriterion("pic_url not in", values, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlBetween(String value1, String value2) {
+            addCriterion("pic_url between", value1, value2, "picUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPicUrlNotBetween(String value1, String value2) {
+            addCriterion("pic_url not between", value1, value2, "picUrl");
+            return (Criteria) this;
+        }
+
         public Criteria andTitleIsNull() {
             addCriterion("title is null");
             return (Criteria) this;
@@ -507,6 +577,76 @@ public class MessageAttachmentExample {
             return (Criteria) this;
         }
 
+        public Criteria andMediaIdIsNull() {
+            addCriterion("media_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdIsNotNull() {
+            addCriterion("media_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdEqualTo(String value) {
+            addCriterion("media_id =", value, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdNotEqualTo(String value) {
+            addCriterion("media_id <>", value, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdGreaterThan(String value) {
+            addCriterion("media_id >", value, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdGreaterThanOrEqualTo(String value) {
+            addCriterion("media_id >=", value, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdLessThan(String value) {
+            addCriterion("media_id <", value, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdLessThanOrEqualTo(String value) {
+            addCriterion("media_id <=", value, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdLike(String value) {
+            addCriterion("media_id like", value, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdNotLike(String value) {
+            addCriterion("media_id not like", value, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdIn(List<String> values) {
+            addCriterion("media_id in", values, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdNotIn(List<String> values) {
+            addCriterion("media_id not in", values, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdBetween(String value1, String value2) {
+            addCriterion("media_id between", value1, value2, "mediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andMediaIdNotBetween(String value1, String value2) {
+            addCriterion("media_id not between", value1, value2, "mediaId");
+            return (Criteria) this;
+        }
+
         public Criteria andAppidIsNull() {
             addCriterion("appid is null");
             return (Criteria) this;

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

@@ -21,6 +21,8 @@ public class SendMsgResult {
 
     private Date updateTime;
 
+    private String textContent;
+
     public Long getId() {
         return id;
     }
@@ -93,6 +95,14 @@ public class SendMsgResult {
         this.updateTime = updateTime;
     }
 
+    public String getTextContent() {
+        return textContent;
+    }
+
+    public void setTextContent(String textContent) {
+        this.textContent = textContent;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -108,6 +118,7 @@ public class SendMsgResult {
         sb.append(", isDelete=").append(isDelete);
         sb.append(", createTime=").append(createTime);
         sb.append(", updateTime=").append(updateTime);
+        sb.append(", textContent=").append(textContent);
         sb.append("]");
         return sb.toString();
     }

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

@@ -0,0 +1,103 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import java.util.Date;
+
+public class Tag {
+    private Long id;
+
+    private String tagGroupId;
+
+    private String tagGroupName;
+
+    private String tagId;
+
+    private String tagName;
+
+    private Integer isDelete;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getTagGroupId() {
+        return tagGroupId;
+    }
+
+    public void setTagGroupId(String tagGroupId) {
+        this.tagGroupId = tagGroupId;
+    }
+
+    public String getTagGroupName() {
+        return tagGroupName;
+    }
+
+    public void setTagGroupName(String tagGroupName) {
+        this.tagGroupName = tagGroupName;
+    }
+
+    public String getTagId() {
+        return tagId;
+    }
+
+    public void setTagId(String tagId) {
+        this.tagId = tagId;
+    }
+
+    public String getTagName() {
+        return tagName;
+    }
+
+    public void setTagName(String tagName) {
+        this.tagName = tagName;
+    }
+
+    public Integer getIsDelete() {
+        return isDelete;
+    }
+
+    public void setIsDelete(Integer isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @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(", tagGroupId=").append(tagGroupId);
+        sb.append(", tagGroupName=").append(tagGroupName);
+        sb.append(", tagId=").append(tagId);
+        sb.append(", tagName=").append(tagName);
+        sb.append(", isDelete=").append(isDelete);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,733 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class TagExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public TagExample() {
+        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 andTagGroupIdIsNull() {
+            addCriterion("tag_group_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdIsNotNull() {
+            addCriterion("tag_group_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdEqualTo(String value) {
+            addCriterion("tag_group_id =", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdNotEqualTo(String value) {
+            addCriterion("tag_group_id <>", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdGreaterThan(String value) {
+            addCriterion("tag_group_id >", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdGreaterThanOrEqualTo(String value) {
+            addCriterion("tag_group_id >=", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdLessThan(String value) {
+            addCriterion("tag_group_id <", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdLessThanOrEqualTo(String value) {
+            addCriterion("tag_group_id <=", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdLike(String value) {
+            addCriterion("tag_group_id like", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdNotLike(String value) {
+            addCriterion("tag_group_id not like", value, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdIn(List<String> values) {
+            addCriterion("tag_group_id in", values, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdNotIn(List<String> values) {
+            addCriterion("tag_group_id not in", values, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdBetween(String value1, String value2) {
+            addCriterion("tag_group_id between", value1, value2, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupIdNotBetween(String value1, String value2) {
+            addCriterion("tag_group_id not between", value1, value2, "tagGroupId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameIsNull() {
+            addCriterion("tag_group_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameIsNotNull() {
+            addCriterion("tag_group_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameEqualTo(String value) {
+            addCriterion("tag_group_name =", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameNotEqualTo(String value) {
+            addCriterion("tag_group_name <>", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameGreaterThan(String value) {
+            addCriterion("tag_group_name >", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameGreaterThanOrEqualTo(String value) {
+            addCriterion("tag_group_name >=", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameLessThan(String value) {
+            addCriterion("tag_group_name <", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameLessThanOrEqualTo(String value) {
+            addCriterion("tag_group_name <=", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameLike(String value) {
+            addCriterion("tag_group_name like", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameNotLike(String value) {
+            addCriterion("tag_group_name not like", value, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameIn(List<String> values) {
+            addCriterion("tag_group_name in", values, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameNotIn(List<String> values) {
+            addCriterion("tag_group_name not in", values, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameBetween(String value1, String value2) {
+            addCriterion("tag_group_name between", value1, value2, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGroupNameNotBetween(String value1, String value2) {
+            addCriterion("tag_group_name not between", value1, value2, "tagGroupName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIsNull() {
+            addCriterion("tag_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIsNotNull() {
+            addCriterion("tag_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdEqualTo(String value) {
+            addCriterion("tag_id =", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotEqualTo(String value) {
+            addCriterion("tag_id <>", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdGreaterThan(String value) {
+            addCriterion("tag_id >", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdGreaterThanOrEqualTo(String value) {
+            addCriterion("tag_id >=", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdLessThan(String value) {
+            addCriterion("tag_id <", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdLessThanOrEqualTo(String value) {
+            addCriterion("tag_id <=", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdLike(String value) {
+            addCriterion("tag_id like", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotLike(String value) {
+            addCriterion("tag_id not like", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIn(List<String> values) {
+            addCriterion("tag_id in", values, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotIn(List<String> values) {
+            addCriterion("tag_id not in", values, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdBetween(String value1, String value2) {
+            addCriterion("tag_id between", value1, value2, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotBetween(String value1, String value2) {
+            addCriterion("tag_id not between", value1, value2, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameIsNull() {
+            addCriterion("tag_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameIsNotNull() {
+            addCriterion("tag_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameEqualTo(String value) {
+            addCriterion("tag_name =", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameNotEqualTo(String value) {
+            addCriterion("tag_name <>", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameGreaterThan(String value) {
+            addCriterion("tag_name >", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameGreaterThanOrEqualTo(String value) {
+            addCriterion("tag_name >=", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameLessThan(String value) {
+            addCriterion("tag_name <", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameLessThanOrEqualTo(String value) {
+            addCriterion("tag_name <=", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameLike(String value) {
+            addCriterion("tag_name like", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameNotLike(String value) {
+            addCriterion("tag_name not like", value, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameIn(List<String> values) {
+            addCriterion("tag_name in", values, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameNotIn(List<String> values) {
+            addCriterion("tag_name not in", values, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameBetween(String value1, String value2) {
+            addCriterion("tag_name between", value1, value2, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNameNotBetween(String value1, String value2) {
+            addCriterion("tag_name not between", value1, value2, "tagName");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNull() {
+            addCriterion("is_delete is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNotNull() {
+            addCriterion("is_delete is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteEqualTo(Integer value) {
+            addCriterion("is_delete =", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotEqualTo(Integer value) {
+            addCriterion("is_delete <>", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThan(Integer value) {
+            addCriterion("is_delete >", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThanOrEqualTo(Integer value) {
+            addCriterion("is_delete >=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThan(Integer value) {
+            addCriterion("is_delete <", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThanOrEqualTo(Integer value) {
+            addCriterion("is_delete <=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIn(List<Integer> values) {
+            addCriterion("is_delete in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotIn(List<Integer> values) {
+            addCriterion("is_delete not in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteBetween(Integer value1, Integer value2) {
+            addCriterion("is_delete between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotBetween(Integer value1, Integer value2) {
+            addCriterion("is_delete not between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("update_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("update_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("update_time =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("update_time <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("update_time >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("update_time >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("update_time <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("update_time <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("update_time in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("update_time not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("update_time between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("update_time not between", value1, value2, "updateTime");
+            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);
+        }
+    }
+}

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

@@ -0,0 +1,103 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import java.util.Date;
+
+public class UserCount {
+    private Long id;
+
+    private Long staffId;
+
+    private String staffName;
+
+    private Integer allCount;
+
+    private Integer newCount;
+
+    private String date;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getStaffId() {
+        return staffId;
+    }
+
+    public void setStaffId(Long staffId) {
+        this.staffId = staffId;
+    }
+
+    public String getStaffName() {
+        return staffName;
+    }
+
+    public void setStaffName(String staffName) {
+        this.staffName = staffName;
+    }
+
+    public Integer getAllCount() {
+        return allCount;
+    }
+
+    public void setAllCount(Integer allCount) {
+        this.allCount = allCount;
+    }
+
+    public Integer getNewCount() {
+        return newCount;
+    }
+
+    public void setNewCount(Integer newCount) {
+        this.newCount = newCount;
+    }
+
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @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(", staffId=").append(staffId);
+        sb.append(", staffName=").append(staffName);
+        sb.append(", allCount=").append(allCount);
+        sb.append(", newCount=").append(newCount);
+        sb.append(", date=").append(date);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,713 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class UserCountExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public UserCountExample() {
+        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 andStaffIdIsNull() {
+            addCriterion("staff_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdIsNotNull() {
+            addCriterion("staff_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdEqualTo(Long value) {
+            addCriterion("staff_id =", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdNotEqualTo(Long value) {
+            addCriterion("staff_id <>", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdGreaterThan(Long value) {
+            addCriterion("staff_id >", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("staff_id >=", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdLessThan(Long value) {
+            addCriterion("staff_id <", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdLessThanOrEqualTo(Long value) {
+            addCriterion("staff_id <=", value, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdIn(List<Long> values) {
+            addCriterion("staff_id in", values, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdNotIn(List<Long> values) {
+            addCriterion("staff_id not in", values, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdBetween(Long value1, Long value2) {
+            addCriterion("staff_id between", value1, value2, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffIdNotBetween(Long value1, Long value2) {
+            addCriterion("staff_id not between", value1, value2, "staffId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameIsNull() {
+            addCriterion("staff_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameIsNotNull() {
+            addCriterion("staff_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameEqualTo(String value) {
+            addCriterion("staff_name =", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameNotEqualTo(String value) {
+            addCriterion("staff_name <>", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameGreaterThan(String value) {
+            addCriterion("staff_name >", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameGreaterThanOrEqualTo(String value) {
+            addCriterion("staff_name >=", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameLessThan(String value) {
+            addCriterion("staff_name <", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameLessThanOrEqualTo(String value) {
+            addCriterion("staff_name <=", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameLike(String value) {
+            addCriterion("staff_name like", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameNotLike(String value) {
+            addCriterion("staff_name not like", value, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameIn(List<String> values) {
+            addCriterion("staff_name in", values, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameNotIn(List<String> values) {
+            addCriterion("staff_name not in", values, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameBetween(String value1, String value2) {
+            addCriterion("staff_name between", value1, value2, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andStaffNameNotBetween(String value1, String value2) {
+            addCriterion("staff_name not between", value1, value2, "staffName");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountIsNull() {
+            addCriterion("all_count is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountIsNotNull() {
+            addCriterion("all_count is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountEqualTo(Integer value) {
+            addCriterion("all_count =", value, "allCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountNotEqualTo(Integer value) {
+            addCriterion("all_count <>", value, "allCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountGreaterThan(Integer value) {
+            addCriterion("all_count >", value, "allCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountGreaterThanOrEqualTo(Integer value) {
+            addCriterion("all_count >=", value, "allCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountLessThan(Integer value) {
+            addCriterion("all_count <", value, "allCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountLessThanOrEqualTo(Integer value) {
+            addCriterion("all_count <=", value, "allCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountIn(List<Integer> values) {
+            addCriterion("all_count in", values, "allCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountNotIn(List<Integer> values) {
+            addCriterion("all_count not in", values, "allCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountBetween(Integer value1, Integer value2) {
+            addCriterion("all_count between", value1, value2, "allCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllCountNotBetween(Integer value1, Integer value2) {
+            addCriterion("all_count not between", value1, value2, "allCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountIsNull() {
+            addCriterion("new_count is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountIsNotNull() {
+            addCriterion("new_count is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountEqualTo(Integer value) {
+            addCriterion("new_count =", value, "newCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountNotEqualTo(Integer value) {
+            addCriterion("new_count <>", value, "newCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountGreaterThan(Integer value) {
+            addCriterion("new_count >", value, "newCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountGreaterThanOrEqualTo(Integer value) {
+            addCriterion("new_count >=", value, "newCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountLessThan(Integer value) {
+            addCriterion("new_count <", value, "newCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountLessThanOrEqualTo(Integer value) {
+            addCriterion("new_count <=", value, "newCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountIn(List<Integer> values) {
+            addCriterion("new_count in", values, "newCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountNotIn(List<Integer> values) {
+            addCriterion("new_count not in", values, "newCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountBetween(Integer value1, Integer value2) {
+            addCriterion("new_count between", value1, value2, "newCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andNewCountNotBetween(Integer value1, Integer value2) {
+            addCriterion("new_count not between", value1, value2, "newCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateIsNull() {
+            addCriterion("`date` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateIsNotNull() {
+            addCriterion("`date` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateEqualTo(String value) {
+            addCriterion("`date` =", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateNotEqualTo(String value) {
+            addCriterion("`date` <>", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateGreaterThan(String value) {
+            addCriterion("`date` >", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateGreaterThanOrEqualTo(String value) {
+            addCriterion("`date` >=", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateLessThan(String value) {
+            addCriterion("`date` <", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateLessThanOrEqualTo(String value) {
+            addCriterion("`date` <=", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateLike(String value) {
+            addCriterion("`date` like", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateNotLike(String value) {
+            addCriterion("`date` not like", value, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateIn(List<String> values) {
+            addCriterion("`date` in", values, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateNotIn(List<String> values) {
+            addCriterion("`date` not in", values, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateBetween(String value1, String value2) {
+            addCriterion("`date` between", value1, value2, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateNotBetween(String value1, String value2) {
+            addCriterion("`date` not between", value1, value2, "date");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("update_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("update_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("update_time =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("update_time <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("update_time >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("update_time >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("update_time <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("update_time <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("update_time in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("update_time not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("update_time between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("update_time not between", value1, value2, "updateTime");
+            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);
+        }
+    }
+}

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

@@ -0,0 +1,81 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import java.util.Date;
+
+public class UserWithTag {
+    private Long id;
+
+    private Long userId;
+
+    private Long tagId;
+
+    private Integer isDelete;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getTagId() {
+        return tagId;
+    }
+
+    public void setTagId(Long tagId) {
+        this.tagId = tagId;
+    }
+
+    public Integer getIsDelete() {
+        return isDelete;
+    }
+
+    public void setIsDelete(Integer isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @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(", userId=").append(userId);
+        sb.append(", tagId=").append(tagId);
+        sb.append(", isDelete=").append(isDelete);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,573 @@
+package com.tzld.piaoquan.growth.common.model.po;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class UserWithTagExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public UserWithTagExample() {
+        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 andUserIdIsNull() {
+            addCriterion("user_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIsNotNull() {
+            addCriterion("user_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdEqualTo(Long value) {
+            addCriterion("user_id =", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotEqualTo(Long value) {
+            addCriterion("user_id <>", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdGreaterThan(Long value) {
+            addCriterion("user_id >", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("user_id >=", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLessThan(Long value) {
+            addCriterion("user_id <", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdLessThanOrEqualTo(Long value) {
+            addCriterion("user_id <=", value, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdIn(List<Long> values) {
+            addCriterion("user_id in", values, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotIn(List<Long> values) {
+            addCriterion("user_id not in", values, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdBetween(Long value1, Long value2) {
+            addCriterion("user_id between", value1, value2, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserIdNotBetween(Long value1, Long value2) {
+            addCriterion("user_id not between", value1, value2, "userId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIsNull() {
+            addCriterion("tag_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIsNotNull() {
+            addCriterion("tag_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdEqualTo(Long value) {
+            addCriterion("tag_id =", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotEqualTo(Long value) {
+            addCriterion("tag_id <>", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdGreaterThan(Long value) {
+            addCriterion("tag_id >", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("tag_id >=", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdLessThan(Long value) {
+            addCriterion("tag_id <", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdLessThanOrEqualTo(Long value) {
+            addCriterion("tag_id <=", value, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdIn(List<Long> values) {
+            addCriterion("tag_id in", values, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotIn(List<Long> values) {
+            addCriterion("tag_id not in", values, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdBetween(Long value1, Long value2) {
+            addCriterion("tag_id between", value1, value2, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIdNotBetween(Long value1, Long value2) {
+            addCriterion("tag_id not between", value1, value2, "tagId");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNull() {
+            addCriterion("is_delete is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNotNull() {
+            addCriterion("is_delete is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteEqualTo(Integer value) {
+            addCriterion("is_delete =", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotEqualTo(Integer value) {
+            addCriterion("is_delete <>", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThan(Integer value) {
+            addCriterion("is_delete >", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThanOrEqualTo(Integer value) {
+            addCriterion("is_delete >=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThan(Integer value) {
+            addCriterion("is_delete <", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThanOrEqualTo(Integer value) {
+            addCriterion("is_delete <=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIn(List<Integer> values) {
+            addCriterion("is_delete in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotIn(List<Integer> values) {
+            addCriterion("is_delete not in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteBetween(Integer value1, Integer value2) {
+            addCriterion("is_delete between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotBetween(Integer value1, Integer value2) {
+            addCriterion("is_delete not between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("update_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("update_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("update_time =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("update_time <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("update_time >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("update_time >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("update_time <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("update_time <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("update_time in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("update_time not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("update_time between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("update_time not between", value1, value2, "updateTime");
+            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);
+        }
+    }
+}

+ 24 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/vo/WeComUserVo.java

@@ -0,0 +1,24 @@
+package com.tzld.piaoquan.growth.common.model.vo;
+
+import lombok.Data;
+
+@Data
+public class WeComUserVo {
+
+    private Long corpId;
+
+    private String externalUserId;
+
+    private String unionId;
+
+    private String externalUserId3rdParty;
+
+    private Integer type;
+
+    private String name;
+
+    private String avatar;
+
+    private Integer gender;
+
+}

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

@@ -63,25 +63,60 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
     private GuaranteesVideoMapper guaranteesVideoMapper;
 
     @Override
-    public void addMiniProgram(List<MessageAttachment> messageAttachmentList, Long createTime) {
+    public List<Long> addMessageAttachment(List<MessageAttachment> messageAttachmentList, Long createTime) {
+        List<Long> messageAttachmentIds = new ArrayList<>();
         for (MessageAttachment messageAttachment : messageAttachmentList) {
             MessageAttachmentExample example = new MessageAttachmentExample();
-            example.createCriteria()
-                    .andAppidEqualTo(messageAttachment.getAppid())
-                    .andTypeEqualTo(messageAttachment.getType())
-                    .andMiniprogramVideoIdEqualTo(messageAttachment.getMiniprogramVideoId())
-                    .andStaffIdEqualTo(messageAttachment.getStaffId());
+            MessageAttachmentExample.Criteria criteria = example.createCriteria().andTypeEqualTo(messageAttachment.getType());
+            if (messageAttachment.getType().equals(MessageAttachmentTypeEnum.IMAGE.getCode())) {
+                if (messageAttachment.getMediaId() != null) {
+                    criteria.andMediaIdEqualTo(messageAttachment.getMediaId());
+                }
+                if (messageAttachment.getPicUrl() != null) {
+                    criteria.andPicUrlEqualTo(messageAttachment.getPicUrl());
+                }
+            }
+            if (messageAttachment.getType().equals(MessageAttachmentTypeEnum.MINI_PROGRAM.getCode())) {
+                if (messageAttachment.getAppid() != null) {
+                    criteria.andAppidEqualTo(messageAttachment.getAppid());
+                }
+                if (messageAttachment.getMiniprogramVideoId() != null) {
+                    criteria.andMiniprogramVideoIdEqualTo(messageAttachment.getMiniprogramVideoId());
+                }
+                if (messageAttachment.getStaffId() != null) {
+                    criteria.andStaffIdEqualTo(messageAttachment.getStaffId());
+                }
+            }
+
+            if (messageAttachment.getType().equals(MessageAttachmentTypeEnum.LINK.getCode())) {
+                if (messageAttachment.getTitle() != null) {
+                    criteria.andTitleEqualTo(messageAttachment.getTitle());
+                }
+                if (messageAttachment.getPicUrl() != null) {
+                    criteria.andPicUrlEqualTo(messageAttachment.getPicUrl());
+                }
+                if (messageAttachment.getDesc() != null) {
+                    criteria.andDescEqualTo(messageAttachment.getDesc());
+                }
+                if (messageAttachment.getUrl() != null) {
+                    criteria.andUrlEqualTo(messageAttachment.getUrl());
+                }
+            }
+
             List<MessageAttachment> messageAttachments = messageAttachmentMapper.selectByExample(example);
             if (CollectionUtils.isEmpty(messageAttachments)) {
-                if (createTime != null) {
+                if (messageAttachment.getType().equals(MessageAttachmentTypeEnum.MINI_PROGRAM.getCode()) &&
+                        createTime != null) {
                     messageAttachment.setSendTime(new Date(createTime));
                 }
-                messageAttachmentMapper.insert(messageAttachment);
-                continue;
+                messageAttachmentMapper.insertSelective(messageAttachment);
+            } else {
+                messageAttachment.setId(messageAttachments.get(0).getId());
+                messageAttachmentMapper.updateByPrimaryKeySelective(messageAttachment);
             }
-            messageAttachment.setId(messageAttachments.get(0).getId());
-            messageAttachmentMapper.updateByPrimaryKeySelective(messageAttachment);
+            messageAttachmentIds.add(messageAttachment.getId());
         }
+        return messageAttachmentIds;
     }
 
 
@@ -103,7 +138,7 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
             addMessageAttachments(videoParam, messageAttachmentMap, guaranteedParam.getDate(), messageAttachmentList);
         }
 
-        addMiniProgram(messageAttachmentList, null);
+        addMessageAttachment(messageAttachmentList, null);
         return CommonResponse.success();
     }
 
@@ -158,7 +193,7 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
             }
             MessageAttachment messageAttachment = new MessageAttachment();
             messageAttachment.setMiniprogramVideoId(videoId);
-            messageAttachment.setType(MessageAttachmentTypeEnum.MINI_PROGRAM.getType());
+            messageAttachment.setType(MessageAttachmentTypeEnum.MINI_PROGRAM.getCode());
             messageAttachment.setCover(videoDetail.getCover());
             messageAttachment.setTitle(videoDetail.getTitle());
             messageAttachment.setAppid(appid);

+ 42 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/WeComUserServiceImpl.java

@@ -6,12 +6,17 @@ import com.tzld.piaoquan.growth.common.component.HttpPoolClient;
 import com.tzld.piaoquan.growth.common.dao.mapper.StaffMapper;
 import com.tzld.piaoquan.growth.common.dao.mapper.StaffWithUserMapper;
 import com.tzld.piaoquan.growth.common.dao.mapper.WeComUserMapper;
+import com.tzld.piaoquan.growth.common.dao.mapper.ext.WeComUserMapperExt;
+import com.tzld.piaoquan.growth.common.model.bo.GroupSendWeComUserParam;
 import com.tzld.piaoquan.growth.common.model.po.*;
+import com.tzld.piaoquan.growth.common.model.vo.WeComUserVo;
 import com.tzld.piaoquan.growth.common.service.WeComAccessTokenService;
 import com.tzld.piaoquan.growth.common.service.WeComUserService;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
 import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
@@ -20,6 +25,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 import static com.tzld.piaoquan.growth.common.common.constant.WeComConstant.GET_WE_COM_EXTERNAL_CONTACT_GET;
 
@@ -35,6 +41,9 @@ public class WeComUserServiceImpl implements WeComUserService {
     @Autowired
     private WeComUserMapper weComUserMapper;
 
+    @Autowired
+    private WeComUserMapperExt weComUserMapperExt;
+
     @Autowired
     private StaffWithUserMapper staffWithUserMapper;
 
@@ -217,4 +226,37 @@ public class WeComUserServiceImpl implements WeComUserService {
         }
         return null;
     }
+
+    @Override
+    public List<WeComUserVo> getWeComUserByNameAvatar(String name, String avatar) {
+        WeComUserExample example = new WeComUserExample();
+        example.createCriteria().andNameEqualTo(name).andAvatarEqualTo(avatar);
+        List<WeComUser> list = weComUserMapper.selectByExample(example);
+        return buildWeComUserVo(list);
+    }
+
+    private List<WeComUserVo> buildWeComUserVo(List<WeComUser> list) {
+        List<WeComUserVo> voList = new ArrayList<>();
+        if (CollectionUtils.isEmpty(list)) {
+            return voList;
+        }
+        for (WeComUser weComUser : list) {
+            WeComUserVo vo = new WeComUserVo();
+            BeanUtils.copyProperties(weComUser, vo);
+            voList.add(vo);
+        }
+        return voList;
+    }
+
+    @Override
+    public List<WeComUserVo> getGroupSendWeComUser(GroupSendWeComUserParam param) {
+        Date start = DateUtil.getDaysAgoDate(1);
+        Date end = DateUtil.getThatDayDate();
+        if (Objects.nonNull(param) && StringUtils.isNotEmpty(param.getDateStr())) {
+            start = DateUtil.getDate(param.getDateStr());
+            end = DateUtil.getDatePlusDays(param.getDateStr(), 1);
+        }
+        List<WeComUser> list = weComUserMapperExt.getGroupSendUserByDate(start, end);
+        return buildWeComUserVo(list);
+    }
 }

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

@@ -9,7 +9,7 @@ import java.util.List;
 
 public interface MessageAttachmentService {
 
-    void addMiniProgram(List<MessageAttachment> messageAttachmentList, Long createTime);
+    List<Long> addMessageAttachment(List<MessageAttachment> messageAttachmentList, Long createTime);
 
     CommonResponse<Void> createGuaranteedMiniProgram(GuaranteedParam guaranteedParam);
 

+ 9 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/WeComUserService.java

@@ -1,6 +1,11 @@
 package com.tzld.piaoquan.growth.common.service;
 
+import com.tzld.piaoquan.growth.common.model.bo.GroupSendWeComUserParam;
 import com.tzld.piaoquan.growth.common.model.po.Staff;
+import com.tzld.piaoquan.growth.common.model.po.WeComUser;
+import com.tzld.piaoquan.growth.common.model.vo.WeComUserVo;
+
+import java.util.List;
 
 
 public interface WeComUserService {
@@ -13,4 +18,8 @@ public interface WeComUserService {
     void delStaffWithUser(String externalUserId, String carrierId, Long deleteTime);
 
     void delStaffWithUser(Long userId, Long staffId, Long deleteTime);
+
+    List<WeComUserVo> getWeComUserByNameAvatar(String name, String avatar);
+
+    List<WeComUserVo> getGroupSendWeComUser(GroupSendWeComUserParam param);
 }

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

@@ -20,6 +20,7 @@ public class DateUtil {
         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 getDaysAgoDate(int day) {
@@ -39,6 +40,13 @@ public class DateUtil {
         return dateFormat.format(yesterday);
     }
 
+    public static String getBeforeDayDateString1() {
+        DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        LocalDate today = LocalDate.now();
+        LocalDate yesterday = today.minusDays(1);
+        return dateFormat.format(yesterday);
+    }
+
     public static String getThatDayDateString() {
         DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         LocalDate today = LocalDate.now();
@@ -134,4 +142,12 @@ public class DateUtil {
         return Date.from(localDate.atStartOfDay(zone).toInstant());
     }
 
+    public static Date getDatePlusDays(String dateString, int plusDays) {
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        LocalDate localDate = LocalDate.parse(dateString, formatter);
+        ZoneId zone = ZoneId.of("Asia/Shanghai");
+        localDate = localDate.plusDays(plusDays);
+        return Date.from(localDate.atStartOfDay(zone).toInstant());
+    }
+
 }

+ 28 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/LarkRobotUtil.java

@@ -19,6 +19,11 @@ public class LarkRobotUtil {
 
     private static final String TIP_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/0eb8793a-5bb3-43d7-aa74-fed1c91e3d9b";
 
+    private static final String WE_COM_NOT_PUSH_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/6fa54ed6-12f7-45c1-a33b-020d4f4483ef";
+
+
+    private static final String AUTO_REPLY_VIDEO_URL = "https://open.feishu.cn/open-apis/bot/v2/hook/0d80b7dc-47d1-4c27-a7e1-97f2fb6ba26e";
+
     private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(3000, 10000, 20, 100, 3, 3000);
 
 
@@ -60,6 +65,29 @@ public class LarkRobotUtil {
         }
     }
 
+
+    public static void sendAutoReplyVideoMessage(JSONObject param) {
+        try {
+            HTTP_POOL_CLIENT_UTIL_DEFAULT.post(AUTO_REPLY_VIDEO_URL, param.toJSONString());
+        } catch (Exception e) {
+            log.error("Lark sendMessage error", e);
+        }
+    }
+
+    public static void sendNotPushMessage(String msg) {
+        try {
+            JSONObject param = new JSONObject();
+            param.put("msg_type", "text");
+            JSONObject content = new JSONObject();
+            content.put("text", msg);
+            param.put("content", content);
+            HTTP_POOL_CLIENT_UTIL_DEFAULT.post(WE_COM_NOT_PUSH_URL, param.toJSONString());
+        } catch (Exception e) {
+            log.error("Lark sendMessage error", e);
+        }
+    }
+
+
     private static String getSign(long timestamp) throws NoSuchAlgorithmException, InvalidKeyException {
         //把timestamp+"\n"+密钥当做签名字符串
         String stringToSign = timestamp + "\n" + SECRET;

+ 229 - 0
common-module/src/main/resources/mapper/AttachmentWithMsgResultMapper.xml

@@ -0,0 +1,229 @@
+<?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.growth.common.dao.mapper.AttachmentWithMsgResultMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.AttachmentWithMsgResult">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="attachment_id" jdbcType="BIGINT" property="attachmentId" />
+    <result column="msg_result_id" jdbcType="BIGINT" property="msgResultId" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </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, attachment_id, msg_result_id, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.AttachmentWithMsgResultExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_attachment_with_msg_result
+    <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 we_com_attachment_with_msg_result
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_attachment_with_msg_result
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.AttachmentWithMsgResultExample">
+    delete from we_com_attachment_with_msg_result
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.AttachmentWithMsgResult">
+    insert into we_com_attachment_with_msg_result (id, attachment_id, msg_result_id, 
+      create_time, update_time)
+    values (#{id,jdbcType=BIGINT}, #{attachmentId,jdbcType=BIGINT}, #{msgResultId,jdbcType=BIGINT}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.AttachmentWithMsgResult">
+    insert into we_com_attachment_with_msg_result
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="attachmentId != null">
+        attachment_id,
+      </if>
+      <if test="msgResultId != null">
+        msg_result_id,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="attachmentId != null">
+        #{attachmentId,jdbcType=BIGINT},
+      </if>
+      <if test="msgResultId != null">
+        #{msgResultId,jdbcType=BIGINT},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.AttachmentWithMsgResultExample" resultType="java.lang.Long">
+    select count(*) from we_com_attachment_with_msg_result
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_attachment_with_msg_result
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.attachmentId != null">
+        attachment_id = #{record.attachmentId,jdbcType=BIGINT},
+      </if>
+      <if test="record.msgResultId != null">
+        msg_result_id = #{record.msgResultId,jdbcType=BIGINT},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_attachment_with_msg_result
+    set id = #{record.id,jdbcType=BIGINT},
+      attachment_id = #{record.attachmentId,jdbcType=BIGINT},
+      msg_result_id = #{record.msgResultId,jdbcType=BIGINT},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.AttachmentWithMsgResult">
+    update we_com_attachment_with_msg_result
+    <set>
+      <if test="attachmentId != null">
+        attachment_id = #{attachmentId,jdbcType=BIGINT},
+      </if>
+      <if test="msgResultId != null">
+        msg_result_id = #{msgResultId,jdbcType=BIGINT},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.AttachmentWithMsgResult">
+    update we_com_attachment_with_msg_result
+    set attachment_id = #{attachmentId,jdbcType=BIGINT},
+      msg_result_id = #{msgResultId,jdbcType=BIGINT},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+
+  <insert id="insertList" parameterType="java.util.List">
+      insert IGNORE into we_com_attachment_with_msg_result
+      (
+      attachment_id,
+      msg_result_id
+      )
+      values
+      <foreach collection="list" item="item" separator=",">
+          (
+          #{item.attachmentId,jdbcType=BIGINT},
+          #{item.msgResultId,jdbcType=BIGINT}
+          )
+      </foreach>
+  </insert>
+</mapper>

+ 15 - 9
api-module/src/main/resources/mapper/CgiReplyBucketDataMapper.xml → common-module/src/main/resources/mapper/CgiReplyBucketDataMapper.xml

@@ -1,7 +1,7 @@
 <?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.CgiReplyBucketDataMapper">
-  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.CgiReplyBucketData">
+<mapper namespace="com.tzld.piaoquan.growth.common.dao.mapper.CgiReplyBucketDataMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="strategy" jdbcType="VARCHAR" property="strategy" />
     <result column="sort" jdbcType="INTEGER" property="sort" />
@@ -83,7 +83,7 @@
     mini_page_path, mini_video_id, page_path_url_id, news_publish_content_id, plan_id,
     is_delete, create_time, update_time
   </sql>
-  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.CgiReplyBucketDataExample" resultMap="BaseResultMap">
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample" resultMap="BaseResultMap">
     select
     <if test="distinct">
       distinct
@@ -107,13 +107,13 @@
     delete from cgi_reply_bucket_data
     where id = #{id,jdbcType=BIGINT}
   </delete>
-  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.CgiReplyBucketDataExample">
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample">
     delete from cgi_reply_bucket_data
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
-  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.CgiReplyBucketData">
+  <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
       SELECT LAST_INSERT_ID()
     </selectKey>
@@ -130,7 +130,7 @@
       #{planId,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
       #{updateTime,jdbcType=TIMESTAMP})
   </insert>
-  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.CgiReplyBucketData">
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
       SELECT LAST_INSERT_ID()
     </selectKey>
@@ -236,7 +236,7 @@
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.CgiReplyBucketDataExample" resultType="java.lang.Long">
+  <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample" resultType="java.lang.Long">
     select count(*) from cgi_reply_bucket_data
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
@@ -324,7 +324,7 @@
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.CgiReplyBucketData">
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
     update cgi_reply_bucket_data
     <set>
       <if test="strategy != null">
@@ -378,7 +378,7 @@
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.CgiReplyBucketData">
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
     update cgi_reply_bucket_data
     set strategy = #{strategy,jdbcType=VARCHAR},
       sort = #{sort,jdbcType=INTEGER},
@@ -398,4 +398,10 @@
       update_time = #{updateTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
+  <select id="selectVideoId" resultType="java.lang.Long">
+    select distinct mini_video_id
+    from cgi_reply_bucket_data
+    where is_delete = 0 and create_time > #{createTime,jdbcType=TIMESTAMP};
+  </select>
 </mapper>

+ 9 - 9
api-module/src/main/resources/mapper/GhDetailMapper.xml → common-module/src/main/resources/mapper/GhDetailMapper.xml

@@ -1,7 +1,7 @@
 <?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.GhDetailMapper">
-  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.GhDetail">
+<mapper namespace="com.tzld.piaoquan.growth.common.dao.mapper.GhDetailMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.GhDetail">
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="gh_id" jdbcType="VARCHAR" property="ghId" />
     <result column="gh_name" jdbcType="VARCHAR" property="ghName" />
@@ -78,7 +78,7 @@
     id, gh_id, gh_name, `type`, category1, category2, is_delete, create_time, update_time, 
     channel, video_ids, strategy_status, autoreply_send_minigram_num
   </sql>
-  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.GhDetailExample" resultMap="BaseResultMap">
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.GhDetailExample" resultMap="BaseResultMap">
     select
     <if test="distinct">
       distinct
@@ -105,13 +105,13 @@
     delete from gh_detail
     where id = #{id,jdbcType=BIGINT}
   </delete>
-  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.GhDetailExample">
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.GhDetailExample">
     delete from gh_detail
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
-  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.GhDetail">
+  <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.GhDetail">
     insert into gh_detail (id, gh_id, gh_name, 
       `type`, category1, category2, 
       is_delete, create_time, update_time, 
@@ -123,7 +123,7 @@
       #{channel,jdbcType=VARCHAR}, #{videoIds,jdbcType=VARCHAR}, #{strategyStatus,jdbcType=INTEGER}, 
       #{autoreplySendMinigramNum,jdbcType=INTEGER})
   </insert>
-  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.GhDetail">
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.GhDetail">
     insert into gh_detail
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -208,7 +208,7 @@
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.GhDetailExample" resultType="java.lang.Long">
+  <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.GhDetailExample" resultType="java.lang.Long">
     select count(*) from gh_detail
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
@@ -280,7 +280,7 @@
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.GhDetail">
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.GhDetail">
     update gh_detail
     <set>
       <if test="ghId != null">
@@ -322,7 +322,7 @@
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.GhDetail">
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.GhDetail">
     update gh_detail
     set gh_id = #{ghId,jdbcType=VARCHAR},
       gh_name = #{ghName,jdbcType=VARCHAR},

+ 42 - 7
common-module/src/main/resources/mapper/MessageAttachmentMapper.xml

@@ -6,8 +6,10 @@
     <result column="staff_id" jdbcType="BIGINT" property="staffId" />
     <result column="type" jdbcType="INTEGER" property="type" />
     <result column="url" jdbcType="VARCHAR" property="url" />
+    <result column="pic_url" jdbcType="VARCHAR" property="picUrl" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="desc" jdbcType="VARCHAR" property="desc" />
+    <result column="media_id" jdbcType="VARCHAR" property="mediaId" />
     <result column="appid" jdbcType="VARCHAR" property="appid" />
     <result column="page" jdbcType="VARCHAR" property="page" />
     <result column="cover" jdbcType="VARCHAR" property="cover" />
@@ -76,8 +78,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, staff_id, `type`, url, title, `desc`, appid, page, cover, miniprogram_video_id, 
-    is_delete, send_time, create_time, update_time
+    id, staff_id, `type`, url, pic_url, title, `desc`, media_id, appid, page, cover, 
+    miniprogram_video_id, is_delete, send_time, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.MessageAttachmentExample" resultMap="BaseResultMap">
     select
@@ -114,17 +116,19 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.MessageAttachment">
     insert into we_com_message_attachment (id, staff_id, `type`, 
-      url, title, `desc`, appid, 
+      url, pic_url, title, 
+      `desc`, media_id, appid, 
       page, cover, miniprogram_video_id, 
-      send_time, create_time,
+      is_delete, send_time, create_time, 
       update_time)
     values (#{id,jdbcType=BIGINT}, #{staffId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, 
-      #{url,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, #{appid,jdbcType=VARCHAR}, 
+      #{url,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, 
+      #{desc,jdbcType=VARCHAR}, #{mediaId,jdbcType=VARCHAR}, #{appid,jdbcType=VARCHAR}, 
       #{page,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, #{miniprogramVideoId,jdbcType=BIGINT}, 
-      #{sendTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
+      #{isDelete,jdbcType=INTEGER}, #{sendTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, 
       #{updateTime,jdbcType=TIMESTAMP})
   </insert>
-  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.MessageAttachment">
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.MessageAttachment" useGeneratedKeys="true" keyProperty="id">
     insert into we_com_message_attachment
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -139,12 +143,18 @@
       <if test="url != null">
         url,
       </if>
+      <if test="picUrl != null">
+        pic_url,
+      </if>
       <if test="title != null">
         title,
       </if>
       <if test="desc != null">
         `desc`,
       </if>
+      <if test="mediaId != null">
+        media_id,
+      </if>
       <if test="appid != null">
         appid,
       </if>
@@ -183,12 +193,18 @@
       <if test="url != null">
         #{url,jdbcType=VARCHAR},
       </if>
+      <if test="picUrl != null">
+        #{picUrl,jdbcType=VARCHAR},
+      </if>
       <if test="title != null">
         #{title,jdbcType=VARCHAR},
       </if>
       <if test="desc != null">
         #{desc,jdbcType=VARCHAR},
       </if>
+      <if test="mediaId != null">
+        #{mediaId,jdbcType=VARCHAR},
+      </if>
       <if test="appid != null">
         #{appid,jdbcType=VARCHAR},
       </if>
@@ -214,6 +230,9 @@
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
     </trim>
+    <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="id">
+      select LAST_INSERT_ID()
+    </selectKey>
   </insert>
   <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.MessageAttachmentExample" resultType="java.lang.Long">
     select count(*) from we_com_message_attachment
@@ -236,12 +255,18 @@
       <if test="record.url != null">
         url = #{record.url,jdbcType=VARCHAR},
       </if>
+      <if test="record.picUrl != null">
+        pic_url = #{record.picUrl,jdbcType=VARCHAR},
+      </if>
       <if test="record.title != null">
         title = #{record.title,jdbcType=VARCHAR},
       </if>
       <if test="record.desc != null">
         `desc` = #{record.desc,jdbcType=VARCHAR},
       </if>
+      <if test="record.mediaId != null">
+        media_id = #{record.mediaId,jdbcType=VARCHAR},
+      </if>
       <if test="record.appid != null">
         appid = #{record.appid,jdbcType=VARCHAR},
       </if>
@@ -277,8 +302,10 @@
       staff_id = #{record.staffId,jdbcType=BIGINT},
       `type` = #{record.type,jdbcType=INTEGER},
       url = #{record.url,jdbcType=VARCHAR},
+      pic_url = #{record.picUrl,jdbcType=VARCHAR},
       title = #{record.title,jdbcType=VARCHAR},
       `desc` = #{record.desc,jdbcType=VARCHAR},
+      media_id = #{record.mediaId,jdbcType=VARCHAR},
       appid = #{record.appid,jdbcType=VARCHAR},
       page = #{record.page,jdbcType=VARCHAR},
       cover = #{record.cover,jdbcType=VARCHAR},
@@ -303,12 +330,18 @@
       <if test="url != null">
         url = #{url,jdbcType=VARCHAR},
       </if>
+      <if test="picUrl != null">
+        pic_url = #{picUrl,jdbcType=VARCHAR},
+      </if>
       <if test="title != null">
         title = #{title,jdbcType=VARCHAR},
       </if>
       <if test="desc != null">
         `desc` = #{desc,jdbcType=VARCHAR},
       </if>
+      <if test="mediaId != null">
+        media_id = #{mediaId,jdbcType=VARCHAR},
+      </if>
       <if test="appid != null">
         appid = #{appid,jdbcType=VARCHAR},
       </if>
@@ -341,8 +374,10 @@
     set staff_id = #{staffId,jdbcType=BIGINT},
       `type` = #{type,jdbcType=INTEGER},
       url = #{url,jdbcType=VARCHAR},
+      pic_url = #{picUrl,jdbcType=VARCHAR},
       title = #{title,jdbcType=VARCHAR},
       `desc` = #{desc,jdbcType=VARCHAR},
+      media_id = #{mediaId,jdbcType=VARCHAR},
       appid = #{appid,jdbcType=VARCHAR},
       page = #{page,jdbcType=VARCHAR},
       cover = #{cover,jdbcType=VARCHAR},

+ 77 - 6
common-module/src/main/resources/mapper/SendMsgResultMapper.xml

@@ -12,6 +12,9 @@
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
   </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tzld.piaoquan.growth.common.model.po.SendMsgResult">
+    <result column="text_content" jdbcType="LONGVARCHAR" property="textContent" />
+  </resultMap>
   <sql id="Example_Where_Clause">
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -73,6 +76,28 @@
   <sql id="Base_Column_List">
     id, msg_id, user_id, staff_id, `status`, send_time, is_delete, create_time, update_time
   </sql>
+  <sql id="Blob_Column_List">
+    text_content
+  </sql>
+  <select id="selectByExampleWithBLOBs" parameterType="com.tzld.piaoquan.growth.common.model.po.SendMsgResultExample" resultMap="ResultMapWithBLOBs">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from we_com_send_msg_result
+    <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.growth.common.model.po.SendMsgResultExample" resultMap="BaseResultMap">
     select
     <if test="distinct">
@@ -90,9 +115,11 @@
       limit #{page.offset} , #{page.pageSize}
     </if>
   </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
     select 
     <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
     from we_com_send_msg_result
     where id = #{id,jdbcType=BIGINT}
   </select>
@@ -109,14 +136,14 @@
   <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.SendMsgResult">
     insert into we_com_send_msg_result (id, msg_id, user_id, 
       staff_id, `status`, send_time, 
-      is_delete, create_time, update_time
-      )
+      is_delete, create_time, update_time, 
+      text_content)
     values (#{id,jdbcType=BIGINT}, #{msgId,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, 
       #{staffId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{sendTime,jdbcType=TIMESTAMP}, 
-      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
-      )
+      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, 
+      #{textContent,jdbcType=LONGVARCHAR})
   </insert>
-  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.SendMsgResult">
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.SendMsgResult" useGeneratedKeys="true" keyProperty="id">
     insert into we_com_send_msg_result
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -146,6 +173,9 @@
       <if test="updateTime != null">
         update_time,
       </if>
+      <if test="textContent != null">
+        text_content,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -175,7 +205,13 @@
       <if test="updateTime != null">
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="textContent != null">
+        #{textContent,jdbcType=LONGVARCHAR},
+      </if>
     </trim>
+    <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="id">
+      select LAST_INSERT_ID()
+    </selectKey>
   </insert>
   <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.SendMsgResultExample" resultType="java.lang.Long">
     select count(*) from we_com_send_msg_result
@@ -213,11 +249,30 @@
       <if test="record.updateTime != null">
         update_time = #{record.updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="record.textContent != null">
+        text_content = #{record.textContent,jdbcType=LONGVARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
+  <update id="updateByExampleWithBLOBs" parameterType="map">
+    update we_com_send_msg_result
+    set id = #{record.id,jdbcType=BIGINT},
+      msg_id = #{record.msgId,jdbcType=VARCHAR},
+      user_id = #{record.userId,jdbcType=BIGINT},
+      staff_id = #{record.staffId,jdbcType=BIGINT},
+      `status` = #{record.status,jdbcType=INTEGER},
+      send_time = #{record.sendTime,jdbcType=TIMESTAMP},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      text_content = #{record.textContent,jdbcType=LONGVARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
   <update id="updateByExample" parameterType="map">
     update we_com_send_msg_result
     set id = #{record.id,jdbcType=BIGINT},
@@ -260,9 +315,25 @@
       <if test="updateTime != null">
         update_time = #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="textContent != null">
+        text_content = #{textContent,jdbcType=LONGVARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tzld.piaoquan.growth.common.model.po.SendMsgResult">
+    update we_com_send_msg_result
+    set msg_id = #{msgId,jdbcType=VARCHAR},
+      user_id = #{userId,jdbcType=BIGINT},
+      staff_id = #{staffId,jdbcType=BIGINT},
+      `status` = #{status,jdbcType=INTEGER},
+      send_time = #{sendTime,jdbcType=TIMESTAMP},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      text_content = #{textContent,jdbcType=LONGVARCHAR}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.SendMsgResult">
     update we_com_send_msg_result
     set msg_id = #{msgId,jdbcType=VARCHAR},

+ 261 - 0
common-module/src/main/resources/mapper/TagMapper.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.growth.common.dao.mapper.TagMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.Tag">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="tag_group_id" jdbcType="VARCHAR" property="tagGroupId" />
+    <result column="tag_group_name" jdbcType="VARCHAR" property="tagGroupName" />
+    <result column="tag_id" jdbcType="VARCHAR" property="tagId" />
+    <result column="tag_name" jdbcType="VARCHAR" property="tagName" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </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, tag_group_id, tag_group_name, tag_id, tag_name, is_delete, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.TagExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_tag
+    <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 we_com_tag
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_tag
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.TagExample">
+    delete from we_com_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.Tag">
+    insert into we_com_tag (id, tag_group_id, tag_group_name, 
+      tag_id, tag_name, is_delete, 
+      create_time, update_time)
+    values (#{id,jdbcType=BIGINT}, #{tagGroupId,jdbcType=VARCHAR}, #{tagGroupName,jdbcType=VARCHAR}, 
+      #{tagId,jdbcType=VARCHAR}, #{tagName,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.Tag">
+    insert into we_com_tag
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="tagGroupId != null">
+        tag_group_id,
+      </if>
+      <if test="tagGroupName != null">
+        tag_group_name,
+      </if>
+      <if test="tagId != null">
+        tag_id,
+      </if>
+      <if test="tagName != null">
+        tag_name,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="tagGroupId != null">
+        #{tagGroupId,jdbcType=VARCHAR},
+      </if>
+      <if test="tagGroupName != null">
+        #{tagGroupName,jdbcType=VARCHAR},
+      </if>
+      <if test="tagId != null">
+        #{tagId,jdbcType=VARCHAR},
+      </if>
+      <if test="tagName != null">
+        #{tagName,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.TagExample" resultType="java.lang.Long">
+    select count(*) from we_com_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_tag
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.tagGroupId != null">
+        tag_group_id = #{record.tagGroupId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.tagGroupName != null">
+        tag_group_name = #{record.tagGroupName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.tagId != null">
+        tag_id = #{record.tagId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.tagName != null">
+        tag_name = #{record.tagName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_tag
+    set id = #{record.id,jdbcType=BIGINT},
+      tag_group_id = #{record.tagGroupId,jdbcType=VARCHAR},
+      tag_group_name = #{record.tagGroupName,jdbcType=VARCHAR},
+      tag_id = #{record.tagId,jdbcType=VARCHAR},
+      tag_name = #{record.tagName,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.Tag">
+    update we_com_tag
+    <set>
+      <if test="tagGroupId != null">
+        tag_group_id = #{tagGroupId,jdbcType=VARCHAR},
+      </if>
+      <if test="tagGroupName != null">
+        tag_group_name = #{tagGroupName,jdbcType=VARCHAR},
+      </if>
+      <if test="tagId != null">
+        tag_id = #{tagId,jdbcType=VARCHAR},
+      </if>
+      <if test="tagName != null">
+        tag_name = #{tagName,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.Tag">
+    update we_com_tag
+    set tag_group_id = #{tagGroupId,jdbcType=VARCHAR},
+      tag_group_name = #{tagGroupName,jdbcType=VARCHAR},
+      tag_id = #{tagId,jdbcType=VARCHAR},
+      tag_name = #{tagName,jdbcType=VARCHAR},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 261 - 0
common-module/src/main/resources/mapper/UserCountMapper.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.growth.common.dao.mapper.UserCountMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.UserCount">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="staff_id" jdbcType="BIGINT" property="staffId" />
+    <result column="staff_name" jdbcType="VARCHAR" property="staffName" />
+    <result column="all_count" jdbcType="INTEGER" property="allCount" />
+    <result column="new_count" jdbcType="INTEGER" property="newCount" />
+    <result column="date" jdbcType="VARCHAR" property="date" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </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, staff_id, staff_name, all_count, new_count, `date`, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.UserCountExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_user_count
+    <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 we_com_user_count
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_user_count
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.UserCountExample">
+    delete from we_com_user_count
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.UserCount">
+    insert into we_com_user_count (id, staff_id, staff_name, 
+      all_count, new_count, `date`, 
+      create_time, update_time)
+    values (#{id,jdbcType=BIGINT}, #{staffId,jdbcType=BIGINT}, #{staffName,jdbcType=VARCHAR}, 
+      #{allCount,jdbcType=INTEGER}, #{newCount,jdbcType=INTEGER}, #{date,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.UserCount">
+    insert into we_com_user_count
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="staffId != null">
+        staff_id,
+      </if>
+      <if test="staffName != null">
+        staff_name,
+      </if>
+      <if test="allCount != null">
+        all_count,
+      </if>
+      <if test="newCount != null">
+        new_count,
+      </if>
+      <if test="date != null">
+        `date`,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="staffId != null">
+        #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="staffName != null">
+        #{staffName,jdbcType=VARCHAR},
+      </if>
+      <if test="allCount != null">
+        #{allCount,jdbcType=INTEGER},
+      </if>
+      <if test="newCount != null">
+        #{newCount,jdbcType=INTEGER},
+      </if>
+      <if test="date != null">
+        #{date,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.UserCountExample" resultType="java.lang.Long">
+    select count(*) from we_com_user_count
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_user_count
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.staffId != null">
+        staff_id = #{record.staffId,jdbcType=BIGINT},
+      </if>
+      <if test="record.staffName != null">
+        staff_name = #{record.staffName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.allCount != null">
+        all_count = #{record.allCount,jdbcType=INTEGER},
+      </if>
+      <if test="record.newCount != null">
+        new_count = #{record.newCount,jdbcType=INTEGER},
+      </if>
+      <if test="record.date != null">
+        `date` = #{record.date,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_user_count
+    set id = #{record.id,jdbcType=BIGINT},
+      staff_id = #{record.staffId,jdbcType=BIGINT},
+      staff_name = #{record.staffName,jdbcType=VARCHAR},
+      all_count = #{record.allCount,jdbcType=INTEGER},
+      new_count = #{record.newCount,jdbcType=INTEGER},
+      `date` = #{record.date,jdbcType=VARCHAR},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.UserCount">
+    update we_com_user_count
+    <set>
+      <if test="staffId != null">
+        staff_id = #{staffId,jdbcType=BIGINT},
+      </if>
+      <if test="staffName != null">
+        staff_name = #{staffName,jdbcType=VARCHAR},
+      </if>
+      <if test="allCount != null">
+        all_count = #{allCount,jdbcType=INTEGER},
+      </if>
+      <if test="newCount != null">
+        new_count = #{newCount,jdbcType=INTEGER},
+      </if>
+      <if test="date != null">
+        `date` = #{date,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.UserCount">
+    update we_com_user_count
+    set staff_id = #{staffId,jdbcType=BIGINT},
+      staff_name = #{staffName,jdbcType=VARCHAR},
+      all_count = #{allCount,jdbcType=INTEGER},
+      new_count = #{newCount,jdbcType=INTEGER},
+      `date` = #{date,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 231 - 0
common-module/src/main/resources/mapper/UserWithTagMapper.xml

@@ -0,0 +1,231 @@
+<?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.growth.common.dao.mapper.UserWithTagMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.UserWithTag">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="user_id" jdbcType="BIGINT" property="userId" />
+    <result column="tag_id" jdbcType="BIGINT" property="tagId" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </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, user_id, tag_id, is_delete, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTagExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from we_com_user_with_tag
+    <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 we_com_user_with_tag
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from we_com_user_with_tag
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTagExample">
+    delete from we_com_user_with_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTag">
+    insert into we_com_user_with_tag (id, user_id, tag_id, 
+      is_delete, create_time, update_time
+      )
+    values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{tagId,jdbcType=BIGINT}, 
+      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTag">
+    insert into we_com_user_with_tag
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="userId != null">
+        user_id,
+      </if>
+      <if test="tagId != null">
+        tag_id,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="userId != null">
+        #{userId,jdbcType=BIGINT},
+      </if>
+      <if test="tagId != null">
+        #{tagId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTagExample" resultType="java.lang.Long">
+    select count(*) from we_com_user_with_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update we_com_user_with_tag
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.userId != null">
+        user_id = #{record.userId,jdbcType=BIGINT},
+      </if>
+      <if test="record.tagId != null">
+        tag_id = #{record.tagId,jdbcType=BIGINT},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update we_com_user_with_tag
+    set id = #{record.id,jdbcType=BIGINT},
+      user_id = #{record.userId,jdbcType=BIGINT},
+      tag_id = #{record.tagId,jdbcType=BIGINT},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTag">
+    update we_com_user_with_tag
+    <set>
+      <if test="userId != null">
+        user_id = #{userId,jdbcType=BIGINT},
+      </if>
+      <if test="tagId != null">
+        tag_id = #{tagId,jdbcType=BIGINT},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.growth.common.model.po.UserWithTag">
+    update we_com_user_with_tag
+    set user_id = #{userId,jdbcType=BIGINT},
+      tag_id = #{tagId,jdbcType=BIGINT},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 30 - 0
common-module/src/main/resources/mapper/ext/WeComUserMapperExt.xml

@@ -0,0 +1,30 @@
+<?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.growth.common.dao.mapper.ext.WeComUserMapperExt">
+    <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.WeComUser">
+        <id column="id" jdbcType="BIGINT" property="id" />
+        <result column="corp_id" jdbcType="BIGINT" property="corpId" />
+        <result column="external_user_id" jdbcType="VARCHAR" property="externalUserId" />
+        <result column="union_id" jdbcType="VARCHAR" property="unionId" />
+        <result column="external_user_id_3rd_party" jdbcType="VARCHAR" property="externalUserId3rdParty" />
+        <result column="type" jdbcType="INTEGER" property="type" />
+        <result column="name" jdbcType="VARCHAR" property="name" />
+        <result column="avatar" jdbcType="VARCHAR" property="avatar" />
+        <result column="gender" jdbcType="INTEGER" property="gender" />
+        <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+        <result column="group_msg_disabled" jdbcType="TINYINT" property="groupMsgDisabled" />
+        <result column="created_at" jdbcType="BIGINT" property="createdAt" />
+        <result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
+        <result column="deleted_at" jdbcType="BIGINT" property="deletedAt" />
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    </resultMap>
+
+    <select id="getGroupSendUserByDate" resultMap="BaseResultMap">
+        select wcu.*
+        from we_com_user wcu
+        join we_com_send_message wcsm on wcsm.user_id = wcu.id
+        where wcu.group_msg_disabled > 0
+        and wcsm.create_time between #{start} and #{end}
+    </select>
+</mapper>

+ 224 - 0
offline-module/src/main/java/com/tzld/piaoquan/offline/job/AutoReplyVideoDataJob.java

@@ -0,0 +1,224 @@
+package com.tzld.piaoquan.offline.job;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
+import com.tzld.piaoquan.growth.common.common.enums.FieshuTableColumnDataTypeEnum;
+import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
+import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
+import com.tzld.piaoquan.growth.common.component.HttpPoolClient;
+import com.tzld.piaoquan.growth.common.dao.mapper.CgiReplyBucketDataMapper;
+import com.tzld.piaoquan.growth.common.dao.mapper.GhDetailMapper;
+import com.tzld.piaoquan.growth.common.model.bo.FeishuTableDTO;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
+import com.tzld.piaoquan.growth.common.model.po.GhDetail;
+import com.tzld.piaoquan.growth.common.model.po.GhDetailExample;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
+import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
+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.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Component
+public class AutoReplyVideoDataJob {
+
+    private static final List<String> auditGhIds = new ArrayList<String>() {{
+        add("gh_b63b9dde3f4b");
+        add("gh_330ef0db846d");
+        add("gh_330ef0db846d");
+        add("gh_e2318164f869");
+        add("gh_620af8e24fb9");
+        add("gh_620af8e24fb9");
+        add("gh_133c36b99b14");
+        add("gh_133c36b99b14");
+        add("gh_5ac72e2b9130");
+        add("gh_ef8ade0fad92");
+        add("gh_1e03b6de22bf");
+        add("gh_5538fe297e59");
+        add("gh_8c6fffcbaac1");
+        add("gh_8c6fffcbaac1");
+        add("gh_d0e830b7547e");
+        add("gh_fb234f4e32a5");
+        add("gh_84c5d01a61e7");
+        add("gh_87c4b8ae885e");
+        add("gh_29d8a63d5e5e");
+        add("gh_b144210318e5");
+        add("gh_b144210318e5");
+        add("gh_1f9bf4cfa788");
+        add("gh_4f47d12bbe04");
+        add("gh_8c6af276df98");
+        add("gh_1f16bc6ac60d");
+        add("gh_4920bc4c5720");
+        add("gh_5177a8c57917");
+        add("gh_5177a8c57917");
+        add("gh_5e3e6cd5e35c");
+        add("gh_5e3e6cd5e35c");
+        add("gh_d2c72bcc05c9");
+        add("gh_d2c72bcc05c9");
+        add("gh_5f2400da935c");
+        add("gh_5f2400da935c");
+        add("gh_669555ebea28");
+        add("gh_28ce883486c3");
+        add("gh_28ce883486c3");
+        add("gh_7057ef30222b");
+        add("gh_7057ef30222b");
+        add("gh_b0048adc0b46");
+        add("gh_6e61a2d5db85");
+        add("gh_01cd19465b39");
+        add("gh_01cd19465b39");
+        add("gh_126c99b39cea");
+        add("gh_4a1174e36ceb");
+        add("gh_f81c27eb8c48");
+        add("gh_f81c27eb8c48");
+        add("gh_3170dc15e246");
+        add("gh_1ccfb5620605");
+        add("gh_315be76a746d");
+        add("gh_4f47d12bbe04");
+        add("gh_4f47d12bbe04");
+        add("gh_4f47d12bbe04");
+    }};
+
+    private static final String VIDEO_DETAIL_URL = "https://longvideoapi.piaoquantv.com/longvideoapi/openapi/video/batchSelectVideoInfo";
+
+    private static final String REFRESH_GZH_URL = "http://aigc-api.cybertogether.net/aigc/publish/api/refreshGzhAutoReplyMsgData";
+
+
+    @Autowired
+    private CgiReplyBucketDataMapper cgiReplyBucketDataMapper;
+
+    @Autowired
+    private HttpPoolClient httpPoolClient;
+
+    @Autowired
+    private GhDetailMapper ghDetailMapper;
+
+
+    @XxlJob("validateAutoReplyVideoAuditStatusJob")
+    public ReturnT<String> validateAutoReplyVideoAuditStatus(String param) throws IOException {
+        Long beforeDayStart = DateUtil.getBeforeDayStart(7);
+        List<Long> videoIds = cgiReplyBucketDataMapper.selectVideoId(new Date(beforeDayStart));
+        if (CollectionUtils.isEmpty(videoIds)) {
+            return ReturnT.SUCCESS;
+        }
+        List<Long> auditFailedVideoIds = new ArrayList<>();
+        List<List<Long>> partition = Lists.partition(videoIds, 20);
+        for (List<Long> videoIdList : partition) {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("videoIdList", videoIdList);
+            String res = httpPoolClient.post(VIDEO_DETAIL_URL, jsonObject.toJSONString());
+            if (StringUtils.isEmpty(res)) {
+                continue;
+            }
+            JSONObject result = JSONObject.parseObject(res);
+            Integer code = result.getInteger("code");
+            if (code != 0) {
+                continue;
+            }
+            JSONArray jsonArray = result.getJSONArray("data");
+            for (int i = 0; i < jsonArray.size(); i++) {
+                JSONObject videoDetail = jsonArray.getJSONObject(i);
+                Integer auditStatus = videoDetail.getInteger("auditStatus");
+                Integer appAuditStatus = videoDetail.getInteger("appAuditStatus");
+                if (auditStatus != 5 || appAuditStatus != 5) {
+                    auditFailedVideoIds.add(videoDetail.getLong("id"));
+                }
+            }
+        }
+        if (CollectionUtils.isEmpty(auditFailedVideoIds)) {
+            return ReturnT.SUCCESS;
+        }
+
+        List<FeishuTableDTO.Column> columns = buildCheckPublishPlanAccountColumns();
+        List<JSONObject> rows = new ArrayList<>();
+
+        for (Long videoId : auditFailedVideoIds) {
+            CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
+            example.createCriteria().andMiniVideoIdEqualTo(videoId).andIsDeleteEqualTo(0)
+                    .andCreateTimeGreaterThan(new Date(beforeDayStart));
+            List<CgiReplyBucketData> cgiReplyBucketDataList = cgiReplyBucketDataMapper.selectByExample(example);
+//            List<String> ghIds = new ArrayList<>();
+//            List<String> manualGhIds = new ArrayList<>();
+            for (CgiReplyBucketData cgiReplyBucketData : cgiReplyBucketDataList) {
+                String ghId = cgiReplyBucketData.getGhId();
+                GhDetailExample ghDetailExample = new GhDetailExample();
+                ghDetailExample.createCriteria().andGhIdEqualTo(ghId);
+                List<GhDetail> ghDetails = ghDetailMapper.selectByExample(ghDetailExample);
+                if (CollectionUtils.isEmpty(ghDetails)) {
+                    continue;
+                }
+                GhDetail ghDetail = ghDetails.get(0);
+
+//                if (Objects.equals(cgiReplyBucketData.getStrategy(), "manual")) {
+//                    ghDetail1.setStrategyStatus(StrategyStatusEnum.STRATEGY.status);
+//                    ghDetailMapper.updateByPrimaryKeySelective(ghDetail1);
+//                    manualGhIds.add(cgiReplyBucketData.getGhId());
+//                }
+
+//                ghIds.add(cgiReplyBucketData.getGhId());
+                JSONObject row = new JSONObject();
+                row.put("name", ghDetail.getGhName());
+                row.put("channel", ghDetail.getChannel());
+                row.put("video", videoId);
+                row.put("ghId", ghDetail.getGhId());
+                rows.add(row);
+                try {
+                    if (auditGhIds.contains(ghId)) {
+                        String url = REFRESH_GZH_URL + "?ghId=" + cgiReplyBucketData.getGhId();
+                        String res = httpPoolClient.get(url);
+                        log.info("refresh ghId={}, res={}", cgiReplyBucketData.getGhId(), res);
+                    }
+                } catch (Exception e) {
+                    log.error("refresh error", e);
+                }
+
+            }
+        }
+
+        Map<String, JSONObject> collect = rows.stream()
+                .collect(Collectors.toMap(
+                        row -> row.getString("ghId") + "-" + row.getString("video"),
+                        row -> row,
+                        (existing, replacement) -> existing
+                ));
+        rows = new ArrayList<>(collect.values());
+
+
+        FeishuTableDTO tableDTO = FeishuTableDTO.createTable("自动回复视频审核失败报警", columns, rows, false);
+        JSONObject content = JSONObject.parseObject(JSONObject.toJSONString(tableDTO));
+        JSONObject bodyParam = new JSONObject();
+        bodyParam.put("msg_type", "interactive");
+        bodyParam.put("card", content);
+        LarkRobotUtil.sendAutoReplyVideoMessage(bodyParam);
+        return ReturnT.SUCCESS;
+    }
+
+
+    private List<FeishuTableDTO.Column> buildCheckPublishPlanAccountColumns() {
+        List<FeishuTableDTO.Column> columns = new ArrayList<>();
+        FeishuTableDTO.Column nameColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "name", "账号名称", null);
+        columns.add(nameColumn);
+        FeishuTableDTO.Column channelColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "channel", "渠道id", null);
+        columns.add(channelColumn);
+        FeishuTableDTO.Column videoColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "video", "审核不通过的视频id", null);
+        columns.add(videoColumn);
+        FeishuTableDTO.Column ghIdColumn = FeishuTableDTO.createFeishuColumns(
+                FieshuTableColumnDataTypeEnum.TEXT.getType(), "ghId", "ghId", null);
+        columns.add(ghIdColumn);
+        return columns;
+    }
+
+}

+ 1 - 1
offline-module/src/main/java/com/tzld/piaoquan/offline/job/PushMessageDataJob.java

@@ -85,7 +85,7 @@ public class PushMessageDataJob {
             if (mysqlCount == 0) {
                 break;
             }
-            String pt = DateUtil.getDateString(startTime.getTime());
+            String pt = DateUtil.getDateString(startTime.getTime(), "yyyyMMdd");
             String sql = String.format("SELECT count(*) FROM push_message_callback WHERE pt = %s;", pt);
             List<Record> recordList = odpsManager.query(sql);
             if (CollectionUtils.isEmpty(recordList)) {

+ 89 - 28
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComHistoryDataJob.java

@@ -77,6 +77,9 @@ public class WeComHistoryDataJob {
     @Autowired
     private SendMsgResultMapper sendMsgResultMapper;
 
+    @Autowired
+    private AttachmentWithMsgResultMapper attachmentWithMsgResultMapper;
+
 
     @XxlJob("saveHistoryMessageJob")
     public ReturnT<String> selectHistoryMessageByDay(String param) {
@@ -152,13 +155,12 @@ public class WeComHistoryDataJob {
             }
             stringBuilder.append(sendDetail.getRemark());
             long count = sendCountList.get(0) + sendCountList.get(1) + sendCountList.get(2) + sendCountList.get(3);
-            Long notSentCount = sendCountList.get(0);
-            if (notSentCount != 0) {
-                LarkRobotUtil.sendMessage("@薛一鸣 存在未发送记录,请检查");
+            if (count != 0 && count == sendCountList.get(0)) {
+                LarkRobotUtil.sendMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
                 if (sendDetail.getStaffId() == 3) {
-                    LarkRobotUtil.sendTipMessage("@王钧灏 存在未发送记录,请检查");
+                    LarkRobotUtil.sendTipMessage(sendDetail.getRemark() + "存在未发送记录,请检查");
                 } else {
-                    LarkRobotUtil.sendTipMessage("@孟庆红 存在未发送记录,请检查");
+                    LarkRobotUtil.sendNotPushMessage("<at user_id=\"all\">所有人</at> " + sendDetail.getRemark() + " 存在未发送记录,请检查");
                 }
             }
             stringBuilder.append("总发送数量:").append(count).append("   ");
@@ -193,35 +195,66 @@ public class WeComHistoryDataJob {
                     JSONObject groupMsg = groupMsgList.getJSONObject(i);
                     JSONArray attachments = groupMsg.getJSONArray("attachments");
                     String msgId = groupMsg.getString("msgid");
+                    String textContent = Optional.ofNullable(groupMsg.getJSONObject("text"))
+                            .map(textObj -> textObj.getString("content"))
+                            .orElse(null);
                     Long createTime = null;
                     if (groupMsg.getLong("create_time") != null) {
                         createTime = groupMsg.getLong("create_time") * 1000;
                     }
+
                     List<MiniprogramRecord> miniprogramRecordList = new ArrayList<>();
                     List<MessageAttachment> messageAttachmentList = new ArrayList<>();
                     if (!CollectionUtils.isEmpty(attachments)) {
                         for (int j = 0; j < attachments.size(); j++) {
-                            JSONObject miniprogram = attachments.getJSONObject(j).getJSONObject("miniprogram");
-                            if (miniprogram == null) {
-                                continue;
-                            }
-                            MiniprogramRecord miniprogramRecord = new MiniprogramRecord();
                             MessageAttachment messageAttachment = new MessageAttachment();
-                            String title = miniprogram.getString("title");
-                            String appid = miniprogram.getString("appid");
-                            String page = miniprogram.getString("page");
-                            Long videoId = MessageUtil.getVideoId(page);
-
-                            miniprogramRecord.setVideoId(videoId);
-                            miniprogramRecord.setAttachmentIdx(j + 1);
-                            miniprogramRecordList.add(miniprogramRecord);
-
-                            messageAttachment.setAppid(appid);
-                            messageAttachment.setPage(page);
-                            messageAttachment.setTitle(title);
-                            messageAttachment.setMiniprogramVideoId(videoId);
-                            messageAttachment.setType(MessageAttachmentTypeEnum.MINI_PROGRAM.getType());
-                            messageAttachmentList.add(messageAttachment);
+                            String msgtype = attachments.getJSONObject(j).getString("msgtype");
+                            if (Objects.equals(MessageAttachmentTypeEnum.IMAGE.getType(), msgtype)) {
+                                JSONObject image = attachments.getJSONObject(j)
+                                        .getJSONObject(MessageAttachmentTypeEnum.IMAGE.getType());
+                                messageAttachment.setMediaId(image.getString("media_id"));
+                                messageAttachment.setPicUrl(image.getString("pic_url"));
+                                messageAttachment.setType(MessageAttachmentTypeEnum.IMAGE.getCode());
+                                messageAttachmentList.add(messageAttachment);
+                            }
+
+                            if (Objects.equals(MessageAttachmentTypeEnum.LINK.getType(), msgtype)) {
+                                JSONObject link = attachments.getJSONObject(j)
+                                        .getJSONObject(MessageAttachmentTypeEnum.LINK.getType());
+
+                                messageAttachment.setTitle(link.getString("title"));
+                                messageAttachment.setPicUrl(link.getString("picurl"));
+                                messageAttachment.setDesc(link.getString("desc"));
+                                messageAttachment.setUrl(link.getString("url"));
+                                messageAttachment.setType(MessageAttachmentTypeEnum.LINK.getCode());
+                                messageAttachmentList.add(messageAttachment);
+
+                            }
+
+                            if (Objects.equals(MessageAttachmentTypeEnum.MINI_PROGRAM.getType(), msgtype)) {
+                                JSONObject miniprogram = attachments.getJSONObject(j)
+                                        .getJSONObject(MessageAttachmentTypeEnum.MINI_PROGRAM.getType());
+                                if (miniprogram == null) {
+                                    continue;
+                                }
+                                MiniprogramRecord miniprogramRecord = new MiniprogramRecord();
+
+                                String title = miniprogram.getString("title");
+                                String appid = miniprogram.getString("appid");
+                                String page = miniprogram.getString("page");
+                                Long videoId = MessageUtil.getVideoId(page);
+
+                                miniprogramRecord.setVideoId(videoId);
+                                miniprogramRecord.setAttachmentIdx(j + 1);
+                                miniprogramRecordList.add(miniprogramRecord);
+
+                                messageAttachment.setAppid(appid);
+                                messageAttachment.setPage(page);
+                                messageAttachment.setTitle(title);
+                                messageAttachment.setMiniprogramVideoId(videoId);
+                                messageAttachment.setType(MessageAttachmentTypeEnum.MINI_PROGRAM.getCode());
+                                messageAttachmentList.add(messageAttachment);
+                            }
                         }
                     }
                     List<String> carrierIdList = selectGroupMsgTask(msgId, corpId);
@@ -246,13 +279,16 @@ public class WeComHistoryDataJob {
                         if (CollectionUtils.isEmpty(externalUsers)) {
                             continue;
                         }
+                        List<Long> attachmentIds = new ArrayList<>();
                         if (!CollectionUtils.isEmpty(messageAttachmentList)) {
                             for (MessageAttachment messageAttachment : messageAttachmentList) {
                                 messageAttachment.setStaffId(staffList.get(0).getId());
                             }
-                            messageAttachmentService.addMiniProgram(messageAttachmentList, createTime);
+                            attachmentIds = messageAttachmentService
+                                    .addMessageAttachment(messageAttachmentList, createTime);
                         }
-                        insertHistoryMessageList(msgId, staffList.get(0), externalUsers, miniprogramRecordList, createTime, corpId, startTime, endTime);
+                        insertHistoryMessageList(msgId, staffList.get(0), externalUsers, miniprogramRecordList,
+                                createTime, corpId, startTime, endTime, attachmentIds, textContent);
                     }
                 }
                 String nextCursor = jsonObject.getString("next_cursor");
@@ -369,7 +405,8 @@ public class WeComHistoryDataJob {
 
     private void insertHistoryMessageList(String msgId, Staff staff, List<ExternalUser> externalUsers,
                                           List<MiniprogramRecord> miniprogramRecordList,
-                                          Long createTime, Long corpId, Long startTime, Long endTime) {
+                                          Long createTime, Long corpId, Long startTime, Long endTime,
+                                          List<Long> attachmentIds, String textContent) {
         if (CollectionUtils.isEmpty(externalUsers)) {
             return;
         }
@@ -384,6 +421,7 @@ public class WeComHistoryDataJob {
         Long sendTime = externalUsers.stream()
                 .map(ExternalUser::getSendTime).filter(Objects::nonNull).findFirst().orElse(null);
         List<HistoryMessage> historyMessageList = new ArrayList<>();
+        List<Long> sendMsgResultIds = new ArrayList<>();
         for (ExternalUser externalUser : externalUsers) {
             Long userId = weComUserMapper.selectIdByExternalUserId(externalUser.getExternalUserId());
             if (userId == null) {
@@ -400,12 +438,14 @@ public class WeComHistoryDataJob {
                 SendMsgResult sendMsgResult = new SendMsgResult();
                 sendMsgResult.setMsgId(msgId);
                 sendMsgResult.setUserId(userId);
+                sendMsgResult.setTextContent(textContent);
                 sendMsgResult.setStaffId(staff.getId());
                 if (sendTime != null) {
                     sendMsgResult.setSendTime(new Date(sendTime));
                 }
                 sendMsgResult.setStatus(status);
                 sendMsgResultMapper.insertSelective(sendMsgResult);
+                sendMsgResultIds.add(sendMsgResult.getId());
             } else {
                 SendMsgResult sendMsgResult = sendMsgResults.get(0);
                 if (sendTime != null) {
@@ -413,6 +453,7 @@ public class WeComHistoryDataJob {
                 }
                 sendMsgResult.setStatus(status);
                 sendMsgResultMapper.updateByPrimaryKeySelective(sendMsgResult);
+                sendMsgResultIds.add(sendMsgResult.getId());
             }
             //小程序发送历史
             if (!CollectionUtils.isEmpty(miniprogramRecordList)) {
@@ -444,6 +485,26 @@ public class WeComHistoryDataJob {
             }
         }
         historyMessageService.batchInsertHistoryMessage(historyMessageList);
+        insertAttachmentWithMsgResult(attachmentIds, sendMsgResultIds);
+    }
+
+    private void insertAttachmentWithMsgResult(List<Long> attachmentIds, List<Long> sendMsgResultIds) {
+        if (CollectionUtils.isEmpty(attachmentIds) || CollectionUtils.isEmpty(sendMsgResultIds)) {
+            return;
+        }
+        List<AttachmentWithMsgResult> list = new ArrayList<>();
+        for (Long attachmentId : attachmentIds) {
+            for (Long sendMsgResultId : sendMsgResultIds) {
+                AttachmentWithMsgResult attachmentWithMsgResult = new AttachmentWithMsgResult();
+                attachmentWithMsgResult.setAttachmentId(attachmentId);
+                attachmentWithMsgResult.setMsgResultId(sendMsgResultId);
+                list.add(attachmentWithMsgResult);
+            }
+        }
+        List<List<AttachmentWithMsgResult>> partition = Lists.partition(list, 2000);
+        for (List<AttachmentWithMsgResult> AttachmentWithMsgResults : partition) {
+            attachmentWithMsgResultMapper.insertList(AttachmentWithMsgResults);
+        }
     }
 
     private String getGroupMsgList(Long startTime, Long endTime, String cursor, Long corpId) throws IOException {

+ 2 - 1
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComMessageDataJob.java

@@ -238,7 +238,8 @@ public class WeComMessageDataJob {
         init(staffIds);
         for (Corp corp : corps) {
             WeComUserExample weComUserExample = new WeComUserExample();
-            weComUserExample.createCriteria().andExternalUserIdIsNotNull().andCorpIdEqualTo(corp.getId()).andGroupMsgDisabledEqualTo((byte) 0);
+            weComUserExample.createCriteria().andExternalUserIdIsNotNull().andCorpIdEqualTo(corp.getId())
+                    .andGroupMsgDisabledNotEqualTo((byte) 2);
             if (xxlJobParam.getUserId() != null) {
                 weComUserExample.createCriteria().andIdEqualTo(xxlJobParam.getUserId());
             }

+ 187 - 4
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComUserDataJob.java

@@ -3,14 +3,12 @@ package com.tzld.piaoquan.offline.job;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.tzld.piaoquan.growth.common.component.HttpPoolClient;
-import com.tzld.piaoquan.growth.common.dao.mapper.CorpMapper;
-import com.tzld.piaoquan.growth.common.dao.mapper.StaffMapper;
-import com.tzld.piaoquan.growth.common.dao.mapper.StaffWithUserMapper;
-import com.tzld.piaoquan.growth.common.dao.mapper.WeComUserMapper;
+import com.tzld.piaoquan.growth.common.dao.mapper.*;
 import com.tzld.piaoquan.growth.common.model.bo.XxlJobParam;
 import com.tzld.piaoquan.growth.common.model.po.*;
 import com.tzld.piaoquan.growth.common.service.WeComAccessTokenService;
 import com.tzld.piaoquan.growth.common.service.WeComUserService;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
 import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
@@ -21,7 +19,9 @@ import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 import static com.tzld.piaoquan.growth.common.common.constant.WeComConstant.*;
@@ -51,6 +51,15 @@ public class WeComUserDataJob {
     @Autowired
     private CorpMapper corpMapper;
 
+    @Autowired
+    private UserCountMapper userCountMapper;
+
+    @Autowired
+    private TagMapper tagMapper;
+
+    @Autowired
+    private UserWithTagMapper userWithTagMapper;
+
     @XxlJob("updateStaffWithUserJob")
     public ReturnT<String> updateStaffWithUser(String param) {
         XxlJobParam xxlJobParam = new XxlJobParam();
@@ -229,4 +238,178 @@ public class WeComUserDataJob {
         }
         return null;
     }
+
+    @XxlJob("statisticsUserCountJob")
+    public ReturnT<String> statisticsUserCount(String param) throws IOException {
+        refreshTag();
+        StaffExample staffExample = new StaffExample();
+        List<Staff> staffList = staffMapper.selectByExample(staffExample);
+        String date;
+        if (StringUtils.isEmpty(param)) {
+            date = DateUtil.getBeforeDayDateString1();
+        } else {
+            date = param;
+        }
+        for (Staff staff : staffList) {
+            Map<String, Integer> userCountRes = getUserList(staff, 1L, date);
+            if (userCountRes == null || userCountRes.get("count") == 0) {
+                continue;
+            }
+            UserCountExample userCountExample = new UserCountExample();
+            userCountExample.createCriteria().andStaffIdEqualTo(staff.getId()).andDateEqualTo(date);
+            List<UserCount> userCounts = userCountMapper.selectByExample(userCountExample);
+            if (CollectionUtils.isEmpty(userCounts)) {
+                UserCount userCount = new UserCount();
+                userCount.setStaffId(staff.getId());
+                userCount.setStaffName(staff.getRemark());
+                userCount.setAllCount(userCountRes.get("count"));
+                userCount.setNewCount(userCountRes.get("newCount"));
+                userCount.setDate(date);
+                userCountMapper.insertSelective(userCount);
+            } else {
+                UserCount userCount = userCounts.get(0);
+                userCount.setAllCount(userCountRes.get("count"));
+                userCount.setNewCount(userCountRes.get("newCount"));
+                userCountMapper.updateByPrimaryKeySelective(userCount);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+
+    private Map<String, Integer> getUserList(Staff staff, Long corpId, String date) {
+        Map<String, Integer> result = new HashMap<>();
+        int count = 0;
+        int newCount = 0;
+        try {
+            String cursor = "";
+            do {
+                String res = getUserDetailList(staff.getCarrierId(), cursor, corpId);
+                log.info("getUserList res={} cursor={}", res, cursor);
+                JSONObject jsonObject = JSONObject.parseObject(res);
+                Integer errCode = jsonObject.getInteger("errcode");
+                if (errCode != 0) {
+                    log.error("getUserList error carrierId={} cursor={}", staff.getCarrierId(), cursor);
+                    return null;
+                }
+                JSONArray externalContactList = jsonObject.getJSONArray("external_contact_list");
+                for (int i = 0; i < externalContactList.size(); i++) {
+                    JSONObject externalContact = externalContactList.getJSONObject(i).getJSONObject("external_contact");
+                    String externalUserId = externalContact.getString("external_userid");
+                    JSONObject followInfo = externalContactList.getJSONObject(i).getJSONObject("follow_info");
+                    Long createAt = followInfo.getLong("createtime");
+                    String dateString = DateUtil.getDateString(createAt * 1000, "yyyy-MM-dd");
+                    if (dateString.equals(date)) {
+                        newCount++;
+                    }
+                    count++;
+                    JSONArray tagIds = followInfo.getJSONArray("tag_id");
+                    Long userId = weComUserMapper.selectIdByExternalUserId(externalUserId);
+                    if (userId == null) {
+                        String name = externalContact.getString("name");
+                        String unionId = externalContact.getString("unionid");
+                        String avatar = externalContact.getString("avatar");
+                        Integer type = externalContact.getInteger("type");
+                        Integer gender = externalContact.getInteger("gender");
+                        WeComUser weComUser = new WeComUser();
+                        weComUser.setExternalUserId(externalUserId);
+                        weComUser.setName(name);
+                        weComUser.setType(type);
+                        weComUser.setUnionId(unionId);
+                        weComUser.setGender(gender);
+                        weComUser.setAvatar(avatar);
+                        weComUser.setCreatedAt(createAt);
+                        weComUserMapper.insertSelective(weComUser);
+                        userId = weComUser.getId();
+                        StaffWithUser staffWithUser = new StaffWithUser();
+                        staffWithUser.setStaffId(staff.getId());
+                        staffWithUser.setUserId(userId);
+                        staffWithUserMapper.insert(staffWithUser);
+                    }
+
+                    if (!tagIds.isEmpty()) {
+                        List<String> tagIdList = tagIds.toJavaList(String.class);
+                        for (String tagId : tagIdList) {
+                            TagExample example = new TagExample();
+                            example.createCriteria().andTagIdEqualTo(tagId);
+                            List<Tag> tags = tagMapper.selectByExample(example);
+                            if (!CollectionUtils.isEmpty(tags)) {
+                                Tag tag = tags.get(0);
+                                UserWithTag userWithTag = new UserWithTag();
+                                userWithTag.setUserId(userId);
+                                userWithTag.setTagId(tag.getId());
+                                addUserWithTag(userWithTag);
+                            }
+                        }
+                    }
+                }
+                String nextCursor = jsonObject.getString("next_cursor");
+                if (cursor.equals(nextCursor)) {
+                    break;
+                }
+                cursor = nextCursor;
+            } while (StringUtils.isNotEmpty(cursor));
+        } catch (IOException e) {
+            log.error("getUserList error", e);
+        }
+        result.put("count", count);
+        result.put("newCount", newCount);
+        return result;
+    }
+
+
+    public void refreshTag() throws IOException {
+        String weComAccessToken = weComAccessTokenService.getWeComAccessToken(1L);
+        String url = String.format(POST_CORP_TAG_LIST + "?access_token=%s", weComAccessToken);
+        String res = httpPoolClient.post(url);
+        JSONObject jsonObject = JSONObject.parseObject(res);
+        Integer errcode = jsonObject.getInteger("errcode");
+        if (errcode == 0) {
+            JSONArray tagGroup = jsonObject.getJSONArray("tag_group");
+            if (!tagGroup.isEmpty()) {
+                for (int i = 0; i < tagGroup.size(); i++) {
+                    JSONObject tagGroupJSONObject = tagGroup.getJSONObject(i);
+                    String groupId = tagGroupJSONObject.getString("group_id");
+                    String groupName = tagGroupJSONObject.getString("group_name");
+                    JSONArray tags = tagGroupJSONObject.getJSONArray("tag");
+                    if (tags.isEmpty()) {
+                        continue;
+                    }
+                    for (int j = 0; j < tags.size(); j++) {
+                        JSONObject tagsJSONObject = tags.getJSONObject(j);
+                        String tagId = tagsJSONObject.getString("id");
+                        String tagName = tagsJSONObject.getString("name");
+                        Tag tag = new Tag();
+                        tag.setTagGroupId(groupId);
+                        tag.setTagGroupName(groupName);
+                        tag.setTagId(tagId);
+                        tag.setTagName(tagName);
+                        addAndUpdateTag(tag);
+                    }
+                }
+            }
+        }
+    }
+
+    private void addAndUpdateTag(Tag tag) {
+        TagExample example = new TagExample();
+        example.createCriteria().andTagGroupIdEqualTo(tag.getTagGroupId()).andTagIdEqualTo(tag.getTagId());
+        List<Tag> tags = tagMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(tags)) {
+            tagMapper.insertSelective(tag);
+        } else {
+            tag.setId(tags.get(0).getId());
+            tagMapper.updateByPrimaryKeySelective(tag);
+        }
+    }
+
+    private void addUserWithTag(UserWithTag userWithTag) {
+        UserWithTagExample userWithTagExample = new UserWithTagExample();
+        userWithTagExample.createCriteria().andUserIdEqualTo(userWithTag.getUserId()).andTagIdEqualTo(userWithTag.getTagId());
+        long l = userWithTagMapper.countByExample(userWithTagExample);
+        if (l == 0) {
+            userWithTagMapper.insertSelective(userWithTag);
+        }
+    }
+
 }

+ 8 - 0
pom.xml

@@ -173,6 +173,14 @@
             <artifactId>ons-client</artifactId>
             <version>1.8.4.Final</version>
         </dependency>
+        
+        <!-- https://mvnrepository.com/artifact/com.ctrip.framework.apollo/apollo-client -->
+        <dependency>
+            <groupId>com.ctrip.framework.apollo</groupId>
+            <artifactId>apollo-client</artifactId>
+            <version>2.0.0</version>
+        </dependency>
+
     </dependencies>
 
 </project>