Sfoglia il codice sorgente

Merge branch 'master' into jiaoyang

yumeng 4 anni fa
parent
commit
2a53df381b
14 ha cambiato i file con 33 aggiunte e 30 eliminazioni
  1. 10 6
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  2. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml
  3. 3 2
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouMatDailyReportJob.java
  4. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroup.java
  5. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml
  6. 4 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java
  7. 2 12
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  8. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaishouReportAccountDailyMapper.java
  9. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAccountMapper.java
  10. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml
  11. 2 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouReportAccountDailyServiceImpl.java
  12. 3 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouReportAccountHourlyServiceImpl.java
  13. 1 1
      module-kuaishou/src/main/resources/json_template/kuaishou_filed_mapping.json
  14. 1 1
      module-kuaishou/src/main/resources/json_template/kuaishou_video_report_filed_mapping.json

+ 10 - 6
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -20,7 +20,6 @@ import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataServ
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.*;
-import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -71,6 +70,8 @@ public class SampleTest {
     private IKuaishouReportDailyGroupService reportDailyGroupService;
     @Autowired
     private IEtlKuaiShouAccountMaterialOverviewService kuaiShouAccountMaterialOverviewService;
+    @Autowired
+    private IKuaiShouGroupService kuaiShouGroupService;
 
 
     @Test
@@ -81,7 +82,10 @@ public class SampleTest {
         CtopOauthToken token = new CtopOauthToken();
         token.setAccountId(9901975L);
         token.setAccessToken("1c7cebebc3174c39fe941d136df65b1d");
-        kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate,"adScene");
+
+        kuaiShouGroupService.getGroupListByPage("90f31a01c2137aa11c8686e86064b630",9845316L,null,1);
+
+//        kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate, "adScene");
 
      /*   JSONObject materialOverview = kuaiShouAccountMaterialOverviewService.getMaterialOverview(5473041L, "2021-03-09");
         System.err.println(materialOverview);*/
@@ -610,11 +614,11 @@ public class SampleTest {
     private IEtlKuaishouVideoInfoService videoEtlInfoService;
 
     @Test
-    public void etlKuaishouVideoInfo(){
-        Date startDate = DateUtils.parseDate("2020-09-11","yyyy-MM-dd");
-        for(int i=0;i<365;i++){
+    public void etlKuaishouVideoInfo() {
+        Date startDate = DateUtils.parseDate("2020-09-11", "yyyy-MM-dd");
+        for (int i = 0; i < 365; i++) {
 //            dailyService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(startDate,i)));
-            videoEtlInfoService.etlKuaishouVideoInfo(DateUtils.formatDate(DateUtils.addDay(startDate,i)));
+            videoEtlInfoService.etlKuaishouVideoInfo(DateUtils.formatDate(DateUtils.addDay(startDate, i)));
         }
     }
 

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml

@@ -66,6 +66,7 @@
     ctop_user_allocation  t2
     ON t1.account_id = t2.account_id
     WHERE t2.project_id = #{projectId}
+    AND t2.account_status = 0
     GROUP BY t1.user_id;
     </select>
 

+ 3 - 2
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouMatDailyReportJob.java

@@ -24,8 +24,9 @@ public class KuaishouMatDailyReportJob {
     @XxlJob("kuaishouMaterialReportByStateDate")
     public void execute() throws Exception {
         //增加接口的开始和结束日期
-        String endDate = DateUtils.getNowDate("yyyy-MM-dd");
-        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", endDate, -1);
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String endDate =DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         tokens.forEach(token -> executorService.submit(() -> {

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroup.java

@@ -110,6 +110,7 @@ public class KuaiShouGroup {
      * 落地页链接
      */
     private Object url;
+    private String schemaUri;
     /**
      * APP ID
      */
@@ -120,7 +121,6 @@ public class KuaiShouGroup {
     private String appIconUrl;
 
 
-
     // 转化目标
     private Long convertId;
     // 转化目标

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml

@@ -28,6 +28,7 @@
         unit_type,
         url_type,
         url,
+        schema_uri,
         app_id,
         app_icon_url,
         convert_id,
@@ -66,6 +67,7 @@
             #{getGroup.unitType},
             #{getGroup.urlType},
             #{getGroup.url},
+            #{getGroup.schemaUri},
             #{getGroup.appId},
             #{getGroup.appIconUrl},
             #{getGroup.convertId},

+ 4 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java

@@ -86,7 +86,9 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GROUP_LIST;
         JSONObject param = new JSONObject();
         param.put("advertiser_id", accountId);
-        param.put("campaign_id", campaignId);
+        if(!Check.isNull(campaignId)){
+            param.put("campaign_id", campaignId);
+        }
         param.put("page_size", 500);
         param.put("page", page);
 
@@ -424,6 +426,7 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
                     group.setUnitType(detail.getInteger("unit_type"));
                     group.setUrlType(detail.getInteger("url_type"));
                     group.setUrl(detail.getString("url"));
+                    group.setSchemaUri(detail.getString("schema_uri"));
                     group.setAppId(detail.getLong("app_id"));
                     group.setAppIconUrl(detail.getString("app_icon_url"));
                     group.setGroupCreateTime(detail.getString("create_time"));

+ 2 - 12
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -18,7 +18,6 @@ import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResultToken;
 import cn.com.ctop.kuaishou.modules.report.entity.*;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
 import cn.com.ctop.kuaishou.modules.report.service.*;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -71,10 +70,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Autowired
     private IKuaiShouCreativeService creativeService;
     @Autowired
-    private KuaiShouConversionInfosMapper conversionInfosMapper;
-    @Autowired
-    private KuaiShouConversionTypesMapper conversionTypesMapper;
-    @Autowired
     private KuaiShouRegionListChildrenMapper regionListChildrenMapper;
     @Autowired
     private KuaiShouRegionListParentMapper regionListParentMapper;
@@ -95,8 +90,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Autowired
     private IKuaishouReportDailyCampaignService dailyCampaignService;
     @Autowired
-    private KuaishouReportDailyGroupMapper dailyGroupMapper;
-    @Autowired
     private IKuaishouReportHourlyGroupService hourlyGroupService;
     @Autowired
     private IKuaishouReportDailyCreativeService dailyCreativeService;
@@ -113,8 +106,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Autowired
     private IUserAllocationService userAllocationService;
     @Autowired
-    private IKuaishouReportDailyCreativeStatisticService dailyCreativeStatisticService;
-    @Autowired
     private IKuaiShouHistoryReportTaskService historyReportTaskService;
     @Autowired
     private IKuaiShouImageGetService kuaiShouImageGetService;
@@ -125,8 +116,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Autowired
     private IKuaiShouGroupService getKuaiShouGroupService;
     @Autowired
-    private IKuaiShouAdvertiserBaseInfoService KuaiShouAdvertiserBaseInfoService;
-    @Autowired
     private IWarningOperationService warningOperationService;
 
 
@@ -838,7 +827,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             Date getStartDate = DateUtils.addDay(endDate, -i);
             //1: 获取广告主信息数据
             getAdvertiserReportHourly(token, getStartDate, getStartDate);
-            getAdvertiserReportDaily(token, getStartDate, getStartDate, "adScene");
+            getAdvertiserReportDaily(token, getStartDate, getStartDate, null);
             //2:获取广告计划信息数据
             // getAdvertiserCampaignReportHourly(token, getStartDate, getStartDate);
             //3:获取广告组信息数据
@@ -1328,6 +1317,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     group.setUnitType(detail.getInteger("unit_type"));
                     group.setUrlType(detail.getInteger("url_type"));
                     group.setUrl(detail.getString("url"));
+                    group.setSchemaUri(detail.getString("schema_uri"));
                     group.setAppId(detail.getLong("app_id"));
                     group.setAppIconUrl(detail.getString("app_icon_url"));
                     group.setGroupCreateTime(detail.getString("create_time"));

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaishouReportAccountDailyMapper.java

@@ -17,7 +17,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface EtlKuaishouReportAccountDailyMapper extends BaseMapper<EtlKuaishouReportAccountDaily> {
 
-    void replaceBatch(@Param("list") List<EtlKuaishouReportAccountDaily> list);
+    void replaceBatch(@Param("list") List<EtlKuaishouReportAccountHourly> list);
 
     EtlKuaishouReportAccountHourly getOnedayAggregatebyDaily(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("accountId") Long accountId);
 

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAccountMapper.java

@@ -51,7 +51,7 @@ public interface KuaishouReportDailyAccountMapper extends BaseMapper<KuaishouRep
 
     void replaceBatchAdScene(@Param("addList") List<KuaishouReportDailyAccount> addList);
 
-    List<EtlKuaishouReportAccountDaily> queryEveryDayDataForAccount();
+    List<EtlKuaishouReportAccountHourly> queryEveryDayDataForAccount();
 
     BigDecimal getSumChargeByAccountIdAndStatDate(@Param("accountId") Long accountId, @Param("statDate") String statDate);
 }

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -1452,7 +1452,7 @@
     </select>
 
     <select id="queryEveryDayDataForAccount"
-            resultType="cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountDaily">
+            resultType="cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly">
     SELECT stat_date,
            account_id,
            SUM(charge) as 'charge',

+ 2 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouReportAccountDailyServiceImpl.java

@@ -2,6 +2,7 @@ package cn.com.ctop.kuaishou.modules.report.service.impl;
 
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountDaily;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly;
 import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouReportAccountDailyMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountDailyService;
@@ -29,7 +30,7 @@ public class EtlKuaishouReportAccountDailyServiceImpl extends ServiceImpl<EtlKua
 
     @Override
     public void queryEveryDayDataForAccount() {
-        List<EtlKuaishouReportAccountDaily> list = dailyAccountMapper.queryEveryDayDataForAccount();
+        List<EtlKuaishouReportAccountHourly> list = dailyAccountMapper.queryEveryDayDataForAccount();
         if (!Check.isNull(list)) {
             etlDailyAccountMapper.replaceBatch(list);
         }

+ 3 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouReportAccountHourlyServiceImpl.java

@@ -64,6 +64,7 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
         if (!Check.isNull(list)) {
             etlHourlyAccountMapper.replaceBatch(list);
         }
+        etlDailyAccountMapper.replaceBatch(list);
     }
 
     @Override
@@ -128,8 +129,8 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
             if ("photo_comment".equals(value)) {
                 value = "comment";
             }
-            if("play_3s_count".equals(value)){
-                value =  value = request.getString("value");
+            if ("play_3s_count".equals(value)) {
+                value = value = request.getString("value");
                 type = "more";
             }
             todayList = etlHourlyAccountMapper.getOnedayEtlReportList(startTime, accountId, value, type);

+ 1 - 1
module-kuaishou/src/main/resources/json_template/kuaishou_filed_mapping.json

@@ -192,7 +192,7 @@
     "comment": "按钮点击率"
   },
   "play3sRate": {
-    "filed": "CASE WHEN sum(CEIL(t1.play_3s_ratio * t1.photo_show)) / sum(t1.photo_show) IS NULL THEN 0 ELSE round(sum(CEIL(t1.play_3s_ratio * t1.photo_show)) / sum(t1.photo_show)*100,2)end as play3sRate ",
+    "filed": "CASE WHEN sum(CEIL(t1.play_3s_ratio * t1.aclick)) / sum(t1.aclick) IS NULL THEN 0 ELSE round(sum(CEIL(t1.play_3s_ratio * t1.aclick)) / sum(t1.aclick)*100,2)end as play3sRate ",
     "comment": "3s播放率"
   },
   "activeRate": {

+ 1 - 1
module-kuaishou/src/main/resources/json_template/kuaishou_video_report_filed_mapping.json

@@ -208,7 +208,7 @@
     "comment": "3s播放数"
   },
   "play3sRate": {
-    "filed": "CASE WHEN sum(photo_show) != 0 THEN CONCAT(CAST(ROUND( sum(t1.play_3s_count) / sum(t1.photo_show),2 )  * 100 AS CHAR),'%') ELSE '-' END AS play3sRate",
+    "filed": "CASE WHEN sum(aclick) != 0 THEN CONCAT(CAST(ROUND( sum(t1.play_3s_count) / sum(t1.aclick),2 )  * 100 AS CHAR),'%') ELSE '-' END AS play3sRate",
     "comment": "3s播放率"
   }
 }