浏览代码

清理历史无用定时任务

songyh 3 年之前
父节点
当前提交
99d8e334a3
共有 58 个文件被更改,包括 7 次插入3014 次删除
  1. 0 22
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ads/controller/StrategyController.java
  2. 0 27
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountBidJob.java
  3. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountCpaBidJob.java
  4. 0 16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AppProductJob.java
  5. 0 49
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java
  6. 0 69
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceHourlyAccountWarningLoadJob.java
  7. 0 33
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceRefreshTokenJob.java
  8. 0 45
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDailyReportLoadJob.java
  9. 0 52
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDataLoadJob.java
  10. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserHourlyReportLoadJob.java
  11. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeDailyReportLoadJob.java
  12. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeHourlyReportLoadJob.java
  13. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportJob.java
  14. 0 82
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportRetryJob.java
  15. 0 67
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyVideoMaterialReportAddJob.java
  16. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyVideoMaterialReportJob.java
  17. 0 55
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceMaterialsLoadJob.java
  18. 0 109
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java
  19. 0 40
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportYeterdayLoadJob.java
  20. 0 84
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanHourlyReportLoadJob.java
  21. 0 60
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanLoadJob.java
  22. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanRealTimeLoadJob.java
  23. 0 61
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceSameDayCreativeLoadJob.java
  24. 0 34
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DailyFlowsJob.java
  25. 0 18
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DataeyeJob.java
  26. 0 50
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouCleanMaterialJob.java
  27. 0 30
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouRefreshTokenJob.java
  28. 0 28
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouAdvertiserCrawlerJob.java
  29. 0 55
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCampaignJob.java
  30. 0 20
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCceDataJob.java
  31. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoDelete.java
  32. 0 47
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoLoginJob.java
  33. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCrawlerJob.java
  34. 0 58
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCampaignReportLoadJob.java
  35. 0 87
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCreativeReportLoadJob.java
  36. 0 72
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyLoadFileJob.java
  37. 0 41
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyReportTaskJob.java
  38. 0 57
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouGroupJob.java
  39. 0 38
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHistoryLoadFileJob.java
  40. 0 81
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountReportLoadJob.java
  41. 0 68
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountWarningLoadJob.java
  42. 0 85
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCampaignReportLoadJob.java
  43. 0 84
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCreativeReportLoadJob.java
  44. 0 57
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouMaterialsLoadJob.java
  45. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateCampaignJob.java
  46. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateCreativeJob.java
  47. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateGroupJob.java
  48. 0 21
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouReportDailyGroupChannelCodeJob.java
  49. 0 37
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MaterialReportAccountUpdateJob.java
  50. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MergeVideoJob.java
  51. 0 29
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/OceanengineJob.java
  52. 0 33
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/PangolinDataJob.java
  53. 0 30
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/PangolinLoginJob.java
  54. 0 42
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/TargetingTagsJob.java
  55. 0 35
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ToutiaoMaterialsLoadJob.java
  56. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java
  57. 7 29
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  58. 0 1
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedancePlanDailyReportLoadJob.java

+ 0 - 22
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ads/controller/StrategyController.java

@@ -1,22 +0,0 @@
-package org.jeecg.modules.ads.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@RestController
-@Slf4j
-@RequestMapping("/ctop/strategy")
-public class StrategyController {
-    @PostMapping("previewCreative")
-    public Map<String,Object> previewCreative(@RequestBody JSONObject data){
-        Map<String,Object>result = new HashMap<>();
-        return result;
-    }
-}

+ 0 - 27
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountBidJob.java

@@ -1,27 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import org.jeecg.modules.ctop.service.IBidWarningService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-/**
- * DONE
- * 出价预警
- */
-public class AccountBidJob implements Job {
-    @Autowired
-    private IBidWarningService bidWarningService;
-
-    /**
-     * 出价预警
-     *
-     * @param jobExecutionContext
-     * @throws JobExecutionException
-     */
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) {
-        bidWarningService.bidWarning();
-    }
-}

+ 0 - 64
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountCpaBidJob.java

@@ -1,64 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.Project;
-import cn.com.ctop.common.module.service.IProjectService;
-import cn.com.ctop.common.module.utils.BigDecimalUtil;
-import cn.com.ctop.common.module.utils.Check;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.jeecg.modules.ctop.service.ICpaBidWarningService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * DONE
- * 深度转化出价预警
- */
-public class AccountCpaBidJob implements Job {
-    @Autowired
-    private ICpaBidWarningService cpaBidWarningService;
-    static ExecutorService executorService = null;
-    @Autowired
-    private IProjectService projectService;
-
-    /**
-     * 出价预警
-     *
-     * @param jobExecutionContext
-     * @throws JobExecutionException
-     */
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                executorService = Executors.newFixedThreadPool(4);
-                QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
-                List<Project> projects = projectService.list(queryWrapper);
-                if (!Check.isNull(projects)) {
-                    for (Project project : projects) {
-                        if (BigDecimalUtil.compareToDecimal(project.getMaxDeepCpaBid(), new BigDecimal(0)) <= 0) {
-                            continue;
-                        }
-                        executorService.submit(new Runnable() {
-                            @Override
-                            public void run() {
-                                cpaBidWarningService.cpaBidWarning(project);
-                            }
-
-                        });
-                    }
-                    executorService.shutdown();
-                }
-            }
-        };
-        thread.start();
-
-    }
-}

+ 0 - 16
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AppProductJob.java

@@ -1,16 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.kuaishou.modules.app.service.IKuaishouAppProductService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class AppProductJob implements Job {
-    @Autowired
-    private IKuaishouAppProductService kuaishouAppProductService;
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        kuaishouAppProductService.selectInto();
-    }
-}

+ 0 - 49
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java

@@ -1,49 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.toutiao.modules.report.service.IBytedanceCreativeDailyReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * DONE
- * 清洗素材报表
- */
-@Slf4j
-public class ByteDanceCleanMaterialJob implements Job {
-    @Autowired
-    private IBytedanceCreativeDailyReportService bytedanceCreativeDailyReportService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                List<String> signatureList = bytedanceCreativeDailyReportService.getSignatureList();
-                if (Check.isNull(signatureList)) {
-                    log.error("头条素材数据获取为空");
-                    return;
-                }
-                executorService = Executors.newFixedThreadPool(3);
-                for (int i = 0; i < signatureList.size(); i++) {
-                    String signature = signatureList.get(i);
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            bytedanceCreativeDailyReportService.calculationMaterialReport(signature);
-                        }
-                    });
-                }
-            }
-        };
-        thread.start();
-
-    }
-}

+ 0 - 69
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceHourlyAccountWarningLoadJob.java

@@ -1,69 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceHourlyAccountWarningService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import static org.jeecg.common.util.DateUtils.getAnotherDay;
-
-/**
- * DONE
- * 头条预警
- *
- * @author yumeng
- */
-@Slf4j
-public class ByteDanceHourlyAccountWarningLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IByteDanceHourlyAccountWarningService byteDanceHourlyAccountWarningService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                log.info("开始时段消耗预警定时任务");
-                long l = System.currentTimeMillis();
-                try {
-                    List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-                    if (null == tokens || tokens.size() <= 0) {
-                        log.info("定时获取头条数据异常:未获取到可用的token");
-                        return;
-                    }
-                    executorService = Executors.newFixedThreadPool(3);
-                    String statDate = DateUtils.getDate("yyyy-MM-dd");
-                    String anotherDay = getAnotherDay("yyyy-MM-dd", statDate, -1);
-                    for (CtopOauthToken token : tokens) {
-                        executorService.submit(new Runnable() {
-                            @Override
-                            public void run() {
-                                byteDanceHourlyAccountWarningService.byteDanceAccountWarning(token.getAccountId(), statDate, anotherDay);
-                            }
-
-                        });
-                    }
-                    log.info("时段消耗预警定时任务执行完毕,耗时:{} ms", System.currentTimeMillis() - l);
-
-                } catch (Exception e) {
-                    e.printStackTrace();
-
-                }
-            }
-        };
-        thread.start();
-    }
-}

