ソースを参照

Merge branch '20250619-wyp-gzhVideoDatastat' of Server/growth-manager into master

wangyunpeng 3 週間 前
コミット
4a93eaf2fc
20 ファイル変更1413 行追加19 行削除
  1. 8 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformDatastatController.java
  2. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/MybatisGeneratorMain.java
  3. 30 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformGzhVideoDataStatMapper.java
  4. 17 6
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.java
  5. 63 0
      api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformDatastatJob.java
  6. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhDatastatListParam.java
  7. 101 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhVideoDataStat.java
  8. 711 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhVideoDataStatExample.java
  9. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwDataStat.java
  10. 70 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwDataStatExample.java
  11. 6 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhDatastatItemVO.java
  12. 3 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhPlanVideoContentItemVO.java
  13. 5 2
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwDatastatItemExportVO.java
  14. 3 2
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwPlanItemVO.java
  15. 45 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformDatastatServiceImpl.java
  16. 18 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java
  17. 261 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhVideoDataStatMapper.xml
  18. 20 5
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwDataStatMapper.xml
  19. 37 0
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.xml
  20. 1 0
      api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml

+ 8 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformDatastatController.java

@@ -56,6 +56,14 @@ public class ContentPlatformDatastatController {
         return CommonResponse.success();
     }
 
+    @ApiOperation(value = "公众号自动回复分账号分视频数据统计同步任务", hidden = true)
+    @GetMapping("/job/syncGzhVideoDatastat")
+    @JwtIgnore
+    public CommonResponse<String> syncContentPlatformGzhVideoDatastatJob(String dateStr) {
+        job.syncContentPlatformGzhVideoDatastatJob(dateStr);
+        return CommonResponse.success();
+    }
+
     @ApiOperation(value = "公众号自动回复总计数据统计同步任务", hidden = true)
     @GetMapping("/job/syncGzhDatastatTotal")
     @JwtIgnore

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/MybatisGeneratorMain.java

