yumeng 4 年之前
父节点
当前提交
309eb987d7

+ 2 - 2
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyCampaignReportLoadJob.java

@@ -29,8 +29,8 @@ public class KuaishouDailyCampaignReportLoadJob {
 
 
     @XxlJob("kuaishouDailyCampaignReport")
     @XxlJob("kuaishouDailyCampaignReport")
     public void execute() throws Exception {
     public void execute() throws Exception {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        Date endDate = DateUtils.addDay(new Date(), -2);
+        Date getDate = DateUtils.addDay(new Date(), -2);
+        Date endDate = DateUtils.addDay(new Date(), -1);
         //1:查询当日数据
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         if (null == tokens || tokens.isEmpty()) {
         if (null == tokens || tokens.isEmpty()) {

+ 4 - 3
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyGroupReportLoadJob.java

@@ -25,11 +25,12 @@ public class KuaishouDailyGroupReportLoadJob {
     private ICtopOauthTokenService tokenService;
     private ICtopOauthTokenService tokenService;
     @Autowired
     @Autowired
     private IKuaishouReportDailyGroupService reportDailyGroupService;
     private IKuaishouReportDailyGroupService reportDailyGroupService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(3);
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
 
 
     @XxlJob("kuaishouDailyGroupReport")
     @XxlJob("kuaishouDailyGroupReport")
     public void execute() throws Exception {
     public void execute() throws Exception {
-        Date getDate = DateUtils.addDay(new Date(), -1);
+        Date startDate = DateUtils.addDay(new Date(), -2);
+        Date endDate = DateUtils.addDay(new Date(), -1);
         //1:查询当日数据
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         if (null == tokens || tokens.size() <= 0) {
         if (null == tokens || tokens.size() <= 0) {
@@ -37,6 +38,6 @@ public class KuaishouDailyGroupReportLoadJob {
             XxlJobHelper.handleFail();
             XxlJobHelper.handleFail();
             return;
             return;
         }
         }
-        tokens.forEach(token -> executorService.submit(() -> reportDailyGroupService.getAdvertiserGroupReportDaily(token, getDate, getDate)));
+        tokens.forEach(token -> executorService.submit(() -> reportDailyGroupService.getAdvertiserGroupReportDaily(token, startDate, endDate)));
     }
     }
 }
 }

+ 0 - 46
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupDailyReportJob.java

@@ -1,46 +0,0 @@
-package cn.com.ctop.job.kuaishou.handler;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyGroupService;
-import com.xxl.job.core.context.XxlJobHelper;
-import com.xxl.job.core.handler.annotation.XxlJob;
-import org.jeecg.common.util.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Component
-public class KuaishouGroupDailyReportJob {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    @Autowired
-    private IKuaishouReportDailyGroupService reportDailyGroupService;
-
-    static ExecutorService executorService = Executors.newFixedThreadPool(5);
-
-    @XxlJob("kuaishouGroupDailyReportJob")
-    public void execute() throws ParseException {
-        String date = DateUtils.getDate("yyyy-MM-dd");
-    //    String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", date, -1);
-        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", date, -2);
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date parse = simpleDateFormat.parse(startDate);
-     //   Date parse2 = simpleDateFormat.parse(endDate);
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        tokens.forEach(token -> executorService.submit(() ->
-                reportDailyGroupService.getAdvertiserGroupReportDaily(token, parse, parse))
-        );
-        XxlJobHelper.log("快手物料数据同步完成");
-    }
-
-}