浏览代码

Merge remote-tracking branch 'origin/V1.1.8' into V1.1.8

zhaoxian 3 年之前
父节点
当前提交
950ed1599d
共有 100 个文件被更改,包括 1383 次插入3089 次删除
  1. 0 22
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ads/controller/StrategyController.java
  2. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  3. 49 11
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialReportOverViewController.java
  4. 3 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  5. 346 21
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  6. 0 27
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountBidJob.java
  7. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountCpaBidJob.java
  8. 0 16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AppProductJob.java
  9. 0 49
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java
  10. 0 69
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceHourlyAccountWarningLoadJob.java
  11. 0 33
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceRefreshTokenJob.java
  12. 0 45
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDailyReportLoadJob.java
  13. 0 52
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDataLoadJob.java
  14. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserHourlyReportLoadJob.java
  15. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeDailyReportLoadJob.java
  16. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeHourlyReportLoadJob.java
  17. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportJob.java
  18. 0 82
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportRetryJob.java
  19. 0 67
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyVideoMaterialReportAddJob.java
  20. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyVideoMaterialReportJob.java
  21. 0 55
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceMaterialsLoadJob.java
  22. 0 109
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java
  23. 0 40
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportYeterdayLoadJob.java
  24. 0 84
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanHourlyReportLoadJob.java
  25. 0 60
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanLoadJob.java
  26. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanRealTimeLoadJob.java
  27. 0 61
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceSameDayCreativeLoadJob.java
  28. 0 34
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DailyFlowsJob.java
  29. 0 18
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DataeyeJob.java
  30. 0 50
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouCleanMaterialJob.java
  31. 0 30
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouRefreshTokenJob.java
  32. 0 28
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouAdvertiserCrawlerJob.java
  33. 0 55
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCampaignJob.java
  34. 0 20
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCceDataJob.java
  35. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoDelete.java
  36. 0 47
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoLoginJob.java
  37. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCrawlerJob.java
  38. 0 58
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCampaignReportLoadJob.java
  39. 0 87
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCreativeReportLoadJob.java
  40. 0 72
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyLoadFileJob.java
  41. 0 41
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyReportTaskJob.java
  42. 0 57
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouGroupJob.java
  43. 0 38
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHistoryLoadFileJob.java
  44. 0 81
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountReportLoadJob.java
  45. 0 68
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountWarningLoadJob.java
  46. 0 85
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCampaignReportLoadJob.java
  47. 0 84
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCreativeReportLoadJob.java
  48. 0 57
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouMaterialsLoadJob.java
  49. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateCampaignJob.java
  50. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateCreativeJob.java
  51. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateGroupJob.java
  52. 0 21
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouReportDailyGroupChannelCodeJob.java
  53. 0 37
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MaterialReportAccountUpdateJob.java
  54. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MergeVideoJob.java
  55. 0 29
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/OceanengineJob.java
  56. 0 33
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/PangolinDataJob.java
  57. 0 30
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/PangolinLoginJob.java
  58. 0 42
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/TargetingTagsJob.java
  59. 0 35
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ToutiaoMaterialsLoadJob.java
  60. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java
  61. 44 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/MaterialReportOverViewMapper.java
  62. 321 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialReportOverViewMapper.xml
  63. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MediaReportMapper.xml
  64. 12 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IMaterialReportOverViewService.java
  65. 104 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/TestService.java
  66. 172 27
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/MaterialReportOverViewServiceImpl.java
  67. 1 2
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  68. 180 17
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  69. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java
  70. 8 2
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml
  71. 3 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MailLogServiceImpl.java
  72. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  73. 6 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/CtopAdConstant.java
  74. 1 5
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/AlarmRuleJob.java
  75. 1 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BaseReportVideoDailyLoadJob.java
  76. 1 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceCheckAccountMonitoringLinkJob.java
  77. 1 1
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceCleanMaterialJob.java
  78. 4 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceHourlyAccountWarningLoadJob.java
  79. 5 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDancePlanRuleDataJob.java
  80. 16 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceRefreshTokenJob.java
  81. 1 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceVideoReportJob.java
  82. 1 1
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAccountBidJob.java
  83. 4 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertiserDailyReportLoadJob.java
  84. 5 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertiserHourlyReportLoadJob.java
  85. 4 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertisingDataLoadJob.java
  86. 5 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAiCreateJob.java
  87. 4 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceCampaignDailyReportLoadJob.java
  88. 4 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceCampaignHourlyReportLoadJob.java
  89. 10 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceCheckAccountReportJob.java
  90. 5 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceCreativeDailyReportLoadJob.java
  91. 5 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceCreativeHourlyReportLoadJob.java
  92. 5 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyMaterialReportJob.java
  93. 1 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyMaterialReportRetryJob.java
  94. 4 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyPlayableReportJob.java
  95. 4 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyPlayableReportRetryJob.java
  96. 22 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceEtlVideoJob.java
  97. 5 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceFlowFundJob.java
  98. 4 2
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceMaterialsLoadJob.java
  99. 4 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceMonitoringLinksCheckJob.java
  100. 0 0
      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;
-    }
-}

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -597,12 +597,16 @@ public class MaterialInfoController {
                 slogenInfoService.insertSlogans(Check.isNull(materialInfo.getProjectId()) ? materialInfoEntity.getProjectId() : materialInfo.getProjectId(), materialInfoEntity.getCode(), slogans, user.getId());
             }
         }
+
+        //如果状态为1 审核通过,则更新审核时间
+        materialInfo.setConfirmTime(DateUtils.getDate());
         boolean ok = materialInfoService.updateById(materialInfo);
         if (ok) {
             result.success("修改成功!");
         }
 
         Integer status = materialInfo.getStatus();
