Bläddra i källkod

Merge branch '20250609-wyp-price' of Server/growth-manager into master

wangyunpeng 1 månad sedan
förälder
incheckning
135b80c0ea
34 ändrade filer med 1190 tillägg och 118 borttagningar
  1. 2 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/ExceptionEnum.java
  2. 35 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/BussinessTypeEnum.java
  3. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/dao/generator/MybatisGeneratorMain.java
  4. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.java
  5. 190 63
      api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformDatastatJob.java
  6. 4 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/AccountListParam.java
  7. 2 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/AccountSaveParam.java
  8. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformAccount.java
  9. 70 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformAccountExample.java
  10. 22 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformFwhDataStatTotal.java
  11. 120 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformFwhDataStatTotalExample.java
  12. 22 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhDataStatTotal.java
  13. 120 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhDataStatTotalExample.java
  14. 22 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwDataStatSubChannel.java
  15. 120 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwDataStatSubChannelExample.java
  16. 22 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwDataStatTotal.java
  17. 120 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwDataStatTotalExample.java
  18. 2 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/AccountLoginVO.java
  19. 2 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/AccountVO.java
  20. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhDatastatItemExportVO.java
  21. 7 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhDatastatItemVO.java
  22. 7 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhTotalDatastatItemExportVO.java
  23. 7 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwDatastatItemVO.java
  24. 7 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwGroupDatastatItemExportVO.java
  25. 7 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwSubChannelDatastatItemExportVO.java
  26. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformAccountServiceImpl.java
  27. 59 7
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformDatastatServiceImpl.java
  28. 26 8
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformAccountMapper.xml
  29. 36 3
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformFwhDataStatTotalMapper.xml
  30. 36 3
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhDataStatTotalMapper.xml
  31. 38 5
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwDataStatSubChannelMapper.xml
  32. 35 5
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwDataStatTotalMapper.xml
  33. 7 0
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformAccountMapperExt.xml
  34. 16 14
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.xml

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/ExceptionEnum.java

@@ -26,6 +26,8 @@ public enum ExceptionEnum {
     USER_NOT_EXIST(1008, "user not exist"),
     SmsCodeExpired(1010, "短信验证码无效"),
     ACCOUNT_NOT_EXISTS_WRONG(1011, "用户不存在"),
+    ACCOUNT_PRICE_ERROR(1012, "定价格式错误"),
+    ACCOUNT_PRICE_NULL_ERROR(1013, "定价不能为空"),
 
     // 合作账号
     GZH_EXISTS(2000, "公众号已由别的用户授权,该用户不能再授权此公众号,请联系平台运营"),

+ 35 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/BussinessTypeEnum.java

@@ -0,0 +1,35 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+import java.util.Objects;
+
+@Getter
+public enum BussinessTypeEnum {
+    GZH_AUTO_REPLY("gzh_autoReply", "gongzhonghaozidonghuifu", "公众号自动回复"),
+    FWH_PUSH("fwh_push", "fuwuhaodaiyunying", "服务号推送"),
+    QW("qw", "qiweihezuo", "企微"),
+
+    ;
+
+    private final String val;
+    private final String prefix;
+    private final String description;
+
+    BussinessTypeEnum(String val, String prefix, String description) {
+        this.val = val;
+        this.prefix = prefix;
+        this.description = description;
+    }
+
+    public static BussinessTypeEnum from(String val) {
+        for (BussinessTypeEnum typeEnum : BussinessTypeEnum.values()) {
+            if (Objects.equals(typeEnum.getVal(), val)) {
+                return typeEnum;
+            }
+        }
+        return null;
+    }
+
+
+}

+ 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);

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