@@ -20,9 +20,9 @@ public class MybatisGeneratorMain {
             throws SQLException, IOException, InterruptedException, InvalidConfigurationException, XMLParserException {
         List<String> warnings = new ArrayList<>();
 
-        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-generator-config.xml").getFile());
+//        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-generator-config.xml").getFile());
 //        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-generator-config.xml").getFile());
-//        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-contentPlatform-generator-config.xml").getFile());
+        File configFile = new File(MybatisGeneratorMain.class.getResource("/mybatis-api-contentPlatform-generator-config.xml").getFile());
         ConfigurationParser cp = new ConfigurationParser(warnings);
         Configuration config = cp.parseConfiguration(configFile);
         DefaultShellCallback callback = new DefaultShellCallback(true);

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

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

+ 17 - 6
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.java

@@ -16,12 +16,19 @@ public interface ContentPlatformDataStatMapperExt {
                                                                @Param("offset") int offset,
                                                                @Param("pageSize") Integer pageSize);
 
+    int getGzhAccountVideoDatastatCount(@Param("param") GzhDatastatListParam param, @Param("createAccountId") Long createAccountId);
+
+    List<ContentPlatformGzhVideoDataStat> getGzhAccountVideoDatastatList(@Param("param") GzhDatastatListParam param,
+                                                                         @Param("createAccountId") Long createAccountId,
+                                                                         @Param("offset") int offset,
+                                                                         @Param("pageSize") Integer pageSize);
+
     Integer getGzhTotalDatastatCount(@Param("param") GzhDatastatListParam param, @Param("createAccountId") Long createAccountId);
 
     List<ContentPlatformGzhDataStatTotal> getGzhTotalDatastatList(@Param("param") GzhDatastatListParam param,
-                                                             @Param("createAccountId") Long createAccountId,
-                                                             @Param("offset") int offset,
-                                                             @Param("pageSize") Integer pageSize);
+                                                                  @Param("createAccountId") Long createAccountId,
+                                                                  @Param("offset") int offset,
+                                                                  @Param("pageSize") Integer pageSize);
 
     int getFwhAccountDatastatCount(@Param("param") GzhDatastatListParam param, @Param("createAccountId") Long createAccountId);
 
@@ -33,9 +40,9 @@ public interface ContentPlatformDataStatMapperExt {
     Integer getFwhTotalDatastatCount(@Param("param") GzhDatastatListParam param, @Param("createAccountId") Long createAccountId);
 
     List<ContentPlatformFwhDataStatTotal> getFwhTotalDatastatList(@Param("param") GzhDatastatListParam param,
-                                                             @Param("createAccountId") Long createAccountId,
-                                                             @Param("offset") int offset,
-                                                             @Param("pageSize") Integer pageSize);
+                                                                  @Param("createAccountId") Long createAccountId,
+                                                                  @Param("offset") int offset,
+                                                                  @Param("pageSize") Integer pageSize);
 
     Integer getQwRootSourceIdDatastatCount(@Param("param") QwDatastatListParam param, @Param("createAccountId") Long createAccountId);
 
@@ -84,6 +91,8 @@ public interface ContentPlatformDataStatMapperExt {
 
     void batchInsertGzhDatastat(@Param("records") List<ContentPlatformGzhDataStat> saveList);
 
+    void batchInsertGzhVideoDatastat(@Param("records") List<ContentPlatformGzhVideoDataStat> saveList);
+
     void batchInsertGzhDatastatTotal(@Param("records") List<ContentPlatformGzhDataStatTotal> saveList);
 
     void batchInsertFwhDatastat(@Param("records") List<ContentPlatformFwhDataStat> saveList);
@@ -111,4 +120,6 @@ public interface ContentPlatformDataStatMapperExt {
     void deleteGzhDatastatTotal(@Param("dt") String dt);
 
     void deleteFwhDatastatTotal(@Param("dt") String dt);
+
+    void deleteGzhVideoDatastat(@Param("dt") String dt);
 }

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

@@ -128,6 +128,57 @@ public class ContentPlatformDatastatJob {
         return ReturnT.SUCCESS;
     }
 
+    @XxlJob("syncContentPlatformGzhVideoDatastatJob")
+    public ReturnT<String> syncContentPlatformGzhVideoDatastatJob(String param) {
+        String dt = DateUtil.getBeforeDayDateString("yyyyMMdd");
+        if (StringUtils.hasText(param)) {
+            dt = param;
+        }
+        // 公众号自动回复分视频数据统计
+        String sql = String.format("SELECT ghid, video_id, video_title, first_uv, split0_uv " +
+                "FROM loghubods.auto_reply_per_video WHERE dt = %s;", dt);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        // 所有公众号
+        List<ContentPlatformGzhAccount> accountList = getAllGzhAccount();
+        Map<String, ContentPlatformGzhAccount> accountMap = accountList.stream()
+                .collect(Collectors.toMap(ContentPlatformGzhAccount::getGhId, account -> account));
+        List<String> ghIds = accountList.stream().map(ContentPlatformGzhAccount::getGhId).collect(Collectors.toList());
+        Long now = System.currentTimeMillis();
+        if (CollectionUtils.isNotEmpty(dataList)) {
+            List<ContentPlatformGzhVideoDataStat> saveList = new ArrayList<>();
+            for (Record record : dataList) {
+                ContentPlatformGzhVideoDataStat item = new ContentPlatformGzhVideoDataStat();
+                String ghId = (String) record.get(0);
+                Long videoId = parseLong(record.get(1));
+                String title = (String) record.get(2);
+                int firstLevelCount = Integer.parseInt((String) record.get(3));
+                Integer fissionCount = parseInteger(record.get(4));
+                item.setDateStr(dt);
+                if (!ghIds.contains(ghId) || videoId == 0) {
+                    continue;
+                }
+                ContentPlatformGzhAccount gzhAccount = accountMap.get(ghId);
+                item.setAccountId(gzhAccount.getId());
+                item.setVideoId(videoId);
+                item.setTitle(title);
+                item.setFirstLevelCount(firstLevelCount);
+
+                if (fissionCount > 0 && firstLevelCount > 0) {
+                    BigDecimal num = BigDecimal.valueOf(fissionCount.doubleValue() * 10 / firstLevelCount);
+                    BigDecimal rounded = num.setScale(2, RoundingMode.HALF_UP);
+                    item.setScore(rounded.doubleValue());
+                }
+                item.setCreateTimestamp(now);
+                saveList.add(item);
+            }
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                dataStatMapperExt.deleteGzhVideoDatastat(dt);
+                dataStatMapperExt.batchInsertGzhVideoDatastat(saveList);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
     @XxlJob("syncContentPlatformGzhDatastatTotalJob")
     public ReturnT<String> syncContentPlatformGzhDatastatTotalJob(String param) {
         String dt = DateUtil.getBeforeDayDateString("yyyyMMdd");
@@ -399,6 +450,8 @@ public class ContentPlatformDatastatJob {
         if (CollectionUtils.isEmpty(qwPlanList)) {
             return ReturnT.SUCCESS;
         }
+        Map<Long, ContentPlatformQwPlan> planMap = qwPlanList.stream()
+                .collect(Collectors.toMap(ContentPlatformQwPlan::getId, plan -> plan));
         List<ContentPlatformQwDataStat> existList = getQwDatastatCount(dt);
         List<String> existRootSourceIds = existList.stream().map(ContentPlatformQwDataStat::getRootSourceId)
                 .collect(Collectors.toList());
@@ -433,6 +486,8 @@ public class ContentPlatformDatastatJob {
                 }
                 item.setDateStr(dt);
                 Long planId = rootSourceIdMap.get(rootSourceId);
+                ContentPlatformQwPlan qwPlan = planMap.get(planId);
+                item.setSubChannel(StringUtils.hasText(qwPlan.getSubChannel()) ? qwPlan.getSubChannel() : "未知");
                 Long videoId = planVideoMap.get(planId);
                 Double score = videoScoreMap.get(videoId);
                 if (Objects.nonNull(score)) {
@@ -765,6 +820,14 @@ public class ContentPlatformDatastatJob {
         }
     }
 
+    private Long parseLong(Object value) {
+        try {
+            return Long.parseLong((String) value);
+        } catch (NumberFormatException e) {
+            return 0L;
+        }
+    }
+
     private Double parseDouble(Object value) {
         try {
             return Double.parseDouble((String) value);

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhDatastatListParam.java

@@ -7,7 +7,7 @@ import lombok.Data;
 @Data
 public class GzhDatastatListParam extends PageParam {
 
-    @ApiModelProperty(value = "0-自动回复总计 1-自动回复分账号 2-服务号总计 3-服务号分账号")
+    @ApiModelProperty(value = "0-自动回复总计 1-自动回复分账号 2-服务号总计 3-服务号分账号 4-自动回复分账号分视频")
     private Integer type;
 
     @ApiModelProperty(value = "公众号id")

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

@@ -0,0 +1,101 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+public class ContentPlatformGzhVideoDataStat {
+    private Long id;
+
+    private String dateStr;
+
+    private Long accountId;
+
+    private Long videoId;
+
+    private String title;
+
+    private Integer firstLevelCount;
+
+    private Double score;
+
+    private Long createTimestamp;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDateStr() {
+        return dateStr;
+    }
+
+    public void setDateStr(String dateStr) {
+        this.dateStr = dateStr;
+    }
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public Integer getFirstLevelCount() {
+        return firstLevelCount;
+    }
+
+    public void setFirstLevelCount(Integer firstLevelCount) {
+        this.firstLevelCount = firstLevelCount;
+    }
+
+    public Double getScore() {
+        return score;
+    }
+
+    public void setScore(Double score) {
+        this.score = score;
+    }
+
+    public Long getCreateTimestamp() {
+        return createTimestamp;
+    }
+
+    public void setCreateTimestamp(Long createTimestamp) {
+        this.createTimestamp = createTimestamp;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", dateStr=").append(dateStr);
+        sb.append(", accountId=").append(accountId);
+        sb.append(", videoId=").append(videoId);
+        sb.append(", title=").append(title);
+        sb.append(", firstLevelCount=").append(firstLevelCount);
+        sb.append(", score=").append(score);
+        sb.append(", createTimestamp=").append(createTimestamp);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,711 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ContentPlatformGzhVideoDataStatExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public ContentPlatformGzhVideoDataStatExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrIsNull() {
+            addCriterion("date_str is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrIsNotNull() {
+            addCriterion("date_str is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrEqualTo(String value) {
+            addCriterion("date_str =", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotEqualTo(String value) {
+            addCriterion("date_str <>", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrGreaterThan(String value) {
+            addCriterion("date_str >", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrGreaterThanOrEqualTo(String value) {
+            addCriterion("date_str >=", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrLessThan(String value) {
+            addCriterion("date_str <", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrLessThanOrEqualTo(String value) {
+            addCriterion("date_str <=", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrLike(String value) {
+            addCriterion("date_str like", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotLike(String value) {
+            addCriterion("date_str not like", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrIn(List<String> values) {
+            addCriterion("date_str in", values, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotIn(List<String> values) {
+            addCriterion("date_str not in", values, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrBetween(String value1, String value2) {
+            addCriterion("date_str between", value1, value2, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotBetween(String value1, String value2) {
+            addCriterion("date_str not between", value1, value2, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNull() {
+            addCriterion("account_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNotNull() {
+            addCriterion("account_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdEqualTo(Long value) {
+            addCriterion("account_id =", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotEqualTo(Long value) {
+            addCriterion("account_id <>", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThan(Long value) {
+            addCriterion("account_id >", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("account_id >=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThan(Long value) {
+            addCriterion("account_id <", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThanOrEqualTo(Long value) {
+            addCriterion("account_id <=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIn(List<Long> values) {
+            addCriterion("account_id in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotIn(List<Long> values) {
+            addCriterion("account_id not in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdBetween(Long value1, Long value2) {
+            addCriterion("account_id between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotBetween(Long value1, Long value2) {
+            addCriterion("account_id not between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNull() {
+            addCriterion("video_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNotNull() {
+            addCriterion("video_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdEqualTo(Long value) {
+            addCriterion("video_id =", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotEqualTo(Long value) {
+            addCriterion("video_id <>", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThan(Long value) {
+            addCriterion("video_id >", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("video_id >=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThan(Long value) {
+            addCriterion("video_id <", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThanOrEqualTo(Long value) {
+            addCriterion("video_id <=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIn(List<Long> values) {
+            addCriterion("video_id in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotIn(List<Long> values) {
+            addCriterion("video_id not in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdBetween(Long value1, Long value2) {
+            addCriterion("video_id between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotBetween(Long value1, Long value2) {
+            addCriterion("video_id not between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIsNull() {
+            addCriterion("title is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIsNotNull() {
+            addCriterion("title is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleEqualTo(String value) {
+            addCriterion("title =", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotEqualTo(String value) {
+            addCriterion("title <>", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleGreaterThan(String value) {
+            addCriterion("title >", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleGreaterThanOrEqualTo(String value) {
+            addCriterion("title >=", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLessThan(String value) {
+            addCriterion("title <", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLessThanOrEqualTo(String value) {
+            addCriterion("title <=", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLike(String value) {
+            addCriterion("title like", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotLike(String value) {
+            addCriterion("title not like", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIn(List<String> values) {
+            addCriterion("title in", values, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotIn(List<String> values) {
+            addCriterion("title not in", values, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleBetween(String value1, String value2) {
+            addCriterion("title between", value1, value2, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotBetween(String value1, String value2) {
+            addCriterion("title not between", value1, value2, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountIsNull() {
+            addCriterion("first_level_count is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountIsNotNull() {
+            addCriterion("first_level_count is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountEqualTo(Integer value) {
+            addCriterion("first_level_count =", value, "firstLevelCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountNotEqualTo(Integer value) {
+            addCriterion("first_level_count <>", value, "firstLevelCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountGreaterThan(Integer value) {
+            addCriterion("first_level_count >", value, "firstLevelCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountGreaterThanOrEqualTo(Integer value) {
+            addCriterion("first_level_count >=", value, "firstLevelCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountLessThan(Integer value) {
+            addCriterion("first_level_count <", value, "firstLevelCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountLessThanOrEqualTo(Integer value) {
+            addCriterion("first_level_count <=", value, "firstLevelCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountIn(List<Integer> values) {
+            addCriterion("first_level_count in", values, "firstLevelCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountNotIn(List<Integer> values) {
+            addCriterion("first_level_count not in", values, "firstLevelCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountBetween(Integer value1, Integer value2) {
+            addCriterion("first_level_count between", value1, value2, "firstLevelCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andFirstLevelCountNotBetween(Integer value1, Integer value2) {
+            addCriterion("first_level_count not between", value1, value2, "firstLevelCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIsNull() {
+            addCriterion("score is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIsNotNull() {
+            addCriterion("score is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreEqualTo(Double value) {
+            addCriterion("score =", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotEqualTo(Double value) {
+            addCriterion("score <>", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreGreaterThan(Double value) {
+            addCriterion("score >", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreGreaterThanOrEqualTo(Double value) {
+            addCriterion("score >=", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreLessThan(Double value) {
+            addCriterion("score <", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreLessThanOrEqualTo(Double value) {
+            addCriterion("score <=", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIn(List<Double> values) {
+            addCriterion("score in", values, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotIn(List<Double> values) {
+            addCriterion("score not in", values, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreBetween(Double value1, Double value2) {
+            addCriterion("score between", value1, value2, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotBetween(Double value1, Double value2) {
+            addCriterion("score not between", value1, value2, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNull() {
+            addCriterion("create_timestamp is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNotNull() {
+            addCriterion("create_timestamp is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampEqualTo(Long value) {
+            addCriterion("create_timestamp =", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotEqualTo(Long value) {
+            addCriterion("create_timestamp <>", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThan(Long value) {
+            addCriterion("create_timestamp >", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp >=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThan(Long value) {
+            addCriterion("create_timestamp <", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp <=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIn(List<Long> values) {
+            addCriterion("create_timestamp in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotIn(List<Long> values) {
+            addCriterion("create_timestamp not in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp not between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

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

@@ -7,6 +7,8 @@ public class ContentPlatformQwDataStat {
 
     private String rootSourceId;
 
+    private String subChannel;
+
     private Integer firstLevelCount;
 
     private Double score;
@@ -37,6 +39,14 @@ public class ContentPlatformQwDataStat {
         this.rootSourceId = rootSourceId;
     }
 
+    public String getSubChannel() {
+        return subChannel;
+    }
+
+    public void setSubChannel(String subChannel) {
+        this.subChannel = subChannel;
+    }
+
     public Integer getFirstLevelCount() {
         return firstLevelCount;
     }
@@ -70,6 +80,7 @@ public class ContentPlatformQwDataStat {
         sb.append(", id=").append(id);
         sb.append(", dateStr=").append(dateStr);
         sb.append(", rootSourceId=").append(rootSourceId);
+        sb.append(", subChannel=").append(subChannel);
         sb.append(", firstLevelCount=").append(firstLevelCount);
         sb.append(", score=").append(score);
         sb.append(", createTimestamp=").append(createTimestamp);

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

@@ -315,6 +315,76 @@ public class ContentPlatformQwDataStatExample {
             return (Criteria) this;
         }
 
+        public Criteria andSubChannelIsNull() {
+            addCriterion("sub_channel is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelIsNotNull() {
+            addCriterion("sub_channel is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelEqualTo(String value) {
+            addCriterion("sub_channel =", value, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelNotEqualTo(String value) {
+            addCriterion("sub_channel <>", value, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelGreaterThan(String value) {
+            addCriterion("sub_channel >", value, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelGreaterThanOrEqualTo(String value) {
+            addCriterion("sub_channel >=", value, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelLessThan(String value) {
+            addCriterion("sub_channel <", value, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelLessThanOrEqualTo(String value) {
+            addCriterion("sub_channel <=", value, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelLike(String value) {
+            addCriterion("sub_channel like", value, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelNotLike(String value) {
+            addCriterion("sub_channel not like", value, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelIn(List<String> values) {
+            addCriterion("sub_channel in", values, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelNotIn(List<String> values) {
+            addCriterion("sub_channel not in", values, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelBetween(String value1, String value2) {
+            addCriterion("sub_channel between", value1, value2, "subChannel");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubChannelNotBetween(String value1, String value2) {
+            addCriterion("sub_channel not between", value1, value2, "subChannel");
+            return (Criteria) this;
+        }
+
         public Criteria andFirstLevelCountIsNull() {
             addCriterion("first_level_count is null");
             return (Criteria) this;

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

@@ -15,6 +15,12 @@ public class GzhDatastatItemVO {
     @ApiModelProperty(value = "公众号ghId")
     private String ghId;
 
+    @ApiModelProperty(value = "videoId")
+    private Long videoId;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
     @ApiModelProperty(value = "新增粉丝数")
     private Integer fansIncreaseCount;
 

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

@@ -18,6 +18,9 @@ public class GzhPlanVideoContentItemVO {
     @ApiModelProperty(value = "封面")
     private String cover;
 
+    @ApiModelProperty(value = "分享封面")
+    private String shareCover;
+
     @ApiModelProperty(value = "自定义封面")
     private String customCover;
 

+ 5 - 2
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwDatastatItemExportVO.java

@@ -19,12 +19,15 @@ public class QwDatastatItemExportVO {
     @ExcelProperty("日期")
     private String dateStr;
 
-    @ExcelProperty("传播得分")
-    private Double score;
+    @ExcelProperty("子渠道")
+    private String subChannel;
 
     @ExcelProperty("视频标题")
     private String title;
 
     @ExcelProperty("视频id")
     private Long videoId;
+
+    @ExcelProperty("本渠道裂变率")
+    private Double score;
 }

+ 3 - 2
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwPlanItemVO.java

@@ -3,8 +3,6 @@ package com.tzld.piaoquan.api.model.vo.contentplatform;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.util.List;
-
 @Data
 public class QwPlanItemVO {
 
@@ -26,6 +24,9 @@ public class QwPlanItemVO {
     @ApiModelProperty(value = "封面")
     private String cover;
 
+    @ApiModelProperty(value = "分享封面")
+    private String shareCover;
+
     @ApiModelProperty(value = "视频url")
     private String video;
 

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

@@ -43,6 +43,8 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
                 return gzhTotalDatastatList(param);
             case 1:
                 return gzhAccountDatastatList(param);
+            case 4:
+                return gzhAccountVideoDatastatList(param);
             case 2:
                 return fwhTotalDatastatList(param);
             case 3:
@@ -107,6 +109,47 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
         return result;
     }
 
+    private Page<GzhDatastatItemVO> gzhAccountVideoDatastatList(GzhDatastatListParam param) {
+        ContentPlatformAccount user = LoginUserContext.getUser();
+        Page<GzhDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        int count = dataStatMapperExt.getGzhAccountVideoDatastatCount(param, user.getId());
+        result.setTotalSize(count);
+        if (count == 0) {
+            return result;
+        }
+        List<ContentPlatformGzhVideoDataStat> datastatList = dataStatMapperExt.getGzhAccountVideoDatastatList(param,
+                user.getId(), offset, param.getPageSize());
+        List<GzhDatastatItemVO> list = buildGzhVideoDatastatItemVOList(datastatList);
+        result.setObjs(list);
+        return result;
+    }
+
+    private List<GzhDatastatItemVO> buildGzhVideoDatastatItemVOList(List<ContentPlatformGzhVideoDataStat> datastatList) {
+        if (CollectionUtils.isEmpty(datastatList)) {
+            return null;
+        }
+        List<Long> accountIds = datastatList.stream().map(ContentPlatformGzhVideoDataStat::getAccountId).distinct().collect(Collectors.toList());
+        List<ContentPlatformGzhAccount> accountList = cooperateAccountService.getAccountListByIds(accountIds);
+        Map<Long, ContentPlatformGzhAccount> accountMap = accountList.stream().collect(Collectors.toMap(ContentPlatformGzhAccount::getId, a -> a));
+        List<GzhDatastatItemVO> result = new ArrayList<>();
+        for (ContentPlatformGzhVideoDataStat datastat : datastatList) {
+            GzhDatastatItemVO vo = new GzhDatastatItemVO();
+            vo.setDateStr(datastat.getDateStr());
+            ContentPlatformGzhAccount account = accountMap.get(datastat.getAccountId());
+            if (Objects.nonNull(account)) {
+                vo.setName(account.getName());
+                vo.setGhId(account.getGhId());
+            }
+            vo.setVideoId(datastat.getVideoId());
+            vo.setTitle(datastat.getTitle());
+            vo.setFirstLevel(datastat.getFirstLevelCount());
+            vo.setScore(datastat.getScore());
+            result.add(vo);
+        }
+        return result;
+    }
+
     private Page<GzhDatastatItemVO> fwhTotalDatastatList(GzhDatastatListParam param) {
         ContentPlatformAccount user = LoginUserContext.getUser();
         Page<GzhDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
@@ -337,6 +380,7 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
         for (ContentPlatformQwDataStat datastat : datastatList) {
             QwDatastatItemVO vo = new QwDatastatItemVO();
             vo.setDateStr(datastat.getDateStr());
+            vo.setSubChannel(datastat.getSubChannel());
             vo.setFirstLevel(datastat.getFirstLevelCount());
             if (Objects.nonNull(datastat.getScore())) {
                 BigDecimal num = BigDecimal.valueOf(datastat.getScore());
@@ -424,7 +468,7 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
         ArrayList<QwDatastatItemExportVO> list = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(dataList)) {
             for (QwDatastatItemVO data : dataList) {
-                list.add(new QwDatastatItemExportVO(data.getDateStr(), data.getScore(), data.getTitle(), data.getVideoId()));
+                list.add(new QwDatastatItemExportVO(data.getDateStr(), data.getSubChannel(), data.getTitle(), data.getVideoId(), data.getScore()));
             }
         } else {
             list.add(new QwDatastatItemExportVO());

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

@@ -173,6 +173,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                             videoItemVO.setPageUrl(bucketData.getMiniPagePath());
                         }
                     }
+                    videoItemVO.setShareCover(getShareCover(ContentPlatformPlanService.getVideoCover(video)));
                     videoVOList.add(videoItemVO);
                 }
                 planItemVO.setVideoList(videoVOList);
@@ -613,11 +614,28 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 planItemVO.setCover(videoItem.getCover());
                 planItemVO.setVideo(videoItem.getVideo());
             }
+            planItemVO.setShareCover(getShareCover(planItemVO.getCover()));
             result.add(planItemVO);
         }
         return result;
     }
 
+    private String getShareCover(String cover) {
+        if (!StringUtils.hasText(cover)) {
+            return "";
+        }
+        if (cover.contains("?")) {
+            cover = cover.substring(0, cover.indexOf("?"));
+        }
+        // 裁剪
+        cover = cover + "?x-oss-process=image/resize,m_fill,w_600,h_480,limit_0/format,jpg";
+        // 水印
+        if (cover.contains("yishihui")) {
+            cover = cover + "/watermark,image_eXNoL3BpYy93YXRlcm1hcmtlci9pY29uX3BsYXlfd2hpdGUucG5nP3gtb3NzLXByb2Nlc3M9aW1hZ2UvcmVzaXplLHdfMTQ0,g_center";
+        }
+        return cover;
+    }
+
     @Override
     public List<ContentPlatformQwPlanVideo> getQwPlanVideoList(List<Long> planIds) {
         ContentPlatformQwPlanVideoExample example = new ContentPlatformQwPlanVideoExample();

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

@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhVideoDataStatMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhVideoDataStat">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="date_str" jdbcType="VARCHAR" property="dateStr" />
+    <result column="account_id" jdbcType="BIGINT" property="accountId" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="first_level_count" jdbcType="INTEGER" property="firstLevelCount" />
+    <result column="score" jdbcType="DOUBLE" property="score" />
+    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, date_str, account_id, video_id, title, first_level_count, score, create_timestamp
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhVideoDataStatExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from content_platform_gzh_video_datastat
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from content_platform_gzh_video_datastat
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from content_platform_gzh_video_datastat
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhVideoDataStatExample">
+    delete from content_platform_gzh_video_datastat
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhVideoDataStat">
+    insert into content_platform_gzh_video_datastat (id, date_str, account_id, 
+      video_id, title, first_level_count, 
+      score, create_timestamp)
+    values (#{id,jdbcType=BIGINT}, #{dateStr,jdbcType=VARCHAR}, #{accountId,jdbcType=BIGINT}, 
+      #{videoId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR}, #{firstLevelCount,jdbcType=INTEGER}, 
+      #{score,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhVideoDataStat">
+    insert into content_platform_gzh_video_datastat
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="dateStr != null">
+        date_str,
+      </if>
+      <if test="accountId != null">
+        account_id,
+      </if>
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="title != null">
+        title,
+      </if>
+      <if test="firstLevelCount != null">
+        first_level_count,
+      </if>
+      <if test="score != null">
+        score,
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="dateStr != null">
+        #{dateStr,jdbcType=VARCHAR},
+      </if>
+      <if test="accountId != null">
+        #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="title != null">
+        #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="firstLevelCount != null">
+        #{firstLevelCount,jdbcType=INTEGER},
+      </if>
+      <if test="score != null">
+        #{score,jdbcType=DOUBLE},
+      </if>
+      <if test="createTimestamp != null">
+        #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhVideoDataStatExample" resultType="java.lang.Long">
+    select count(*) from content_platform_gzh_video_datastat
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update content_platform_gzh_video_datastat
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.dateStr != null">
+        date_str = #{record.dateStr,jdbcType=VARCHAR},
+      </if>
+      <if test="record.accountId != null">
+        account_id = #{record.accountId,jdbcType=BIGINT},
+      </if>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.title != null">
+        title = #{record.title,jdbcType=VARCHAR},
+      </if>
+      <if test="record.firstLevelCount != null">
+        first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
+      </if>
+      <if test="record.score != null">
+        score = #{record.score,jdbcType=DOUBLE},
+      </if>
+      <if test="record.createTimestamp != null">
+        create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update content_platform_gzh_video_datastat
+    set id = #{record.id,jdbcType=BIGINT},
+      date_str = #{record.dateStr,jdbcType=VARCHAR},
+      account_id = #{record.accountId,jdbcType=BIGINT},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      title = #{record.title,jdbcType=VARCHAR},
+      first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
+      score = #{record.score,jdbcType=DOUBLE},
+      create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhVideoDataStat">
+    update content_platform_gzh_video_datastat
+    <set>
+      <if test="dateStr != null">
+        date_str = #{dateStr,jdbcType=VARCHAR},
+      </if>
+      <if test="accountId != null">
+        account_id = #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="title != null">
+        title = #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="firstLevelCount != null">
+        first_level_count = #{firstLevelCount,jdbcType=INTEGER},
+      </if>
+      <if test="score != null">
+        score = #{score,jdbcType=DOUBLE},
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhVideoDataStat">
+    update content_platform_gzh_video_datastat
+    set date_str = #{dateStr,jdbcType=VARCHAR},
+      account_id = #{accountId,jdbcType=BIGINT},
+      video_id = #{videoId,jdbcType=BIGINT},
+      title = #{title,jdbcType=VARCHAR},
+      first_level_count = #{firstLevelCount,jdbcType=INTEGER},
+      score = #{score,jdbcType=DOUBLE},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 20 - 5
api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwDataStatMapper.xml

@@ -5,6 +5,7 @@
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="date_str" jdbcType="VARCHAR" property="dateStr" />
     <result column="root_source_id" jdbcType="VARCHAR" property="rootSourceId" />
+    <result column="sub_channel" jdbcType="VARCHAR" property="subChannel" />
     <result column="first_level_count" jdbcType="INTEGER" property="firstLevelCount" />
     <result column="score" jdbcType="DOUBLE" property="score" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
@@ -68,7 +69,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, date_str, root_source_id, first_level_count, score, create_timestamp
+    id, date_str, root_source_id, sub_channel, first_level_count, score, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatExample" resultMap="BaseResultMap">
     select
@@ -105,11 +106,11 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
     insert into content_platform_qw_datastat (id, date_str, root_source_id, 
-      first_level_count, score, create_timestamp
-      )
+      sub_channel, first_level_count, score, 
+      create_timestamp)
     values (#{id,jdbcType=BIGINT}, #{dateStr,jdbcType=VARCHAR}, #{rootSourceId,jdbcType=VARCHAR}, 
-      #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT}
-      )
+      #{subChannel,jdbcType=VARCHAR}, #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, 
+      #{createTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
     insert into content_platform_qw_datastat
@@ -123,6 +124,9 @@
       <if test="rootSourceId != null">
         root_source_id,
       </if>
+      <if test="subChannel != null">
+        sub_channel,
+      </if>
       <if test="firstLevelCount != null">
         first_level_count,
       </if>
@@ -143,6 +147,9 @@
       <if test="rootSourceId != null">
         #{rootSourceId,jdbcType=VARCHAR},
       </if>
+      <if test="subChannel != null">
+        #{subChannel,jdbcType=VARCHAR},
+      </if>
       <if test="firstLevelCount != null">
         #{firstLevelCount,jdbcType=INTEGER},
       </if>
@@ -172,6 +179,9 @@
       <if test="record.rootSourceId != null">
         root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
       </if>
+      <if test="record.subChannel != null">
+        sub_channel = #{record.subChannel,jdbcType=VARCHAR},
+      </if>
       <if test="record.firstLevelCount != null">
         first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
       </if>
@@ -191,6 +201,7 @@
     set id = #{record.id,jdbcType=BIGINT},
       date_str = #{record.dateStr,jdbcType=VARCHAR},
       root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
+      sub_channel = #{record.subChannel,jdbcType=VARCHAR},
       first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
       score = #{record.score,jdbcType=DOUBLE},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
@@ -207,6 +218,9 @@
       <if test="rootSourceId != null">
         root_source_id = #{rootSourceId,jdbcType=VARCHAR},
       </if>
+      <if test="subChannel != null">
+        sub_channel = #{subChannel,jdbcType=VARCHAR},
+      </if>
       <if test="firstLevelCount != null">
         first_level_count = #{firstLevelCount,jdbcType=INTEGER},
       </if>
@@ -223,6 +237,7 @@
     update content_platform_qw_datastat
     set date_str = #{dateStr,jdbcType=VARCHAR},
       root_source_id = #{rootSourceId,jdbcType=VARCHAR},
+      sub_channel = #{subChannel,jdbcType=VARCHAR},
       first_level_count = #{firstLevelCount,jdbcType=INTEGER},
       score = #{score,jdbcType=DOUBLE},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}

+ 37 - 0
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.xml

@@ -25,6 +25,29 @@
         limit #{offset}, #{pageSize}
     </select>
 
+    <select id="getGzhAccountVideoDatastatCount" resultType="java.lang.Integer">
+        select count(1)
+        from content_platform_gzh_video_datastat cpgvd
+        join content_platform_gzh_account cpgza on cpgvd.account_id = cpgza.id
+        where cpgza.create_account_id = #{createAccountId}
+        <if test="param.accountId!= null and param.accountId!= ''">
+            and cpgza.account_id = #{param.accountId}
+        </if>
+    </select>
+
+    <select id="getGzhAccountVideoDatastatList"
+            resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhVideoDataStat">
+        select cpgvd.*
+        from content_platform_gzh_video_datastat cpgvd
+        join content_platform_gzh_account cpgza on cpgvd.account_id = cpgza.id
+        where cpgza.create_account_id = #{createAccountId}
+        <if test="param.accountId!= null and param.accountId!= ''">
+            and cpgza.account_id = #{param.accountId}
+        </if>
+        order by cpgvd.date_str desc
+        limit #{offset}, #{pageSize}
+    </select>
+
     <select id="getGzhTotalDatastatCount" resultType="java.lang.Integer">
         select count(1)
         from content_platform_gzh_datastat_total cpgdt
@@ -198,6 +221,16 @@
         </foreach>
     </insert>
 
+    <insert id="batchInsertGzhVideoDatastat">
+        insert into content_platform_gzh_video_datastat (date_str, account_id, video_id, title, first_level_count,
+                                                         score, create_timestamp)
+        values
+        <foreach collection="records" item="item" separator=",">
+            (#{item.dateStr}, #{item.accountId}, #{item.videoId}, #{item.title}, #{item.firstLevelCount}, #{item.score},
+            #{item.createTimestamp})
+        </foreach>
+    </insert>
+
     <insert id="batchInsertGzhDatastatTotal">
         insert into content_platform_gzh_datastat_total (date_str, channel, fans_increase_count, first_level_count, score,
         unit_price, settlement_amount, create_timestamp)
@@ -304,4 +337,8 @@
         delete from content_platform_fwh_datastat_total where date_str = #{dt}
     </delete>
 
+    <delete id="deleteGzhVideoDatastat">
+        delete from content_platform_gzh_video_datastat where date_str = #{dt}
+    </delete>
+
 </mapper>

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

@@ -53,6 +53,7 @@
         <table tableName="content_platform_account" domainObjectName="ContentPlatformAccount" alias=""/>
         <table tableName="content_platform_gzh_account" domainObjectName="ContentPlatformGzhAccount" alias=""/>
         <table tableName="content_platform_gzh_datastat" domainObjectName="ContentPlatformGzhDataStat" alias=""/>
+        <table tableName="content_platform_gzh_video_datastat" domainObjectName="ContentPlatformGzhVideoDataStat" alias=""/>
         <table tableName="content_platform_gzh_datastat_total" domainObjectName="ContentPlatformGzhDataStatTotal" alias=""/>
         <table tableName="content_platform_fwh_datastat" domainObjectName="ContentPlatformFwhDataStat" alias=""/>
         <table tableName="content_platform_fwh_datastat_total" domainObjectName="ContentPlatformFwhDataStatTotal" alias=""/>