+ 0 - 33
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceRefreshTokenJob.java

@@ -1,33 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.service.IRefreshTokenService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-/**
- * DONE
- */
-public class ByteDanceRefreshTokenJob implements Job {
-    @Autowired
-    private IRefreshTokenService refreshTokenService;
-
-    /**
-     * 刷新token
-     *
-     * @param jobExecutionContext
-     * @throws JobExecutionException
-     */
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                refreshTokenService.byteDanceRefresh(null);
-            }
-        };
-        thread.start();
-
-    }
-}

+ 0 - 45
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDailyReportLoadJob.java

@@ -1,45 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.report.service.IReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-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;
-
-/**
- * DONE
- * @author syh
- * 头条广告主日报数据获取任务
- * 第二天凌晨跑前一天的数据
- */
-@Slf4j
-public class BytedanceAdvertiserDailyReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IReportService reportService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.isEmpty()) {
-            log.info("定时获取头条数据异常:为获取到可用的token");
-            return;
-        }
-        executorService = Executors.newFixedThreadPool(5);
-        tokens.forEach(token -> executorService.submit(() -> reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY)));
-    }
-}

+ 0 - 52
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDataLoadJob.java

@@ -1,52 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceCampaignService;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 素材数据获取
- */
-@Slf4j
-public class BytedanceAdvertiserDataLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(5);
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-    @Autowired
-    private IByteDanceCreativeService creativeService;
-    @Autowired
-    private IByteDanceCampaignService byteDanceCampaignService;
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Date getDate = new Date();
-        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        String dateString = dateFormat.format(getDate);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        tokens.forEach(token -> executorService.submit(() -> {
-            //1:获取当日广告组数据
-            byteDanceCampaignService.getAdvertiserCampaign(token, null, dateString);
-            //2:获取当日广告计划数据
-            advertiserDataService.getAdvertiserPlan(token, "", dateString, null);
-            //3:获取当日创意数据
-            creativeService.getAdvertiserCreative(token, "", dateString);
-        }));
-        log.info("物料数据同步完成");
-    }
-}

+ 0 - 63
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserHourlyReportLoadJob.java

@@ -1,63 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.report.service.IReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * DONE
- * @author syh
- * 头条广告主时报获取任务
- */
-@Slf4j
-public class BytedanceAdvertiserHourlyReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IReportService reportService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        log.info("头条时报数据获取开始");
-        Date getDate = new Date();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-        String hour = simpleDateFormat.format(getDate);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条小时数据异常:未获取到可用的token");
-            return;
-        }
-        executorService = Executors.newFixedThreadPool(4);
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    if (null != hour && "00".equals(hour)) {
-                        Date  finalGetDate = DateUtils.addDay(getDate, -1);
-                        //获取广告主信息数据
-                        reportService.getAdvertiserReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-                    }
-                    reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-                }
-
-            });
-
-        });
-        log.info("头条时报数据获取结束");
-    }
-}

+ 0 - 56
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeDailyReportLoadJob.java

@@ -1,56 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.report.service.IReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-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;
-
-/**
- * DONE
- * @author syh
- * 头条创意日报数据获取任务
- * 第二天凌晨跑前一天的数据
- */
-@Slf4j
-public class BytedanceCreativeDailyReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IReportService reportService;
-    static ExecutorService executorService = null;
-
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条数据异常:为获取到可用的token");
-            return;
-        }
-        executorService = Executors.newFixedThreadPool(5);
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    //获取广告创意信息数据
-                    reportService.getAdvertiserCreativeReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-                }
-            });
-        });
-    }
-
-
-}

+ 0 - 63
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeHourlyReportLoadJob.java

@@ -1,63 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.report.service.IReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * DONE
- * @author syh
- * 头条创意时报获取任务
- */
-@Slf4j
-public class BytedanceCreativeHourlyReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IReportService reportService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        log.info("头条时报数据获取开始");
-        Date getDate = new Date();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-        String hour = simpleDateFormat.format(getDate);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条小时数据异常:未获取到可用的token");
-            return;
-        }
-        executorService = Executors.newFixedThreadPool(4);
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    if (null != hour && "00".equals(hour)) {
-                        Date  finalGetDate = DateUtils.addDay(getDate, -1);
-                        //获取广告创意信息数据
-                        reportService.getAdvertiserCreativeReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-                    }
-                    reportService.getAdvertiserCreativeReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-                }
-
-            });
-
-        });
-        log.info("头条时报数据获取结束");
-    }
-}

+ 0 - 64
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportJob.java

@@ -1,64 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-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;
-
-/**
- * 头条素材报表按天跑前一天的数据任务
- *
- * @author sunzhen
- */
-@Slf4j
-public class BytedanceDailyMaterialReportJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IBytedanceReportService bytedanceReportService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Date getDate2 = DateUtils.addDay(new Date(), -2);
-        String date2 = DateUtils.formatDate(getDate2);
-
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        String date = DateUtils.formatDate(getDate);
-        log.info("头条获取素材报表数据任务开始,任务时间:" + date2 + "~" + date);
-
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("头条获取素材报表数据任务执行失败:未获取到可用的token");
-            return;
-        }
-
-        final ExecutorService executorService = Executors.newFixedThreadPool(3);
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        //获取头条素材报表两天前的数据
-                        bytedanceReportService.bytedanceMaterialReport(token, date2, date2);
-                        //获取头条素材报表数据
-                        bytedanceReportService.bytedanceMaterialReport(token, date, date);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                    }
-                }
-            });
-        });
-
-    }
-}

+ 0 - 82
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportRetryJob.java

@@ -1,82 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialRetry;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
-import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 头条素材报表错误重试定时任务
- *
- * @author sunzhen
- */
-@Slf4j
-public class BytedanceDailyMaterialReportRetryJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IBytedanceReportService bytedanceReportService;
-    @Autowired
-    private IByteDanceVideoReportDailyService byteDanceVideoReportDailyService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        log.info("头条素材报表重试定时任务开始");
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-
-                List<BytedanceReportMaterialRetry> retryList = bytedanceReportService.getRetryList();
-                //
-                //多线程
-                final ExecutorService executorService = Executors.newFixedThreadPool(3);
-                retryList.forEach(retry -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                String startDate = retry.getStartDate();
-                                String endDate = retry.getEndDate();
-                                Long accountId = retry.getAccountId();
-                                Integer type = retry.getType();
-                                CtopOauthToken token = tokenService.getOauthTokenByAccountId(String.valueOf(accountId));
-                                log.info("头条素材报表重试定时任务,当前accountId为:" + token.getAccountId());
-                                Long days = DateUtils.getDiscrepantDays(startDate, endDate); //间隔天数
-                                String start = null;
-                                String end = null;
-                                for (int i = 0; i <= days; i++) {
-                                    start = DateUtils.addDay(startDate, i);
-                                    end = start;
-                                    //获取头条素材报表数据
-                                    int code = bytedanceReportService.bytedanceMaterialReportRetry(type, token, start, end);
-                                    if (code == 200 || code == 1) {
-                                        if (type == 1) {
-                                            //重试成功清洗数据
-                                            byteDanceVideoReportDailyService.videoInfoListByAccountId(start, end, accountId);
-                                        }
-                                    }
-                                }
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                            }
-                        }
-                    });
-                });
-            }
-        };
-        thread.start();
-
-    }
-}