@@ -18,7 +18,7 @@ public interface ContentPlatformDataStatMapperExt {
 
     Integer getGzhTotalDatastatCount(@Param("param") GzhDatastatListParam param, @Param("createAccountId") Long createAccountId);
 
-    List<ContentPlatformGzhDataStat> getGzhTotalDatastatList(@Param("param") GzhDatastatListParam param,
+    List<ContentPlatformGzhDataStatTotal> getGzhTotalDatastatList(@Param("param") GzhDatastatListParam param,
                                                              @Param("createAccountId") Long createAccountId,
                                                              @Param("offset") int offset,
                                                              @Param("pageSize") Integer pageSize);
@@ -32,7 +32,7 @@ public interface ContentPlatformDataStatMapperExt {
 
     Integer getFwhTotalDatastatCount(@Param("param") GzhDatastatListParam param, @Param("createAccountId") Long createAccountId);
 
-    List<ContentPlatformGzhDataStat> getFwhTotalDatastatList(@Param("param") GzhDatastatListParam param,
+    List<ContentPlatformFwhDataStatTotal> getFwhTotalDatastatList(@Param("param") GzhDatastatListParam param,
                                                              @Param("createAccountId") Long createAccountId,
                                                              @Param("offset") int offset,
                                                              @Param("pageSize") Integer pageSize);

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

@@ -1,6 +1,9 @@
 package com.tzld.piaoquan.api.job;
 
+import com.alibaba.fastjson.JSONObject;
 import com.aliyun.odps.data.Record;
+import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
+import com.tzld.piaoquan.api.common.enums.contentplatform.BussinessTypeEnum;
 import com.tzld.piaoquan.api.component.AigcApiService;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformDataStatMapperExt;
@@ -53,6 +56,12 @@ public class ContentPlatformDatastatJob {
     @Autowired
     private ContentPlatformPlanService planService;
 
+    @ApolloJsonValue("${unit.price.min:{\"gzh_autoReply\":0.1,\"fwh_push\":0.1,\"qw\":0.15}}")
+    private Map<String, Double> unitPriceMinConfig;
+
+    @ApolloJsonValue("${unit.price.max:{\"gzh_autoReply\":0.2,\"fwh_push\":0.2,\"qw\":0.3}}")
+    private Map<String, Double> unitPriceMaxConfig;
+
 
     @XxlJob("syncContentPlatformGzhDatastatJob")
     public ReturnT<String> syncContentPlatformGzhDatastatJob(String param) {
@@ -66,19 +75,21 @@ public class ContentPlatformDatastatJob {
         }
         Long now = System.currentTimeMillis();
         // 公众号自动回复数据统计
-        String sql = String.format("SELECT first_level.channel_shortname, first_level.subchannel, first_level.first_uv, fission.split_uv " +
-                "FROM    loghubods.out_channel_mid_first_total first_level " +
+        String sql = String.format(
+                "SELECT first_level.channel_shortname, first_level.subchannel, first_level.first_uv, fission.split_uv " +
+                "FROM loghubods.out_channel_mid_first_total first_level " +
                 "left join loghubods.out_channel_mid_split_total fission " +
-                "on first_level.channel_shortname = fission.channel_shortname and first_level.subchannel = fission.subchannel and first_level.dt = fission.dt " +
-                "and first_level.type = fission.type and first_level.tag = fission.tag " +
-                "WHERE   first_level.dt = %s and first_level.type = '公众号即时回复' and first_level.tag = '分投放渠道客户分账号去重';", dt);
+                "on first_level.channel_shortname = fission.channel_shortname and first_level.subchannel = fission.subchannel " +
+                "and first_level.dt = fission.dt and first_level.type = fission.type and first_level.tag = fission.tag " +
+                "WHERE first_level.dt = %s and first_level.type = '公众号即时回复' and first_level.tag = '分投放渠道客户分账号去重';", 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());
-        List<String> accountExternalIds = accountList.stream().map(ContentPlatformGzhAccount::getExternalId).collect(Collectors.toList());
+        List<String> accountExternalIds = accountList.stream().map(ContentPlatformGzhAccount::getExternalId)
+                .collect(Collectors.toList());
         String dateStr = dt.substring(0, 4) + "-" + dt.substring(4, 6) + "-" + dt.substring(6, 8);
         List<WxAccountDatastatVO> wxAccountDatastatVOList = aigcApiService.getWxAccountDatastat(dateStr, accountExternalIds);
         Map<String, WxAccountDatastatVO> wxAccountDatastatMap = wxAccountDatastatVOList.stream()
@@ -88,7 +99,7 @@ public class ContentPlatformDatastatJob {
             for (Record record : dataList) {
                 ContentPlatformGzhDataStat item = new ContentPlatformGzhDataStat();
                 String ghId = (String) record.get(1);
-                Integer firstLevelCount = Integer.valueOf((String) record.get(2));
+                int firstLevelCount = Integer.parseInt((String) record.get(2));
                 Integer fissionCount = parseInteger(record.get(3));
                 item.setDateStr(dt);
                 if (!ghIds.contains(ghId)) {
@@ -102,7 +113,7 @@ public class ContentPlatformDatastatJob {
                     item.setFansIncreaseCount(wxAccountDatastatVO.getFansIncreaseCount());
                 }
 
-                if (Objects.nonNull(fissionCount) && fissionCount > 0 && firstLevelCount > 0) {
+                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());
@@ -125,12 +136,16 @@ public class ContentPlatformDatastatJob {
         }
         Long now = System.currentTimeMillis();
         // 公众号自动回复数据统计
-        String sql = String.format("SELECT  first_level.channel_shortname, first_level.first_uv, fission.split_uv " +
-                "FROM    loghubods.out_channel_mid_first_total first_level " +
+        String sql = String.format(
+                "SELECT first_level.channel_shortname, first_level.first_uv, fission.split_uv, price.arpu " +
+                "FROM loghubods.out_channel_mid_first_total first_level " +
                 "left join loghubods.out_channel_mid_split_total fission " +
                 "on first_level.channel_shortname = fission.channel_shortname and first_level.dt = fission.dt " +
                 "and first_level.type = fission.type and first_level.tag = fission.tag " +
-                "WHERE   first_level.dt = %s and first_level.type = '公众号即时回复' and first_level.tag = '投放渠道内去重' ;", dt);
+                "left join loghubods.wecom_cooperation_dynamic_unit_price price " +
+                "on first_level.channel_shortname = price.channel_shortname and first_level.dt = price.dt " +
+                "and first_level.type = price.type and first_level.tag = price.tag " +
+                "WHERE first_level.dt = %s and first_level.type = '公众号即时回复' and first_level.tag = '投放渠道内去重' ;", dt);
         List<Record> dataList = OdpsUtil.getOdpsData(sql);
         // 所有公众号
         List<ContentPlatformAccount> accountList = getAllAccount();
@@ -139,7 +154,8 @@ public class ContentPlatformDatastatJob {
         List<ContentPlatformGzhAccount> gzhAccountList = getAllGzhAccount();
         Map<Long, List<ContentPlatformGzhAccount>> gzhAccountMap = gzhAccountList.stream()
                 .collect(Collectors.groupingBy(ContentPlatformGzhAccount::getCreateAccountId));
-        List<String> accountExternalIds = gzhAccountList.stream().map(ContentPlatformGzhAccount::getExternalId).collect(Collectors.toList());
+        List<String> accountExternalIds = gzhAccountList.stream().map(ContentPlatformGzhAccount::getExternalId)
+                .collect(Collectors.toList());
         String dateStr = dt.substring(0, 4) + "-" + dt.substring(4, 6) + "-" + dt.substring(6, 8);
         List<WxAccountDatastatVO> wxAccountDatastatVOList = aigcApiService.getWxAccountDatastat(dateStr, accountExternalIds);
         Map<String, WxAccountDatastatVO> wxAccountDatastatMap = wxAccountDatastatVOList.stream()
@@ -149,8 +165,9 @@ public class ContentPlatformDatastatJob {
             for (Record record : dataList) {
                 ContentPlatformGzhDataStatTotal item = new ContentPlatformGzhDataStatTotal();
                 String channel = record.getString(0);
-                Integer firstLevelCount = Integer.valueOf((String) record.get(1));
+                int firstLevelCount = Integer.parseInt((String) record.get(1));
                 Integer fissionCount = parseInteger(record.get(2));
+                Double arpu = parseDouble(record.get(3));
                 item.setDateStr(dt);
                 item.setChannel(channel);
                 item.setFirstLevelCount(firstLevelCount);
@@ -168,10 +185,16 @@ public class ContentPlatformDatastatJob {
                 }
                 item.setFansIncreaseCount(fansIncreaseCount);
 
-                if (Objects.nonNull(fissionCount) && fissionCount > 0 && firstLevelCount > 0) {
-                    BigDecimal num = BigDecimal.valueOf(fissionCount.doubleValue() * 10 / firstLevelCount);
-                    BigDecimal rounded = num.setScale(2, RoundingMode.HALF_UP);
+                if (fissionCount > 0 && firstLevelCount > 0) {
+                    BigDecimal fissionRate = BigDecimal.valueOf(fissionCount.doubleValue() / firstLevelCount);
+                    BigDecimal rounded = fissionRate.multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP);
                     item.setScore(rounded.doubleValue());
+                    BigDecimal unitPrice = getUnitPrice(account.getPrice(), fissionRate, arpu, BussinessTypeEnum.GZH_AUTO_REPLY);
+                    if (Objects.nonNull(unitPrice)) {
+                        item.setUnitPrice(unitPrice.doubleValue());
+                        BigDecimal settlementAmount = unitPrice.multiply(new BigDecimal(firstLevelCount)).setScale(2, RoundingMode.HALF_UP);
+                        item.setSettlementAmount(settlementAmount.doubleValue());
+                    }
                 }
                 item.setCreateTimestamp(now);
                 saveList.add(item);
@@ -196,19 +219,21 @@ public class ContentPlatformDatastatJob {
         }
         Long now = System.currentTimeMillis();
         // 公众号自动回复数据统计
-        String sql = String.format("SELECT first_level.subchannel, first_level.first_uv, fission.split_uv " +
-                "FROM    loghubods.out_channel_mid_first_total first_level " +
+        String sql = String.format(
+                "SELECT first_level.subchannel, first_level.first_uv, fission.split_uv " +
+                "FROM loghubods.out_channel_mid_first_total first_level " +
                 "left join loghubods.out_channel_mid_split_total fission " +
                 "on first_level.subchannel = fission.subchannel and first_level.dt = fission.dt " +
                 "and first_level.type = fission.type and first_level.tag = fission.tag " +
-                "WHERE   first_level.dt = %s and first_level.type = '服务号代运营' and first_level.tag = '分投放渠道客户分账号去重' ;", dt);
+                "WHERE first_level.dt = %s and first_level.type = '服务号代运营' and first_level.tag = '分投放渠道客户分账号去重' ;", 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());
-        List<String> accountExternalIds = accountList.stream().map(ContentPlatformGzhAccount::getExternalId).collect(Collectors.toList());
+        List<String> accountExternalIds = accountList.stream().map(ContentPlatformGzhAccount::getExternalId)
+                .collect(Collectors.toList());
         String dateStr = dt.substring(0, 4) + "-" + dt.substring(4, 6) + "-" + dt.substring(6, 8);
         List<WxAccountDatastatVO> wxAccountDatastatVOList = aigcApiService.getWxAccountDatastat(dateStr, accountExternalIds);
         Map<String, WxAccountDatastatVO> wxAccountDatastatMap = wxAccountDatastatVOList.stream()
@@ -218,7 +243,7 @@ public class ContentPlatformDatastatJob {
             for (Record record : dataList) {
                 ContentPlatformFwhDataStat item = new ContentPlatformFwhDataStat();
                 String ghId = (String) record.get(0);
-                Integer firstLevelCount = Integer.valueOf((String) record.get(1));
+                int firstLevelCount = Integer.parseInt((String) record.get(1));
                 Integer fissionCount = parseInteger(record.get(2));
                 item.setDateStr(dt);
                 if (!ghIds.contains(ghId)) {
@@ -232,7 +257,7 @@ public class ContentPlatformDatastatJob {
                     item.setFansIncreaseCount(wxAccountDatastatVO.getFansIncreaseCount());
                 }
 
-                if (Objects.nonNull(fissionCount) && fissionCount > 0 && firstLevelCount > 0) {
+                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());
@@ -255,12 +280,16 @@ public class ContentPlatformDatastatJob {
         }
         Long now = System.currentTimeMillis();
         // 公众号自动回复数据统计
-        String sql = String.format("SELECT  first_level.channel_shortname, first_level.first_uv, fission.split_uv " +
-                "FROM    loghubods.out_channel_mid_first_total first_level " +
+        String sql = String.format(
+                "SELECT first_level.channel_shortname, first_level.first_uv, fission.split_uv, price.arpu " +
+                "FROM loghubods.out_channel_mid_first_total first_level " +
                 "left join loghubods.out_channel_mid_split_total fission " +
                 "on first_level.channel_shortname = fission.channel_shortname and first_level.dt = fission.dt " +
                 "and first_level.type = fission.type and first_level.tag = fission.tag " +
-                "WHERE   first_level.dt = %s and first_level.type = '服务号代运营' and first_level.tag = '投放渠道内去重' ;", dt);
+                "left join loghubods.wecom_cooperation_dynamic_unit_price price " +
+                "on first_level.channel_shortname = price.channel_shortname and first_level.dt = price.dt " +
+                "and first_level.type = price.type and first_level.tag = price.tag " +
+                "WHERE first_level.dt = %s and first_level.type = '服务号代运营' and first_level.tag = '投放渠道内去重' ;", dt);
         List<Record> dataList = OdpsUtil.getOdpsData(sql);
         // 所有公众号
         List<ContentPlatformAccount> accountList = getAllAccount();
@@ -269,7 +298,8 @@ public class ContentPlatformDatastatJob {
         List<ContentPlatformGzhAccount> gzhAccountList = getAllGzhAccount();
         Map<Long, List<ContentPlatformGzhAccount>> gzhAccountMap = gzhAccountList.stream()
                 .collect(Collectors.groupingBy(ContentPlatformGzhAccount::getCreateAccountId));
-        List<String> accountExternalIds = gzhAccountList.stream().map(ContentPlatformGzhAccount::getExternalId).collect(Collectors.toList());
+        List<String> accountExternalIds = gzhAccountList.stream().map(ContentPlatformGzhAccount::getExternalId)
+                .collect(Collectors.toList());
         String dateStr = dt.substring(0, 4) + "-" + dt.substring(4, 6) + "-" + dt.substring(6, 8);
         List<WxAccountDatastatVO> wxAccountDatastatVOList = aigcApiService.getWxAccountDatastat(dateStr, accountExternalIds);
         Map<String, WxAccountDatastatVO> wxAccountDatastatMap = wxAccountDatastatVOList.stream()
@@ -279,8 +309,9 @@ public class ContentPlatformDatastatJob {
             for (Record record : dataList) {
                 ContentPlatformFwhDataStatTotal item = new ContentPlatformFwhDataStatTotal();
                 String channel = record.getString(0);
-                Integer firstLevelCount = Integer.valueOf((String) record.get(1));
+                int firstLevelCount = Integer.parseInt((String) record.get(1));
                 Integer fissionCount = parseInteger(record.get(2));
+                Double arpu = parseDouble(record.get(3));
                 item.setDateStr(dt);
                 item.setChannel(channel);
                 item.setFirstLevelCount(firstLevelCount);
@@ -298,10 +329,16 @@ public class ContentPlatformDatastatJob {
                 }
                 item.setFansIncreaseCount(fansIncreaseCount);
 
-                if (Objects.nonNull(fissionCount) && fissionCount > 0 && firstLevelCount > 0) {
-                    BigDecimal num = BigDecimal.valueOf(fissionCount.doubleValue() * 10 / firstLevelCount);
-                    BigDecimal rounded = num.setScale(2, RoundingMode.HALF_UP);
+                if (fissionCount > 0 && firstLevelCount > 0) {
+                    BigDecimal fissionRate = BigDecimal.valueOf(fissionCount.doubleValue() / firstLevelCount);
+                    BigDecimal rounded = fissionRate.multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP);
                     item.setScore(rounded.doubleValue());
+                    BigDecimal unitPrice = getUnitPrice(account.getPrice(), fissionRate, arpu, BussinessTypeEnum.FWH_PUSH);
+                    if (Objects.nonNull(unitPrice)) {
+                        item.setUnitPrice(unitPrice.doubleValue());
+                        BigDecimal settlementAmount = unitPrice.multiply(new BigDecimal(firstLevelCount)).setScale(2, RoundingMode.HALF_UP);
+                        item.setSettlementAmount(settlementAmount.doubleValue());
+                    }
                 }
                 item.setCreateTimestamp(now);
                 saveList.add(item);
@@ -355,7 +392,8 @@ public class ContentPlatformDatastatJob {
             return ReturnT.SUCCESS;
         }
         List<ContentPlatformQwDataStat> existList = getQwDatastatCount(dt);
-        List<String> existRootSourceIds = existList.stream().map(ContentPlatformQwDataStat::getRootSourceId).collect(Collectors.toList());
+        List<String> existRootSourceIds = existList.stream().map(ContentPlatformQwDataStat::getRootSourceId)
+                .collect(Collectors.toList());
         Map<String, Long> rootSourceIdMap = qwPlanList.stream()
                 .collect(Collectors.toMap(ContentPlatformQwPlan::getRootSourceId, ContentPlatformQwPlan::getId));
         List<Long> planIds = qwPlanList.stream().map(ContentPlatformQwPlan::getId).collect(Collectors.toList());
@@ -449,19 +487,27 @@ public class ContentPlatformDatastatJob {
             dt = param;
         }
         Map<String, ContentPlatformQwDataStatTotal> saveMap = new HashMap<>();
-        String outSql = String.format("SELECT first_level.channel_shortname, first_level.first_uv, fission.split_uv " +
-                "FROM    loghubods.out_channel_mid_first_total first_level " +
+        String outSql = String.format(
+                "SELECT first_level.channel_shortname, first_level.first_uv, fission.split_uv, price.arpu " +
+                "FROM loghubods.out_channel_mid_first_total first_level " +
                 "left join loghubods.out_channel_mid_split_total fission " +
                 "on first_level.channel_shortname = fission.channel_shortname and first_level.dt = fission.dt " +
                 "and first_level.type = fission.type and first_level.tag = fission.tag " +
-                "WHERE   first_level.dt = %s and first_level.type = '企微外部' and first_level.tag = '投放渠道内去重' ;", dt);
+                "left join loghubods.wecom_cooperation_dynamic_unit_price price " +
+                "on first_level.channel_shortname = price.channel_shortname and first_level.dt = price.dt " +
+                "and first_level.type = price.type and first_level.tag = price.tag " +
+                "WHERE first_level.dt = %s and first_level.type = '企微外部' and first_level.tag = '投放渠道内去重' ;", dt);
         List<Record> outDataList = OdpsUtil.getOdpsData(outSql);
+        List<ContentPlatformAccount> accountList = getAllAccount();
+        Map<String, ContentPlatformAccount> accountMap = accountList.stream()
+                .collect(Collectors.toMap(ContentPlatformAccount::getChannel, account -> account));
         Long now = System.currentTimeMillis();
         if (CollectionUtils.isNotEmpty(outDataList)) {
             for (Record record : outDataList) {
                 String channel = (String) record.get(0);
                 int firstLevelCount = Integer.parseInt((String) record.get(1));
                 Integer fissionCount = parseInteger(record.get(2));
+                Double arpu = parseDouble(record.get(3));
                 if (firstLevelCount == 0) {
                     continue;
                 }
@@ -471,11 +517,32 @@ public class ContentPlatformDatastatJob {
                 if (item.getFirstLevelCount() == null) {
                     item.setFirstLevelCount(0);
                 }
-
-                if (Objects.nonNull(fissionCount) && fissionCount > 0 && firstLevelCount > 0) {
-                    BigDecimal num = BigDecimal.valueOf(fissionCount.doubleValue() * 10 / firstLevelCount);
-                    BigDecimal rounded = num.setScale(2, RoundingMode.HALF_UP);
+                ContentPlatformAccount account = accountMap.get(channel);
+                if (Objects.isNull(account)) {
+                    account = new ContentPlatformAccount();
+                    account.setPrice("{\n" +
+                            "\"qiweihezuo_price_mode\": \"static\",\n" +
+                            "\"qiweihezuo_dynamic_times\":3,\n" +
+                            "\"qiweihezuo_static_price\":0.12,\n" +
+                            "\"fuwuhaodaiyunying_price_mode\": \"dynamic\",\n" +
+                            "\"fuwuhaodaiyunying_dynamic_times\":3,\n" +
+                            "\"fuwuhaodaiyunying_static_price\":0.12,\n" +
+                            "\"gongzhonghaozidonghuifu_price_mode\": \"static\",\n" +
+                            "\"gongzhonghaozidonghuifu_dynamic_times\":3,\n" +
+                            "\"gongzhonghaozidonghuifu_static_price\":0.12\n" +
+                            "}");
+                }
+
+                if (fissionCount > 0 && firstLevelCount > 0) {
+                    BigDecimal fissionRate = BigDecimal.valueOf(fissionCount.doubleValue() / firstLevelCount);
+                    BigDecimal rounded = fissionRate.multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP);
                     item.setScore(rounded.doubleValue());
+                    BigDecimal unitPrice = getUnitPrice(account.getPrice(), fissionRate, arpu, BussinessTypeEnum.QW);
+                    if (Objects.nonNull(unitPrice)) {
+                        item.setUnitPrice(unitPrice.doubleValue());
+                        BigDecimal settlementAmount = unitPrice.multiply(new BigDecimal(firstLevelCount)).setScale(2, RoundingMode.HALF_UP);
+                        item.setSettlementAmount(settlementAmount.doubleValue());
+                    }
                 }
                 item.setFirstLevelCount(item.getFirstLevelCount() + firstLevelCount);
                 item.setCreateTimestamp(now);
@@ -529,7 +596,6 @@ public class ContentPlatformDatastatJob {
                     continue;
                 }
                 if (saveMap.containsKey(channel) && !out2Channels.contains(channel)) {
-
                     saveMap.remove(channel);
                 }
                 ContentPlatformQwDataStatReplyTotal item = saveMap.getOrDefault(channel, new ContentPlatformQwDataStatReplyTotal());
@@ -546,10 +612,12 @@ public class ContentPlatformDatastatJob {
         }
         List<ContentPlatformQwDataStatReplyTotal> saveList = new ArrayList<>(saveMap.values());
         if (CollectionUtils.isNotEmpty(saveList)) {
-            List<String> channels = saveList.stream().map(ContentPlatformQwDataStatReplyTotal::getChannel).distinct().collect(Collectors.toList());
+            List<String> channels = saveList.stream().map(ContentPlatformQwDataStatReplyTotal::getChannel).distinct()
+                    .collect(Collectors.toList());
             List<ContentPlatformQwDataStatReplyTotal> channelScoreList = dataStatMapperExt.getQwTotalDatastatReplyScoreList(dt, channels);
             Map<String, Double> channelScoreMap = channelScoreList.stream()
-                    .collect(Collectors.toMap(ContentPlatformQwDataStatReplyTotal::getChannel, ContentPlatformQwDataStatReplyTotal::getScore, (a, b) -> a));
+                    .collect(Collectors.toMap(ContentPlatformQwDataStatReplyTotal::getChannel,
+                            ContentPlatformQwDataStatReplyTotal::getScore, (a, b) -> a));
             for (ContentPlatformQwDataStatReplyTotal item : saveList) {
                 item.setScore(channelScoreMap.get(item.getChannel()));
             }
@@ -566,12 +634,16 @@ public class ContentPlatformDatastatJob {
             dt = param;
         }
         List<ContentPlatformQwDataStatSubChannel> saveList = new ArrayList<>();
-        String outSql = String.format("SELECT  first_level.channel_shortname, first_level.subchannel, first_level.first_uv, fission.split_uv " +
-                "FROM    loghubods.out_channel_mid_first_total first_level " +
+        String outSql = String.format(
+                "SELECT first_level.channel_shortname, first_level.subchannel, first_level.first_uv, fission.split_uv, price.arpu " +
+                "FROM loghubods.out_channel_mid_first_total first_level " +
                 "left join loghubods.out_channel_mid_split_total fission " +
-                "on first_level.channel_shortname = fission.channel_shortname and first_level.subchannel = fission.subchannel and first_level.dt = fission.dt " +
-                "and first_level.type = fission.type and first_level.tag = fission.tag " +
-                "WHERE   first_level.dt = %s and first_level.type = '企微外部' and first_level.tag = '分投放渠道客户分账号去重' ;", dt);
+                "on first_level.channel_shortname = fission.channel_shortname and first_level.subchannel = fission.subchannel " +
+                "and first_level.dt = fission.dt and first_level.type = fission.type and first_level.tag = fission.tag " +
+                "left join loghubods.wecom_cooperation_dynamic_unit_price price " +
+                "on first_level.channel_shortname = price.channel_shortname and first_level.subchannel = price.subchannel " +
+                "and first_level.dt = price.dt and first_level.type = price.type and first_level.tag = price.tag " +
+                "WHERE first_level.dt = %s and first_level.type = '企微外部' and first_level.tag = '分投放渠道客户分账号去重' ;", dt);
         List<Record> outDataList = OdpsUtil.getOdpsData(outSql);
         List<ContentPlatformAccount> accountList = getAllAccount();
         Map<String, ContentPlatformAccount> accountMap = accountList.stream()
@@ -587,6 +659,7 @@ public class ContentPlatformDatastatJob {
                 String subChannel = (String) record.get(1);
                 int firstLevelCount = Integer.parseInt((String) record.get(2));
                 Integer fissionCount = parseInteger(record.get(3));
+                Double arpu = parseDouble(record.get(4));
                 if (firstLevelCount == 0) {
                     continue;
                 }
@@ -597,23 +670,27 @@ public class ContentPlatformDatastatJob {
                     continue;
                 }
                 List<ContentPlatformQwPlan> qwPlans = qwPlanMap.getOrDefault(account.getId(), new ArrayList<>());
-                List<String> subChannelList = qwPlans.stream().map(ContentPlatformQwPlan::getSubChannel).distinct().collect(Collectors.toList());
+                List<String> subChannelList = qwPlans.stream().map(ContentPlatformQwPlan::getSubChannel).distinct()
+                        .collect(Collectors.toList());
                 if (CollectionUtils.isEmpty(qwPlans) || !subChannelList.contains(subChannel)) {
                     noSubChannelRecordList.add(record);
                     continue;
                 }
                 item.setCreateAccountId(account.getId());
                 item.setSubChannel(subChannel);
-                if (item.getFirstLevelCount() == null) {
-                    item.setFirstLevelCount(0);
-                }
+                item.setFirstLevelCount(firstLevelCount);
 
-                if (Objects.nonNull(fissionCount) && fissionCount > 0 && firstLevelCount > 0) {
-                    BigDecimal num = BigDecimal.valueOf(fissionCount.doubleValue() * 10 / firstLevelCount);
-                    BigDecimal rounded = num.setScale(2, RoundingMode.HALF_UP);
+                if (fissionCount > 0 && firstLevelCount > 0) {
+                    BigDecimal fissionRate = BigDecimal.valueOf(fissionCount.doubleValue() / firstLevelCount);
+                    BigDecimal rounded = fissionRate.multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP);
                     item.setScore(rounded.doubleValue());
+                    BigDecimal unitPrice = getUnitPrice(account.getPrice(), fissionRate, arpu, BussinessTypeEnum.QW);
+                    if (Objects.nonNull(unitPrice)) {
+                        item.setUnitPrice(unitPrice.doubleValue());
+                        BigDecimal settlementAmount = unitPrice.multiply(new BigDecimal(firstLevelCount)).setScale(2, RoundingMode.HALF_UP);
+                        item.setSettlementAmount(settlementAmount.doubleValue());
+                    }
                 }
-                item.setFirstLevelCount(item.getFirstLevelCount() + firstLevelCount);
                 item.setCreateTimestamp(now);
                 saveList.add(item);
             }
@@ -621,6 +698,7 @@ public class ContentPlatformDatastatJob {
                 String channel = (String) record.get(0);
                 int firstLevelCount = Integer.parseInt((String) record.get(2));
                 Integer fissionCount = parseInteger(record.get(3));
+                Double arpu = parseDouble(record.get(4));
                 ContentPlatformQwDataStatSubChannel item = new ContentPlatformQwDataStatSubChannel();
                 item.setDateStr(dt);
                 ContentPlatformAccount account = accountMap.get(channel);
@@ -629,15 +707,18 @@ public class ContentPlatformDatastatJob {
                 }
                 item.setCreateAccountId(account.getId());
                 item.setSubChannel("未知");
-                if (item.getFirstLevelCount() == null) {
-                    item.setFirstLevelCount(0);
-                }
-                item.setFirstLevelCount(item.getFirstLevelCount() + firstLevelCount);
+                item.setFirstLevelCount(firstLevelCount);
 
-                if (Objects.nonNull(fissionCount) && fissionCount > 0 && firstLevelCount > 0) {
-                    BigDecimal num = BigDecimal.valueOf(fissionCount.doubleValue() * 10 / firstLevelCount);
-                    BigDecimal rounded = num.setScale(2, RoundingMode.HALF_UP);
+                if (fissionCount > 0 && firstLevelCount > 0) {
+                    BigDecimal fissionRate = BigDecimal.valueOf(fissionCount.doubleValue() / firstLevelCount);
+                    BigDecimal rounded = fissionRate.multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP);
                     item.setScore(rounded.doubleValue());
+                    BigDecimal unitPrice = getUnitPrice(account.getPrice(), fissionRate, arpu, BussinessTypeEnum.QW);
+                    if (Objects.nonNull(unitPrice)) {
+                        item.setUnitPrice(unitPrice.doubleValue());
+                        BigDecimal settlementAmount = unitPrice.multiply(new BigDecimal(firstLevelCount)).setScale(2, RoundingMode.HALF_UP);
+                        item.setSettlementAmount(settlementAmount.doubleValue());
+                    }
                 }
                 item.setCreateTimestamp(now);
                 saveList.add(item);
@@ -655,13 +736,59 @@ public class ContentPlatformDatastatJob {
         example.createCriteria().andSubChannelIsNotNull();
         return qwPlanMapper.selectByExample(example);
     }
-    
+
     private Integer parseInteger(Object value) {
         try {
             return Integer.parseInt((String) value);
         } catch (NumberFormatException e) {
-            return null;
+            return 0;
         }
     }
 
+    private Double parseDouble(Object value) {
+        try {
+            return Double.parseDouble((String) value);
+        } catch (NumberFormatException e) {
+            return 0.0;
+        }
+    }
+
+    private Double getUnitPriceMin(BussinessTypeEnum typeEnum) {
+        return unitPriceMinConfig.get(typeEnum.getVal());
+    }
+
+    private Double getUnitPriceMax(BussinessTypeEnum typeEnum) {
+        return unitPriceMaxConfig.get(typeEnum.getVal());
+    }
+
+    private BigDecimal getUnitPrice(String price, BigDecimal fissionRate, Double arpu, BussinessTypeEnum typeEnum) {
+        JSONObject priceJSON;
+        try {
+            priceJSON = JSONObject.parseObject(price);
+        } catch (Exception e) {
+            return null;
+        }
+        String priceModeKey = typeEnum.getPrefix() + "_price_mode";
+        String staticPriceKey = typeEnum.getPrefix() + "_static_price";
+        String dynamicTimesKey = typeEnum.getPrefix() + "_dynamic_times";
+        String priceMode = priceJSON.getString(priceModeKey);
+        Double staticPrice = priceJSON.getDouble(staticPriceKey);
+        Double dynamicTimes = priceJSON.getDouble(dynamicTimesKey);
+        if ("static".equals(priceMode)) {
+            if (Objects.isNull(staticPrice) || staticPrice == 0) {
+                return null;
+            }
+            return new BigDecimal(staticPrice);
+        } else if ("dynamic".equals(priceMode)) {
+            if (Objects.isNull(fissionRate) || Objects.isNull(arpu) || Objects.isNull(dynamicTimes) || dynamicTimes == 0) {
+                return null;
+            }
+            return fissionRate.multiply(new BigDecimal(arpu))
+                    .multiply(BigDecimal.valueOf(dynamicTimes))
+                    .setScale(2, RoundingMode.HALF_UP)
+                    .min(BigDecimal.valueOf(getUnitPriceMax(typeEnum)))
+                    .max(BigDecimal.valueOf(getUnitPriceMin(typeEnum)));
+        }
+        return null;
+    }
 }

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

@@ -1,8 +1,12 @@
 package com.tzld.piaoquan.api.model.param.contentplatform;
 
 import com.tzld.piaoquan.api.model.param.PageParam;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 @Data
 public class AccountListParam extends PageParam {
+
+    @ApiModelProperty(value = "公司主体名称")
+    private String name;
 }

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

@@ -18,6 +18,8 @@ public class AccountSaveParam {
     private String contactName;
     @ApiModelProperty(value = "手机号")
     private String telNum;
+    @ApiModelProperty(value = "定价系数")
+    private String price;
     @ApiModelProperty(value = "密码")
     private String password;
 

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

@@ -13,6 +13,8 @@ public class ContentPlatformAccount {
 
     private String telNum;
 
+    private String price;
+
     private String password;
 
     private String token;
@@ -77,6 +79,14 @@ public class ContentPlatformAccount {
         this.telNum = telNum;
     }
 
+    public String getPrice() {
+        return price;
+    }
+
+    public void setPrice(String price) {
+        this.price = price;
+    }
+
     public String getPassword() {
         return password;
     }
@@ -153,6 +163,7 @@ public class ContentPlatformAccount {
         sb.append(", channel=").append(channel);
         sb.append(", contactName=").append(contactName);
         sb.append(", telNum=").append(telNum);
+        sb.append(", price=").append(price);
         sb.append(", password=").append(password);
         sb.append(", token=").append(token);
         sb.append(", tokenExpireTimestamp=").append(tokenExpireTimestamp);

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

@@ -515,6 +515,76 @@ public class ContentPlatformAccountExample {
             return (Criteria) this;
         }
 
+        public Criteria andPriceIsNull() {
+            addCriterion("price is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceIsNotNull() {
+            addCriterion("price is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceEqualTo(String value) {
+            addCriterion("price =", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceNotEqualTo(String value) {
+            addCriterion("price <>", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceGreaterThan(String value) {
+            addCriterion("price >", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceGreaterThanOrEqualTo(String value) {
+            addCriterion("price >=", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceLessThan(String value) {
+            addCriterion("price <", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceLessThanOrEqualTo(String value) {
+            addCriterion("price <=", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceLike(String value) {
+            addCriterion("price like", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceNotLike(String value) {
+            addCriterion("price not like", value, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceIn(List<String> values) {
+            addCriterion("price in", values, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceNotIn(List<String> values) {
+            addCriterion("price not in", values, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceBetween(String value1, String value2) {
+            addCriterion("price between", value1, value2, "price");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriceNotBetween(String value1, String value2) {
+            addCriterion("price not between", value1, value2, "price");
+            return (Criteria) this;
+        }
+
         public Criteria andPasswordIsNull() {
             addCriterion("`password` is null");
             return (Criteria) this;

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

@@ -13,6 +13,10 @@ public class ContentPlatformFwhDataStatTotal {
 
     private Double score;
 
+    private Double unitPrice;
+
+    private Double settlementAmount;
+
     private Long createTimestamp;
 
     public Long getId() {
@@ -63,6 +67,22 @@ public class ContentPlatformFwhDataStatTotal {
         this.score = score;
     }
 
+    public Double getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(Double unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    public Double getSettlementAmount() {
+        return settlementAmount;
+    }
+
+    public void setSettlementAmount(Double settlementAmount) {
+        this.settlementAmount = settlementAmount;
+    }
+
     public Long getCreateTimestamp() {
         return createTimestamp;
     }
@@ -83,6 +103,8 @@ public class ContentPlatformFwhDataStatTotal {
         sb.append(", fansIncreaseCount=").append(fansIncreaseCount);
         sb.append(", firstLevelCount=").append(firstLevelCount);
         sb.append(", score=").append(score);
+        sb.append(", unitPrice=").append(unitPrice);
+        sb.append(", settlementAmount=").append(settlementAmount);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");
         return sb.toString();

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

@@ -495,6 +495,126 @@ public class ContentPlatformFwhDataStatTotalExample {
             return (Criteria) this;
         }
 
+        public Criteria andUnitPriceIsNull() {
+            addCriterion("unit_price is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceIsNotNull() {
+            addCriterion("unit_price is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceEqualTo(Double value) {
+            addCriterion("unit_price =", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotEqualTo(Double value) {
+            addCriterion("unit_price <>", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceGreaterThan(Double value) {
+            addCriterion("unit_price >", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceGreaterThanOrEqualTo(Double value) {
+            addCriterion("unit_price >=", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceLessThan(Double value) {
+            addCriterion("unit_price <", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceLessThanOrEqualTo(Double value) {
+            addCriterion("unit_price <=", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceIn(List<Double> values) {
+            addCriterion("unit_price in", values, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotIn(List<Double> values) {
+            addCriterion("unit_price not in", values, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceBetween(Double value1, Double value2) {
+            addCriterion("unit_price between", value1, value2, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotBetween(Double value1, Double value2) {
+            addCriterion("unit_price not between", value1, value2, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIsNull() {
+            addCriterion("settlement_amount is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIsNotNull() {
+            addCriterion("settlement_amount is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountEqualTo(Double value) {
+            addCriterion("settlement_amount =", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotEqualTo(Double value) {
+            addCriterion("settlement_amount <>", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountGreaterThan(Double value) {
+            addCriterion("settlement_amount >", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountGreaterThanOrEqualTo(Double value) {
+            addCriterion("settlement_amount >=", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountLessThan(Double value) {
+            addCriterion("settlement_amount <", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountLessThanOrEqualTo(Double value) {
+            addCriterion("settlement_amount <=", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIn(List<Double> values) {
+            addCriterion("settlement_amount in", values, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotIn(List<Double> values) {
+            addCriterion("settlement_amount not in", values, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountBetween(Double value1, Double value2) {
+            addCriterion("settlement_amount between", value1, value2, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotBetween(Double value1, Double value2) {
+            addCriterion("settlement_amount not between", value1, value2, "settlementAmount");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateTimestampIsNull() {
             addCriterion("create_timestamp is null");
             return (Criteria) this;

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

@@ -13,6 +13,10 @@ public class ContentPlatformGzhDataStatTotal {
 
     private Double score;
 
+    private Double unitPrice;
+
+    private Double settlementAmount;
+
     private Long createTimestamp;
 
     public Long getId() {
@@ -63,6 +67,22 @@ public class ContentPlatformGzhDataStatTotal {
         this.score = score;
     }
 
+    public Double getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(Double unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    public Double getSettlementAmount() {
+        return settlementAmount;
+    }
+
+    public void setSettlementAmount(Double settlementAmount) {
+        this.settlementAmount = settlementAmount;
+    }
+
     public Long getCreateTimestamp() {
         return createTimestamp;
     }
@@ -83,6 +103,8 @@ public class ContentPlatformGzhDataStatTotal {
         sb.append(", fansIncreaseCount=").append(fansIncreaseCount);
         sb.append(", firstLevelCount=").append(firstLevelCount);
         sb.append(", score=").append(score);
+        sb.append(", unitPrice=").append(unitPrice);
+        sb.append(", settlementAmount=").append(settlementAmount);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");
         return sb.toString();

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

@@ -495,6 +495,126 @@ public class ContentPlatformGzhDataStatTotalExample {
             return (Criteria) this;
         }
 
+        public Criteria andUnitPriceIsNull() {
+            addCriterion("unit_price is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceIsNotNull() {
+            addCriterion("unit_price is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceEqualTo(Double value) {
+            addCriterion("unit_price =", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotEqualTo(Double value) {
+            addCriterion("unit_price <>", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceGreaterThan(Double value) {
+            addCriterion("unit_price >", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceGreaterThanOrEqualTo(Double value) {
+            addCriterion("unit_price >=", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceLessThan(Double value) {
+            addCriterion("unit_price <", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceLessThanOrEqualTo(Double value) {
+            addCriterion("unit_price <=", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceIn(List<Double> values) {
+            addCriterion("unit_price in", values, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotIn(List<Double> values) {
+            addCriterion("unit_price not in", values, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceBetween(Double value1, Double value2) {
+            addCriterion("unit_price between", value1, value2, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotBetween(Double value1, Double value2) {
+            addCriterion("unit_price not between", value1, value2, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIsNull() {
+            addCriterion("settlement_amount is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIsNotNull() {
+            addCriterion("settlement_amount is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountEqualTo(Double value) {
+            addCriterion("settlement_amount =", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotEqualTo(Double value) {
+            addCriterion("settlement_amount <>", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountGreaterThan(Double value) {
+            addCriterion("settlement_amount >", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountGreaterThanOrEqualTo(Double value) {
+            addCriterion("settlement_amount >=", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountLessThan(Double value) {
+            addCriterion("settlement_amount <", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountLessThanOrEqualTo(Double value) {
+            addCriterion("settlement_amount <=", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIn(List<Double> values) {
+            addCriterion("settlement_amount in", values, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotIn(List<Double> values) {
+            addCriterion("settlement_amount not in", values, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountBetween(Double value1, Double value2) {
+            addCriterion("settlement_amount between", value1, value2, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotBetween(Double value1, Double value2) {
+            addCriterion("settlement_amount not between", value1, value2, "settlementAmount");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateTimestampIsNull() {
             addCriterion("create_timestamp is null");
             return (Criteria) this;

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

@@ -11,6 +11,10 @@ public class ContentPlatformQwDataStatSubChannel {
 
     private Double score;
 
+    private Double unitPrice;
+
+    private Double settlementAmount;
+
     private Long createAccountId;
 
     private Long createTimestamp;
@@ -55,6 +59,22 @@ public class ContentPlatformQwDataStatSubChannel {
         this.score = score;
     }
 
+    public Double getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(Double unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    public Double getSettlementAmount() {
+        return settlementAmount;
+    }
+
+    public void setSettlementAmount(Double settlementAmount) {
+        this.settlementAmount = settlementAmount;
+    }
+
     public Long getCreateAccountId() {
         return createAccountId;
     }
@@ -82,6 +102,8 @@ public class ContentPlatformQwDataStatSubChannel {
         sb.append(", subChannel=").append(subChannel);
         sb.append(", firstLevelCount=").append(firstLevelCount);
         sb.append(", score=").append(score);
+        sb.append(", unitPrice=").append(unitPrice);
+        sb.append(", settlementAmount=").append(settlementAmount);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");

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

@@ -435,6 +435,126 @@ public class ContentPlatformQwDataStatSubChannelExample {
             return (Criteria) this;
         }
 
+        public Criteria andUnitPriceIsNull() {
+            addCriterion("unit_price is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceIsNotNull() {
+            addCriterion("unit_price is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceEqualTo(Double value) {
+            addCriterion("unit_price =", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotEqualTo(Double value) {
+            addCriterion("unit_price <>", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceGreaterThan(Double value) {
+            addCriterion("unit_price >", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceGreaterThanOrEqualTo(Double value) {
+            addCriterion("unit_price >=", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceLessThan(Double value) {
+            addCriterion("unit_price <", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceLessThanOrEqualTo(Double value) {
+            addCriterion("unit_price <=", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceIn(List<Double> values) {
+            addCriterion("unit_price in", values, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotIn(List<Double> values) {
+            addCriterion("unit_price not in", values, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceBetween(Double value1, Double value2) {
+            addCriterion("unit_price between", value1, value2, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotBetween(Double value1, Double value2) {
+            addCriterion("unit_price not between", value1, value2, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIsNull() {
+            addCriterion("settlement_amount is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIsNotNull() {
+            addCriterion("settlement_amount is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountEqualTo(Double value) {
+            addCriterion("settlement_amount =", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotEqualTo(Double value) {
+            addCriterion("settlement_amount <>", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountGreaterThan(Double value) {
+            addCriterion("settlement_amount >", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountGreaterThanOrEqualTo(Double value) {
+            addCriterion("settlement_amount >=", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountLessThan(Double value) {
+            addCriterion("settlement_amount <", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountLessThanOrEqualTo(Double value) {
+            addCriterion("settlement_amount <=", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIn(List<Double> values) {
+            addCriterion("settlement_amount in", values, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotIn(List<Double> values) {
+            addCriterion("settlement_amount not in", values, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountBetween(Double value1, Double value2) {
+            addCriterion("settlement_amount between", value1, value2, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotBetween(Double value1, Double value2) {
+            addCriterion("settlement_amount not between", value1, value2, "settlementAmount");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateAccountIdIsNull() {
             addCriterion("create_account_id is null");
             return (Criteria) this;

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

@@ -11,6 +11,10 @@ public class ContentPlatformQwDataStatTotal {
 
     private Double score;
 
+    private Double unitPrice;
+
+    private Double settlementAmount;
+
     private Long createTimestamp;
 
     public Long getId() {
@@ -53,6 +57,22 @@ public class ContentPlatformQwDataStatTotal {
         this.score = score;
     }
 
+    public Double getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(Double unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    public Double getSettlementAmount() {
+        return settlementAmount;
+    }
+
+    public void setSettlementAmount(Double settlementAmount) {
+        this.settlementAmount = settlementAmount;
+    }
+
     public Long getCreateTimestamp() {
         return createTimestamp;
     }
@@ -72,6 +92,8 @@ public class ContentPlatformQwDataStatTotal {
         sb.append(", channel=").append(channel);
         sb.append(", firstLevelCount=").append(firstLevelCount);
         sb.append(", score=").append(score);
+        sb.append(", unitPrice=").append(unitPrice);
+        sb.append(", settlementAmount=").append(settlementAmount);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");
         return sb.toString();

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

@@ -435,6 +435,126 @@ public class ContentPlatformQwDataStatTotalExample {
             return (Criteria) this;
         }
 
+        public Criteria andUnitPriceIsNull() {
+            addCriterion("unit_price is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceIsNotNull() {
+            addCriterion("unit_price is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceEqualTo(Double value) {
+            addCriterion("unit_price =", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotEqualTo(Double value) {
+            addCriterion("unit_price <>", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceGreaterThan(Double value) {
+            addCriterion("unit_price >", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceGreaterThanOrEqualTo(Double value) {
+            addCriterion("unit_price >=", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceLessThan(Double value) {
+            addCriterion("unit_price <", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceLessThanOrEqualTo(Double value) {
+            addCriterion("unit_price <=", value, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceIn(List<Double> values) {
+            addCriterion("unit_price in", values, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotIn(List<Double> values) {
+            addCriterion("unit_price not in", values, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceBetween(Double value1, Double value2) {
+            addCriterion("unit_price between", value1, value2, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andUnitPriceNotBetween(Double value1, Double value2) {
+            addCriterion("unit_price not between", value1, value2, "unitPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIsNull() {
+            addCriterion("settlement_amount is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIsNotNull() {
+            addCriterion("settlement_amount is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountEqualTo(Double value) {
+            addCriterion("settlement_amount =", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotEqualTo(Double value) {
+            addCriterion("settlement_amount <>", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountGreaterThan(Double value) {
+            addCriterion("settlement_amount >", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountGreaterThanOrEqualTo(Double value) {
+            addCriterion("settlement_amount >=", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountLessThan(Double value) {
+            addCriterion("settlement_amount <", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountLessThanOrEqualTo(Double value) {
+            addCriterion("settlement_amount <=", value, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountIn(List<Double> values) {
+            addCriterion("settlement_amount in", values, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotIn(List<Double> values) {
+            addCriterion("settlement_amount not in", values, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountBetween(Double value1, Double value2) {
+            addCriterion("settlement_amount between", value1, value2, "settlementAmount");
+            return (Criteria) this;
+        }
+
+        public Criteria andSettlementAmountNotBetween(Double value1, Double value2) {
+            addCriterion("settlement_amount not between", value1, value2, "settlementAmount");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateTimestampIsNull() {
             addCriterion("create_timestamp is null");
             return (Criteria) this;

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

@@ -18,6 +18,8 @@ public class AccountLoginVO {
     private String contactName;
     @ApiModelProperty(value = "手机号")
     private String telNum;
+    @ApiModelProperty(value = "定价系数")
+    private String price;
     @ApiModelProperty(value = "创建时间")
     private Long createTimestamp;
     @ApiModelProperty(value = "token")

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

@@ -18,6 +18,8 @@ public class AccountVO {
 	private String contactName;
 	@ApiModelProperty(value = "手机号")
 	private String telNum;
+	@ApiModelProperty(value = "定价系数")
+	private String price;
 	@ApiModelProperty(value = "状态 1-正常 0-封禁")
 	private Integer status;
 	@ApiModelProperty(value = "创建时间")

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhDatastatItemExportVO.java

@@ -34,6 +34,6 @@ public class GzhDatastatItemExportVO {
     @ExcelProperty("打开率")
     private Double openRate;
 
-    @ExcelProperty("传播得分")
+    @ExcelProperty("本渠道裂变率")
     private Double score;
 }

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

@@ -24,6 +24,12 @@ public class GzhDatastatItemVO {
     @ApiModelProperty(value = "打开率")
     private Double openRate;
 
-    @ApiModelProperty(value = "传播得分")
+    @ApiModelProperty(value = "得分")
     private Double score;
+
+    @ApiModelProperty(value = "预估单价")
+    private Double unitPrice;
+
+    @ApiModelProperty(value = "建议结算金额")
+    private Double settlementAmount;
 }

+ 7 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhTotalDatastatItemExportVO.java

@@ -28,6 +28,12 @@ public class GzhTotalDatastatItemExportVO {
     @ExcelProperty("打开率")
     private Double openRate;
 
-    @ExcelProperty("传播得分")
+    @ExcelProperty("本渠道裂变率")
     private Double score;
+
+    @ExcelProperty(value = "预估单价")
+    private Double unitPrice;
+
+    @ExcelProperty(value = "建议结算金额")
+    private Double settlementAmount;
 }

+ 7 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwDatastatItemVO.java

@@ -15,7 +15,7 @@ public class QwDatastatItemVO {
     @ApiModelProperty(value = "小程序访问人数")
     private Integer firstLevel;
 
-    @ApiModelProperty(value = "传播得分")
+    @ApiModelProperty(value = "得分")
     private Double score;
 
     @ApiModelProperty(value = "视频标题")
@@ -23,4 +23,10 @@ public class QwDatastatItemVO {
 
     @ApiModelProperty(value = "视频id")
     private Long videoId;
+
+    @ApiModelProperty(value = "预估单价")
+    private Double unitPrice;
+
+    @ApiModelProperty(value = "建议结算金额")
+    private Double settlementAmount;
 }

+ 7 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwGroupDatastatItemExportVO.java

@@ -22,6 +22,12 @@ public class QwGroupDatastatItemExportVO {
     @ExcelProperty("小程序访问人数")
     private Integer firstLevel;
 
-    @ExcelProperty("传播得分")
+    @ExcelProperty("本渠道裂变率")
     private Double score;
+
+    @ExcelProperty(value = "预估单价")
+    private Double unitPrice;
+
+    @ExcelProperty(value = "建议结算金额")
+    private Double settlementAmount;
 }

+ 7 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwSubChannelDatastatItemExportVO.java

@@ -25,6 +25,12 @@ public class QwSubChannelDatastatItemExportVO {
     @ExcelProperty("小程序访问人数")
     private Integer firstLevel;
 
-    @ExcelProperty("传播得分")
+    @ExcelProperty("本渠道裂变率")
     private Double score;
+
+    @ExcelProperty(value = "预估单价")
+    private Double unitPrice;
+
+    @ExcelProperty(value = "建议结算金额")
+    private Double settlementAmount;
 }

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

@@ -1,6 +1,7 @@
 package com.tzld.piaoquan.api.service.contentplatform.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
 import com.tzld.piaoquan.api.common.enums.contentplatform.AccountStatusEnum;
 import com.tzld.piaoquan.api.common.exception.CommonException;
@@ -153,6 +154,7 @@ public class ContentPlatformAccountServiceImpl implements ContentPlatformAccount
             accountVO.setChannel(account.getChannel());
             accountVO.setContactName(account.getContactName());
             accountVO.setTelNum(account.getTelNum());
+            accountVO.setPrice(account.getPrice());
             accountVO.setStatus(account.getStatus());
             accountVO.setCreateTimestamp(account.getCreateTimestamp());
             result.add(accountVO);
@@ -194,6 +196,14 @@ public class ContentPlatformAccountServiceImpl implements ContentPlatformAccount
         if (!StringUtils.hasText(param.getChannel())) {
             throw new CommonException(ExceptionEnum.CHANNEL_NULL_WRONG);
         }
+        try {
+            JSONObject.parseObject(param.getPrice());
+        } catch (Exception e) {
+            throw new CommonException(ExceptionEnum.ACCOUNT_PRICE_ERROR);
+        }
+        if (!StringUtils.hasText(param.getPrice())) {
+            throw new CommonException(ExceptionEnum.ACCOUNT_PRICE_NULL_ERROR);
+        }
         Long now = System.currentTimeMillis();
         ContentPlatformAccount account = new ContentPlatformAccount();
         account.setName(param.getName());
@@ -201,6 +211,7 @@ public class ContentPlatformAccountServiceImpl implements ContentPlatformAccount
         account.setChannel(param.getChannel());
         account.setContactName(param.getContactName());
         account.setTelNum(param.getTelNum());
+        account.setPrice(param.getPrice());
         if (StringUtils.hasText(param.getPassword())) {
             String password = new String(Base64.getDecoder().decode(param.getPassword()));
             account.setPassword(Md5Util.encoderByMd5(password));

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

@@ -61,13 +61,36 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
         if (count == 0) {
             return result;
         }
-        List<ContentPlatformGzhDataStat> datastatList = dataStatMapperExt.getGzhTotalDatastatList(param,
+        List<ContentPlatformGzhDataStatTotal> datastatList = dataStatMapperExt.getGzhTotalDatastatList(param,
                 user.getId(), offset, param.getPageSize());
-        List<GzhDatastatItemVO> list = buildGzhDatastatItemVOList(param.getType(), datastatList);
+        List<GzhDatastatItemVO> list = buildGzhDatastatTotalItemVOList(datastatList);
         result.setObjs(list);
         return result;
     }
 
+    private List<GzhDatastatItemVO> buildGzhDatastatTotalItemVOList(List<ContentPlatformGzhDataStatTotal> datastatList) {
+        if (CollectionUtils.isEmpty(datastatList)) {
+            return null;
+        }
+        List<GzhDatastatItemVO> result = new ArrayList<>();
+        for (ContentPlatformGzhDataStatTotal datastat : datastatList) {
+            GzhDatastatItemVO vo = new GzhDatastatItemVO();
+            vo.setDateStr(datastat.getDateStr());
+            vo.setFansIncreaseCount(datastat.getFansIncreaseCount());
+            vo.setFirstLevel(datastat.getFirstLevelCount());
+            vo.setScore(datastat.getScore());
+            vo.setUnitPrice(datastat.getUnitPrice());
+            vo.setSettlementAmount(datastat.getSettlementAmount());
+            if (Objects.nonNull(vo.getFansIncreaseCount()) && vo.getFansIncreaseCount() > 0) {
+                BigDecimal num = BigDecimal.valueOf(vo.getFirstLevel() / (double) vo.getFansIncreaseCount());
+                BigDecimal rounded = num.setScale(3, RoundingMode.HALF_UP);
+                vo.setOpenRate(rounded.doubleValue());
+            }
+            result.add(vo);
+        }
+        return result;
+    }
+
     private Page<GzhDatastatItemVO> gzhAccountDatastatList(GzhDatastatListParam param) {
         ContentPlatformAccount user = LoginUserContext.getUser();
         Page<GzhDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
@@ -93,13 +116,36 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
         if (count == 0) {
             return result;
         }
-        List<ContentPlatformGzhDataStat> datastatList = dataStatMapperExt.getFwhTotalDatastatList(param,
+        List<ContentPlatformFwhDataStatTotal> datastatList = dataStatMapperExt.getFwhTotalDatastatList(param,
                 user.getId(), offset, param.getPageSize());
-        List<GzhDatastatItemVO> list = buildGzhDatastatItemVOList(param.getType(), datastatList);
+        List<GzhDatastatItemVO> list = buildFwhDatastatTotalItemVOList(datastatList);
         result.setObjs(list);
         return result;
     }
 
+    private List<GzhDatastatItemVO> buildFwhDatastatTotalItemVOList(List<ContentPlatformFwhDataStatTotal> datastatList) {
+        if (CollectionUtils.isEmpty(datastatList)) {
+            return null;
+        }
+        List<GzhDatastatItemVO> result = new ArrayList<>();
+        for (ContentPlatformFwhDataStatTotal datastat : datastatList) {
+            GzhDatastatItemVO vo = new GzhDatastatItemVO();
+            vo.setDateStr(datastat.getDateStr());
+            vo.setFansIncreaseCount(datastat.getFansIncreaseCount());
+            vo.setFirstLevel(datastat.getFirstLevelCount());
+            vo.setScore(datastat.getScore());
+            vo.setUnitPrice(datastat.getUnitPrice());
+            vo.setSettlementAmount(datastat.getSettlementAmount());
+            if (Objects.nonNull(vo.getFansIncreaseCount()) && vo.getFansIncreaseCount() > 0) {
+                BigDecimal num = BigDecimal.valueOf(vo.getFirstLevel() / (double) vo.getFansIncreaseCount());
+                BigDecimal rounded = num.setScale(3, RoundingMode.HALF_UP);
+                vo.setOpenRate(rounded.doubleValue());
+            }
+            result.add(vo);
+        }
+        return result;
+    }
+
     private Page<GzhDatastatItemVO> fwhAccountDatastatList(GzhDatastatListParam param) {
         ContentPlatformAccount user = LoginUserContext.getUser();
         Page<GzhDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
@@ -184,6 +230,8 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
             vo.setDateStr(datastat.getDateStr());
             vo.setFirstLevel(datastat.getFirstLevelCount());
             vo.setScore(datastat.getScore());
+            vo.setUnitPrice(datastat.getUnitPrice());
+            vo.setSettlementAmount(datastat.getSettlementAmount());
             return vo;
         }).collect(Collectors.toList());
         result.setObjs(list);
@@ -245,6 +293,8 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
             vo.setSubChannel(datastat.getSubChannel());
             vo.setFirstLevel(datastat.getFirstLevelCount());
             vo.setScore(datastat.getScore());
+            vo.setUnitPrice(datastat.getUnitPrice());
+            vo.setSettlementAmount(datastat.getSettlementAmount());
             return vo;
         }).collect(Collectors.toList());
         result.setObjs(list);
@@ -324,7 +374,7 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
         if (CollectionUtils.isNotEmpty(dataList)) {
             for (GzhDatastatItemVO data : dataList) {
                 list.add(new GzhTotalDatastatItemExportVO(data.getDateStr(), data.getFansIncreaseCount(),
-                        data.getFirstLevel(), data.getOpenRate(), data.getScore()));
+                        data.getFirstLevel(), data.getOpenRate(), data.getScore(), data.getUnitPrice(), data.getSettlementAmount()));
             }
         } else {
             list.add(new GzhTotalDatastatItemExportVO());
@@ -391,7 +441,8 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
         ArrayList<QwSubChannelDatastatItemExportVO> list = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(dataList)) {
             for (QwDatastatItemVO data : dataList) {
-                list.add(new QwSubChannelDatastatItemExportVO(data.getDateStr(), data.getSubChannel(), data.getFirstLevel(), data.getScore()));
+                list.add(new QwSubChannelDatastatItemExportVO(data.getDateStr(), data.getSubChannel(),
+                        data.getFirstLevel(), data.getScore(), data.getUnitPrice(), data.getSettlementAmount()));
             }
         } else {
             list.add(new QwSubChannelDatastatItemExportVO());
@@ -408,7 +459,8 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
         ArrayList<QwGroupDatastatItemExportVO> list = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(dataList)) {
             for (QwDatastatItemVO data : dataList) {
-                list.add(new QwGroupDatastatItemExportVO(data.getDateStr(), data.getFirstLevel(), data.getScore()));
+                list.add(new QwGroupDatastatItemExportVO(data.getDateStr(), data.getFirstLevel(), data.getScore(),
+                        data.getUnitPrice(), data.getSettlementAmount()));
             }
         } else {
             list.add(new QwGroupDatastatItemExportVO());

+ 26 - 8
api-module/src/main/resources/mapper/contentplatform/ContentPlatformAccountMapper.xml

@@ -8,6 +8,7 @@
     <result column="channel" jdbcType="VARCHAR" property="channel" />
     <result column="contact_name" jdbcType="VARCHAR" property="contactName" />
     <result column="tel_num" jdbcType="VARCHAR" property="telNum" />
+    <result column="price" jdbcType="VARCHAR" property="price" />
     <result column="password" jdbcType="VARCHAR" property="password" />
     <result column="token" jdbcType="VARCHAR" property="token" />
     <result column="token_expire_timestamp" jdbcType="BIGINT" property="tokenExpireTimestamp" />
@@ -76,8 +77,9 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, `name`, `identity`, channel, contact_name, tel_num, `password`, token, token_expire_timestamp, 
-    `status`, create_account, create_timestamp, update_account, update_timestamp
+    id, `name`, `identity`, channel, contact_name, tel_num, price, `password`, token, 
+    token_expire_timestamp, `status`, create_account, create_timestamp, update_account, 
+    update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccountExample" resultMap="BaseResultMap">
     select
@@ -115,14 +117,16 @@
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount">
     insert into content_platform_account (id, `name`, `identity`, 
       channel, contact_name, tel_num, 
-      `password`, token, token_expire_timestamp, 
-      `status`, create_account, create_timestamp, 
-      update_account, update_timestamp)
+      price, `password`, token, 
+      token_expire_timestamp, `status`, create_account, 
+      create_timestamp, update_account, update_timestamp
+      )
     values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{identity,jdbcType=INTEGER}, 
       #{channel,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR}, #{telNum,jdbcType=VARCHAR}, 
-      #{password,jdbcType=VARCHAR}, #{token,jdbcType=VARCHAR}, #{tokenExpireTimestamp,jdbcType=BIGINT}, 
-      #{status,jdbcType=INTEGER}, #{createAccount,jdbcType=VARCHAR}, #{createTimestamp,jdbcType=BIGINT}, 
-      #{updateAccount,jdbcType=VARCHAR}, #{updateTimestamp,jdbcType=BIGINT})
+      #{price,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{token,jdbcType=VARCHAR}, 
+      #{tokenExpireTimestamp,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{createAccount,jdbcType=VARCHAR}, 
+      #{createTimestamp,jdbcType=BIGINT}, #{updateAccount,jdbcType=VARCHAR}, #{updateTimestamp,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount">
     insert into content_platform_account
@@ -145,6 +149,9 @@
       <if test="telNum != null">
         tel_num,
       </if>
+      <if test="price != null">
+        price,
+      </if>
       <if test="password != null">
         `password`,
       </if>
@@ -189,6 +196,9 @@
       <if test="telNum != null">
         #{telNum,jdbcType=VARCHAR},
       </if>
+      <if test="price != null">
+        #{price,jdbcType=VARCHAR},
+      </if>
       <if test="password != null">
         #{password,jdbcType=VARCHAR},
       </if>
@@ -242,6 +252,9 @@
       <if test="record.telNum != null">
         tel_num = #{record.telNum,jdbcType=VARCHAR},
       </if>
+      <if test="record.price != null">
+        price = #{record.price,jdbcType=VARCHAR},
+      </if>
       <if test="record.password != null">
         `password` = #{record.password,jdbcType=VARCHAR},
       </if>
@@ -279,6 +292,7 @@
       channel = #{record.channel,jdbcType=VARCHAR},
       contact_name = #{record.contactName,jdbcType=VARCHAR},
       tel_num = #{record.telNum,jdbcType=VARCHAR},
+      price = #{record.price,jdbcType=VARCHAR},
       `password` = #{record.password,jdbcType=VARCHAR},
       token = #{record.token,jdbcType=VARCHAR},
       token_expire_timestamp = #{record.tokenExpireTimestamp,jdbcType=BIGINT},
@@ -309,6 +323,9 @@
       <if test="telNum != null">
         tel_num = #{telNum,jdbcType=VARCHAR},
       </if>
+      <if test="price != null">
+        price = #{price,jdbcType=VARCHAR},
+      </if>
       <if test="password != null">
         `password` = #{password,jdbcType=VARCHAR},
       </if>
@@ -343,6 +360,7 @@
       channel = #{channel,jdbcType=VARCHAR},
       contact_name = #{contactName,jdbcType=VARCHAR},
       tel_num = #{telNum,jdbcType=VARCHAR},
+      price = #{price,jdbcType=VARCHAR},
       `password` = #{password,jdbcType=VARCHAR},
       token = #{token,jdbcType=VARCHAR},
       token_expire_timestamp = #{tokenExpireTimestamp,jdbcType=BIGINT},

+ 36 - 3
api-module/src/main/resources/mapper/contentplatform/ContentPlatformFwhDataStatTotalMapper.xml

@@ -8,6 +8,8 @@
     <result column="fans_increase_count" jdbcType="INTEGER" property="fansIncreaseCount" />
     <result column="first_level_count" jdbcType="INTEGER" property="firstLevelCount" />
     <result column="score" jdbcType="DOUBLE" property="score" />
+    <result column="unit_price" jdbcType="DOUBLE" property="unitPrice" />
+    <result column="settlement_amount" jdbcType="DOUBLE" property="settlementAmount" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
   <sql id="Example_Where_Clause">
@@ -69,7 +71,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, date_str, channel, fans_increase_count, first_level_count, score, create_timestamp
+    id, date_str, channel, fans_increase_count, first_level_count, score, unit_price, 
+    settlement_amount, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformFwhDataStatTotalExample" resultMap="BaseResultMap">
     select
@@ -107,10 +110,12 @@
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformFwhDataStatTotal">
     insert into content_platform_fwh_datastat_total (id, date_str, channel, 
       fans_increase_count, first_level_count, score, 
-      create_timestamp)
+      unit_price, settlement_amount, create_timestamp
+      )
     values (#{id,jdbcType=BIGINT}, #{dateStr,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, 
       #{fansIncreaseCount,jdbcType=INTEGER}, #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, 
-      #{createTimestamp,jdbcType=BIGINT})
+      #{unitPrice,jdbcType=DOUBLE}, #{settlementAmount,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformFwhDataStatTotal">
     insert into content_platform_fwh_datastat_total
@@ -133,6 +138,12 @@
       <if test="score != null">
         score,
       </if>
+      <if test="unitPrice != null">
+        unit_price,
+      </if>
+      <if test="settlementAmount != null">
+        settlement_amount,
+      </if>
       <if test="createTimestamp != null">
         create_timestamp,
       </if>
@@ -156,6 +167,12 @@
       <if test="score != null">
         #{score,jdbcType=DOUBLE},
       </if>
+      <if test="unitPrice != null">
+        #{unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="settlementAmount != null">
+        #{settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="createTimestamp != null">
         #{createTimestamp,jdbcType=BIGINT},
       </if>
@@ -188,6 +205,12 @@
       <if test="record.score != null">
         score = #{record.score,jdbcType=DOUBLE},
       </if>
+      <if test="record.unitPrice != null">
+        unit_price = #{record.unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="record.settlementAmount != null">
+        settlement_amount = #{record.settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="record.createTimestamp != null">
         create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
       </if>
@@ -204,6 +227,8 @@
       fans_increase_count = #{record.fansIncreaseCount,jdbcType=INTEGER},
       first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
       score = #{record.score,jdbcType=DOUBLE},
+      unit_price = #{record.unitPrice,jdbcType=DOUBLE},
+      settlement_amount = #{record.settlementAmount,jdbcType=DOUBLE},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -227,6 +252,12 @@
       <if test="score != null">
         score = #{score,jdbcType=DOUBLE},
       </if>
+      <if test="unitPrice != null">
+        unit_price = #{unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="settlementAmount != null">
+        settlement_amount = #{settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="createTimestamp != null">
         create_timestamp = #{createTimestamp,jdbcType=BIGINT},
       </if>
@@ -240,6 +271,8 @@
       fans_increase_count = #{fansIncreaseCount,jdbcType=INTEGER},
       first_level_count = #{firstLevelCount,jdbcType=INTEGER},
       score = #{score,jdbcType=DOUBLE},
+      unit_price = #{unitPrice,jdbcType=DOUBLE},
+      settlement_amount = #{settlementAmount,jdbcType=DOUBLE},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>

+ 36 - 3
api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhDataStatTotalMapper.xml

@@ -8,6 +8,8 @@
     <result column="fans_increase_count" jdbcType="INTEGER" property="fansIncreaseCount" />
     <result column="first_level_count" jdbcType="INTEGER" property="firstLevelCount" />
     <result column="score" jdbcType="DOUBLE" property="score" />
+    <result column="unit_price" jdbcType="DOUBLE" property="unitPrice" />
+    <result column="settlement_amount" jdbcType="DOUBLE" property="settlementAmount" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
   <sql id="Example_Where_Clause">
@@ -69,7 +71,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, date_str, channel, fans_increase_count, first_level_count, score, create_timestamp
+    id, date_str, channel, fans_increase_count, first_level_count, score, unit_price, 
+    settlement_amount, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStatTotalExample" resultMap="BaseResultMap">
     select
@@ -107,10 +110,12 @@
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStatTotal">
     insert into content_platform_gzh_datastat_total (id, date_str, channel, 
       fans_increase_count, first_level_count, score, 
-      create_timestamp)
+      unit_price, settlement_amount, create_timestamp
+      )
     values (#{id,jdbcType=BIGINT}, #{dateStr,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, 
       #{fansIncreaseCount,jdbcType=INTEGER}, #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, 
-      #{createTimestamp,jdbcType=BIGINT})
+      #{unitPrice,jdbcType=DOUBLE}, #{settlementAmount,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStatTotal">
     insert into content_platform_gzh_datastat_total
@@ -133,6 +138,12 @@
       <if test="score != null">
         score,
       </if>
+      <if test="unitPrice != null">
+        unit_price,
+      </if>
+      <if test="settlementAmount != null">
+        settlement_amount,
+      </if>
       <if test="createTimestamp != null">
         create_timestamp,
       </if>
@@ -156,6 +167,12 @@
       <if test="score != null">
         #{score,jdbcType=DOUBLE},
       </if>
+      <if test="unitPrice != null">
+        #{unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="settlementAmount != null">
+        #{settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="createTimestamp != null">
         #{createTimestamp,jdbcType=BIGINT},
       </if>
@@ -188,6 +205,12 @@
       <if test="record.score != null">
         score = #{record.score,jdbcType=DOUBLE},
       </if>
+      <if test="record.unitPrice != null">
+        unit_price = #{record.unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="record.settlementAmount != null">
+        settlement_amount = #{record.settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="record.createTimestamp != null">
         create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
       </if>
@@ -204,6 +227,8 @@
       fans_increase_count = #{record.fansIncreaseCount,jdbcType=INTEGER},
       first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
       score = #{record.score,jdbcType=DOUBLE},
+      unit_price = #{record.unitPrice,jdbcType=DOUBLE},
+      settlement_amount = #{record.settlementAmount,jdbcType=DOUBLE},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -227,6 +252,12 @@
       <if test="score != null">
         score = #{score,jdbcType=DOUBLE},
       </if>
+      <if test="unitPrice != null">
+        unit_price = #{unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="settlementAmount != null">
+        settlement_amount = #{settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="createTimestamp != null">
         create_timestamp = #{createTimestamp,jdbcType=BIGINT},
       </if>
@@ -240,6 +271,8 @@
       fans_increase_count = #{fansIncreaseCount,jdbcType=INTEGER},
       first_level_count = #{firstLevelCount,jdbcType=INTEGER},
       score = #{score,jdbcType=DOUBLE},
+      unit_price = #{unitPrice,jdbcType=DOUBLE},
+      settlement_amount = #{settlementAmount,jdbcType=DOUBLE},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>

+ 38 - 5
api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwDataStatSubChannelMapper.xml

@@ -7,6 +7,8 @@
     <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="unit_price" jdbcType="DOUBLE" property="unitPrice" />
+    <result column="settlement_amount" jdbcType="DOUBLE" property="settlementAmount" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
@@ -69,7 +71,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, date_str, sub_channel, first_level_count, score, create_account_id, create_timestamp
+    id, date_str, sub_channel, first_level_count, score, unit_price, settlement_amount, 
+    create_account_id, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatSubChannelExample" resultMap="BaseResultMap">
     select
@@ -106,11 +109,13 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatSubChannel">
     insert into content_platform_qw_datastat_sub_channel (id, date_str, sub_channel, 
-      first_level_count, score, create_account_id, 
-      create_timestamp)
+      first_level_count, score, unit_price, 
+      settlement_amount, create_account_id, create_timestamp
+      )
     values (#{id,jdbcType=BIGINT}, #{dateStr,jdbcType=VARCHAR}, #{subChannel,jdbcType=VARCHAR}, 
-      #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, #{createAccountId,jdbcType=BIGINT}, 
-      #{createTimestamp,jdbcType=BIGINT})
+      #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, #{unitPrice,jdbcType=DOUBLE}, 
+      #{settlementAmount,jdbcType=DOUBLE}, #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatSubChannel">
     insert into content_platform_qw_datastat_sub_channel
@@ -130,6 +135,12 @@
       <if test="score != null">
         score,
       </if>
+      <if test="unitPrice != null">
+        unit_price,
+      </if>
+      <if test="settlementAmount != null">
+        settlement_amount,
+      </if>
       <if test="createAccountId != null">
         create_account_id,
       </if>
@@ -153,6 +164,12 @@
       <if test="score != null">
         #{score,jdbcType=DOUBLE},
       </if>
+      <if test="unitPrice != null">
+        #{unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="settlementAmount != null">
+        #{settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="createAccountId != null">
         #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -185,6 +202,12 @@
       <if test="record.score != null">
         score = #{record.score,jdbcType=DOUBLE},
       </if>
+      <if test="record.unitPrice != null">
+        unit_price = #{record.unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="record.settlementAmount != null">
+        settlement_amount = #{record.settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="record.createAccountId != null">
         create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       </if>
@@ -203,6 +226,8 @@
       sub_channel = #{record.subChannel,jdbcType=VARCHAR},
       first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
       score = #{record.score,jdbcType=DOUBLE},
+      unit_price = #{record.unitPrice,jdbcType=DOUBLE},
+      settlement_amount = #{record.settlementAmount,jdbcType=DOUBLE},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
@@ -224,6 +249,12 @@
       <if test="score != null">
         score = #{score,jdbcType=DOUBLE},
       </if>
+      <if test="unitPrice != null">
+        unit_price = #{unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="settlementAmount != null">
+        settlement_amount = #{settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="createAccountId != null">
         create_account_id = #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -239,6 +270,8 @@
       sub_channel = #{subChannel,jdbcType=VARCHAR},
       first_level_count = #{firstLevelCount,jdbcType=INTEGER},
       score = #{score,jdbcType=DOUBLE},
+      unit_price = #{unitPrice,jdbcType=DOUBLE},
+      settlement_amount = #{settlementAmount,jdbcType=DOUBLE},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}

+ 35 - 5
api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwDataStatTotalMapper.xml

@@ -7,6 +7,8 @@
     <result column="channel" jdbcType="VARCHAR" property="channel" />
     <result column="first_level_count" jdbcType="INTEGER" property="firstLevelCount" />
     <result column="score" jdbcType="DOUBLE" property="score" />
+    <result column="unit_price" jdbcType="DOUBLE" property="unitPrice" />
+    <result column="settlement_amount" jdbcType="DOUBLE" property="settlementAmount" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
   <sql id="Example_Where_Clause">
@@ -68,7 +70,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, date_str, channel, first_level_count, score, create_timestamp
+    id, date_str, channel, first_level_count, score, unit_price, settlement_amount, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatTotalExample" resultMap="BaseResultMap">
     select
@@ -105,11 +107,11 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatTotal">
     insert into content_platform_qw_datastat_total (id, date_str, channel, 
-      first_level_count, score, create_timestamp
-      )
+      first_level_count, score, unit_price, 
+      settlement_amount, create_timestamp)
     values (#{id,jdbcType=BIGINT}, #{dateStr,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, 
-      #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT}
-      )
+      #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, #{unitPrice,jdbcType=DOUBLE}, 
+      #{settlementAmount,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatTotal">
     insert into content_platform_qw_datastat_total
@@ -129,6 +131,12 @@
       <if test="score != null">
         score,
       </if>
+      <if test="unitPrice != null">
+        unit_price,
+      </if>
+      <if test="settlementAmount != null">
+        settlement_amount,
+      </if>
       <if test="createTimestamp != null">
         create_timestamp,
       </if>
@@ -149,6 +157,12 @@
       <if test="score != null">
         #{score,jdbcType=DOUBLE},
       </if>
+      <if test="unitPrice != null">
+        #{unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="settlementAmount != null">
+        #{settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="createTimestamp != null">
         #{createTimestamp,jdbcType=BIGINT},
       </if>
@@ -178,6 +192,12 @@
       <if test="record.score != null">
         score = #{record.score,jdbcType=DOUBLE},
       </if>
+      <if test="record.unitPrice != null">
+        unit_price = #{record.unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="record.settlementAmount != null">
+        settlement_amount = #{record.settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="record.createTimestamp != null">
         create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
       </if>
@@ -193,6 +213,8 @@
       channel = #{record.channel,jdbcType=VARCHAR},
       first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
       score = #{record.score,jdbcType=DOUBLE},
+      unit_price = #{record.unitPrice,jdbcType=DOUBLE},
+      settlement_amount = #{record.settlementAmount,jdbcType=DOUBLE},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -213,6 +235,12 @@
       <if test="score != null">
         score = #{score,jdbcType=DOUBLE},
       </if>
+      <if test="unitPrice != null">
+        unit_price = #{unitPrice,jdbcType=DOUBLE},
+      </if>
+      <if test="settlementAmount != null">
+        settlement_amount = #{settlementAmount,jdbcType=DOUBLE},
+      </if>
       <if test="createTimestamp != null">
         create_timestamp = #{createTimestamp,jdbcType=BIGINT},
       </if>
@@ -225,6 +253,8 @@
       channel = #{channel,jdbcType=VARCHAR},
       first_level_count = #{firstLevelCount,jdbcType=INTEGER},
       score = #{score,jdbcType=DOUBLE},
+      unit_price = #{unitPrice,jdbcType=DOUBLE},
+      settlement_amount = #{settlementAmount,jdbcType=DOUBLE},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>

+ 7 - 0
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformAccountMapperExt.xml

@@ -33,6 +33,13 @@
             resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount">
         select *
         from content_platform_account
+        <if test="param!=null">
+            <where>
+                <if test="param.name != null and param.name !=''">
+                    and name like concat('%', #{param.name}, '%')
+                </if>
+            </where>
+        </if>
         order by create_timestamp desc
         limit #{offset}, #{pageSize}
     </select>

+ 16 - 14
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.xml

@@ -33,8 +33,8 @@
     </select>
 
     <select id="getGzhTotalDatastatList"
-            resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStat">
-        select date_str, fans_increase_count, first_level_count, score
+            resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStatTotal">
+        select date_str, fans_increase_count, first_level_count, score, unit_price, settlement_amount
         from content_platform_gzh_datastat_total cpgdt
          join content_platform_account cpa on cpgdt.channel = cpa.channel
         where cpa.id = #{createAccountId}
@@ -73,8 +73,8 @@
     </select>
 
     <select id="getFwhTotalDatastatList"
-            resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStat">
-        select date_str, fans_increase_count, first_level_count, score
+            resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformFwhDataStatTotal">
+        select date_str, fans_increase_count, first_level_count, score, unit_price, settlement_amount
         from content_platform_fwh_datastat_total cpfdt
          join content_platform_account cpa on cpfdt.channel = cpa.channel
         where cpa.id = #{createAccountId}
@@ -107,7 +107,7 @@
 
     <select id="getQwTotalDatastatList"
             resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatTotal">
-        select date_str, channel, first_level_count, score
+        select date_str, channel, first_level_count, score, unit_price, settlement_amount
         from content_platform_qw_datastat_total
         where channel = #{channel}
         order by date_str desc, id
@@ -137,7 +137,7 @@
 
     <select id="getQwSubChannelDatastatList"
             resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatSubChannel">
-        select date_str, sub_channel, first_level_count, score
+        select date_str, sub_channel, first_level_count, score, unit_price, settlement_amount
         from content_platform_qw_datastat_sub_channel
         where create_account_id = #{createAccountId}
         order by date_str desc, id
@@ -200,11 +200,11 @@
 
     <insert id="batchInsertGzhDatastatTotal">
         insert into content_platform_gzh_datastat_total (date_str, channel, fans_increase_count, first_level_count, score,
-        create_timestamp)
+        unit_price, settlement_amount, create_timestamp)
         values
         <foreach collection="records" item="item" separator=",">
             (#{item.dateStr}, #{item.channel}, #{item.fansIncreaseCount}, #{item.firstLevelCount}, #{item.score},
-            #{item.createTimestamp})
+            #{item.unitPrice}, #{item.settlementAmount}, #{item.createTimestamp})
         </foreach>
     </insert>
 
@@ -220,11 +220,11 @@
 
     <insert id="batchInsertFwhDatastatTotal">
         insert into content_platform_fwh_datastat_total (date_str, channel, fans_increase_count, first_level_count, score,
-        create_timestamp)
+        unit_price, settlement_amount, create_timestamp)
         values
         <foreach collection="records" item="item" separator=",">
             (#{item.dateStr}, #{item.channel}, #{item.fansIncreaseCount}, #{item.firstLevelCount}, #{item.score},
-            #{item.createTimestamp})
+            #{item.unitPrice}, #{item.settlementAmount}, #{item.createTimestamp})
         </foreach>
     </insert>
 
@@ -237,10 +237,12 @@
     </insert>
 
     <insert id="batchInsertQwDatastatTotal">
-        insert into content_platform_qw_datastat_total (date_str, channel, first_level_count, score, create_timestamp)
+        insert into content_platform_qw_datastat_total (date_str, channel, first_level_count, score, unit_price,
+                                                        settlement_amount, create_timestamp)
         values
         <foreach collection="records" item="item" separator=",">
-            (#{item.dateStr}, #{item.channel}, #{item.firstLevelCount}, #{item.score}, #{item.createTimestamp})
+            (#{item.dateStr}, #{item.channel}, #{item.firstLevelCount}, #{item.score}, #{item.unitPrice},
+             #{item.settlementAmount}, #{item.createTimestamp})
         </foreach>
     </insert>
 
@@ -254,11 +256,11 @@
 
     <insert id="batchInsertQwDatastatSubChannel">
         insert into content_platform_qw_datastat_sub_channel (date_str, sub_channel, first_level_count, score,
-                                                              create_account_id, create_timestamp)
+                                                              create_account_id, unit_price, settlement_amount, create_timestamp)
         values
         <foreach collection="records" item="item" separator=",">
             (#{item.dateStr}, #{item.subChannel}, #{item.firstLevelCount}, #{item.score}, #{item.createAccountId},
-             #{item.createTimestamp})
+            #{item.unitPrice}, #{item.settlementAmount}, #{item.createTimestamp})
         </foreach>
     </insert>