+
         // 如果状态为2 审核拒绝 给上传人发送消息
         if (status == 2) {
             Product product = productService.getById(materialInfoEntity.getProductId());

+ 49 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialReportOverViewController.java

@@ -10,6 +10,7 @@ import org.jeecg.modules.ctop.service.IMaterialReportOverViewService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.HashMap;
@@ -28,7 +29,7 @@ public class MaterialReportOverViewController {
     @Autowired
     private IMaterialReportOverViewService materialReportOverViewService;
 
-    @Autowired
+    @Resource
     private MaterialReportOverViewMapper materialReportOverViewMapper;
 
     /**
@@ -51,11 +52,48 @@ public class MaterialReportOverViewController {
 
     /**
      *  根据筛选条件查询总消耗、视频总数、爆款视频、有效视频
+     *  mediaId 类型 1-头条 2-快手
+     *  projects[] 项目id
      */
     @PostMapping("/sumData")
     public Result<Map<String,Object>> sumData(@RequestBody JSONObject params){
         Result<Map<String,Object>> result= new Result<>();
-        Map<String, Object> totalModule = materialReportOverViewService.getTotalModule(params.getInteger("mediaId"),
+        Map<String, Object> totalModule = materialReportOverViewService.getTotalModule(
+                params.getInteger("mediaId"),
+                params.getString("startDate"),
+                params.getString("endDate"),
+                params.getJSONArray("projects"));
+        result.setResult(totalModule);
+        result.setSuccess(true);
+        return result;
+    }
+ /**
+     *  根据筛选条件查询视频上新 有效
+     *  mediaId 类型 1-头条 2-快手
+     *  projects[] 项目id
+     */
+    @PostMapping("/sumDataVideoNewEffective")
+    public Result<Map<String,Object>> sumDataVideoNewEffective(@RequestBody JSONObject params){
+        Result<Map<String,Object>> result= new Result<>();
+        Map<String, Object> totalModule = materialReportOverViewService.sumDataVideoNewEffective(
+                params.getInteger("mediaId"),
+                params.getString("startDate"),
+                params.getString("endDate"),
+                params.getJSONArray("projects"));
+        result.setResult(totalModule);
+        result.setSuccess(true);
+        return result;
+    }
+ /**
+     *  根据筛选条件查询 爆款视频
+     *  mediaId 类型 1-头条 2-快手
+     *  projects[] 项目id
+     */
+    @PostMapping("/sumDataVideoHot")
+    public Result<Map<String,Object>> sumDataVideoHot(@RequestBody JSONObject params){
+        Result<Map<String,Object>> result= new Result<>();
+        Map<String, Object> totalModule = materialReportOverViewService.sumDataVideoHot(
+                params.getInteger("mediaId"),
                 params.getString("startDate"),
                 params.getString("endDate"),
                 params.getJSONArray("projects"));
@@ -88,7 +126,9 @@ public class MaterialReportOverViewController {
         List<JSONObject> topMaterialList = materialReportOverViewService.getTopMaterialList(params.getInteger("mediaId"),
                 params.getString("startDate"),
                 params.getString("endDate"),
-                params.getJSONArray("projects"));
+                params.getJSONArray("projects"),
+                params.getInteger("channelType")
+        );
         result.setResult(topMaterialList);
         result.setSuccess(true);
         return result;
@@ -135,16 +175,14 @@ public class MaterialReportOverViewController {
      *  Top设计排行榜
      */
     @PostMapping("/designTop")
-    public Result<PageInfo<JSONObject>> designTop(@RequestBody JSONObject params){
-        Result<PageInfo<JSONObject>> result = new Result<>();
-        PageInfo<JSONObject> topMaterialList = materialReportOverViewService.getTopDesignList(
+    public Result<List<JSONObject>> designTop(@RequestBody JSONObject params){
+        Result<List<JSONObject>> result = new Result<>();
+        List<JSONObject> topMaterialList = materialReportOverViewService.getTopDesignList(
+                params.getInteger("mediaId"),
                 params.getString("startDate"),
                 params.getString("endDate"),
-                params.getString("userId"),
-                params.getString("target"),
-                params.getString("order"),
-                params.getInteger("pageSize"),
-                params.getInteger("pageNo"));
+                params.getJSONArray("projects"),
+                params.getString("type"));
         result.setResult(topMaterialList);
         result.setSuccess(true);
         return result;

+ 3 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java

@@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.MD5Util;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
 import org.jeecg.modules.ctop.service.IAdvertiserService;
@@ -26,6 +27,7 @@ import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.*;
 
@@ -43,7 +45,7 @@ import java.util.*;
 public class ProjectMemberController {
     @Autowired
     private IProjectMemberService projectMemberService;
-    @Autowired
+    @Resource
     private ProjectMemberMapper projectMemberMapper;
     @Autowired
     private IProjectService projectService;
@@ -573,8 +575,5 @@ public class ProjectMemberController {
             result.setSuccess(true);
         }
         return result;
-
     }
-
-
 }

+ 346 - 21
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -13,10 +13,9 @@ import cn.com.ctop.crawler.modules.douyin.service.DouyinMusicService;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreateCreativeService;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouTemplate;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouProgramCreative;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouAccessToken;
@@ -25,7 +24,6 @@ import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouProjectData;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouDailyAgentService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouProjectDataService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouAudienceReportDailyService;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportHourlyGroupService;
 import cn.com.ctop.manage.modules.material.service.IMaterialUploadService;
 import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
@@ -35,7 +33,6 @@ import cn.com.ctop.toutiao.modules.report.service.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
@@ -53,7 +50,6 @@ import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -103,7 +99,7 @@ public class TestController {
     @Autowired
     private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
 
-    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+    static ExecutorService executorService = Executors.newFixedThreadPool(10);
     static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
     @Autowired
     private IKuaiShouDailyAgentService dailyAgentService;
@@ -137,13 +133,342 @@ public class TestController {
 
     @Autowired
     private IBatchService batchService;
-    static ExecutorService videoService = Executors.newFixedThreadPool(3);
+    static ExecutorService videoService = Executors.newFixedThreadPool(8);
     @Autowired
     private IMaterialUploadService materialUploadService;
+    @Autowired
+    private IKuaishouProgramCreativeService kuaishouProgramCreativeService;
 
     @Value("${xxl-job.requestUrl}")
     private String jobUrl;
 
+
+    @GetMapping(value = "/getProgramCreative")
+    public void getProgramCreative() {
+        List<Long> list = new ArrayList();
+
+        list.add(10344460L);
+        list.add(10344415L);
+        list.add(10344390L);
+        list.add(10344030L);
+        list.add(10343624L);
+        list.add(10343590L);
+        list.add(10343529L);
+        list.add(10343451L);
+        list.add(10343394L);
+        list.add(10327332L);
+        list.add(10327322L);
+        list.add(10327303L);
+        list.add(10327276L);
+        list.add(10327257L);
+        list.add(10327214L);
+        list.add(10327078L);
+        list.add(10327042L);
+        list.add(10327022L);
+        list.add(10326908L);
+        list.add(10299258L);
+        list.add(10299241L);
+        list.add(10299221L);
+        list.add(10299210L);
+        list.add(10298910L);
+        list.add(10298871L);
+        list.add(10298859L);
+        list.add(10298840L);
+        list.add(10258924L);
+        list.add(10258921L);
+        list.add(10258286L);
+        list.add(10258278L);
+        list.add(10258257L);
+        list.add(10258249L);
+        list.add(10258216L);
+        list.add(10257909L);
+        list.add(10257825L);
+        list.add(10257792L);
+        list.add(10257253L);
+        list.add(10257209L);
+        list.add(10257193L);
+        list.add(10257189L);
+        list.add(10257172L);
+        list.add(10257141L);
+        list.add(10257048L);
+        list.add(10252339L);
+        list.add(10252321L);
+        list.add(10252233L);
+        list.add(10252231L);
+        list.add(10173389L);
+        list.add(10173385L);
+        list.add(10173375L);
+        list.add(10173366L);
+        list.add(10173200L);
+        list.add(10108671L);
+        list.add(10108435L);
+        list.add(10093939L);
+        list.add(10093926L);
+        list.add(10093914L);
+        list.add(10093909L);
+        list.add(10093479L);
+        list.add(9767717L);
+        list.add(9767697L);
+        list.add(9706671L);
+        list.add(9635821L);
+        list.add(9635234L);
+        list.add(9549313L);
+        list.add(9549277L);
+
+
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            videoService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        kuaishouProgramCreativeService.getProgramCreative(oauthToken.getAccountId(), null, oauthToken.getAccessToken(), null, null, 1);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            });
+        }
+    }
+
+
+    @GetMapping(value = "/updateProgramCreative")
+    public void updateProgramCreative() {
+        List<Long> list = new ArrayList();
+        list.add(10173366L);
+        list.add(10173375L);
+        list.add(10298910L);
+        list.add(10299210L);
+        list.add(10299221L);
+        list.add(10299241L);
+
+
+
+
+
+
+
+
+
+
+
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
+            QueryWrapper<KuaishouProgramCreative> creativeQueryWrapper = new QueryWrapper<>();
+            creativeQueryWrapper.eq("account_id", accountId);
+            creativeQueryWrapper.lt("creative_create_time", "2021-07-11 00:00:00");
+            List<KuaishouProgramCreative> proList = kuaishouProgramCreativeService.list(creativeQueryWrapper);
+            if (Check.isNull(proList)) {
+                continue;
+            }
+            for (KuaishouProgramCreative programCreative : proList) {
+                Long unitId = programCreative.getUnitId();
+                if (Check.isNull(unitId)) {
+                    continue;
+                }
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+                            String updateUrl = "https://ad.e.kuaishou.com/rest/openapi/v2/creative/advanced/program/update";
+                            Map<String, String> headers = new HashMap<>();
+                            headers.put("Content-Type", "application/json");
+                            headers.put("Access-Token", token.getAccessToken());
+                            Map<String, Object> param = new HashMap<>();
+                            param.put("advertiser_id", token.getAccountId());
+                            param.put("unit_id", unitId);
+
+                            String replaceUrll = "https://uri6.com/tkio/Yj6773a?imei=__IMEI2__&androidid=__ANDROIDID2__&oaid=__OAID__&mac=__MAC__&ip=__IP__&ry_adcreative_id=__CID__&ry_adplan_id=__DID__&ry_adplan_name=__DNAME__&ry_adgroup_id=__AID__&callback=__CALLBACK__&csite=__CSITE__&accountid=__ACCOUNTID__&ua=__UA__&os=__OS__&noredirect=true";
+                            param.put("click_url", replaceUrll);
+                            String result = HttpUtils.httpPostRequest(updateUrl, param, headers);
+                            JSONObject resultJson = JSONObject.parseObject(result);
+                            Integer code = resultJson.getInteger("code");
+                            if (code == 0) {
+                                log.info("修改成功,accountId:{},unitId:{}", token.getAccountId(), unitId);
+                                QueryWrapper<KuaishouProgramCreative> programCreativeQueryWrapper = new QueryWrapper<>();
+                                programCreativeQueryWrapper.eq("account_id", accountId);
+                                programCreativeQueryWrapper.eq("unit_id", unitId);
+                                kuaishouProgramCreativeService.remove(programCreativeQueryWrapper);
+
+                            } else {
+                                log.info("修改失败,accountId:{},unitId:{},原因:{}", token.getAccountId(), unitId, resultJson.getString("message"));
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+            }
+
+
+        }
+    }
+
+
+    @GetMapping(value = "/campaignList")
+    public void campaignList() {
+        List<Long> list = new ArrayList();
+        list.add(9549277L);
+        list.add(9635234L);
+        list.add(9767697L);
+        list.add(9767717L);
+        list.add(9549313L);
+
+
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            // kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
+            videoService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        //   kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
+                        kuaishouInterfaceService.getGroupList(oauthToken, null, null);
+                        //     kuaishouInterfaceService.getCreativeList(oauthToken, null, null);
+                        Thread.sleep(1500);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            });
+
+        }
+
+    }
+
+
+    @GetMapping(value = "/creativeList")
+    public void creativeList() {
+        List<Long> list = new ArrayList();
+        list.add(10108671L);
+
+
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+
+
+            suzhaoService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    kuaishouInterfaceService.getCreativeList(oauthToken, null, null);
+                }
+            });
+            try {
+                Thread.sleep(400L);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+
+        }
+
+    }
+
+
+    @GetMapping(value = "/updateUnit")
+    public void updateUnit() throws Exception {
+        List<Long> list = new ArrayList();
+        list.add(9556344L);
+        list.add(9743738L);
+
+
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            QueryWrapper<KuaiShouGroup> groupQueryWrapper = new QueryWrapper<>();
+            groupQueryWrapper.eq("account_id", accountId);
+            List<KuaiShouGroup> list1 = groupService.list(groupQueryWrapper);
+            for (KuaiShouGroup group : list1) {
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+                            JSONObject json = new JSONObject();
+                            json.put("unitId", group.getUnitId());
+                            json.put("cpaBid", 18 * 1000);
+                            //     json.put("gender", "2");
+                            batchService.updateUnit(json, oauthToken);
+                            Thread.sleep(1500);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+
+
+            }
+
+
+        }
+
+
+    }
+
+    @Autowired
+    private IKuaiShouUpdateService kuaiShouUpdateService;
+
+    @GetMapping(value = "/updateCreative")
+    public void updateCreative() {
+        List<Long> list = new ArrayList();
+        list.add(10173366L);
+        list.add(10173375L);
+        list.add(10298910L);
+        list.add(10299210L);
+        list.add(10299221L);
+        list.add(10299241L);
+
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
+            QueryWrapper<KuaiShouCreative> creativeQueryWrapper = new QueryWrapper<>();
+            creativeQueryWrapper.eq("account_id", accountId);
+            creativeQueryWrapper.eq("status", 52);
+            creativeQueryWrapper.lt("creative_create_time", "2021-07-11 00:00:00");
+            List<KuaiShouCreative> creativeList = creativeService.list(creativeQueryWrapper);
+            if (Check.isNull(creativeList)) {
+                continue;
+            }
+            for (KuaiShouCreative creative : creativeList) {
+                QueryWrapper<KuaiShouGroup> groupQueryWrapper = new QueryWrapper<>();
+                groupQueryWrapper.eq("unit_id", creative.getUnitId());
+                groupQueryWrapper.last("limit 1");
+                KuaiShouGroup one = groupService.getOne(groupQueryWrapper);
+                if (Check.isNull(one)) {
+                    continue;
+                }
+                executorService.submit(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+                            JSONObject json = new JSONObject();
+                            json.put("creativeId", creative.getCreativeId());
+                            String url = "https://uri6.com/tkio/Yj6773a?imei=__IMEI2__&androidid=__ANDROIDID2__&oaid=__OAID__&mac=__MAC__&ip=__IP__&ry_adcreative_id=__CID__&ry_adplan_id=__DID__&ry_adplan_name=__DNAME__&ry_adgroup_id=__AID__&callback=__CALLBACK__&csite=__CSITE__&accountid=__ACCOUNTID__&ua=__UA__&os=__OS__&noredirect=true";
+
+                            if (creative.getCreativeMaterialType() == 1) {
+                                json.put("clickTrackUrl", url);
+                            } else if (creative.getCreativeMaterialType() == 4) {
+                                json.put("impressionUrl", url);
+                                json.put("clickTrackUrl", url);
+
+                            }
+                            JSONObject jsonObject = batchService.updateCreative(json, oauthToken);
+                            log.info("修改创意返回信息accountId:{},creative:{},结果:{}", creative.getAccountId(), creative.getCreativeId(), jsonObject);
+                            Thread.sleep(1000L);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
+            }
+
+
+        }
+    }
+
+
     @GetMapping("/testSend")
     public void testSend(String userId) {
 
@@ -1262,29 +1587,29 @@ public class TestController {
     }
 
     @GetMapping("checkCostData")
-    public void checkCostData(String date){
-            //1:初始化
-            checkReportTaskInfoService.initTask(date);
-            //2: checkCost
-            List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,date,0);
-            if(null!=taskInfos&&!taskInfos.isEmpty()){
-                for (BytedanceCheckReportTaskInfo task:taskInfos) {
-                    checkReportTaskInfoService.checkCost(task);
-                }
-                log.info("{}:数据获取完成",date);
+    public void checkCostData(String date) {
+        //1:初始化
+        checkReportTaskInfoService.initTask(date);
+        //2: checkCost
+        List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, date, 0);
+        if (null != taskInfos && !taskInfos.isEmpty()) {
+            for (BytedanceCheckReportTaskInfo task : taskInfos) {
+                checkReportTaskInfoService.checkCost(task);
             }
+            log.info("{}:数据获取完成", date);
+        }
     }
 
     @GetMapping("refreshReportData")
-    public void refreshReportData()throws Exception{
+    public void refreshReportData() throws Exception {
         //1:查询异常任务数据
-        List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,null,50001);
-        if(null!=taskInfos&&!taskInfos.isEmpty()){
+        List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, null, 50001);
+        if (null != taskInfos && !taskInfos.isEmpty()) {
             taskInfos.forEach(taskInfo -> {
                 try {
                     checkReportTaskInfoService.reloadData(taskInfo);
                     checkReportTaskInfoService.checkCost(taskInfo);
-                }catch (Exception e) {
+                } catch (Exception e) {
                 }
             });
             log.info("数据更新完成");

+ 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);
-                }
-            }
-        }
-    }
-}