+ 0 - 67
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyVideoMaterialReportAddJob.java

@@ -1,67 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-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;
-
-/**
- * 头条视频素材报表每天将前一天新绑定的账户数据从20200101开始跑到前一天
- *
- * @author sunzhen
- */
-@Slf4j
-public class BytedanceDailyVideoMaterialReportAddJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IBytedanceReportService bytedanceReportService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        String endDate = DateUtils.formatDate(getDate);
-        String startDate = "2020-01-01";
-        log.info("头条获取视频素材报表数据补充任务开始,任务时间:{}~{}",startDate,endDate);
-
-        List<CtopOauthToken> tokens = tokenService.getToutiaoTokenByCreateTime(endDate);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("头条获取素材报表数据任务执行失败:未获取到可用的token");
-            return;
-        }
-
-        final ExecutorService executorService = Executors.newFixedThreadPool(3);
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-
-                        Long days = DateUtils.getDiscrepantDays(startDate, endDate); //间隔天数
-                        String start = null;
-                        String end = null;
-                        for (int i = 0; i <= days; i++) {
-                            start = DateUtils.addDay(startDate, i);
-                            end = start;
-                            bytedanceReportService.bytedanceVideoMaterialReport(token, start, end);
-                        }
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                    }
-                }
-            });
-        });
-
-    }
-}

+ 0 - 64
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyVideoMaterialReportJob.java

@@ -1,64 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-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;
-
-/**
- * 头条视频素材报表按天跑前两天的数据任务
- *
- * @author sunzhen
- */
-@Slf4j
-public class BytedanceDailyVideoMaterialReportJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IBytedanceReportService bytedanceReportService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Date getDate2 = DateUtils.addDay(new Date(), -2);
-        String date2 = DateUtils.formatDate(getDate2);
-
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        String date = DateUtils.formatDate(getDate);
-        log.info("头条获取素材报表数据任务开始,任务时间:" + date2 + "~" + date);
-
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("头条获取素材报表数据任务执行失败:未获取到可用的token");
-            return;
-        }
-
-        final ExecutorService executorService = Executors.newFixedThreadPool(3);
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        //获取头条视频素材报表两天前的数据
-                        bytedanceReportService.bytedanceVideoMaterialReport(token, date2, date2);
-                        //获取头条视频素材报表数据
-                        bytedanceReportService.bytedanceVideoMaterialReport(token, date, date);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                    }
-                }
-            });
-        });
-
-    }
-}

+ 0 - 55
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceMaterialsLoadJob.java

@@ -1,55 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Slf4j
-public class BytedanceMaterialsLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    static ExecutorService executorService = null;
-    //线程计数器
-    static CountDownLatch countDownLatch = null;
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        executorService = Executors.newFixedThreadPool(4);
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        //获取全量视频素材数据
-                        advertiserDataService.getMaterialList(token);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                        countDownLatch.countDown();
-                    }
-                }
-            });
-        });
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        log.info("物料数据同步完成");
-    }
-}

+ 0 - 109
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java

@@ -1,109 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.entity.UserAllocation;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.service.IUserAllocationService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.report.entity.BytedancePlanDailyReport;
-import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportService;
-import cn.com.ctop.toutiao.modules.report.service.IReportService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-/**
- * DONE
- * 头条计划日报数据任务
- * @author 宋英豪
- */
-@Slf4j
-public class BytedancePlanDailyReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IReportService reportService;
-    @Autowired
-    private IUserAllocationService userAllocationService;
-    @Autowired
-    private IBytedancePlanDailyReportService planDailyReportService;
-
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条数据异常:为获取到可用的token");
-            return;
-        }
-        tokens.forEach(token -> {
-            //获取广告计划信息数据
-            reportService.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        });
-        formatZybData(215, getDate);
-        planDailyReportService.cleanChannelCodeData(112, getDate);
-        planDailyReportService.cleanChannelCodeData(113, getDate);
-        planDailyReportService.cleanChannelCodeData(222, getDate);
-        planDailyReportService.cleanYzData(151);
-        planDailyReportService.cleanChannelCodeData(235, getDate);
-        planDailyReportService.cleanChannelCodeData(270, getDate);
-    }
-
-    private void formatZybData(Integer projectId, Date getDate) {
-        //清洗关于作业帮数据
-        //1:查询作业帮相关的用户数据
-        QueryWrapper<UserAllocation> wrapper = new QueryWrapper<>();
-        wrapper.eq("project_id", projectId);
-        List<UserAllocation> allocations = userAllocationService.list(wrapper);
-        if(null!=allocations&&allocations.size()>0){
-            allocations.forEach(allocation->{
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                String dateString = dateFormat.format(getDate)+" 00:00:00";
-                queryWrapper.eq("advertiser_id",allocation.getAccountId())
-                        .eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport>bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if(null!=bytedancePlanDailyReports&&bytedancePlanDailyReports.size()>0){
-                    bytedancePlanDailyReports.forEach(report->{
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setAdsense(tags[1]);
-                        report.setPlanCode(tags[2]);
-                        String materialName = tags[3];
-                        report.setMaterialName(materialName);
-                        if (materialName.contains("其他")) {
-                            report.setMaterialType("其他");
-                        } else if (materialName.contains("图片轮播")) {
-                            report.setMaterialType("图片轮播");
-                        } else if (materialName.contains("大字报")) {
-                            report.setMaterialType("大字报");
-                        } else if (materialName.contains("文字动画")) {
-                            report.setMaterialType("文字动画");
-                        } else if (materialName.contains("采访形式")) {
-                            report.setMaterialType("采访形式");
-                        } else if (materialName.contains("剧情")) {
-                            report.setMaterialType("剧情");
-                        } else if (materialName.contains("口播")) {
-                            report.setMaterialType("口播");
-                        }else{
-                            report.setMaterialType("其他");
-                        }
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-    }
-}

+ 0 - 40
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportYeterdayLoadJob.java

@@ -1,40 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.report.service.IReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Date;
-import java.util.List;
-
-
-@Slf4j
-public class BytedancePlanDailyReportYeterdayLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IReportService reportService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条数据异常:为获取到可用的token");
-            return;
-        }
-        tokens.forEach(token -> {
-            //获取广告计划信息数据
-            reportService.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-        });
-    }
-
-}

+ 0 - 84
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanHourlyReportLoadJob.java

@@ -1,84 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportService;
-import cn.com.ctop.toutiao.modules.report.service.IReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * done
- * 头条计划时报数据任务
- */
-@Slf4j
-public class BytedancePlanHourlyReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IReportService reportService;
-    @Autowired
-    private IBytedancePlanDailyReportService planDailyReportService;
-    static ExecutorService executorService = null;
-    //线程计数器
-    static CountDownLatch countDownLatch = null;
-
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        log.info("头条时报数据获取开始");
-        Date getDate = new Date();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-        String hour = simpleDateFormat.format(getDate);
-        //1:查询当日计划时报数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        executorService = Executors.newFixedThreadPool(5);
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        if (null != hour && "00".equals(hour)) {
-                            Date  finalGetDate = DateUtils.addDay(getDate, -1);
-                            reportService.getAdvertiserPlanReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-                        }
-                        reportService.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                        countDownLatch.countDown();
-                    }
-                }
-            });
-        });
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        //清洗缘多多数据渠道号
-        if (null != hour && "00".equals(hour)) {
-            Date lastday = DateUtils.addDay(getDate, -1);
-            planDailyReportService.cleanYddHourlyChannelCode(113, lastday);
-            planDailyReportService.cleanYddHourlyChannelCode(419, lastday);
-        }
-        planDailyReportService.cleanYddHourlyChannelCode(113, getDate);
-        planDailyReportService.cleanYddHourlyChannelCode(419, getDate);
-
-        log.info("头条计划时报数据获取完成");
-        executorService.shutdown();
-    }
-}

