yumeng il y a 1 an
Parent
commit
570bfd08ec

+ 0 - 50
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyMaterialReportJob.java

@@ -34,57 +34,7 @@ public class BytedanceDailyMaterialReportJob {
      * 2021-10-14---zianY修改按账户获取
      * @throws Exception
      */
-    @XxlJob("bytedanceDailyMaterialReportJob")
-    public void execute() throws Exception {
-        Date getDate2 = DateUtils.addDay(new Date(), -2);
-        String date2 = DateUtils.formatDate(getDate2);
-        Long start = System.currentTimeMillis();
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        String date = DateUtils.formatDate(getDate);
-        XxlJobHelper.log("头条获取素材报表数据任务开始,任务时间:" + date2 + "~" + date);
 
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        if (null == tokens || tokens.isEmpty()) {
-            XxlJobHelper.log("头条获取素材报表数据任务执行失败:未获取到可用的token");
-            XxlJobHelper.handleFail();
-            return ;
-        }
-        CountDownLatch countDownLatch = new CountDownLatch(tokens.size());
-
-        tokens.forEach(token -> executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        //获取头条素材报表两天前的数据
-                        XxlJobHelper.log("账户"+token.getAccountId() + "素材报表数据任务开始,任务时间:" + date + "~" + date2);
-                        bytedanceReportService.bytedanceMaterialReport(token, date2, date2);
-                        bytedanceReportService.bytedanceMaterialReport(token, date, date);
-                        //获取头条素材报表数据
-                        bytedanceReportService.bytedanceVideoMaterialReport(token, date2, date2);
-                        bytedanceReportService.bytedanceVideoMaterialReport(token, date, date);
-                        XxlJobHelper.log("账户"+token.getAccountId() + "素材报表数据任务完成,任务时间:" + date + "~" + date2);
-                        bytedanceReportMaterialDailyMapper.updateImageReportCode(token.getAccountId());
-                        bytedanceReportMaterialDailyMapper.updateImageReportProjectId(token.getAccountId());
-                        bytedanceReportMaterialDailyMapper.updateImageReportProjectName(token.getAccountId());
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                        countDownLatch.countDown();
-                    }
-                }
-            }));
-
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        Long end = System.currentTimeMillis();
-        XxlJobHelper.log("头条素材数据获取耗时:{}毫秒", end - start);
-
-        videoReportDailyService.videoInfoList(date, date);
-        videoReportDailyService.videoInfoList(date2, date2);
-    }
 
     @Autowired
     private IByteDanceVideoReportDailyService videoReportDailyService;

+ 1 - 9
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceVideoDailyReportLoadJob.java

@@ -11,15 +11,7 @@ import java.util.Date;
 @Component
 public class BytedanceVideoDailyReportLoadJob {
 
-    //TODO 待删除
-    @XxlJob("bytedanceVideoDailyReportLoadJob")
-    public void execute() throws Exception {
-        for(int i=0;i<3;i++){
-            Date getDate = DateUtils.addDay(new Date(), -i);
-            String date = DateUtils.formatDate(getDate);
-            videoReportDailyService.videoInfoList(date, date);
-        }
-    }
+
 
     @Autowired
     private IByteDanceVideoReportDailyService videoReportDailyService;

+ 1 - 12
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceVideoReportCleanJob.java

@@ -13,16 +13,5 @@ public class BytedanceVideoReportCleanJob {
     @Autowired
     private IByteDanceVideoReportDailyService videoReportDailyService;
 
-    /**
-     * 头条视频数据清洗
-     * @throws Exception
-     */
-    @XxlJob("bytedanceVideoReportCleanJob")
-    public void execute() throws Exception {
-        for(int i=0;i<2;i++){
-            Date getDate = DateUtils.addDay(new Date(), -i);
-            String date = DateUtils.formatDate(getDate);
-            videoReportDailyService.videoInfoList(date, date);
-        }
-    }
+
 }

+ 6 - 6
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/JiaoYangFenXiaoServiceImpl.java

@@ -52,7 +52,7 @@ public class JiaoYangFenXiaoServiceImpl implements IJiaoYangFenXiaoService {
             params.put("orderCreateTimeEnd", orderCreateTimeEnd);
         }
         //  params.put("fundType", 1);
-        params.put("limit", 200);
+        params.put("limit", 100);
         params.put("offset", offset);
         params.put("timeType", 1);
         Map<String, String> headers = new HashMap<>();
@@ -121,8 +121,8 @@ public class JiaoYangFenXiaoServiceImpl implements IJiaoYangFenXiaoService {
             orders.add(order);
         }
         jiaoYangFenXiaoMapper.replace(orders);
-        if (list.size() >= 200) {
-            getOrderList(cookie, offset + 200, orderCreateTimeStart, orderCreateTimeEnd);
+        if (list.size() >= 100) {
+            getOrderList(cookie, offset + 100, orderCreateTimeStart, orderCreateTimeEnd);
         }
 
     }
@@ -132,7 +132,7 @@ public class JiaoYangFenXiaoServiceImpl implements IJiaoYangFenXiaoService {
         Thread.sleep(500L);
         Map<String, Object> params = new HashMap<>();
         params.put("status", status);
-        params.put("limit", 200);
+        params.put("limit", 10);
         params.put("offset", offset);
         Map<String, String> headers = new HashMap<>();
         headers.put("Cookie", cookie);
@@ -190,8 +190,8 @@ public class JiaoYangFenXiaoServiceImpl implements IJiaoYangFenXiaoService {
 
         }
         jiaoYangFenXiaoMapper.replaceClipCooperation(adds);
-        if (list.size() >= 200) {
-            getClipCooperation(cookie, offset + 200, statDate, status);
+        if (list.size() >= 10) {
+            getClipCooperation(cookie, offset + 10, statDate, status);
         }
     }
 

+ 3 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouSupplyChainServiceImpl.java

@@ -52,7 +52,7 @@ public class KuaishouSupplyChainServiceImpl extends ServiceImpl<KuaishouSupplyCh
         }
         params.put("fundType", 1);
         params.put("timeType", 1);
-        params.put("limit", 200);
+        params.put("limit", 100);
         params.put("offset", offset);
 
         Map<String, String> headers = new HashMap<>();
@@ -122,8 +122,8 @@ public class KuaishouSupplyChainServiceImpl extends ServiceImpl<KuaishouSupplyCh
             e.printStackTrace();
         }
 
-        if (list.size() >= 200) {
-            getOrderList(cookie, offset + 200, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
+        if (list.size() >= 100) {
+            getOrderList(cookie, offset + 100, orderCreateTimeStart, orderCreateTimeEnd, itemMap);
         }
 
     }