Browse Source

fix on 2020.9.30

jiequan.bi 4 years ago
parent
commit
da135318f6
1 changed files with 27 additions and 2 deletions
  1. 27 2
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

+ 27 - 2
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -15,8 +15,11 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskServ
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.log.XxlJobLogger;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.constant.SystemDateConstant;
 import org.jeecg.common.util.DateUtils;
@@ -186,9 +189,9 @@ public class SampleTest {
     @Test
     public void loadAllHourReport(){
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        String getDate="2020-09-17";
+        String getDate="2020-09-27";
         tokens.forEach(token -> {
-            reportService.getAdvertiserReport(token, DateUtils.parseDate(getDate, SystemDateConstant.yyyy_MM_dd), DateUtils.parseDate(getDate, SystemDateConstant.yyyy_MM_dd), CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
+            reportService.getAdvertiserReport(token, DateUtils.parseDate(getDate, SystemDateConstant.yyyy_MM_dd), DateUtils.parseDate(getDate, SystemDateConstant.yyyy_MM_dd), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         });
     }
 
@@ -223,4 +226,26 @@ public class SampleTest {
             }
         }
     }
+
+    @Autowired
+    IBytedanceReportService bytedanceReportService;
+    //头条素材报表拉数据
+    @Test
+    public void getMaterialReportByDate() {
+        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
+        String startDate="2020-09-29";
+        String endDate="2020-09-29";
+        tokens.forEach(token -> {
+                    try {
+                        //获取头条素材报表数据
+                        XxlJobLogger.log("账户" + token.getAccountId() + "素材报表数据任务开始,任务时间:" +new Date());
+                        bytedanceReportService.bytedanceMaterialReport(token, startDate, endDate);
+                        XxlJobLogger.log("账户" + token.getAccountId() + "素材报表数据任务完成,任务时间:" + new Date());
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    } finally {
+                    }
+
+            });
+    }
 }