+ 0 - 60
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanLoadJob.java

@@ -1,60 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * DONE
- */
-@Slf4j
-public class BytedancePlanLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    static ExecutorService executorService = null;
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-    @Autowired
-    private IByteDanceCreativeService creativeService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-                executorService = Executors.newFixedThreadPool(4);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                //1:获取当日广告计划数据
-                                advertiserDataService.getAdvertiserPlan(token, "", null, null);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                            }
-                        }
-                    });
-                });
-                log.info("头条全量计划数据获取完成");
-            }
-
-        };
-        thread.start();
-    }
-}

+ 0 - 63
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanRealTimeLoadJob.java

@@ -1,63 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * DONE
- * 头条当日计划素材获取任务
- */
-@Slf4j
-public class BytedancePlanRealTimeLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    static ExecutorService executorService = null;
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-                executorService = Executors.newFixedThreadPool(4);
-                String nowDate = DateUtils.formatDate();
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                //1:获取当日广告计划数据
-                                advertiserDataService.getAdvertiserPlan(token, "", nowDate, nowDate);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                            }
-                        }
-                    });
-                });
-                log.info("头条全量计划数据获取完成");
-            }
-
-        };
-        thread.start();
-    }
-
-
-}

+ 0 - 61
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceSameDayCreativeLoadJob.java

@@ -1,61 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * DONE
- */
-@Slf4j
-public class BytedanceSameDayCreativeLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    static ExecutorService executorService = null;
-    //线程计数器
-    static CountDownLatch countDownLatch = null;
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        executorService = Executors.newFixedThreadPool(6);
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        String getDateString = DateUtils.formatDate(new Date());
-//                        advertiserDataService.getAdvertiserCreative(token, getDateString);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    } finally {
-                        countDownLatch.countDown();
-                    }
-                }
-            });
-        });
-        try {
-            countDownLatch.await();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        log.info("创意物料数据同步完成");
-    }
-}

+ 0 - 34
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DailyFlowsJob.java

@@ -1,34 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-
-public class DailyFlowsJob implements Job {
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    @Autowired
-    private ICtopOauthTokenService oauthTokenService;
-    /**
-     * 刷新token
-     *
-     * @param jobExecutionContext
-     * @throws JobExecutionException
-     */
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) {
-        List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
-        if (!Check.isNull(tokens)) {
-            for (CtopOauthToken ctopOauthToken : tokens) {
-                kuaishouInterfaceService.getDailyFlows(ctopOauthToken);
-            }
-        }
-    }
-}

+ 0 - 18
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DataeyeJob.java

@@ -1,18 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.crawler.modules.dataeye.service.DataeyeMediaService;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-@Slf4j
-public class DataeyeJob implements Job {
-    @Autowired
-    private DataeyeMediaService dataeyeMediaService;
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        dataeyeMediaService.getMediaList();
-    }
-}

+ 0 - 50
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouCleanMaterialJob.java

@@ -1,50 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.utils.Check;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.modules.ctop.service.ICleanMaterialService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 清洗素材报表
- */
-@Slf4j
-public class KuaiShouCleanMaterialJob implements Job {
-    @Autowired
-    private ICleanMaterialService cleanMaterialService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                List<String> signatureList = cleanMaterialService.getSignature();
-                if (Check.isNull(signatureList)) {
-                    log.error("素材数据获取为空");
-                    return;
-                }
-                executorService = Executors.newFixedThreadPool(5);
-                for (int i = 0; i < signatureList.size(); i++) {
-                    String signature = signatureList.get(i);
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            cleanMaterialService.calculationReport(signature);
-                        }
-                    });
-                }
-
-
-            }
-        };
-        thread.start();
-
-    }
-}

+ 0 - 30
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouRefreshTokenJob.java

@@ -1,30 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.service.IRefreshTokenService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class KuaiShouRefreshTokenJob implements Job {
-    @Autowired
-    private IRefreshTokenService refreshTokenService;
-
-    /**
-     * 刷新token
-     *
-     * @param jobExecutionContext
-     * @throws JobExecutionException
-     */
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                refreshTokenService.getKuaiShouRefresh();
-            }
-        };
-        thread.start();
-
-    }
-}

+ 0 - 28
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouAdvertiserCrawlerJob.java

@@ -1,28 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.crawler.modules.account.entity.KuaishouAdAccount;
-import cn.com.ctop.crawler.modules.account.service.IKuaishouAdAccountService;
-import cn.com.ctop.kuaishou.modules.app.service.IKuaishouAppService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-
-public class KuaishouAdvertiserCrawlerJob implements Job {
-    @Autowired
-    private IKuaishouAdAccountService kuaishouAdAccountService;
-    @Autowired
-    private IKuaishouAppService kuaishouAppService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        List<KuaishouAdAccount> list = kuaishouAdAccountService.querySyncAccount();
-        if (list != null) {
-            for (KuaishouAdAccount account : list) {
-                kuaishouAppService.adAccountFetch(account, "");
-            }
-        }
-    }
-}

+ 0 - 55
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCampaignJob.java

@@ -1,55 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-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 lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Slf4j
-public class KuaishouCampaignJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                executorService = Executors.newFixedThreadPool(5);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                //1:获取全量广告计划数据
-                                kuaishouInterfaceService.getCampaignList(token, null, null);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                            }
-                        }
-                    });
-                });
-                log.info("快手物料数据同步完成");
-            }
-
-        };
-        thread.start();
-
-
-    }
-}

+ 0 - 20
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCceDataJob.java

@@ -1,20 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import org.jeecg.modules.ctop.service.ICrawlerService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-/**
- * @author 宋英豪
- */
-public class KuaishouCceDataJob implements Job {
-    @Autowired
-    private ICrawlerService crawlerService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        crawlerService.loadInspiration();
-    }
-}

+ 0 - 66
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoDelete.java

