浏览代码

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-boot

zhaoxian 4 年之前
父节点
当前提交
1e968a343d

+ 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.entity.BytedanceAccountReportTaskRecord;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.*;
 import cn.com.ctop.toutiao.modules.report.service.*;
-import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
 import org.junit.Test;
@@ -71,6 +70,8 @@ public class SampleTest {
     private IKuaishouReportDailyGroupService reportDailyGroupService;
     private IKuaishouReportDailyGroupService reportDailyGroupService;
     @Autowired
     @Autowired
     private IEtlKuaiShouAccountMaterialOverviewService kuaiShouAccountMaterialOverviewService;
     private IEtlKuaiShouAccountMaterialOverviewService kuaiShouAccountMaterialOverviewService;
+    @Autowired
+    private IKuaiShouGroupService kuaiShouGroupService;
 
 
 
 
     @Test
     @Test
@@ -81,7 +82,10 @@ public class SampleTest {
         CtopOauthToken token = new CtopOauthToken();
         CtopOauthToken token = new CtopOauthToken();
         token.setAccountId(9901975L);
         token.setAccountId(9901975L);
         token.setAccessToken("1c7cebebc3174c39fe941d136df65b1d");
         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");
      /*   JSONObject materialOverview = kuaiShouAccountMaterialOverviewService.getMaterialOverview(5473041L, "2021-03-09");
         System.err.println(materialOverview);*/
         System.err.println(materialOverview);*/
@@ -610,11 +614,11 @@ public class SampleTest {
     private IEtlKuaishouVideoInfoService videoEtlInfoService;
     private IEtlKuaishouVideoInfoService videoEtlInfoService;
 
 
     @Test
     @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)));
 //            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
     ctop_user_allocation  t2
     ON t1.account_id = t2.account_id
     ON t1.account_id = t2.account_id
     WHERE t2.project_id = #{projectId}
     WHERE t2.project_id = #{projectId}
