Forráskód Böngészése

删除重复定时任务

syh 4 éve
szülő
commit
a84b929e5f

+ 0 - 1
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/jobhandler/BytedancePlanLoadJob.java

@@ -24,7 +24,6 @@ public class BytedancePlanLoadJob {
 
 
     @XxlJob("bytedancePlanLoadJob")
     @XxlJob("bytedancePlanLoadJob")
     public void execute() throws Exception {
     public void execute() throws Exception {
-        //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
         countDownLatch = new CountDownLatch(tokens.size());
         countDownLatch = new CountDownLatch(tokens.size());
         tokens.forEach(token -> executorService.submit(() -> {
         tokens.forEach(token -> executorService.submit(() -> {

+ 1 - 1
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/jobhandler/BytedancePlanRealTimeLoadJob.java

@@ -32,7 +32,7 @@ public class BytedancePlanRealTimeLoadJob {
         List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
         List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
         String nowDate = DateUtils.formatDate();
         String nowDate = DateUtils.formatDate();
         tokens.forEach(token -> executorService.submit(() -> advertiserDataService.getAdvertiserPlan(token, "", nowDate, nowDate)));
         tokens.forEach(token -> executorService.submit(() -> advertiserDataService.getAdvertiserPlan(token, "", nowDate, nowDate)));
-        XxlJobHelper.log("头条全量计划数据获取完成");
+        XxlJobHelper.log("头条当日计划数据获取完成");
     }
     }
 
 
 
 

+ 0 - 44
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/jobhandler/BytedanceTodayPlaneLoadJob.java

@@ -1,44 +0,0 @@
-package com.xxl.job.executor.jobhandler;
-
-import com.xxl.job.core.context.XxlJobHelper;
-import com.xxl.job.core.handler.annotation.XxlJob;
-import com.xxl.job.executor.common.entity.CtopOauthToken;
-import com.xxl.job.executor.common.service.ICtopOauthTokenService;
-import com.xxl.job.executor.material.service.IByteDanceAdvertiserDataService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- *
- * @author 宋英豪
- */
-@Component
-public class BytedanceTodayPlaneLoadJob {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(15);
-    @XxlJob("bytedanceTodayPlaneLoadJob")
-    public void execute() throws Exception {
-        Date getDate = new Date();
-        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        String dateString = dateFormat.format(getDate);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        tokens.forEach(token -> executorService.submit(() -> {
-            try {
-                advertiserDataService.getAdvertiserPlan(token, "", null, dateString);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }));
-        XxlJobHelper.log("当日计划数据同步完成完成");
-    }
-}

+ 0 - 24
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/jobhandler/BytedanceVideoDailyReportLoadJob.java

@@ -1,24 +0,0 @@
-package com.xxl.job.executor.jobhandler;
-
-import com.xxl.job.core.handler.annotation.XxlJob;
-import com.xxl.job.executor.report.service.IByteDanceVideoReportDailyService;
-import com.xxl.job.executor.utils.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.Date;
-
-@Component
-public class BytedanceVideoDailyReportLoadJob {
-    @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;
-}

+ 0 - 28
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/jobhandler/BytedanceVideoInfoLoadJob.java

@@ -1,28 +0,0 @@
-package com.xxl.job.executor.jobhandler;
-
-import com.xxl.job.core.handler.annotation.XxlJob;
-import com.xxl.job.executor.common.entity.CtopOauthToken;
-import com.xxl.job.executor.common.service.ICtopOauthTokenService;
-import com.xxl.job.executor.material.service.IByteDanceAdvertiserDataService;
-import com.xxl.job.executor.utils.CtopAdConstant;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Component
-public class BytedanceVideoInfoLoadJob {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(4);
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-
-    @XxlJob("bytedanceVideoInfo")
-    public void execute() throws Exception {
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        tokens.forEach(token -> executorService.submit(() -> advertiserDataService.getMaterialList(token)));
-    }
-}

+ 0 - 47
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/jobhandler/BytedanceYesterdayAdvertiserHourlyLoadJob.java

@@ -1,47 +0,0 @@
-package com.xxl.job.executor.jobhandler;
-
-import com.xxl.job.core.context.XxlJobHelper;
-import com.xxl.job.core.handler.annotation.XxlJob;
-import com.xxl.job.executor.common.entity.CtopOauthToken;
-import com.xxl.job.executor.common.service.ICtopOauthTokenService;
-import com.xxl.job.executor.report.service.IReportService;
-import com.xxl.job.executor.utils.CtopAdConstant;
-import com.xxl.job.executor.utils.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- *  Created by JQ.bi on 2020.09.03
- */
-public class BytedanceYesterdayAdvertiserHourlyLoadJob {
-
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IReportService reportService;
-    private ExecutorService executorService = Executors.newFixedThreadPool(5);
-
-    @XxlJob("byteDanceAdvertiserHourlyReport")
-    public void execute() throws Exception {
-        //查询需要拉取数据的账户token
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        if (null == tokens || tokens.isEmpty()) {
-            XxlJobHelper.log("获取昨日头条小时数据异常:未获取到可用的token");
-        }
-        Date yesterday = DateUtils.parseDate(DateUtils.getAnotherDay("yy-MM-dd", DateUtils.getNowDate("yy-MM-dd"), -1), "yy-MM-dd");
-        tokens.forEach(it ->executorService.submit(() -> {
-            try {
-                reportService.getAdvertiserReport(it, yesterday, yesterday, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-            } catch (Exception e) {
-                XxlJobHelper.log("获取昨日头条小时数据异常:拉取数据异常");
-            }
-        }));
-        if(!executorService.isShutdown()){
-            executorService.shutdown();
-        }
-    }
-}