@@ -1,66 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.BindAccountLogin;
-import cn.com.ctop.common.module.service.IBindAccountLoginService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Slf4j
-public class KuaishouCommentAutoDelete implements Job {
-    @Value("${chrome.script.clean}")
-    private String cleanUrl;
-    @Autowired
-    private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
-    @Autowired
-    private IBindAccountLoginService bindAccountLoginService;
-    static ExecutorService executorService = null;
-    //线程计数器
-    static CountDownLatch countDownLatch = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Long start = System.currentTimeMillis();
-        List<BindAccountLogin>loginList = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY,1);
-        if (loginList != null && !loginList.isEmpty()) {
-            executorService = Executors.newFixedThreadPool(5);
-            countDownLatch = new CountDownLatch(loginList.size());
-            loginList.forEach(login -> executorService.submit(()->{
-                try {
-                    kuaishouWebInterfaceService.deleteAllComment(new HashMap<>(),login);
-                    Runtime runtime = Runtime.getRuntime();
-                    Process pro = runtime.exec(cleanUrl);
-                    int status = pro.waitFor();
-                    if (status == 0) {
-                        log.info("success,删除评论调用shell脚本执行成功");
-                    } else {
-                        log.info("error,删除评论调用shell脚本执行失败");
-                    }
-                    Thread.sleep(3 * 1000L);
-                }catch (Exception e){
-                    log.error(e.getMessage(),e);
-                }finally {
-                    countDownLatch.countDown();
-                }
-            }));
-            try {
-                countDownLatch.await();
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-            Long end = System.currentTimeMillis();
-            log.info("快手删评论所用时长:{}毫秒",end-start);
-        }
-    }
-}

+ 0 - 47
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoLoginJob.java

@@ -1,47 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.BindAccountLogin;
-import cn.com.ctop.common.module.service.IBindAccountLoginService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-
-import java.util.List;
-
-@Slf4j
-public class KuaishouCommentAutoLoginJob implements Job {
-    @Value("${chrome.script.clean}")
-    private String cleanUrl;
-    @Autowired
-    private IBindAccountLoginService bindAccountLoginService;
-    @Autowired
-    private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY,1);
-        if(list!=null&&!list.isEmpty()){
-            for (BindAccountLogin login:list) {
-                if(null==login.getCookie()||"".equals(login.getCookie().trim())){
-                    kuaishouWebInterfaceService.getkuaishouWebLoginCookie(login);
-                    Runtime runtime = Runtime.getRuntime();
-                    try {
-                        Process pro = runtime.exec(cleanUrl);
-                        int status = pro.waitFor();
-                        if (status == 0) {
-                            log.info("success,删除评论调用shell脚本执行成功");
-                        } else {
-                            log.info("error,删除评论调用shell脚本执行失败");
-                        }
-                    } catch (Exception e) {
-                        log.error(e.getMessage(),e);
-                    }
-                }
-            }
-        }
-    }
-}

+ 0 - 56
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCrawlerJob.java

@@ -1,56 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.crawler.modules.account.entity.KuaishouAppAccount;
-import cn.com.ctop.crawler.modules.account.entity.KuaishouIosAccount;
-import cn.com.ctop.crawler.modules.account.service.IKuaishouAppAccountService;
-import cn.com.ctop.crawler.modules.account.service.IKuaishouIosAccountService;
-import cn.com.ctop.kuaishou.modules.app.service.IKuaishouAppService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-
-public class KuaishouCrawlerJob implements Job {
-    @Autowired
-    private IKuaishouAppService kuaishouAppService;
-    @Autowired
-    private IKuaishouAppAccountService kuaishouAppAccountService;
-    @Autowired
-    private IKuaishouIosAccountService kuaishouIosAccountService;
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        try {
-            Integer page = 1;
-            QueryWrapper<KuaishouAppAccount> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("path","/rest/n/feed/hot");
-            List<KuaishouAppAccount> list = kuaishouAppAccountService.list(queryWrapper);
-            if (list != null) {
-                for (KuaishouAppAccount kuaishouAppAccount : list) {
-                    try {
-                        kuaishouAppService.adFetch(kuaishouAppAccount, page);
-                    }catch (Exception e){
-                        e.printStackTrace();
-                    }
-                }
-            }
-
-            QueryWrapper<KuaishouIosAccount> queryWrapper2 = new QueryWrapper<>();
-            queryWrapper2.eq("path","/rest/n/feed/hot");
-            List<KuaishouIosAccount> list2 = kuaishouIosAccountService.list(queryWrapper2);
-            if (list2 != null) {
-                for (KuaishouIosAccount kuaishouIosAccount : list2) {
-                    try {
-                        kuaishouAppService.adFetch(kuaishouIosAccount);
-                    }catch (Exception e){
-                        e.printStackTrace();
-                    }
-                }
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}

+ 0 - 58
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCampaignReportLoadJob.java

@@ -1,58 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-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 lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-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;
-
-/**
- * 广告计划分天报表
- *
- * @author syh
- */
-@Slf4j
-public class KuaishouDailyCampaignReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                Date getDate = DateUtils.addDay(new Date(), -1);
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                if (null == tokens || tokens.size() <= 0) {
-                    log.info("定时获取快手数据异常:未获取到可用的token");
-                    return;
-                }
-                executorService = Executors.newFixedThreadPool(3);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            //获取广告计划信息数据
-                            kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
-                        }
-                    });
-                });
-            }
-        };
-        thread.start();
-
-    }
-}

+ 0 - 87
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCreativeReportLoadJob.java

@@ -1,87 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCampaignService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import com.alibaba.fastjson.JSONArray;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-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;
-
-/**
- * 获取创意分天报表
- *
- * @author syh
- */
-@Slf4j
-public class KuaishouDailyCreativeReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = null;
-
-    @Autowired
-    private IKuaiShouCampaignService campaignService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                Date getDate = DateUtils.addDay(new Date(), -1);
-                //1:查询当日数据
-                executorService = Executors.newFixedThreadPool(4);
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                if (null == tokens || tokens.size() <= 0) {
-                    log.info("定时获取快手数据异常:未获取到可用的token");
-                    return;
-                }
-                for (CtopOauthToken token : tokens) {
-                    try {
-                        log.info("获取创意分天报表开始,accountId:{}", token.getAccountId());
-                        kuaishouInterfaceService.getCampaignList(token, null, null);
-                        sleep(5 * 100);
-                        List<JSONArray> campaigns = campaignService.getJsonArrByAccount(token.getAccountId(), 50);
-                        if (!Check.isNull(campaigns) && campaigns.size() > 0) {
-                            for (int i = 0; i < campaigns.size(); i++) {
-                                JSONArray campaignIds = (JSONArray) JSONArray.parse(campaigns.get(i).toJSONString());
-                                executorService.submit(new Runnable() {
-                                    @Override
-                                    public void run() {
-                                        try {
-                                            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate, campaignIds, null);
-                                        } catch (Exception e) {
-                                            log.info("获取创意日报失败,accountId:{}", token.getAccountId());
-                                        }
-
-                                    }
-                                });
-
-                            }
-
-                        }
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-
-
-                }
-            }
-        };
-        thread.start();
-
-    }
-
-}

+ 0 - 72
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyLoadFileJob.java

@@ -1,72 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import static org.jeecg.common.util.DateUtils.getAnotherDay;
-
-/**
- * 获取文件状态并下载入库
- *
- * @author yumeng
- */
-@Slf4j
-public class KuaishouDailyLoadFileJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    static ExecutorService executorService = null;
-    static CountDownLatch countDownLatch = null;
-    @Autowired
-    private IKuaiShouDailyReportTaskService dailyReportTaskService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                String nowDate = DateUtils.getDate("yyyy-MM-dd");
-                String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -1);
-                //  查询快手token
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                if (null == tokens || tokens.size() <= 0) {
-                    log.info("定时获取快手数据异常:未获取到可用的token");
-                    return;
-                }
-                executorService = Executors.newFixedThreadPool(3);
-                countDownLatch = new CountDownLatch(tokens.size());
-                for (CtopOauthToken token : tokens) {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), statDate);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                                countDownLatch.countDown();
-                            }
-                        }
-                    });
-                }
-                executorService.shutdown();
-            }
-        };
-        thread.start();
-
-    }
-
-
-}