+ 44 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/MaterialReportOverViewMapper.java

@@ -3,9 +3,11 @@ package org.jeecg.modules.ctop.mapper;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.orderplatform.util.JsonArrayUtil;
 
 import java.math.BigDecimal;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 public interface MaterialReportOverViewMapper {
@@ -30,6 +32,38 @@ public interface MaterialReportOverViewMapper {
     //查询素材总数
     Long queryMaterialCount(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
 
+
+
+
+    //查询素材 上新 数据 头条
+    List<Map<String,String>> queryMaterialCountList(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
+    //上新 快手
+    List<Map<String,String>> queryMaterialCountListKs(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
+
+    //查询有消耗的素材 - 头条
+    Long queryMaterialCostList(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
+    //查询有消耗的素材 - 快手
+    Long queryMaterialCostListKs(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
+
+
+    //查询有效视频-头条
+    List<Map<String,String>> selectEffectiveMaterialVideoBytedance(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
+    //有效视频-快手
+    List<Map<String,String>> selectEffectiveMaterialVideoKs(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
+
+    //查询爆款视频-头条
+    List<Map<String,String>> selectHotMaterialVideoBytedance(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
+    //爆款视频 -快手
+    List<Map<String,String>> selectHotMaterialVideoKs(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
+
+
+
+
+
+
+
+
+
     //查询今日上新素材数
     Long queryNewMaterialCount(@Param("statDate") String statDate, @Param("projects") JSONArray projects);
 
@@ -46,6 +80,9 @@ public interface MaterialReportOverViewMapper {
     //头条素材排行榜
     List<JSONObject> queryBytedanceTopMaterial(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
 
+    //头条素材排行榜New
+    List<JSONObject> queryBytedanceTopMaterialNew(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects, @Param("channelType")Integer channelType);
+
     //查看更多
     List<JSONObject> queryBytedanceMaterialReport(@Param("filed") String filed, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects,
                                                   @Param("md5") String md5, @Param("target") String target, @Param("order") String order);
@@ -54,7 +91,8 @@ public interface MaterialReportOverViewMapper {
                                            @Param("md5") String md5);
 
     //快手素材排行榜
-    List<JSONObject> queryKuaishouTopMaterial(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects);
+    List<JSONObject> queryKuaishouTopMaterial(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects, @Param("channelType")Integer channelType);
+
 
     //查看更多
     List<JSONObject> queryKuaishouMaterialReport(@Param("filed") String filed, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray projects,
@@ -64,9 +102,12 @@ public interface MaterialReportOverViewMapper {
                                           @Param("channelType") String channelType, @Param("md5") String md5);
 
     //设计排行榜
-    List<JSONObject> queryTopDesign(String startDate, String endDate, Set<String> userIds, String target, String order);
-
+    List<JSONObject> queryTopDesign(String startDate, String endDate, Set<String> userIds, String target, String order, String roleName);
     Long queryTopDesignCount(String startDate, String endDate, Set<String> userIds);
+    //设计排行榜新版本
+    List<JSONObject> queryKuaishouTopDesign(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray  projects, @Param("type")  String type);
+    List<JSONObject> queryBytedanceTopDesign(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projects") JSONArray  projects, @Param("type")  String type);
+
 
     //素材详情页
 

+ 321 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialReportOverViewMapper.xml

@@ -126,6 +126,196 @@
         AND DATE_FORMAT(create_time, '%Y-%m-%d')&lt;= #{endDate}
     </select>
 
+    <!-- 查询素材 上新 数据  头条-->
+    <select id="queryMaterialCountList" resultType="java.util.HashMap">
+        SELECT
+        count(distinct code) as count ,
+        DATE_FORMAT(cmi.create_time, '%Y-%m-%d') as time
+        from ctop_material_info cmi
+        left join ctop_project cp on cp.id = cmi.project_id
+        WHERE 1=1
+        <if test="projects !=null">
+            AND project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        and cp.media_id in (1,3)
+        and cmi.create_time &gt;= #{startDate}
+        and cmi.create_time &lt;= #{endDate}
+        GROUP BY time
+        ORDER BY time
+
+    </select>
+<!-- 查询素材 上新 数据  快手-->
+    <select id="queryMaterialCountListKs" resultType="java.util.HashMap">
+        SELECT
+        count(distinct code) as count ,
+        DATE_FORMAT(cmi.create_time, '%Y-%m-%d') as time
+        from ctop_material_info cmi
+        left join ctop_project cp on cp.id = cmi.project_id
+        WHERE 1=1
+        <if test="projects !=null">
+            AND project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        and cp.media_id in (2,4)
+        and cmi.create_time &gt;= #{startDate}
+        and cmi.create_time &lt;= #{endDate}
+        GROUP BY time
+        ORDER BY time
+    </select>
+
+ <!-- 查询有消耗的素材 头条 -->
+    <select id="queryMaterialCostList" resultType="long">
+        SELECT
+        COUNT( distinct m.id) as count
+        FROM
+        ctop_material_info m
+        LEFT join ctop_project cp on cp.id = m.project_id
+        LEFT JOIN ctop_bytedance_video_info v ON m.CODE = v.signature
+        LEFT JOIN ctop_bytedance_report_material_daily r ON v.account_id = r.account_id AND v.material_id = r.material_id
+        WHERE
+        1 = 1
+        AND r.cost > 0
+        AND cp.media_id in (1,3)
+        <if test="projects !=null">
+            AND m.project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        and m.create_time &gt;= #{startDate}
+        and m.create_time &lt;= #{endDate}
+
+    </select>
+
+ <!-- 查询有消耗的素材 快手 -->
+    <select id="queryMaterialCostListKs" resultType="long">
+
+        SELECT
+        COUNT( distinct m.id ) as count
+        FROM
+        ctop_material_info m
+        LEFT join ctop_project cp on cp.id = m.project_id
+        LEFT JOIN ctop_kuaishou_report_daily_material r ON r.signature = m.code
+        WHERE
+        1 = 1
+        AND r.charge > 0
+        AND cp.media_id in (2,4)
+        <if test="projects !=null">
+            AND m.project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        and m.create_time &gt;= #{startDate}
+        and m.create_time &lt;= #{endDate}
+    </select>
+
+    <!-- 有效视频-头条 -->
+    <select id="selectEffectiveMaterialVideoBytedance" resultType="java.util.HashMap">
+        select
+               COUNT(m.id) count,
+               b.effect_date as time
+        from
+        ctop_bytedance_video_etl_info b
+        LEFT JOIN ctop_material_info m on m.code = b.video_code
+        where b.effect_date is not null
+        and b.effect_day_num &lt;= 7
+        <if test="projects !=null">
+            AND m.project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        and b.effect_date &gt;= #{startDate}
+        and b.effect_date &lt;= #{endDate}
+        GROUP BY time
+        ORDER BY time
+    </select>
+
+
+    <!-- 有效视频-快手 -->
+    <select id="selectEffectiveMaterialVideoKs" resultType="java.util.HashMap">
+        select
+               COUNT(m.id) count,
+             b.effect_date as time
+        from
+        ctop_kuaishou_video_etl_info b
+        LEFT JOIN ctop_material_info m on m.code = b.video_code
+        where b.effect_date is not null
+        and b.effect_day_num &lt;= 7
+        <if test="projects !=null">
+            AND m.project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        and b.effect_date &gt;= #{startDate}
+        and b.effect_date &lt;= #{endDate}
+        GROUP BY time
+        ORDER BY time
+    </select>
+
+
+    <!-- 爆款视频-头条 -->
+    <select id="selectHotMaterialVideoBytedance" resultType="java.util.HashMap">
+        select
+               COUNT(m.id) count,
+        b.faddish_date as time
+        from
+        ctop_bytedance_video_etl_info b
+        LEFT JOIN ctop_material_info m on m.code = b.video_code
+        where b.faddish_date is not null
+        and b.faddish_day_num &lt;= 14
+        <if test="projects !=null">
+            AND m.project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        and b.faddish_date &gt;= #{startDate}
+        and b.faddish_date &lt;= #{endDate}
+        GROUP BY time
+        ORDER BY time
+    </select>
+
+
+    <!-- 爆款视频-快手 -->
+    <select id="selectHotMaterialVideoKs" resultType="java.util.HashMap">
+        select
+            COUNT(m.id) count,
+            b.faddish_date as time
+        from
+        ctop_kuaishou_video_etl_info b
+        LEFT JOIN ctop_material_info m on m.code = b.video_code
+        where b.faddish_date is not null
+        and b.faddish_day_num &lt;= 14
+        <if test="projects !=null">
+            AND m.project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        and b.faddish_date &gt;= #{startDate}
+        and b.faddish_date &lt;= #{endDate}
+        GROUP BY time
+        ORDER BY time
+    </select>
+
+
+
     <select id="queryNewMaterialCount" resultType="long">
         SELECT
         count(id) from ctop_material_info
@@ -231,7 +421,7 @@
         tag
         FROM
         (SELECT md5 signature,
-        IFNULL(toutiao_url, '') AS url,
+        case when toutiao_url = '' or toutiao_url is null then url end url,
         cover_url AS coverUrl,
         material_name AS materialName,
         sum(cost) AS cost from etl_report_bytedance_video
@@ -252,6 +442,93 @@
         ORDER BY cost DESC
     </select>
 
+    <select id="queryKuaishouTopDesign" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        t1.charge as cost
+        <if test="type == 1"> ,t1.shot_name as userName, "摄像" as roleName </if>
+        <if test="type == 2"> ,t1.clip_name as userName, "剪辑" as roleName </if>
+        <if test="type == 3"> ,t1.plan_name as userName, "编导" as roleName </if>
+        FROM
+        (select sum(charge) as charge,t2.*
+        from ctop_etl_kuaishou_account_material_report_daily t1 LEFT JOIN ctop_etl_kuaishou_video_info t2 ON t1.signature = t2.video_code
+        where
+        1=1
+        AND t1.stat_date &gt;= #{startDate}
+        AND t1.stat_date &lt;= #{endDate}
+        <if test="projects !=null">
+            AND project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="type == 1"> AND t2.shot_id is not null and t2.shot_id != '' GROUP BY t2.shot_id</if>
+        <if test="type == 2"> AND t2.clip_id is not null and t2.clip_id != '' GROUP BY t2.clip_id</if>
+        <if test="type == 3"> AND t2.plan_id is not null and t2.plan_id != '' GROUP BY t2.plan_id</if>
+        ORDER BY charge desc  LIMIT 10
+        ) t1
+
+
+
+    </select>
+
+    <select id="queryBytedanceTopDesign" resultType="com.alibaba.fastjson.JSONObject">
+
+        SELECT
+        t1.cost
+        <if test="type == 1"> ,t1.shot_name as userName, "摄像" as roleName </if>
+        <if test="type == 2"> ,t1.clip_name as userName, "剪辑" as roleName </if>
+        <if test="type == 3"> ,t1.plan_name as userName, "编导" as roleName </if>
+        FROM
+        (select sum(cost) as cost,clip_name,plan_name,shot_name
+        from etl_report_bytedance_video t1
+        where
+        1=1
+        AND t1.stat_datetime &gt;= #{startDate}
+        AND t1.stat_datetime &lt;=  #{endDate}
+        <if test="projects !=null">
+            AND project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="type == 1"> AND t1.shot_id is not null and t1.shot_id != '' GROUP BY t1.shot_id</if>
+        <if test="type == 2"> AND t1.clip_id is not null and t1.clip_id != '' GROUP BY t1.clip_id</if>
+        <if test="type == 3"> AND t1.plan_id is not null and t1.plan_id != '' GROUP BY t1.plan_id</if>
+        ORDER BY cost desc  LIMIT 10
+        ) t1
+
+    </select>
+
+    <select id="queryBytedanceTopMaterialNew" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        t1.*,
+        IFNULL((SELECT GROUP_CONCAT(tag_name) from ctop_material_tag_info where code=signature and status=1),"塑造") as  tag
+        FROM
+        (SELECT md5 signature,
+        case when toutiao_url = '' or toutiao_url is null then url end url,
+        cover_url AS coverUrl,
+        material_name AS materialName,
+        sum(cost) AS cost from etl_report_bytedance_video
+        where 1=1
+        <if test="projects !=null">
+            AND project_id IN
+            <foreach collection="projects" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        AND stat_datetime &gt;= #{startDate}
+        AND stat_datetime &lt;= #{endDate}
+        AND md5!=''
+        GROUP BY md5
+        ORDER BY cost DESC
+        LIMIT 5) t1
+        ORDER BY cost DESC
+    </select>
+
+
     <select id="queryBytedanceMaterialReport" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         t1.md5 signature,
@@ -304,14 +581,16 @@
         GROUP BY t1.md5) t
     </select>
 
+
+
     <select id="queryKuaishouTopMaterial" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         t1.*,
         t2.video_name as materialName,
         t2.cover_url as coverUrl,
         t2.url as url ,
-        IFNULL((SELECT GROUP_CONCAT(tag_name) from ctop_material_tag_info where code=t1.signature and status=1),"塑造") as
-        tag
+        t2.channel_type,
+        (SELECT GROUP_CONCAT(tag_name) from ctop_material_tag_info where code=t1.signature and status=1)as tag
         FROM
         (select sum(charge) as charge,signature
         from ctop_etl_kuaishou_account_material_report_daily t1
@@ -324,15 +603,48 @@
                 #{item}
             </foreach>
         </if>
+
         AND t1.stat_date &gt;= #{startDate}
         AND t1.stat_date &lt;= #{endDate}
         GROUP BY t1.signature
         ORDER BY charge desc
-        limit 5
         ) t1
         LEFT JOIN ctop_etl_kuaishou_video_info t2
         ON t1.signature = t2.video_code
-        ORDER BY charge desc
+        where 1=1
+        <if test="channelType !=null">
+            AND t2.channel_type = #{channelType}
+        </if>
+        ORDER BY charge desc LIMIT 5
+
+<!--        SELECT-->
+<!--        t1.*,-->
+<!--        t2.video_name as materialName,-->
+<!--        t2.cover_url as coverUrl,-->
+<!--        t2.url as url ,-->
+<!--        IFNULL((SELECT GROUP_CONCAT(tag_name) from ctop_material_tag_info where code=t1.signature and status=1),"塑造") as-->
+<!--        tag-->
+<!--        FROM-->
+<!--        (select sum(charge) as charge,signature-->
+<!--        from ctop_etl_kuaishou_account_material_report_daily t1-->
+<!--        where-->
+<!--        1=1-->
+<!--        <if test="projects !=null">-->
+<!--            AND project_id IN-->
+<!--            <foreach collection="projects" item="item" separator=","-->
+<!--                     open="(" close=")">-->
+<!--                #{item}-->
+<!--            </foreach>-->
+<!--        </if>-->
+<!--        AND t1.stat_date &gt;= #{startDate}-->
+<!--        AND t1.stat_date &lt;= #{endDate}-->
+<!--        GROUP BY t1.signature-->
+<!--        ORDER BY charge desc-->
+<!--        limit 5-->
+<!--        ) t1-->
+<!--        LEFT JOIN ctop_etl_kuaishou_video_info t2-->
+<!--        ON t1.signature = t2.video_code-->
+<!--        ORDER BY charge desc-->
     </select>
 
     <select id="queryKuaishouMaterialReport" resultType="com.alibaba.fastjson.JSONObject">
@@ -430,6 +742,10 @@
         user_id
         ORDER BY
         ${target} ${order}) t) t1
+        where 1=1
+        <if test="roleName != null">
+            and t1.roleName = #{roleName}
+        </if>
     </select>
 
     <select id="queryTopDesignCount" resultType="java.lang.Long">

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MediaReportMapper.xml

@@ -111,7 +111,7 @@
 
                  SELECT r.*, (r.todayCost - r.yesterdayCost) as diffCost, (r.todayCost + r.yesterdayCost) as sumCost
                  from (
-                          SELECT '- '                                                            as mediaType,
+                          SELECT '-'                                                            as mediaType,
                                  '-'                                                             as companyId,
                                  id                                                              as advertiserId,
                                  corporation_name                                                as advertiserName,

+ 12 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IMaterialReportOverViewService.java

@@ -22,6 +22,10 @@ public interface IMaterialReportOverViewService {
 
     //查询总消耗、视频总数、爆款视频数、有效是视频数
     Map<String,Object> getTotalModule(int mediaId, String startDate, String endDate, JSONArray projects);
+    //查询 视频上新 和 有效
+    Map<String,Object> sumDataVideoNewEffective(int mediaId, String startDate, String endDate, JSONArray projects);
+    //查询 爆款
+    Map<String,Object> sumDataVideoHot(int mediaId, String startDate, String endDate, JSONArray projects);
 
     //查询消耗趋势图
     List<JSONObject> getTotalChat(int mediaId, String startDate, String endDate, JSONArray projects);
@@ -30,7 +34,7 @@ public interface IMaterialReportOverViewService {
     JSONObject getTagProportion(int mediaId, String startDate, String endDate, int tagId);
 
     //查询Top素材排行榜
-    List<JSONObject> getTopMaterialList(int mediaId, String startDate, String endDate, JSONArray projects);
+    List<JSONObject> getTopMaterialList(int mediaId, String startDate, String endDate, JSONArray projects, Integer channelType);
 
     //素材查看更多
     PageInfo<JSONObject> getTopMaterialList(int mediaId, String startDate, String endDate, JSONArray projects, String channelType, String md5, String target, String order, int pageNo, int pageSize);
@@ -40,8 +44,14 @@ public interface IMaterialReportOverViewService {
 
     void exportKuaishouExcel(JSONObject requestBody, HttpServletRequest request, HttpServletResponse response);
 
+//    params.getInteger("mediaId"),
+//            params.getString("startDate"),
+//            params.getString("endDate"),
+//            params.getJSONArray("projects"),
+//            params.getString("roleName"));
+
     //查询设计人员排行榜
-    PageInfo<JSONObject> getTopDesignList(String startDate, String endDate, String userId, String target, String order, int pageSize, int pageNo);
+    List<JSONObject> getTopDesignList(Integer mediaId, String startDate, String endDate, JSONArray projects, String roleName);
 
     // 视频详情页
     JSONObject getMaterialDetailInfo(int mediaId, String md5);

+ 104 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/TestService.java

@@ -0,0 +1,104 @@
+package org.jeecg.modules.ctop.service;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class TestService {
+
+
+    public static void main(String[] args) {
+        List<JSONObject> list1 = new ArrayList<>();
+        JSONObject sex = new JSONObject();
+        sex.put("SEX", "男");
+        list1.add(sex);
+        JSONObject sex2 = new JSONObject();
+        sex2.put("SEX", "女");
+        list1.add(sex2);
+
+
+        List<JSONObject> list2 = new ArrayList<>();
+
+        JSONObject age = new JSONObject();
+        age.put("age", "青年");
+        list2.add(age);
+        JSONObject age2 = new JSONObject();
+        age2.put("age", "中年");
+        list2.add(age2);
+
+
+        List<JSONObject> list3 = new ArrayList<>();
+
+        JSONObject area = new JSONObject();
+        JSONArray arr1 = new JSONArray();
+        arr1.add("北京");
+        arr1.add("天津");
+        area.put("area", arr1);
+        list3.add(area);
+
+
+        JSONObject area2 = new JSONObject();
+        JSONArray arr2 = new JSONArray();
+        arr2.add("上海");
+        arr2.add("深圳");
+        area2.put("area", arr2);
+        list3.add(area2);
+
+
+        List<List<JSONObject>> allList = new ArrayList<>();
+        allList.add(list1);
+        allList.add(list2);
+        allList.add(list3);
+
+        calculateCombination(allList);
+    }
+
+
+    public static void calculateCombination(List<List<JSONObject>> inputList) {
+        JSONArray array = new JSONArray();
+        List<Integer> combination = new ArrayList<Integer>();
+        int n = inputList.size();
+        for (int i = 0; i < n; i++) {
+            combination.add(0);
+        }
+        int i = 0;
+        boolean isContinue = false;
+        do {
+            JSONObject dataJson = new JSONObject();
+            //打印一次循环生成的组合
+            for (int j = 0; j < n; j++) {
+                JSONObject jsonObject = inputList.get(j).get(combination.get(j));
+                jsonObject.forEach((key, value) -> {
+                    dataJson.put(key, value);
+                });
+
+            }
+            array.add(dataJson);
+
+            i++;
+            combination.set(n - 1, i);
+            for (int j = n - 1; j >= 0; j--) {
+                if (combination.get(j) >= inputList.get(j).size()) {
+                    combination.set(j, 0);
+                    i = 0;
+                    if (j - 1 >= 0) {
+                        combination.set(j - 1, combination.get(j - 1) + 1);
+                    }
+                }
+            }
+            isContinue = false;
+            for (Integer integer : combination) {
+                if (integer != 0) {
+                    isContinue = true;
+                }
+            }
+        } while (isContinue);
+        System.err.println(array);
+    }
+
+
+}

+ 172 - 27
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/MaterialReportOverViewServiceImpl.java

@@ -21,6 +21,7 @@ import org.jeecg.modules.system.service.ISysRoleService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -29,12 +30,13 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.ParseException;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Slf4j
 @Service
 public class MaterialReportOverViewServiceImpl implements IMaterialReportOverViewService {
 
-    @Autowired
+    @Resource
     private MaterialReportOverViewMapper materialReportOverViewMapper;
 
     @Autowired
@@ -88,27 +90,149 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
             projects = getProjectsByCurrentUser(mediaId);
         }
         if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
+            //总消耗
             BigDecimal cost = materialReportOverViewMapper.queryBytedanceCost(startDate, endDate, projects);
+            //上阶段消耗
             BigDecimal lastCost = materialReportOverViewMapper.queryBytedanceCost(DateUtils.addDay(startDate, -DateUtils.dateDiff(startDate, endDate)-1), DateUtils.addDay(startDate, -1), projects);
-            result.put("cost", cost);
-            result.put("costLink", countLink(cost == null ? BigDecimal.ZERO : cost, lastCost == null ? BigDecimal.ZERO : lastCost));
-            result.put("video", materialReportOverViewMapper.queryMaterialCount(startDate, endDate, projects));
-            result.put("newVideo", materialReportOverViewMapper.queryNewMaterialCount(DateUtils.date2Str(), projects));
-            result.put("hot", 0);
-            result.put("valid", 0);
+            result.put("costTotal", cost);
+            //同比 (本阶段截止昨天消耗-上一个阶段截止和昨天对应日期的消耗)/上一个阶段截止和昨天对应日期的消耗 X 100%
+            result.put("yearOnYearCompare", countLink(cost,lastCost));
+            //昨日消耗
+            BigDecimal yesterdayCost = materialReportOverViewMapper.queryBytedanceCost(endDate, endDate, projects);
+            //前天消耗
+            BigDecimal beforeYesterdayCost = materialReportOverViewMapper.queryBytedanceCost(DateUtils.addDay(endDate, -1), DateUtils.addDay(endDate, -1), projects);
+            result.put("yesterdayCost", yesterdayCost);
+            //环比 (昨日消耗-前日消耗)/前日消耗 X 100%
+            result.put("chainCompare", countLink(yesterdayCost,beforeYesterdayCost));
+
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
+            //总消耗
             BigDecimal cost = materialReportOverViewMapper.queryKuaishouCost(startDate, endDate, projects);
+            //上阶段
             BigDecimal lastCost = materialReportOverViewMapper.queryKuaishouCost(DateUtils.addDay(startDate, -DateUtils.dateDiff(startDate, endDate)-1), DateUtils.addDay(startDate, -1), projects);
-            result.put("cost", cost);
-            result.put("costLink", countLink(cost == null ? BigDecimal.ZERO : cost, lastCost == null ? BigDecimal.ZERO : lastCost));
-            result.put("video", materialReportOverViewMapper.queryMaterialCount(startDate, endDate, projects));
-            result.put("newVideo", materialReportOverViewMapper.queryNewMaterialCount(DateUtils.date2Str(), projects));
-            result.put("hot", 0);
-            result.put("valid", 0);
+            result.put("costTotal", cost);
+            //同比 (本阶段截止昨天消耗-上一个阶段截止和昨天对应日期的消耗)/上一个阶段截止和昨天对应日期的消耗 X 100%
+            result.put("yearOnYearCompare", countLink(cost,lastCost));
+            //昨日消耗
+            BigDecimal yesterdayCost = materialReportOverViewMapper.queryKuaishouCost(endDate, endDate, projects);
+            //前天消耗
+            BigDecimal beforeYesterdayCost = materialReportOverViewMapper.queryKuaishouCost(DateUtils.addDay(endDate, -1), DateUtils.addDay(endDate, -1), projects);
+            result.put("yesterdayCost", yesterdayCost);
+            //环比 (昨日消耗-前日消耗)/前日消耗 X 100%
+            result.put("chainCompare", countLink(yesterdayCost,beforeYesterdayCost));
+        }
+        return result;
+    }
+
+
+
+    @Override
+    public Map<String, Object> sumDataVideoNewEffective(int mediaId, String startDate, String endDate, JSONArray projects) {
+        Map<String, Object> result = new HashMap<>();
+        if (projects.isEmpty()) {
+            projects = getProjectsByCurrentUser(mediaId);
+        }
+        if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
+              //视频上新
+            List<Map<String, String>> videoList = materialReportOverViewMapper.queryMaterialCountList(startDate+" 00:00:00", endDate+" 23:59:59", projects);
+            //总数
+            long videoTotal = videoList.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            result.put("videoList",videoList);
+            result.put("videoTotal",videoTotal);
+            //素材使用率 = 有消耗的素材 / 总数 * 100%
+            long videoCost = materialReportOverViewMapper.queryMaterialCostList(startDate+" 00:00:00", endDate+" 23:59:59", projects);
+            result.put("useCompare", Check.isNull(videoCost) ? 0: new BigDecimal(videoCost).divide(new BigDecimal(videoTotal),4, RoundingMode.HALF_UP));
+            //有效视频
+            List<Map<String, String>> effectiveList = materialReportOverViewMapper.selectEffectiveMaterialVideoBytedance(startDate,endDate, projects);
+            //总数
+            long effectiveTotal = effectiveList.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            result.put("effectiveList",effectiveList);
+            result.put("effectiveTotal",effectiveTotal);
+            //素材有效率 = 有效视频数量 / 视频总数 X 100%
+            result.put("effectiveCompare",Check.isNull(videoCost) ? 0: new BigDecimal(effectiveTotal).divide(new BigDecimal(videoTotal),4, RoundingMode.HALF_UP));
+
+        } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
+
+            //视频上新
+            List<Map<String, String>> videoList = materialReportOverViewMapper.queryMaterialCountListKs(startDate+" 00:00:00", endDate+" 23:59:59", projects);
+            //总数
+            long videoTotal = videoList.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            result.put("videoList",videoList);
+            result.put("videoTotal",videoTotal);
+            //素材使用率 = 有消耗的素材 / 总数 * 100%
+            long videoCost = materialReportOverViewMapper.queryMaterialCostListKs(startDate+" 00:00:00", endDate+" 23:59:59", projects);
+            result.put("useCompare", Check.isNull(videoCost) ? 0: new BigDecimal(videoCost).divide(new BigDecimal(videoTotal),4, RoundingMode.HALF_UP));
+            //有效视频
+            List<Map<String, String>> effectiveList = materialReportOverViewMapper.selectEffectiveMaterialVideoKs(startDate,endDate, projects);
+            //总数
+            long effectiveTotal = effectiveList.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            result.put("effectiveList",effectiveList);
+            result.put("effectiveTotal",effectiveTotal);
+            //素材有效率 = 有效视频数量 / 视频总数 X 100%
+            result.put("effectiveCompare",Check.isNull(videoTotal) ? 0 : new BigDecimal(effectiveTotal).divide(new BigDecimal(videoTotal),4, RoundingMode.HALF_UP));
+
         }
         return result;
     }
 
+    //爆款视频
+    @Override
+    public Map<String, Object> sumDataVideoHot(int mediaId, String startDate, String endDate, JSONArray projects) {
+        Map<String, Object> result = new HashMap<>();
+        if (projects.isEmpty()) {
+            projects = getProjectsByCurrentUser(mediaId);
+        }
+        if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
+            //爆款视频
+            List<Map<String, String>> hotList = materialReportOverViewMapper.selectHotMaterialVideoBytedance(startDate,endDate, projects);
+            //总数
+            long hotTotal = hotList.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            result.put("hotList",hotList);
+            result.put("hotTotal",hotTotal);
+            //上阶段
+            List<Map<String, String>> lastHostList = materialReportOverViewMapper.selectHotMaterialVideoBytedance(DateUtils.addDay(startDate, -DateUtils.dateDiff(startDate, endDate)-1), DateUtils.addDay(startDate, -1), projects);
+            long lastHotTotal = lastHostList.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            //同比 (本阶段截止昨天的爆款视频数量-上一个阶段截止和昨天对应日期的爆款视频数量)/上一个阶段截止和昨天对应日期的爆款视频数量X 100%
+            result.put("hotYearOnYearCompare", countLink(new BigDecimal(hotTotal),new BigDecimal(lastHotTotal)));
+            //昨日消耗
+            List<Map<String, String>> yesterdayHost = materialReportOverViewMapper.selectHotMaterialVideoBytedance(endDate,endDate, projects);
+            //前天消耗
+            List<Map<String, String>> beforeYesterdayHost = materialReportOverViewMapper.selectHotMaterialVideoBytedance(DateUtils.addDay(endDate, -1), DateUtils.addDay(endDate, -1), projects);
+            long yesterday = yesterdayHost.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            long before = beforeYesterdayHost.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            //环比 (昨日-前日)/前日消耗 X 100%
+            result.put("hostCompare", countLink(new BigDecimal(yesterday),new BigDecimal(before)));
+
+        } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
+            //爆款视频
+            List<Map<String, String>> hotList = materialReportOverViewMapper.selectHotMaterialVideoKs(startDate,endDate, projects);
+            //总数
+            long hotTotal = hotList.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            result.put("hotList",hotList);
+            result.put("hotTotal",hotTotal);
+            //上阶段
+            List<Map<String, String>> lastHostList = materialReportOverViewMapper.selectHotMaterialVideoKs(DateUtils.addDay(startDate, -DateUtils.dateDiff(startDate, endDate)-1), DateUtils.addDay(startDate, -1), projects);
+            long lastHotTotal = lastHostList.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            //同比 (本阶段截止昨天的爆款视频数量-上一个阶段截止和昨天对应日期的爆款视频数量)/上一个阶段截止和昨天对应日期的爆款视频数量X 100%
+            result.put("hotYearOnYearCompare", countLink(new BigDecimal(hotTotal),new BigDecimal(lastHotTotal)));
+            //昨日消耗
+            List<Map<String, String>> yesterdayHost = materialReportOverViewMapper.selectHotMaterialVideoKs(endDate,endDate, projects);
+            //前天消耗
+            List<Map<String, String>> beforeYesterdayHost = materialReportOverViewMapper.selectHotMaterialVideoKs(DateUtils.addDay(endDate, -1), DateUtils.addDay(endDate, -1), projects);
+            long yesterday = yesterdayHost.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            long before = beforeYesterdayHost.stream().collect(Collectors.summarizingInt(s->Integer.valueOf(String.valueOf(s.get("count"))))).getSum();
+            //环比 (昨日-前日)/前日消耗 X 100%
+            result.put("hostCompare", countLink(new BigDecimal(yesterday),new BigDecimal(before)));
+        }
+        return result;
+    }
+
+
+
+
+
+
+
     @Override
     public List<JSONObject> getTotalChat(int mediaId, String startDate, String endDate, JSONArray projects) {
         List<JSONObject> result = new ArrayList<>();
@@ -141,7 +265,7 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
     }
 
     @Override
-    public List<JSONObject> getTopMaterialList(int mediaId, String startDate, String endDate, JSONArray projects) {
+    public List<JSONObject> getTopMaterialList(int mediaId, String startDate, String endDate, JSONArray projects, Integer channelType) {
         List<JSONObject> result = new ArrayList<>();
         if (projects.isEmpty()) {
             projects = getProjectsByCurrentUser(mediaId);
@@ -150,7 +274,7 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
             result = materialReportOverViewMapper.queryBytedanceTopMaterial(startDate, endDate, projects);
 
         } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
-            result = materialReportOverViewMapper.queryKuaishouTopMaterial(startDate, endDate, projects);
+            result = materialReportOverViewMapper.queryKuaishouTopMaterial(startDate, endDate, projects, channelType);
         }
         return result;
     }
@@ -284,17 +408,17 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
     }
 
     @Override
-    public PageInfo<JSONObject> getTopDesignList(String startDate, String endDate, String userId, String target, String order, int pageSize, int pageNo) {
-        PageInfo<JSONObject> result = new PageInfo<>();
-        Set<String> subordinate = this.recursiveQuerySubordinate(userId);
-        if (subordinate.size()==1) {
-            subordinate = materialReportOverViewMapper.recursiveQuerySubordinateByUserId(userId);
-        }
-        PageHelper.startPage(pageNo, pageSize, false);
-        List<JSONObject> topDesign = materialReportOverViewMapper.queryTopDesign(startDate, endDate, subordinate, target, order);
-        Long count = materialReportOverViewMapper.queryTopDesignCount(startDate, endDate, subordinate);
-        result.setList(topDesign);
-        result.setTotal(count);
+    public List<JSONObject> getTopDesignList(Integer mediaId, String startDate, String endDate, JSONArray projects, String type) {
+        List<JSONObject> result = new ArrayList<>();
+        if (projects.isEmpty()) {
+            projects = getProjectsByCurrentUser(mediaId);
+        }
+        if (mediaId == CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT) {
+            result = materialReportOverViewMapper.queryBytedanceTopDesign(startDate, endDate, projects, type);
+
+        } else if (mediaId == CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT) {
+            result = materialReportOverViewMapper.queryKuaishouTopDesign(startDate, endDate, projects, type);
+        }
         return result;
     }
 
@@ -361,6 +485,7 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
     //当项目为空的时候,根据当前登录人查询可查看的所有项目集合
     private JSONArray getProjectsByCurrentUser(int mediaId) {
         String currentUser = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
+        //String currentUser = "e9ca23d68d884d4ebb19d07889727dae";
         //TODO 为了解决管理员等角色初始化查全部项目查询效率慢的问题判断角色,待优化
         String roleCode = roleService.getRoleCodeByUserId(currentUser);
         if (roleCode.equals("admin")) {
@@ -386,11 +511,31 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
 
     //环比计算
     private  BigDecimal countLink(BigDecimal numA, BigDecimal numB) {
-        BigDecimal link = new BigDecimal(0);
+        BigDecimal link = new BigDecimal("0");
+        if (Check.isNull(numA) || Check.isNull(numB)){
+            return link;
+        }
         if (numB.compareTo(BigDecimal.ZERO)!=0) {
             link = (numA.subtract(numB)).divide(numB, 4, RoundingMode.HALF_UP);
         }
         return link;
     }
 
+
+    /**
+     * 同比 (当前 - 上阶段 ) / 上阶段
+     * @param current 当前阶段数值
+     * @param last 上阶段数值
+     * @return
+     */
+    private BigDecimal yearOnYearCompare(BigDecimal current,BigDecimal last){
+        BigDecimal yearOnYear = new BigDecimal("0");
+        if (last.compareTo(BigDecimal.ZERO)!=0) {
+            // (当前 - 上阶段 ) / 上阶段
+            yearOnYear = (current.subtract(last)).divide(last,20,BigDecimal.ROUND_HALF_UP);
+        }
+        return yearOnYear;
+    }
+
+
 }

+ 1 - 2
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -1,6 +1,5 @@
 server:
-  port: 8088
-  ip: 39.97.120.42
+  port: 8806
   servlet:
     context-path: /jeecg-boot
     compression:

+ 180 - 17
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -4,9 +4,13 @@ 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.entity.EtlKuaishouAccountMaterialReportDaily;
 import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
@@ -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;
@@ -26,9 +32,8 @@ import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
 import java.text.ParseException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
+import java.text.SimpleDateFormat;
+import java.util.*;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -76,19 +81,20 @@ public class SampleTest {
     private IBytedanceReportService bytedanceReportService;
     @Autowired
     private IETLReportBytedanceVideoService etlReportBytedanceVideoService;
+    @Autowired
+    private IKuaishouInterfaceService iKuaishouInterfaceService;
+
 
     @Test
     public void loadKuaishouCookie() throws ParseException {
-        CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1700996735138951L);
-        advertiserDataService.getMaterialList(tokenByAccountId);
-
-        CtopOauthToken tokenByAccountId1 = tokenService.getTokenByAccountId(1700996735589383L);
-        advertiserDataService.getMaterialList(tokenByAccountId1);
+        CtopOauthToken token = tokenService.getTokenByAccountId(10291211L);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse = simpleDateFormat.parse("2021-07-11");
+        Date pars1 = simpleDateFormat.parse("2021-07-12");
+        iKuaishouInterfaceService.getGroupList(token, parse, pars1);
     }
 
 
-
-
     @Test
     public void deleteKuaishouComment() {
         Long start = System.currentTimeMillis();
@@ -123,7 +129,6 @@ public class SampleTest {
     }
 
 
-
     @Test
     public void etlBytedanceVideoInfo() {
         String startDate = "2021-02-01";
@@ -147,7 +152,6 @@ public class SampleTest {
     }
 
 
-
     @Test
     public void formatVideoReportData() {
         for (int i = 1; i < 45; i++) {
@@ -237,11 +241,170 @@ public class SampleTest {
     }
 
     @Test
-    public void loadEffecfData(){
+    public void loadEffecfData() {
         String startDate = "2021-05-01";
-        for(int i=0;i<=70;i++){
-            String getDate = DateUtils.addDay(startDate,i);
-            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(DateUtils.parseDate(getDate,"yyyy-MM-dd"));
+        for (int i = 0; i <= 70; i++) {
+            String getDate = DateUtils.addDay(startDate, i);
+            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(DateUtils.parseDate(getDate, "yyyy-MM-dd"));
+        }
+    }
+    @Resource
+    private KuaishouOperationRecordMapper kuaishouOperationRecordMapper;
+
+
+    @Test
+    public void dealOperationRecordData() throws InterruptedException {
+        Date beginDate = DateUtils.parseDate("2021-06-01", "yyyy-MM-dd");
+        Date endDate = DateUtils.parseDate("2021-07-19", "yyyy-MM-dd");
+//        Date beginDate = DateUtils.parseDate("2020-04-21", "yyyy-MM-dd");
+//        Date endDate = DateUtils.parseDate("2021-07-17", "yyyy-MM-dd");
+
+        int recordsCount = 0;
+        int newRecordCount = 0;
+
+        while (beginDate.before(endDate)){
+            System.out.println("开始拆分数据,当前时间为:" + beginDate);
+//            List<KuaishouOperationRecord> records = kuaishouOperationRecordMapper.selectCreativeRecordByStatDate(DateUtils.formatDate(beginDate, "yyyy-MM-dd"));    //开始拆分数据,当前时间为:Tue Apr 28 00:00:00 CST 2020
+//            List<KuaishouOperationRecord> records = kuaishouOperationRecordMapper.selectAccountRecordByStatDate(DateUtils.formatDate(beginDate, "yyyy-MM-dd"));
+//            List<KuaishouOperationRecord> records = kuaishouOperationRecordMapper.selectAppRecordByStatDate(DateUtils.formatDate(beginDate, "yyyy-MM-dd"));
+//            List<KuaishouOperationRecord> records = kuaishouOperationRecordMapper.selectCampaignRecordByStatDate(DateUtils.formatDate(beginDate, "yyyy-MM-dd"));  //已执行完毕
+//            List<KuaishouOperationRecord> records = kuaishouOperationRecordMapper.selectPackageRecordByStatDate(DateUtils.formatDate(beginDate, "yyyy-MM-dd"));
+            List<KuaishouOperationRecord> records = kuaishouOperationRecordMapper.selectUnitRecordByStatDate(DateUtils.formatDate(beginDate, "yyyy-MM-dd"));    //已执行完毕
+//            List<KuaishouOperationRecord> records = kuaishouOperationRecordMapper.selectVideoRecordByStatDate(DateUtils.formatDate(beginDate, "yyyy-MM-dd"));
+            if(Check.isNull(records)){
+                System.out.print("     -> 今日的数据为空!!!");
+                beginDate = DateUtils.addDay(beginDate, 1);
+                continue;
+            }
+            recordsCount += records.size();
+            countDownLatch = new CountDownLatch(records.size());
+
+            List<KuaishouOperationRecord> newRecords = new ArrayList<>();
+
+            records.forEach(record -> executorService.submit(() -> {
+                try{
+                    String log = record.getLog();
+                    JSONArray jsonArray = JSONArray.parseArray(log);
+                    for(int i=0;i<jsonArray.size();i++){
+                        JSONObject object = jsonArray.getJSONObject(i);
+                        String originalData = object.getString("original_data");
+                        String updateData = object.getString("update_data");
+                        String fieldName = object.getString("field_name");
+                        KuaishouOperationRecord newRecord = new KuaishouOperationRecord(record);
+                        newRecord.setOriginalData(originalData);
+                        newRecord.setUpdateData(updateData);
+                        newRecord.setFieldName(fieldName);
+
+                        if("".equals(newRecord.getOriginalData()) && "".equals(newRecord.getUpdateData())){
+                            continue;
+                        }
+                        newRecords.add(newRecord);
+                    }
+                }catch (Exception e){
+                }finally {
+                    countDownLatch.countDown();
+            }}));
+            countDownLatch.await();
+            newRecordCount += newRecords.size();
+            this.saveOperationRecordListToDb(newRecords);
+            beginDate = DateUtils.addDay(beginDate, 1);
+        }
+        System.out.println("---------------------------------------------------------------");
+        System.out.println("------------获取数据结束"+recordsCount+"条原始数据变成了"+newRecordCount+"条数据------------");
+        System.out.println("---------------------------------------------------------------");
+    }
+
+    private void saveOperationRecordListToDb(List<KuaishouOperationRecord> records) {
+        if (Check.isNull(records)) {
+            return;
+        }
+
+        List<KuaishouOperationRecord> batchList = new ArrayList<>();
+        records.removeAll(Collections.singleton(null));
+        Integer operationTarget = records.get(0).getOperationTarget();
+
+
+
+        for (KuaishouOperationRecord sumPosition : records) {
+            batchList.add(sumPosition);
+
+            if (batchList.size() >= 1000) {
+                if (operationTarget == 1) {
+                    kuaishouOperationRecordMapper.insertOperationRecordInfoAccountNew(batchList);
+                } else if (operationTarget == 2) {
+                    kuaishouOperationRecordMapper.insertOperationRecordInfoCampaignNew(batchList);
+                } else if (operationTarget == 3) {
+                    kuaishouOperationRecordMapper.insertOperationRecordInfoUnitNew(batchList);
+                } else if (operationTarget == 4) {
+                    kuaishouOperationRecordMapper.insertOperationRecordInfoCreativeNew(batchList);
+                } else if (operationTarget == 5) {
+                    kuaishouOperationRecordMapper.insertOperationRecordInfoVideoNew(batchList);
+                } else if (operationTarget == 6) {
+                    kuaishouOperationRecordMapper.insertOperationRecordInfoAppNew(batchList);
+                } else if (operationTarget == 7) {
+                    kuaishouOperationRecordMapper.insertOperationRecordInfoPackageNew(batchList);
+                } else {
+                    System.out.println("未知的目标类型!");
+                }
+                batchList.clear();
+            }
+        }
+        if (!batchList.isEmpty()) {
+
+            if (operationTarget == 1) {
+                kuaishouOperationRecordMapper.insertOperationRecordInfoAccountNew(batchList);
+            } else if (operationTarget == 2) {
+                kuaishouOperationRecordMapper.insertOperationRecordInfoCampaignNew(batchList);
+            } else if (operationTarget == 3) {
+                kuaishouOperationRecordMapper.insertOperationRecordInfoUnitNew(batchList);
+            } else if (operationTarget == 4) {
+                kuaishouOperationRecordMapper.insertOperationRecordInfoCreativeNew(batchList);
+            } else if (operationTarget == 5) {
+                kuaishouOperationRecordMapper.insertOperationRecordInfoVideoNew(batchList);
+            } else if (operationTarget == 6) {
+                kuaishouOperationRecordMapper.insertOperationRecordInfoAppNew(batchList);
+            } else if (operationTarget == 7) {
+                kuaishouOperationRecordMapper.insertOperationRecordInfoPackageNew(batchList);
+            } else {
+                System.out.println("未知的目标类型!");
+            }
+            batchList.clear();
         }
+
     }
+    @Autowired
+    KuaishouInterfaceServiceImpl2 kuaishouInterfaceServiceImpl2;
+
+    @Test
+    public void getUnitData(){
+        List<Long> accountIdList = new ArrayList<>();
+        accountIdList.add(9556188l);
+        accountIdList.add(9677284l);
+        accountIdList.add(9677304l);
+        accountIdList.add(10072135l);
+        accountIdList.add(9901975l);
+        accountIdList.add(9677344l);
+        accountIdList.add(9901956l);
+        accountIdList.add(9556431l);
+        accountIdList.add(9767055l);
+        accountIdList.add(10248827l);
+
+        Date beginDate = DateUtils.parseDate("2021-06-01", "yyyy-MM-dd");
+        Date endDate = DateUtils.parseDate("2021-07-19", "yyyy-MM-dd");
+
+        while (beginDate.before(endDate)){
+            for(Long accountId : accountIdList){
+                kuaishouInterfaceServiceImpl2.getOperationRecord( accountId,
+                        tokenService.getOauthTokenByAccountId(String.valueOf(accountId)).getAccessToken(),
+                        3,
+                        DateUtils.formatDate(beginDate,"yyyy-MM-dd"),
+                        DateUtils.formatDate(beginDate,"yyyy-MM-dd"));
+                System.out.println("获取完毕 -> accountId:" + accountId +",日期:" + DateUtils.formatDate(beginDate,"yyyy-MM-dd"));
+
+            }
+            beginDate = DateUtils.addDay(beginDate, 1);
+        }
+        System.out.println("走完了~");
+    }
+
 }

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -197,4 +197,6 @@ public class MaterialInfo implements Serializable {
     private Integer slogansCount;
 
     private Integer offlineFlag;
+
+    private Date confirmTime;
 }

+ 8 - 2
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml

@@ -92,7 +92,8 @@
         matInfo.project_id,
         matInfo.id,
         t.slogansCount,
-        matInfo.offline_flag
+        matInfo.offline_flag,
+        matInfo.confirm_time
         from ctop_material_info matInfo
         left JOIN (
         SELECT
@@ -152,7 +153,12 @@
         <if test="offlineFlag!=null">
             and matInfo.offline_flag = #{offlineFlag}
         </if>
-        order by matInfo.create_time desc
+        <if test="status==1">
+            order by matInfo.confirm_time desc
+        </if>
+        <if test="status!=1">
+            order by matInfo.create_time desc
+        </if>
 
     </select>
     <select id="getListByDate" resultType="cn.com.ctop.common.module.entity.MaterialInfo">

+ 3 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MailLogServiceImpl.java

@@ -15,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+
 /**
  * 邮箱记录表
  *
@@ -24,7 +26,7 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class MailLogServiceImpl extends ServiceImpl<MailLogMapper, MailLog> implements IMailLogService {
-    @Autowired
+    @Resource
     private MailLogMapper mailLogMapper;
     @Autowired
     private CorpWexinUtils corpWexinUtils;

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -798,6 +798,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
                 MaterialInfo materialInfo = materialInfoMapper.selectById(info.getId());
                 materialInfo.setSlogansCount(info.getSlogansCount());
                 materialInfo.setOfflineFlag(info.getOfflineFlag());
+                materialInfo.setConfirmTime(info.getConfirmTime());
                 //素材名称为空 则使用素材id 同步失败
                 materialInfo.setMaterialName(Check.isNull(materialInfo.getMaterialName()) ? materialInfo.getId() : materialInfo.getMaterialName());
                 //判断是否已经同步到快手平台

+ 6 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/CtopAdConstant.java

@@ -87,4 +87,10 @@ public class CtopAdConstant {
 
     public static final String COMMON_ORDER_TYPE_ASC = "asc";
     public static final String COMMON_ORDER_TYPE_DESC = "desc";
+
+    /**
+     * 视频类型
+     */
+    public static final String VIDEO_TYPR_ZR = "真人";
+    public static final String VIDEO_TYPR_ZZ = "制作";
 }

+ 1 - 5
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/AlarmRuleJob.java

@@ -17,16 +17,12 @@ import java.util.Map;
 @Component
 public class AlarmRuleJob {
     @Autowired
-    private IRuleGroupService ruleGroupService;
-
-    @Autowired
     private RuleAccountTemplateMapper ruleAccountTemplateMapper;
 
     String URLPREFIX = "http://api.tjyourong.com.cn/jeecg-boot/ruleGroup/checkRulesByAccountId?accountId=";
 
     /**
-     * 定时任务
-     *
+     *预警定时任务
      * @param
      * @return
      * @throws

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

@@ -24,6 +24,7 @@ public class BaseReportVideoDailyLoadJob {
     IBytedanceVideoReportService bytedanceVideoReportService;
     private ExecutorService executorService = Executors.newFixedThreadPool(10);
     private CountDownLatch countDownLatch;
+    //TODO --待废弃
     @XxlJob("baseReportVideoDailyLoadJob")
     public void execute() throws Exception {
         List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();

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

@@ -30,6 +30,7 @@ public class ByteDanceCheckAccountMonitoringLinkJob {
     @Autowired
     private ICtopOauthTokenService oauthTokenService;
 
+    //TODO 待废弃
     @XxlJob("byteDanceCheckAccountMonitoringLinkJob")
     public void execute() throws Exception{
 

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

@@ -21,7 +21,7 @@ public class ByteDanceCleanMaterialJob {
     @Autowired
     private IBytedanceCreativeDailyReportService creativeDailyReportService;
     static ExecutorService executorService = Executors.newFixedThreadPool(3);
-
+    //TODO 待废弃
     @XxlJob("byteDanceCleanMaterial")
     public void execute() throws Exception {
         List<String> signatureList = creativeDailyReportService.getSignatureList();

+ 4 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceHourlyAccountWarningLoadJob.java

@@ -26,6 +26,10 @@ public class ByteDanceHourlyAccountWarningLoadJob {
     private IByteDanceHourlyAccountWarningService byteDanceHourlyAccountWarningService;
     static ExecutorService executorService = Executors.newFixedThreadPool(3);
 
+    /**
+     * 头条时段消耗预警
+     * @throws Exception
+     */
     @XxlJob("byteDanceHourlyAccountWarning")
     public void execute() throws Exception {
         XxlJobHelper.log("开始时段消耗预警定时任务");

+ 5 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDancePlanRuleDataJob.java

@@ -31,6 +31,11 @@ public class ByteDancePlanRuleDataJob {
     @Autowired
     private IRuleDataTargetService ruleDataTargetService;
     private ExecutorService executorService = Executors.newFixedThreadPool(10);
+
+    /**
+     * 规则引擎计划数据任务
+     * @throws Exception
+     */
     @XxlJob("bytedancePlanRuleLoadJob")
     public void execute() throws Exception {
         Date date = new Date();

+ 16 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceRefreshTokenJob.java

@@ -29,6 +29,10 @@ public class ByteDanceRefreshTokenJob {
     @Autowired
     private IUserAllocationService userAllocationService;
 
+    /**
+     * 刷新账户名称
+     * @throws Exception
+     */
     @XxlJob("refreshAuthName")
     public void refreshAuthName() throws Exception {
         List<UserAllocation> userAllocationList = userAllocationService.listByMediaId(null,0);
@@ -39,4 +43,16 @@ public class ByteDanceRefreshTokenJob {
             });
         }
     }
+
+
+    /**
+     * 刷新token  千川
+     * 待上线
+     */
+   /* @XxlJob("qianChuanRefreshTokenJob")
+    public void qianChuanRefresh() throws Exception {
+        refreshTokenService.qianChuanRefresh(null);
+    }*/
+
+
 }

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

@@ -19,6 +19,7 @@ public class ByteDanceVideoReportJob {
     @Autowired
     private IByteDanceVideoReportDailyService byteDanceVideoReportDailyService;
 
+    // TODO 待删除
     @XxlJob("byteDanceVideoReport")
     public void execute() throws Exception {
         String getDate2 = DateUtils.formatDate(DateUtils.addDay(new Date(), -2));

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

@@ -12,7 +12,7 @@ public class BytedanceAccountBidJob {
     private IBytedanceBidWarningService bidWarningService;
 
     /**
-     * 出价预警
+     * 头条出价预警
      */
     @XxlJob("bytedanceAccountBidJob")
     public void execute() throws Exception {

+ 4 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertiserDailyReportLoadJob.java

@@ -29,6 +29,10 @@ public class BytedanceAdvertiserDailyReportLoadJob {
     private IReportService reportService;
     static ExecutorService executorService = Executors.newFixedThreadPool(5);;
 
+    /**
+     * 头条广告主日报
+     * @throws Exception
+     */
     @XxlJob("bytedanceAdvertiserDailyReport")
     public void execute() throws Exception {
         XxlJobHelper.log("头条广告主日报获取任务执行开始");

+ 5 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertiserHourlyReportLoadJob.java

@@ -26,6 +26,11 @@ public class BytedanceAdvertiserHourlyReportLoadJob {
     @Autowired
     private IReportService reportService;
     static ExecutorService executorService = Executors.newFixedThreadPool(4);
+
+    /**
+     * 头条广告主时报
+     * @throws Exception
+     */
     @XxlJob("bytedanceAdvertiserHourlyReport")
     public void execute() throws Exception {
         XxlJobHelper.log("头条时报数据获取开始");

+ 4 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAdvertisingDataLoadJob.java

@@ -32,6 +32,10 @@ public class BytedanceAdvertisingDataLoadJob {
     @Autowired
     private IByteDanceCreativeService creativeService;
 
+    /**
+     * 组、计划、创意
+     * @throws Exception
+     */
     @XxlJob("bytedanceAdvertisingData")
     public void execute() throws Exception {
         Date getDate = new Date();

+ 5 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAiCreateJob.java

@@ -10,6 +10,11 @@ import java.util.Date;
 @Component
 public class BytedanceAiCreateJob {
     private static final String URLPREFIX = "http://118.24.244.213:8808/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/autoCreateCreative?hour=";
+//    private static final String URLPREFIX = "http://gateway.tjyourong.com.cn/advertiser/aiBytedanceAdvertiserStrategy/autoCreateCreative?hour=";
+    /**
+     * 头条自动投放创建任务
+     * @throws Exception
+     */
     @XxlJob("bytedanceAutoCreateJob")
     public void execute() throws Exception {
         String hour = DateUtils.getNowHour(new Date());

+ 4 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceCampaignDailyReportLoadJob.java

@@ -24,6 +24,10 @@ public class BytedanceCampaignDailyReportLoadJob {
     static ExecutorService executorService = Executors.newFixedThreadPool(5);
 
 
+    /**
+     * 广告组日报
+     * @throws Exception
+     */
     @XxlJob("bytedanceCampaignDailyReport")
     public void execute() throws Exception {
         XxlJobHelper.log("头条广告组日报获取任务执行开始");

+ 4 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceCampaignHourlyReportLoadJob.java

@@ -23,6 +23,10 @@ public class BytedanceCampaignHourlyReportLoadJob {
     private IReportService reportService;
     static ExecutorService executorService = Executors.newFixedThreadPool(4);
 
+    /**
+     * 广告组时报
+     * @throws Exception
+     */
     @XxlJob("bytedanceCampaignHourlyReport")
     public void execute() throws Exception {
         XxlJobHelper.log("头条广告组时报数据获取开始");

+ 10 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceCheckAccountReportJob.java

@@ -21,6 +21,12 @@ public class BytedanceCheckAccountReportJob {
     private CountDownLatch countDownLatch;
     @Autowired
     private IBytedanceCheckReportTaskInfoService checkReportTaskInfoService;
+
+
+    /**
+     * 头条数据检查任务
+     * @throws Exception
+     */
     @XxlJob("initCheckReportJob")
     public void initCheckReportJob() throws Exception {
         String date = DateUtils.addDay(DateUtils.formatDate(),-1);
@@ -46,6 +52,10 @@ public class BytedanceCheckAccountReportJob {
         }
     }
 
+    /**
+     * 头条数据重试
+     * @throws Exception
+     */
     @XxlJob("refreshCheckReportJob")
     public void refreshCheckReportJob() throws Exception {
         //1:查询异常任务数据

+ 5 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceCreativeDailyReportLoadJob.java

@@ -27,6 +27,11 @@ public class BytedanceCreativeDailyReportLoadJob {
     @Autowired
     private IReportService reportService;
     static ExecutorService executorService = Executors.newFixedThreadPool(5);
+
+    /**
+     * 头条创意日报
+     * @throws Exception
+     */
     @XxlJob("bytedanceCreativeDailyReport")
     public void execute() throws Exception {
         Date getDate = DateUtils.addDay(new Date(), -1);

+ 5 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceCreativeHourlyReportLoadJob.java

@@ -26,6 +26,11 @@ public class BytedanceCreativeHourlyReportLoadJob {
     @Autowired
     private IReportService reportService;
     static ExecutorService executorService = Executors.newFixedThreadPool(4);
+
+    /**
+     * 头条创意时报
+     * @throws Exception
+     */
     @XxlJob("bytedanceCreativeHourlyReport")
     public void execute() throws Exception {
         XxlJobHelper.log("头条时报数据获取开始");

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

@@ -28,6 +28,11 @@ public class BytedanceDailyMaterialReportJob {
     private IBytedanceReportService bytedanceReportService;
     @Resource
     private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
+
+    /**
+     * 头条获取素材报表数据任务
+     * @throws Exception
+     */
     @XxlJob("bytedanceDailyMaterialReportJob")
     public void execute() throws Exception {
         Date getDate2 = DateUtils.addDay(new Date(), -2);

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

@@ -25,6 +25,7 @@ public class BytedanceDailyMaterialReportRetryJob {
     @Autowired
     private IByteDanceVideoReportDailyService byteDanceVideoReportDailyService;
 
+    //TODO 待废弃
     @XxlJob("bytedanceDailyMaterialReportRetryJob")
     public void execute() throws Exception {
         XxlJobHelper.log("头条素材报表重试定时任务开始");

+ 4 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyPlayableReportJob.java

@@ -22,6 +22,10 @@ public class BytedanceDailyPlayableReportJob {
     @Autowired
     private IBytedanceInterfaceService bytedanceInterfaceService;
 
+    /**
+     * 试玩报表定时任务
+     * @throws Exception
+     */
     @XxlJob("bytedanceDailyPlayableReportJob")
     public void execute() throws Exception {
         Date getDate2 = DateUtils.addDay(new Date(), -2);

+ 4 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyPlayableReportRetryJob.java

@@ -23,6 +23,10 @@ public class BytedanceDailyPlayableReportRetryJob {
     private IBytedanceInterfaceService bytedanceInterfaceService;
 
 
+    /**
+     * 试玩报表重试任务
+     * @throws Exception
+     */
     @XxlJob("bytedanceDailyPlayableReportRetryJob")
     public void execute() throws Exception {
         XxlJobHelper.log("头条试玩报表重试定时任务开始");

+ 22 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceEtlVideoJob.java

@@ -28,6 +28,7 @@ public class BytedanceEtlVideoJob {
         }
     }
 
+    //TODO 待废弃
     @XxlJob("bytedanceEtlVideoProjectJob")
     public void bytedanceEtlVideoProjectJob() throws Exception {
         Date startDate = DateUtils.addDay(new Date(),-2);
@@ -38,6 +39,10 @@ public class BytedanceEtlVideoJob {
     }
 
 
+    /**
+     * 头条视频报表url异常
+     * @throws Exception
+     */
     @XxlJob("updBytedanceVideoJob")
     public void updBytedanceVideoJob() throws Exception {
         etlBytedanceReportVideoDailyService.updBytedanceVideo();
@@ -45,21 +50,38 @@ public class BytedanceEtlVideoJob {
 
     @Autowired
     private IETLReportBytedanceVideoService etlReportBytedanceVideoService;
+
+    /**
+     * 清洗头条剪辑
+     * @throws Exception
+     */
     @XxlJob("etlBytedanceVideoClipInfoJob")
     public void etlBytedanceVideoClipInfoJob() throws Exception {
         etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
     }
 
+    /**
+     * 清洗头条视频报表编导数据
+     * @throws Exception
+     */
     @XxlJob("etlBytedanceVideoPlanInfoJob")
     public void etlBytedanceVideoPlanInfoJob() throws Exception {
         etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
     }
 
+    /**
+     * 清洗头条拍摄
+     * @throws Exception
+     */
     @XxlJob("etlBytedanceVideoShotInfoJob")
     public void etlBytedanceVideoShotInfoJob() throws Exception {
         etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
     }
 
+    /**
+     * 头条视频报表数据任务
+     * @throws Exception
+     */
     @XxlJob("formatBytedance")
     public void etlBytedanceVideoJob() throws Exception {
         etlBytedanceReportVideoDailyService.etlBytedanceVideo();

+ 5 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceFlowFundJob.java

@@ -21,6 +21,11 @@ public class BytedanceFlowFundJob {
     @Autowired
     private IBytedanceFundDailyService bytedanceFundDailyService;
     static ExecutorService executorService = Executors.newFixedThreadPool(4);
+
+    /**
+     * 头条账户流水
+     * @throws Exception
+     */
     @XxlJob("bytedanceFlowFund")
     public void execute() throws Exception {
         XxlJobHelper.log("头条账户流水数据获取开始");

+ 4 - 2
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceMaterialsLoadJob.java

@@ -29,6 +29,10 @@ public class BytedanceMaterialsLoadJob {
     @Autowired
     private IBytedanceImageInfoService imageInfoService;
 
+    /**
+     * 头条素材数据获取
+     * @throws Exception
+     */
     @XxlJob("bytedanceMaterialsLoadJob")
     public void execute() throws Exception{
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
@@ -53,8 +57,6 @@ public class BytedanceMaterialsLoadJob {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
-        //修改视频类型
-        videoInfoService.updateMaterialType();
         //修改图片类型
         imageInfoService.updateType();
         XxlJobHelper.log("物料数据同步完成");

+ 4 - 0
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceMonitoringLinksCheckJob.java

@@ -36,6 +36,10 @@ public class BytedanceMonitoringLinksCheckJob {
     @Autowired
     private ICtopOauthTokenService tokenService;
 
+    /**
+     * 头条内广监测链接检查
+     * @throws Exception
+     */
     @XxlJob("bytedanceMonitoringLinksCheckJob")
     public void execute() throws Exception{
         List<Project> projects = projectService.listByMediaType(3,1);

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


部分文件因为文件数量过多而无法显示