Bladeren bron

修改代码逻辑

syh 4 jaren geleden
bovenliggende
commit
b5b1268b7f
1 gewijzigde bestanden met toevoegingen van 8 en 29 verwijderingen
  1. 8 29
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

+ 8 - 29
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -409,28 +409,10 @@ public class SampleTest {
 
     @Test
     public void loadBDAccoutData() {
-//        List<BytedanceAccountReportTaskRecord>  records = reportTaskRecordService.listByParams(1,"ACCOUNT_DAILY");
-        List<BytedanceAccountReportTaskRecord>  records = reportTaskRecordService.listByParams(100,"ACCOUNT_DAILY");
-        executorService = Executors.newFixedThreadPool(8);
-        countDownLatch = new CountDownLatch(records.size());
-        records.forEach(record -> executorService.submit(() -> {
-            try {
-//                reportService.getAdvertiserReport(record, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-//                log.info("账户数据获取完成:account:{},时间:{}-{}",record.getAccountId(),record.getStartDate(),record.getEndDate());
-                bytedanceReportService.bytedanceMaterialReportV2(record);
-                log.info("素材数据获取完成:account:{},时间:{}-{}",record.getAccountId(),record.getStartDate(),record.getEndDate());
-            } catch (Exception e) {
-
-            } finally {
-                countDownLatch.countDown();
-            }
-        }));
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        System.out.println("数据获取完成");
+        CtopOauthToken token1 = tokenService.getTokenByAccountId(1665924577326087L);
+        load12Data(token1);
+        CtopOauthToken token2 = tokenService.getTokenByAccountId(1674206482908163L);
+        load12Data(token2);
         bytedanceReportMaterialDailyMapper.updateImageReportCode();
         bytedanceReportMaterialDailyMapper.updateImageReportProjectId();
         bytedanceReportMaterialDailyMapper.updateImageReportProjectName();
@@ -448,13 +430,10 @@ public class SampleTest {
     }
 
     private void load12Data(CtopOauthToken token) {
-//        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-01", "2020-10-05");
-//        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-06", "2020-10-10");
-//        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-11", "2020-10-15");
-//        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-16", "2020-10-20");
-//        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-21", "2020-10-25");
-//        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-26", "2020-10-31");
-        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-03", "2020-10-04");
+        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-11", "2020-10-15");
+        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-16", "2020-10-20");
+        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-21", "2020-10-25");
+        bytedanceReportService.bytedanceMaterialReport(token, "2020-10-26", "2020-10-31");
     }
 
     @Autowired