+ 0 - 41
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyReportTaskJob.java

@@ -1,41 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Date;
-import java.util.List;
-
-@Slf4j
-public class KuaishouDailyReportTaskJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaiShouHistoryReportTaskService reportTaskService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        log.info("快手获取日报数据任务执行开始");
-        Long start = System.currentTimeMillis();
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("快手获取日报数据任务执行失败:未获取到可用的token");
-            return;
-        }
-        String getDateStr = DateUtils.formatDate(getDate);
-        for (CtopOauthToken token : tokens) {
-            reportTaskService.createTask(token.getAccountId(), token.getAccessToken(), getDateStr, getDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY);
-        }
-        Long end = System.currentTimeMillis();
-        log.info("快手获取日报数据任务执行结束,执行耗时:{}秒", (end - start) / 1000);
-    }
-}

+ 0 - 57
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouGroupJob.java

@@ -1,57 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-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 lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Slf4j
-public class KuaishouGroupJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                executorService = Executors.newFixedThreadPool(3);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-
-                                kuaishouInterfaceService.getGroupList(token, null, null);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                            }
-                        }
-                    });
-                });
-                log.info("快手物料数据同步完成");
-            }
-
-        };
-        thread.start();
-
-
-    }
-}

+ 0 - 38
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHistoryLoadFileJob.java

@@ -1,38 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.concurrent.ExecutorService;
-
-/**
- * 获取文件状态并下载入库
- *
- * @author yumeng
- */
-@Slf4j
-public class KuaishouHistoryLoadFileJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    static ExecutorService executorService = null;
-    @Autowired
-    private IKuaiShouHistoryReportTaskService historyReportTaskService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                historyReportTaskService.getTaskList();
-            }
-
-        };
-        thread.start();
-
-    }
-}

+ 0 - 81
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountReportLoadJob.java

@@ -1,81 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-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 lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 获取广告主分时报表
- *
- * @author syh
- */
-@Slf4j
-public class KuaishouHourlyAccountReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = Executors.newFixedThreadPool(8);
-    //线程计数器
-    static CountDownLatch countDownLatch = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                Date getDate = new Date();
-                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-                String hour = simpleDateFormat.format(getDate);
-                if (null != hour && "00".equals(hour)) {
-                    getDate = DateUtils.addDay(getDate, -1);
-                }
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                if (null == tokens || tokens.size() <= 0) {
-                    log.info("定时获取快手数据异常:未获取到可用的token");
-                    return;
-                }
-                countDownLatch = new CountDownLatch(tokens.size());
-                Date finalGetDate = getDate;
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                // 获取广告主时报
-                                kuaishouInterfaceService.getAdvertiserReportHourly(token, finalGetDate, finalGetDate);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                                countDownLatch.countDown();
-                            }
-                        }
-                    });
-                });
-                try {
-                    countDownLatch.await();
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
-                executorService.shutdown();
-            }
-        };
-        thread.start();
-
-    }
-}

+ 0 - 68
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountWarningLoadJob.java

@@ -1,68 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.kuaishou.modules.batch.service.IAccountWarningService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import static org.jeecg.common.util.DateUtils.getAnotherDay;
-
-/**
- * 获取广告主分时报表
- *
- * @author syh
- */
-@Slf4j
-public class KuaishouHourlyAccountWarningLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IAccountWarningService accountWarningService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                log.info("开始时段消耗预警定时任务");
-                long l = System.currentTimeMillis();
-                try {
-                    List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                    if (null == tokens || tokens.size() <= 0) {
-                        log.info("定时获取快手数据异常:未获取到可用的token");
-                        return;
-                    }
-                    String statDate = DateUtils.getDate("yyyy-MM-dd");
-                    String anotherDay = getAnotherDay("yyyy-MM-dd", statDate, -1);
-                    executorService = Executors.newFixedThreadPool(3);
-                    for (CtopOauthToken token : tokens) {
-                        executorService.submit(new Runnable() {
-                            @Override
-                            public void run() {
-                                accountWarningService.kuaiShouAccountWarning(token.getAccountId(), statDate, anotherDay);
-
-                            }
-                        });
-                    }
-                    log.info("异步时段消耗预警定时任务执行完毕,耗时:{} ms", System.currentTimeMillis() - l);
-
-                } catch (Exception e) {
-                    e.printStackTrace();
-
-                }
-            }
-        };
-        thread.start();
-    }
-}

+ 0 - 85
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCampaignReportLoadJob.java

@@ -1,85 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 获取广告计划分时报表
- *
- * @author syh
- */
-@Slf4j
-public class KuaishouHourlyCampaignReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = null;
-    //线程计数器
-    static CountDownLatch countDownLatch = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                Date getDate = new Date();
-                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-                String hour = simpleDateFormat.format(getDate);
-                if (null != hour && "00".equals(hour)) {
-                    getDate = DateUtils.addDay(getDate, -1);
-                }
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                if (null == tokens || tokens.size() <= 0) {
-                    log.info("定时获取快手数据异常:未获取到可用的token");
-                    return;
-                }
-                executorService = Executors.newFixedThreadPool(5);
-                countDownLatch = new CountDownLatch(tokens.size());
-                Date finalGetDate = getDate;
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                // 获取 广告计划时报
-                                kuaishouInterfaceService.getAdvertiserCampaignReportHourly(token, finalGetDate, finalGetDate);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                                countDownLatch.countDown();
-                            }
-                        }
-                    });
-                });
-                try {
-                    countDownLatch.await();
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
-                executorService.shutdown();
-            }
-        };
-        thread.start();
-
-
-    }
-}

+ 0 - 84
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCreativeReportLoadJob.java

@@ -1,84 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-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 lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 获取 广告创意分时数据
- *
- * @author syh
- */
-@Slf4j
-public class KuaishouHourlyCreativeReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = null;
-    //线程计数器
-    static CountDownLatch countDownLatch = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                Date getDate = new Date();
-                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
-                String hour = simpleDateFormat.format(getDate);
-                if (null != hour && "00".equals(hour)) {
-                    getDate = DateUtils.addDay(getDate, -1);
-                }
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                if (null == tokens || tokens.size() <= 0) {
-                    log.info("定时获取快手数据异常:未获取到可用的token");
-                    return;
-                }
-                executorService = Executors.newFixedThreadPool(3);
-                countDownLatch = new CountDownLatch(tokens.size());
-                Date finalGetDate = getDate;
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-
-                                //4: 获取广告创意信息数据
-                                kuaishouInterfaceService.getAdvertiserCreativeReportHourly(token, finalGetDate, finalGetDate);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                                countDownLatch.countDown();
-                            }
-                        }
-                    });
-                });
-                try {
-                    countDownLatch.await();
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
-                executorService.shutdown();
-            }
-
-        };
-        thread.start();
-
-    }
-}

+ 0 - 57
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouMaterialsLoadJob.java

@@ -1,57 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-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 lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Slf4j
-public class KuaishouMaterialsLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                String endDate = DateUtils.getNowDate("yyyy-MM-dd");
-                String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", endDate, -1);
-                executorService = Executors.newFixedThreadPool(8);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-
-                                //获取全量视频素材数据
-                                kuaishouInterfaceService.getVideoList(token, startDate, endDate);
-                                // 获取图片信息数据
-                                kuaishouInterfaceService.getImageList(token, DateUtils.getNowDate("yyyy-MM-dd"));
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                            }
-                        }
-                    });
-                });
-                log.info("快手物料数据同步完成");
-            }
-        };
-        thread.start();
-    }
-}