+    AND t2.account_status = 0
     GROUP BY t1.user_id;
     GROUP BY t1.user_id;
     </select>
     </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")
     @XxlJob("kuaishouMaterialReportByStateDate")
     public void execute() throws Exception {
     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:查询当日数据
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         tokens.forEach(token -> executorService.submit(() -> {
         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 Object url;
+    private String schemaUri;
     /**
     /**
      * APP ID
      * APP ID
      */
      */
@@ -120,7 +121,6 @@ public class KuaiShouGroup {
     private String appIconUrl;
     private String appIconUrl;
 
 
 
 
-
     // 转化目标
     // 转化目标
     private Long convertId;
     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,
         unit_type,
         url_type,
         url_type,
         url,
         url,
+        schema_uri,
         app_id,
         app_id,
         app_icon_url,
         app_icon_url,
         convert_id,
         convert_id,
@@ -66,6 +67,7 @@
             #{getGroup.unitType},
             #{getGroup.unitType},
             #{getGroup.urlType},
             #{getGroup.urlType},
             #{getGroup.url},
             #{getGroup.url},
+            #{getGroup.schemaUri},
             #{getGroup.appId},
             #{getGroup.appId},
             #{getGroup.appIconUrl},
             #{getGroup.appIconUrl},
             #{getGroup.convertId},
             #{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;
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GROUP_LIST;
         JSONObject param = new JSONObject();
         JSONObject param = new JSONObject();
         param.put("advertiser_id", accountId);
         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_size", 500);
         param.put("page", page);
         param.put("page", page);
 
 
@@ -424,6 +426,7 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
                     group.setUnitType(detail.getInteger("unit_type"));
                     group.setUnitType(detail.getInteger("unit_type"));
                     group.setUrlType(detail.getInteger("url_type"));
                     group.setUrlType(detail.getInteger("url_type"));
                     group.setUrl(detail.getString("url"));
                     group.setUrl(detail.getString("url"));
+                    group.setSchemaUri(detail.getString("schema_uri"));
                     group.setAppId(detail.getLong("app_id"));
                     group.setAppId(detail.getLong("app_id"));
                     group.setAppIconUrl(detail.getString("app_icon_url"));
                     group.setAppIconUrl(detail.getString("app_icon_url"));
                     group.setGroupCreateTime(detail.getString("create_time"));
                     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.entity.*;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 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.KuaishouReportDailyCampaignMapper;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
 import cn.com.ctop.kuaishou.modules.report.service.*;
 import cn.com.ctop.kuaishou.modules.report.service.*;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
@@ -71,10 +70,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Autowired
     @Autowired
     private IKuaiShouCreativeService creativeService;
     private IKuaiShouCreativeService creativeService;
     @Autowired
     @Autowired
-    private KuaiShouConversionInfosMapper conversionInfosMapper;
-    @Autowired
-    private KuaiShouConversionTypesMapper conversionTypesMapper;
-    @Autowired
     private KuaiShouRegionListChildrenMapper regionListChildrenMapper;
     private KuaiShouRegionListChildrenMapper regionListChildrenMapper;
     @Autowired
     @Autowired
     private KuaiShouRegionListParentMapper regionListParentMapper;
     private KuaiShouRegionListParentMapper regionListParentMapper;
@@ -95,8 +90,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Autowired
     @Autowired
     private IKuaishouReportDailyCampaignService dailyCampaignService;
     private IKuaishouReportDailyCampaignService dailyCampaignService;
     @Autowired
     @Autowired
-    private KuaishouReportDailyGroupMapper dailyGroupMapper;
-    @Autowired
     private IKuaishouReportHourlyGroupService hourlyGroupService;
     private IKuaishouReportHourlyGroupService hourlyGroupService;
     @Autowired
     @Autowired
     private IKuaishouReportDailyCreativeService dailyCreativeService;
     private IKuaishouReportDailyCreativeService dailyCreativeService;
@@ -113,8 +106,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Autowired
     @Autowired
     private IUserAllocationService userAllocationService;
     private IUserAllocationService userAllocationService;
     @Autowired
     @Autowired
-    private IKuaishouReportDailyCreativeStatisticService dailyCreativeStatisticService;
-    @Autowired
     private IKuaiShouHistoryReportTaskService historyReportTaskService;
     private IKuaiShouHistoryReportTaskService historyReportTaskService;
     @Autowired
     @Autowired
     private IKuaiShouImageGetService kuaiShouImageGetService;
     private IKuaiShouImageGetService kuaiShouImageGetService;
@@ -125,8 +116,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Autowired
     @Autowired
     private IKuaiShouGroupService getKuaiShouGroupService;
     private IKuaiShouGroupService getKuaiShouGroupService;
     @Autowired
     @Autowired
-    private IKuaiShouAdvertiserBaseInfoService KuaiShouAdvertiserBaseInfoService;
-    @Autowired
     private IWarningOperationService warningOperationService;
     private IWarningOperationService warningOperationService;
 
 
 
 
@@ -838,7 +827,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             Date getStartDate = DateUtils.addDay(endDate, -i);
             Date getStartDate = DateUtils.addDay(endDate, -i);
             //1: 获取广告主信息数据
             //1: 获取广告主信息数据
             getAdvertiserReportHourly(token, getStartDate, getStartDate);
             getAdvertiserReportHourly(token, getStartDate, getStartDate);
-            getAdvertiserReportDaily(token, getStartDate, getStartDate, "adScene");
+            getAdvertiserReportDaily(token, getStartDate, getStartDate, null);
             //2:获取广告计划信息数据
             //2:获取广告计划信息数据
             // getAdvertiserCampaignReportHourly(token, getStartDate, getStartDate);
             // getAdvertiserCampaignReportHourly(token, getStartDate, getStartDate);
             //3:获取广告组信息数据
             //3:获取广告组信息数据
@@ -1328,6 +1317,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     group.setUnitType(detail.getInteger("unit_type"));
                     group.setUnitType(detail.getInteger("unit_type"));
                     group.setUrlType(detail.getInteger("url_type"));
                     group.setUrlType(detail.getInteger("url_type"));
                     group.setUrl(detail.getString("url"));
                     group.setUrl(detail.getString("url"));
+                    group.setSchemaUri(detail.getString("schema_uri"));
                     group.setAppId(detail.getLong("app_id"));
                     group.setAppId(detail.getLong("app_id"));
                     group.setAppIconUrl(detail.getString("app_icon_url"));
                     group.setAppIconUrl(detail.getString("app_icon_url"));
                     group.setGroupCreateTime(detail.getString("create_time"));
                     group.setGroupCreateTime(detail.getString("create_time"));

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

@@ -192,7 +192,7 @@
     "comment": "按钮点击率"
     "comment": "按钮点击率"
   },
   },
   "play3sRate": {
   "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播放率"
     "comment": "3s播放率"
   },
   },
   "activeRate": {
   "activeRate": {

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

@@ -208,7 +208,7 @@
     "comment": "3s播放数"
     "comment": "3s播放数"
   },
   },
   "play3sRate": {
   "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播放率"
     "comment": "3s播放率"
   }
   }
 }
 }