Selaa lähdekoodia

修改头条规则引擎字段数据获取逻辑-清除已关停的创意数据信息

syh 4 vuotta sitten
vanhempi
commit
d8dfe9658f

+ 4 - 4
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -57,8 +57,8 @@ spring:
     exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
     url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-    username: hcst
-    password: hcst@2020
+    username: data
+    password: hcst@2021
     driver-class-name: com.mysql.jdbc.Driver
     druid:
       stat-view-servlet:
@@ -97,8 +97,8 @@ spring:
       datasource:
         master:
           url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: hcst
-          password: hcst@2020
+          username: data
+          password: hcst@2021
           driver-class-name: com.mysql.jdbc.Driver
   #redis 配置
   redis:

+ 32 - 13
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -382,14 +382,43 @@ public class SampleTest {
 
     @Test
     public void execute() {
-        CtopOauthToken token = tokenService.getTokenByAccountId(9589905L);
-        ruleKuaiShouPlanService.cleanRuleDataTarget(token.getAccountId(), 1);
+        String accountIds = "1675239584963662,1676540490482759,1675237415468045";
+        String[] arrays = accountIds.split(",");
+        for(int i=0;i<arrays.length;i++){
+            Long accountId = Long.parseLong(arrays[i]);
+            CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+            load12Data(token);
+            load12AccountData(token);
+        }
+    }
+
+    @Test
+    public void loadBytedanceData(){
+        String accountIds = "1676540490482759";
+        String[] arrays = accountIds.split(",");
+        for(int i=0;i<arrays.length;i++){
+            Long accountId = Long.parseLong(arrays[i]);
+            CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+            load12Data(token);
+        }
+    }
+
+    private void load12AccountData(CtopOauthToken token){
+        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-01","yyyy-MM-dd"), DateUtils.parseDate("2020-12-11","yyyy-MM-dd"),CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-11","yyyy-MM-dd"), DateUtils.parseDate("2020-12-21","yyyy-MM-dd"),CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        reportService.getAdvertiserReport(token, DateUtils.parseDate("2020-12-21","yyyy-MM-dd"), DateUtils.parseDate("2020-12-31","yyyy-MM-dd"),CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+    }
+
+    private void load12Data(CtopOauthToken token){
+        bytedanceReportService.bytedanceMaterialReport(token, "2020-12-01", "2020-12-11");
+        bytedanceReportService.bytedanceMaterialReport(token, "2020-12-11", "2020-12-21");
+        bytedanceReportService.bytedanceMaterialReport(token, "2020-12-21", "2020-12-31");
     }
     @Autowired
     private IKuaishouVideoEtlInfoService kuaishouVideoEtlInfoService;
     @Test
     public void etlKuaishouData(){
-        String dateString = "2020-12-25";
+        String dateString = "2020-12-31";
         Date startDate = DateUtils.parseDate(dateString,"yyyy-MM-dd");
         for(int i=0;i<=10;i++){
             Date getDate = DateUtils.addDay(startDate,i);
@@ -400,16 +429,6 @@ public class SampleTest {
 
     @Autowired
     private IBytedanceVideoEtlInfoService bytedanceVideoEtlInfoService;
-    @Test
-    public void etlBytedanceData(){
-        String dateString = "2020-12-23";
-        Date startDate = DateUtils.parseDate(dateString,"yyyy-MM-dd");
-        for(int i=0;i<=10;i++){
-            Date getDate = DateUtils.addDay(startDate,i);
-            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
-            kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
-        }
-    }
 
     @Test
     public void loadBytedanceVideo(){

+ 4 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDancePlanRuleDataJob.java

@@ -2,6 +2,7 @@ package cn.com.ctop.job.bytedance.handler;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.IRuleDataCreativeService;
 import cn.com.ctop.common.module.service.IRuleDataPlanService;
 import cn.com.ctop.common.module.service.IRuleDataTargetService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
@@ -26,6 +27,8 @@ public class ByteDancePlanRuleDataJob {
     @Autowired
     private IRuleDataPlanService ruleDataPlanService;
     @Autowired
+    private IRuleDataCreativeService ruleDataCreativeService;
+    @Autowired
     private IRuleDataTargetService ruleDataTargetService;
     private ExecutorService executorService = Executors.newFixedThreadPool(10);
     @XxlJob("bytedancePlanRuleLoadJob")
@@ -38,6 +41,7 @@ public class ByteDancePlanRuleDataJob {
             params.put("account_id",token.getAccountId());
             ruleDataPlanService.removeByMap(params);
             ruleDataTargetService.removeByMap(params);
+            ruleDataCreativeService.removeByMap(params);
             reportService.getAdvertiserPlanRuleData(token,date,date, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         }));
     }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportServiceImpl.java

@@ -762,7 +762,7 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             log.error("返回为空,请求有误:" + JSONObject.toJSONString(data));
             return -2;
         }
-
+        System.out.println(json.toJSONString());
         try {
             Integer code = json.getInteger("code");
             if (code != 0) {