+ 0 - 66
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateCampaignJob.java

@@ -1,66 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-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 lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Slf4j
-public class KuaishouNowDateCampaignJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-
-        Thread thread = new Thread() {
-            @SneakyThrows
-            @Override
-            public void run() {
-                //1:查询当日数据
-                Date endDate  = new Date();
-                String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.formatDate(endDate), -1);
-                SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
-                Date startDate = sim.parse(anotherDay);
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                executorService = Executors.newFixedThreadPool(5);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                kuaishouInterfaceService.getCampaignList(token, startDate, endDate);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                            }
-                        }
-                    });
-                });
-                log.info("快手物料数据同步完成");
-            }
-
-        };
-        thread.start();
-
-
-    }
-
-}

+ 0 - 66
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateCreativeJob.java

@@ -1,66 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-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 lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Slf4j
-public class KuaishouNowDateCreativeJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-
-        Thread thread = new Thread() {
-            @SneakyThrows
-            @Override
-            public void run() {
-                //1:查询当日数据
-                Date endDate  = new Date();
-                String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.formatDate(endDate), -1);
-                SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
-                Date startDate = sim.parse(anotherDay);
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                executorService = Executors.newFixedThreadPool(5);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                kuaishouInterfaceService.getCreativeList(token, startDate, endDate);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                            }
-                        }
-                    });
-                });
-                log.info("快手物料数据同步完成");
-            }
-
-        };
-        thread.start();
-
-
-    }
-
-}

+ 0 - 66
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateGroupJob.java

@@ -1,66 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-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 lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Slf4j
-public class KuaishouNowDateGroupJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-
-        Thread thread = new Thread() {
-            @SneakyThrows
-            @Override
-            public void run() {
-                //1:查询当日数据
-                Date endDate  = new Date();
-                String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.formatDate(endDate), -1);
-                SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
-                Date startDate = sim.parse(anotherDay);
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                executorService = Executors.newFixedThreadPool(5);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                kuaishouInterfaceService.getGroupList(token, startDate, endDate);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                            }
-                        }
-                    });
-                });
-                log.info("快手物料数据同步完成");
-            }
-
-        };
-        thread.start();
-
-
-    }
-
-}

+ 0 - 21
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouReportDailyGroupChannelCodeJob.java

@@ -1,21 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyGroupService;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Date;
-
-public class KuaishouReportDailyGroupChannelCodeJob implements Job {
-    @Autowired
-    private IKuaishouReportDailyGroupService groupService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        String date = DateUtils.formatDate(DateUtils.addDay(new Date(), -1));
-        groupService.formatChannelCode(date);
-    }
-}

+ 0 - 37
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MaterialReportAccountUpdateJob.java

@@ -1,37 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.constant.SystemDateConstant;
-import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.service.IMaterialTopService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-/**
- *  Created by JQ.bi on 2020.5.25
- *  定时更新素材报表的 快手头条整合数据
- */
-@Slf4j
-public class MaterialReportAccountUpdateJob implements Job {
-
-    @Autowired
-    IMaterialTopService materialTopService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-        log.info("MaterialReportAccountUpdateJob is start");
-
-        boolean result=materialTopService.insertMaterialReportAccount(DateUtils.getAnotherDay(SystemDateConstant.yyyy_MM_dd,
-                DateUtils.getNowDate(SystemDateConstant.yyyy_MM_dd), -1));
-
-        if(!result){
-            log.error("MaterialReportAccountUpdateJob is error");
-        } else {
-            log.info("MaterialReportAccountUpdateJob is done");
-        }
-    }
-
-}

+ 0 - 63
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MergeVideoJob.java

@@ -1,63 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.MaterialInfo;
-import cn.com.ctop.common.module.entity.VideoMergeTask;
-import cn.com.ctop.common.module.service.IMaterialInfoService;
-import cn.com.ctop.common.module.service.IVideoMergeTaskService;
-import cn.com.ctop.common.module.utils.LoadFileUtil;
-import cn.com.ctop.common.module.utils.MpsUtils;
-import cn.com.ctop.common.module.utils.PropertiesUtils;
-import com.aliyuncs.mts.model.v20140618.QueryJobListResponse;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-
-public class MergeVideoJob implements Job {
-    @Autowired
-    private IVideoMergeTaskService videoMergeTaskService;
-    @Autowired
-    private IMaterialInfoService materialInfoService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        QueryWrapper<VideoMergeTask> queryWrapper = new QueryWrapper<>();
-        queryWrapper.in("status", "Submitted", "Transcoding");
-        List<VideoMergeTask> list = videoMergeTaskService.list(queryWrapper);
-        if (list != null && list.size() > 0) {
-            for (VideoMergeTask videoMergeTask : list) {
-                QueryJobListResponse.Job job = MpsUtils.getJobStatus(videoMergeTask.getJobId());
-                if ("TranscodeSuccess".equals(job.getState())) {
-                    String url = "https://ctop-part.oss-cn-beijing.aliyuncs.com/" + job.getOutput().getOutputFile().getObject();
-
-                    try {
-                        String localPath = LoadFileUtil.downLoadFromUrl(url, PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
-                        String md5 = LoadFileUtil.getMD5(localPath);
-                        LoadFileUtil.delFile(localPath);
-                        MaterialInfo materialInfo = new MaterialInfo();
-                        materialInfo.setCode(md5);
-                        materialInfo.setId(md5);
-                        materialInfo.setUrl(url);
-                        materialInfo.setUserId(videoMergeTask.getUserId());
-                        materialInfo.setStatus(0);
-                        materialInfo.setType("VIDEO");
-                        materialInfo.setMaterialName("合成" + DateUtils.getMillis());
-                        materialInfoService.saveOrUpdate(materialInfo);
-                        Thread.sleep(3 * 1000);
-                  //      materialInfoService.getFile(materialInfo);
-                        videoMergeTask.setVideoUrl(url);
-                        videoMergeTask.setStatus(job.getState());
-                        videoMergeTask.setVideoId(materialInfo.getId());
-                        videoMergeTaskService.updateById(videoMergeTask);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                }
-            }
-        }
-    }
-}

+ 0 - 29
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/OceanengineJob.java

@@ -1,29 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.crawler.modules.oceanengine.service.IOceanEngineService;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-@Slf4j
-public class OceanengineJob implements Job {
-    @Autowired
-    private IOceanEngineService oceanEngineService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        String account="3248395570@qq.com";
-        String password = "Ydxq-704127411";
-        oceanEngineService.login(account,password);
-        oceanEngineService.douyinHotHandler(1,1);
-        oceanEngineService.effectCaseHandler(1);
-        oceanEngineService.hotMaterialHandler(1,1,"西瓜");
-        oceanEngineService.hotMaterialHandler(1,3,"火山");
-        oceanEngineService.hotMaterialHandler(1,4,"抖音");
-        oceanEngineService.hotMaterialHandler(1,8,"头条");
-        oceanEngineService.hotMaterialHandler(1,9,"穿山甲");
-        log.info("巨量创意抓取完成");
-    }
-}

+ 0 - 33
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/PangolinDataJob.java

@@ -1,33 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.BindAccountLogin;
-import cn.com.ctop.common.module.service.IBindAccountLoginService;
-import cn.com.ctop.crawler.modules.pangolin.service.PangolinCrawlerService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-
-public class PangolinDataJob implements Job {
-    @Autowired
-    private IBindAccountLoginService bindAccountLoginService;
-    @Autowired
-    private PangolinCrawlerService pangolinCrawlerService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("login_type", "pangolin");
-        queryWrapper.eq("status", 1);
-        queryWrapper.isNotNull("cookie");
-        List<BindAccountLogin> list = bindAccountLoginService.list(queryWrapper);
-        if (list != null && !list.isEmpty()) {
-            for (BindAccountLogin bindAccountLogin : list) {
-                pangolinCrawlerService.getNowData(bindAccountLogin);
-            }
-        }
-    }
-}

+ 0 - 30
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/PangolinLoginJob.java

@@ -1,30 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.BindAccountLogin;
-import cn.com.ctop.common.module.service.IBindAccountLoginService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.crawler.modules.pangolin.service.PangolinLoginService;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-
-public class PangolinLoginJob implements Job {
-    @Autowired
-    private IBindAccountLoginService bindAccountLoginService;
-    @Autowired
-    private PangolinLoginService pangolinLoginService;
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_PANGOLIN_PY,1);
-        if(list!=null&&!list.isEmpty()){
-            for (BindAccountLogin login:list) {
-                if(null==login.getCookie()||"".equals(login.getCookie().trim())){
-                    pangolinLoginService.pangolinLogin(login.getAccountName(), login.getPassword());
-                }
-            }
-        }
-    }
-}

+ 0 - 42
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/TargetingTagsJob.java

@@ -1,42 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-
-public class TargetingTagsJob implements Job {
-    @Autowired
-    private IKuaishouInterfaceService iKuaishouInterfaceService;
-    @Autowired
-    private CtopOauthTokenMapper oauthTokenMapper;
-
-    /**
-     * 定时更新 快手 标签
-     *
-     * @param jobExecutionContext
-     * @throws JobExecutionException
-     */
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
-                tokenQueryWrapper.eq("media_id", 2);
-                tokenQueryWrapper.orderByDesc("create_time");
-                tokenQueryWrapper.last("limit 1");
-                CtopOauthToken token = oauthTokenMapper.selectOne(tokenQueryWrapper);
-                iKuaishouInterfaceService.getTargetingTags(token.getAccountId(), token.getAccessToken());
-                iKuaishouInterfaceService.areaList(token.getAccessToken());
-            }
-        };
-        thread.start();
-
-    }
-}

+ 0 - 35
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ToutiaoMaterialsLoadJob.java

@@ -1,35 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-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;
-
-@Slf4j
-public class ToutiaoMaterialsLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IBytedanceReportService bytedanceReportService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(8);
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        //增加接口的开始和结束日期
-        String startDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -1));
-        //获取头条token数据
-        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        tokens.forEach(token -> executorService.submit(()-> bytedanceReportService.bytedanceMaterialReport(token,startDate,startDate)));
-        log.info("头条素材数据同步完成,"+ "开始时间:" + startDate + ",结束时间:" + startDate);
-    }
-}

+ 0 - 56
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java

@@ -1,56 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.MaterialInfo;
-import cn.com.ctop.common.module.entity.VideoWatermarkTask;
-import cn.com.ctop.common.module.service.IMaterialInfoService;
-import cn.com.ctop.common.module.service.IVideoWatermarkTaskService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.common.module.utils.LoadFileUtil;
-import cn.com.ctop.common.module.utils.MpsUtils;
-import cn.com.ctop.common.module.utils.PropertiesUtils;
-import com.aliyuncs.mts.model.v20140618.QueryJobListResponse;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-
-public class WatermarkVideoJob implements Job {
-    @Autowired
-    private IVideoWatermarkTaskService videoWaterMarkService;
-    @Autowired
-    private IMaterialInfoService materialInfoService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        QueryWrapper<VideoWatermarkTask> queryWrapper = new QueryWrapper<>();
-        queryWrapper.in("status", "Submitted", "Transcoding");
-        List<VideoWatermarkTask> list = videoWaterMarkService.list(queryWrapper);
-        if (list != null && !list.isEmpty()) {
-            for (VideoWatermarkTask videoWatermarkTask : list) {
-                QueryJobListResponse.Job job = MpsUtils.getJobStatus(videoWatermarkTask.getJobId());
-                if ("TranscodeSuccess".equals(job.getState())) {
-                    String url = "https://ctop-media.oss-cn-beijing.aliyuncs.com/" + job.getOutput().getOutputFile().getObject();
-                    String localPath = LoadFileUtil.downLoadFromUrl(url, PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
-                    LoadFileUtil.delFile(localPath);
-                    QueryWrapper<MaterialInfo> materialInfoQueryWrapper = new QueryWrapper<>();
-                    materialInfoQueryWrapper.eq("watermark_code", job.getJobId());
-                    MaterialInfo materialInfo = materialInfoService.getOne(materialInfoQueryWrapper);
-                    if (Check.isNull(materialInfo)) {
-                        videoWaterMarkService.removeById(videoWatermarkTask.getId());
-                        continue;
-
-                    }
-                    materialInfo.setWatermarkUrl(url);
-                    materialInfoService.saveOrUpdate(materialInfo);
-                    videoWatermarkTask.setVideoUrl(url);
-                    videoWatermarkTask.setStatus(job.getState());
-                    videoWatermarkTask.setVideoId(materialInfo.getId());
-                    videoWaterMarkService.updateById(videoWatermarkTask);
-                }
-            }
-        }
-    }
-}

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

@@ -4,8 +4,12 @@ import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouOperationRecord;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouOperationRecordMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.batch.service.impl.KuaishouInterfaceServiceImpl2;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
@@ -14,6 +18,8 @@ import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceCheckReportTaskInfo;
 import cn.com.ctop.toutiao.modules.report.service.*;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
@@ -27,9 +33,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 import javax.annotation.Resource;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
+import java.util.*;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -244,31 +248,6 @@ public class SampleTest {
             bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(DateUtils.parseDate(getDate, "yyyy-MM-dd"));
         }
     }
-    @Test
-    public void loadKuaiShouMatHourlyData() throws InterruptedException{
-//        kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(7411077l, tokenService.getOauthTokenByAccountId("7411077").getAccessToken(), "2021-07-02", "2021-07-02", "HOURLY", 1);
-
-        String startDate = "2021-07-19";
-        String endDate = "2021-07-19";
-        System.out.println(DateUtils.now());
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        System.out.println(tokens.size());
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> executorService.submit(() -> {
-            try {
-                kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), startDate, endDate, "HOURLY", 1);
-            }catch (Exception e){
-            }finally {
-                countDownLatch.countDown();
-            }
-        }));
-        countDownLatch.await();
-        System.out.println("数据获取完成");
-        System.out.println(DateUtils.now());
-    }
-
-    @Autowired
-    IKuaishouInterfaceService2 kuaishouInterfaceService2;
     @Resource
     private KuaishouOperationRecordMapper kuaishouOperationRecordMapper;
 
@@ -323,7 +302,6 @@ public class SampleTest {
                     }
                 }catch (Exception e){
                 }finally {
-
                     countDownLatch.countDown();
             }}));
             countDownLatch.await();

+ 0 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedancePlanDailyReportLoadJob.java

@@ -3,7 +3,6 @@ package cn.com.ctop.job.bytedance.handler;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;