Explorar el Código

Merge branch 'master' into test

yumeng hace 3 años
padre
commit
c5b7135058
Se han modificado 100 ficheros con 809 adiciones y 3207 borrados
  1. 25 0
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  3. 0 22
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ads/controller/StrategyController.java
  4. 48 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java
  5. 57 34
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  6. 3 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  7. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ReleaseViewRecordController.java
  8. 346 21
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  9. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  10. 0 27
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountBidJob.java
  11. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountCpaBidJob.java
  12. 0 16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AppProductJob.java
  13. 0 49
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java
  14. 0 69
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceHourlyAccountWarningLoadJob.java
  15. 0 33
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceRefreshTokenJob.java
  16. 0 45
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDailyReportLoadJob.java
  17. 0 52
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDataLoadJob.java
  18. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserHourlyReportLoadJob.java
  19. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeDailyReportLoadJob.java
  20. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeHourlyReportLoadJob.java
  21. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportJob.java
  22. 0 82
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportRetryJob.java
  23. 0 67
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyVideoMaterialReportAddJob.java
  24. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyVideoMaterialReportJob.java
  25. 0 55
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceMaterialsLoadJob.java
  26. 0 109
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java
  27. 0 40
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportYeterdayLoadJob.java
  28. 0 84
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanHourlyReportLoadJob.java
  29. 0 60
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanLoadJob.java
  30. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanRealTimeLoadJob.java
  31. 0 61
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceSameDayCreativeLoadJob.java
  32. 0 34
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DailyFlowsJob.java
  33. 0 18
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DataeyeJob.java
  34. 0 50
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouCleanMaterialJob.java
  35. 0 30
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouRefreshTokenJob.java
  36. 0 28
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouAdvertiserCrawlerJob.java
  37. 0 55
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCampaignJob.java
  38. 0 20
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCceDataJob.java
  39. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoDelete.java
  40. 0 47
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoLoginJob.java
  41. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCrawlerJob.java
  42. 0 58
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCampaignReportLoadJob.java
  43. 0 87
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCreativeReportLoadJob.java
  44. 0 72
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyLoadFileJob.java
  45. 0 41
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyReportTaskJob.java
  46. 0 57
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouGroupJob.java
  47. 0 38
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHistoryLoadFileJob.java
  48. 0 81
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountReportLoadJob.java
  49. 0 68
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountWarningLoadJob.java
  50. 0 85
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCampaignReportLoadJob.java
  51. 0 84
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCreativeReportLoadJob.java
  52. 0 57
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouMaterialsLoadJob.java
  53. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateCampaignJob.java
  54. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateCreativeJob.java
  55. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateGroupJob.java
  56. 0 21
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouReportDailyGroupChannelCodeJob.java
  57. 0 37
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MaterialReportAccountUpdateJob.java
  58. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MergeVideoJob.java
  59. 0 29
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/OceanengineJob.java
  60. 0 33
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/PangolinDataJob.java
  61. 0 30
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/PangolinLoginJob.java
  62. 0 42
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/TargetingTagsJob.java
  63. 0 35
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ToutiaoMaterialsLoadJob.java
  64. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java
  65. 14 12
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ProjectMemberMapper.java
  66. 3 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialReportOverViewMapper.xml
  67. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MediaReportMapper.xml
  68. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml
  69. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java
  70. 104 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/TestService.java
  71. 6 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  72. 0 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java
  73. 1 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  74. 19 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/UserCompanyController.java
  75. 31 87
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  76. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/Project.java
  77. 8 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/UserAllocation.java
  78. 3 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java
  79. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/ProjectMapper.java
  80. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java
  81. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/UserCompanyMapper.java
  82. 16 22
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml
  83. 15 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/ProjectMapper.xml
  84. 10 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml
  85. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserCompanyMapper.xml
  86. 3 2
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java
  87. 2 1
      module-common/src/main/java/cn/com/ctop/common/module/service/IProjectService.java
  88. 3 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java
  89. 3 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IUserCompanyService.java
  90. 3 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MailLogServiceImpl.java
  91. 10 7
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  92. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/ProjectServiceImpl.java
  93. 11 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java
  94. 11 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserCompanyServiceImpl.java
  95. 6 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/CtopAdConstant.java
  96. 0 3
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/AlarmRuleJob.java
  97. 1 2
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BaseReportVideoDailyLoadJob.java
  98. 1 2
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceCheckAccountMonitoringLinkJob.java
  99. 1 2
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceCleanMaterialJob.java
  100. 0 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceAiCreateJob.java

+ 25 - 0
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -1641,6 +1641,31 @@ public class DateUtils extends PropertyEditorSupport {
 
         return days;
     }
+
+    /**
+     * 判断time是否在from,to之内
+     *
+     * @param time 指定日期
+     * @param from 开始日期
+     * @param to   结束日期
+     * @throws
+     */
+    public static boolean checkTimeLimit(Date time, Date from, Date to) {
+        Calendar date = Calendar.getInstance();
+        date.setTime(time);
+
+        Calendar after = Calendar.getInstance();
+        after.setTime(from);
+
+        Calendar before = Calendar.getInstance();
+        before.setTime(to);
+
+        if (date.after(after) && date.before(before)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
 }
 
 

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -200,6 +200,7 @@ public class ShiroConfig {
         //filterChainDefinitionMap.put("/overView/*", "anon");
         filterChainDefinitionMap.put("/kuaishouCrowdPack/**", "anon");
         filterChainDefinitionMap.put("/kuaishou/batch/*", "anon");
+        filterChainDefinitionMap.put("/ai/projectCreate/*", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

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

+ 48 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java

@@ -9,7 +9,12 @@ import cn.com.ctop.common.module.service.IBindAccountAuthService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.service.ISysDepartService;
 import cn.com.ctop.common.module.service.ISysUserService;
-import cn.com.ctop.common.module.utils.*;
+import cn.com.ctop.common.module.utils.BytedanceInterfaceConstant;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
+import cn.com.ctop.common.module.utils.PropertiesUtils;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAppPackageService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouAccessToken;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResultToken;
@@ -36,7 +41,10 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.text.ParseException;
-import java.util.*;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Slf4j
 @RestController
@@ -59,6 +67,8 @@ public class CallbackController {
     private IByteDanceAdvertiserDataService advertiserDataService;
     @Autowired
     private IReportService reportService;
+    @Autowired
+    private IKuaishouAppPackageService kuaishouAppPackageService;
 
     @GetMapping("/qywexin")
     public void qywexin(HttpServletRequest request,
@@ -153,6 +163,12 @@ public class CallbackController {
                     BigDecimal warningAmount = json.getBigDecimal("WarningAmount");
                     String systemType = json.getString("systemType");
 
+
+                    Integer autoDelivery = json.getInteger("autoDelivery");
+                    String materialTypeStr = json.getString("materialType");
+                    //物料类型,0-不同步,1应用包,(2人群包,3定向包)
+                    JSONArray materialTypeArr = json.getJSONArray("materialType");
+
                     CtopOauthToken topOauthToken = new CtopOauthToken();
                     topOauthToken.setId(String.valueOf(accountId));
                     topOauthToken.setAppId(json.getLong("appId"));
@@ -187,7 +203,7 @@ public class CallbackController {
                     userAllocation.setSystemType(systemType);
                     // 获取快手昵称
                     userAllocation.setAuthName((String) advertiseBaseInfoMap.get("userName"));
-                    if(null!=authBeginTime&&!authBeginTime.trim().equals("")){
+                    if (null != authBeginTime && !authBeginTime.trim().equals("")) {
                         userAllocation.setAuthBeginTime(authBeginTime);
                     }
                     userAllocation.setMediaId(mediaId);
@@ -197,15 +213,21 @@ public class CallbackController {
                     userAllocation.setWarningAmount(warningAmount);
                     userAllocation.setCreateTime(new Date());
                     userAllocation.setUpdateTime(new Date());
+                    //自动投放,0关闭,1开启
+
+                    userAllocation.setAutoDelivery(autoDelivery);
+                    userAllocation.setMaterialType(materialTypeStr);
                     allocationMapper.deleteById(userAllocation.getId());
                     Map<String, Object> deleteUserMap = new HashMap<>();
                     deleteUserMap.put("advertiser_id", advertiserId);
                     deleteUserMap.put("account_id", accountId);
                     allocationMapper.deleteByMap(deleteUserMap);
+                    log.info("待创建账户信息:{}", userAllocation.toString());
                     int i = allocationMapper.insert(userAllocation);
                     if (i > 0) {
                         log.info("同步分配用户表完成,task_id:{},accountId:{}", state, accountId);
                     }
+                    Integer materialType = materialTypeArr.getInteger(0);
                     //账号绑定
                     bindAccountAuthService.addBindAccount(accountId, KuaishouInterfaceConstant.LOGIN_TYPE_KUAISHOU, advertiserId);
                     Thread t = new Thread() {
@@ -213,6 +235,10 @@ public class CallbackController {
                         public void run() {
                             try {
                                 kuaishouInterfaceService.loadKuaishouDataSingle(topOauthToken);
+
+                                if (!Check.isNull(materialType) && materialType != 0) {
+                                    synchronMaterials(materialType, accountId, projectId);
+                                }
                             } catch (ParseException e) {
                                 e.printStackTrace();
                             }
@@ -228,9 +254,23 @@ public class CallbackController {
         return "授权绑定失败!";
     }
 
-
-    public static void main(String[] args) {
-        System.err.println(UUID.randomUUID().toString().replace("-", ""));
+    private void synchronMaterials(Integer materialType, Long accountId, Long projectId) {
+        if (materialType == 1) {
+            JSONArray accountIds = new JSONArray();
+            accountIds.add(accountId);
+            //1 有效项目模板
+            List<Long> ids = kuaishouAppPackageService.queryByAppVersion(projectId, null, 1);
+            JSONObject data = new JSONObject();
+            data.put("accountIds", accountIds);
+            data.put("message", "授权同步应用");
+            log.info("同步账户应用,应用模板={}", ids);
+            if (!Check.isNull(ids)) {
+                for (Long id : ids) {
+                    data.put("id", id);
+                    kuaishouAppPackageService.pushAppPackage(id, accountIds, data);
+                }
+            }
+        }
     }
 
     @RequestMapping("/bytedance")
@@ -345,7 +385,7 @@ public class CallbackController {
                             userAllocation.setProjectId(projectId);
                             userAllocation.setSystemType(systemType);
                             userAllocation.setAuthName((String) advertiserDataMap.get("name"));
-                            if(null!=authBeginTime&&!authBeginTime.trim().equals("")){
+                            if (null != authBeginTime && !authBeginTime.trim().equals("")) {
                                 userAllocation.setAuthBeginTime(authBeginTime);
                             }
                             userAllocation.setAdvertiserId(advertiserId);
@@ -400,7 +440,7 @@ public class CallbackController {
                     userAllocation.setProjectId(projectId);
                     userAllocation.setSystemType(systemType);
                     userAllocation.setAuthName((String) advertiserDataMap.get("name"));
-                    if(null!=authBeginTime&&!authBeginTime.trim().equals("")){
+                    if (null != authBeginTime && !authBeginTime.trim().equals("")) {
                         userAllocation.setAuthBeginTime(authBeginTime);
                     }
                     userAllocation.setAdvertiserId(advertiserId);

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

@@ -20,7 +20,6 @@ import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
@@ -79,6 +78,9 @@ public class MaterialInfoController {
     @Autowired
     private IProjectService projectService;
     @Autowired
+    private IProjectMemberService projectMemberService;
+
+    @Autowired
     private IByteDanceCreativeWordPackageService byteDanceGeneralCopywriterService;
 
     @GetMapping("/supplierWatermark")
@@ -298,36 +300,57 @@ public class MaterialInfoController {
                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        List<Long> productIds = null;
+        List<Long> projectIds = new ArrayList<>();
         String userId = user.getId();
         String roleCode = roleService.getRoleCodeByUserId(userId);
         if (null == tagCode || "".equals(tagCode.trim())) {
             tagCode = null;
         }
-        if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale")) {
-            //查询所有
-            if (null != productId && productId != 0) {
-                productIds = new ArrayList<>();
-                productIds.add(productId);
+        //管理员、销售查询所有素材
+        if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || roleCode.contains("sale")) {
+            if (!Check.isNull(projectId)) {
+                projectIds.add(projectId);
+            } else if (!Check.isNull(productId)) {
+                List<Long> projectIdsByProductId = projectService.getProjectIdsByProductId(productId);
+                projectIds.addAll(projectIdsByProductId);
+            }
+            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
+            //运营经理、运营、运营助理
+        } else if ("operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
+            if (!Check.isNull(projectId)) {
+                projectIds.add(projectId);
+            } else if (!Check.isNull(productId)) {
+                List<Long> partakeProjectIds = projectMemberService.getProjectIdsByProductId(productId, userId);
+                List<Long> productProjectIds = projectService.getProjectIdsByProductIdAndNotIn(productId, partakeProjectIds);
+                projectIds.addAll(partakeProjectIds);
+                projectIds.addAll(productProjectIds);
+            } else {
+                List<Long> partakeProjectIds = projectMemberService.getProjectIdsByProductId(null, userId);
+                List<Long> productProjectIds = projectService.getProjectIdsByProductIdAndNotIn(null, partakeProjectIds);
+                projectIds.addAll(partakeProjectIds);
+                projectIds.addAll(productProjectIds);
             }
-            return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, null, projectId, clipId, shotId, planId,offlineFlag, pageNo, pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
+
         } else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)) {
             //查询自己所在项目下的数据
-            if (null == productId || productId == 0) {
-                productIds = memberService.selectProductsByUserId(userId);
+            if (!Check.isNull(projectId)) {
+                projectIds.add(projectId);
+            } else if (!Check.isNull(productId)) {
+                projectIds = projectMemberService.getProjectIdsByProductId(productId, userId);
 
             } else {
-                productIds = new ArrayList<>();
-                productIds.add(productId);
+                projectIds = projectMemberService.getProjectIdsByProductId(null, userId);
             }
-            return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, null, projectId, clipId, shotId, planId,offlineFlag, pageNo, pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
         } else {
             //查询自己上传的视频
-            if (null != productId && productId != 0) {
-                productIds = new ArrayList<>();
-                productIds.add(productId);
+            if (!Check.isNull(projectId)) {
+                projectIds.add(projectId);
+            } else if (!Check.isNull(productId)) {
+                projectIds = projectMemberService.getProjectIdsByProductId(productId, userId);
             }
-            return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, userId, projectId, clipId, shotId, planId,offlineFlag, pageNo, pageSize);
+            return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, userId, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
         }
     }
 
@@ -520,12 +543,12 @@ public class MaterialInfoController {
             if (null != slogans && !slogans.isEmpty()) {
 
 
-                for (int i = 0;i<slogans.size();i++) {
+                for (int i = 0; i < slogans.size(); i++) {
                     JSONObject slogenInfo = slogans.getJSONObject(i);
                     String title = slogenInfo.getString("title");
-                    title = title.trim().replaceAll("[\\{]{2,}","{");
-                    title = title.trim().replaceAll("[\\}]{2,}","}");
-                    slogenInfo.put("title",title);
+                    title = title.trim().replaceAll("[\\{]{2,}", "{");
+                    title = title.trim().replaceAll("[\\}]{2,}", "}");
+                    slogenInfo.put("title", title);
                     String reg = "\\{[\\u4e00-\\u9fa5\\-]{2,6}\\}";
                     Pattern pattern = Pattern.compile(reg);
                     Matcher matcher = pattern.matcher(title);
@@ -534,44 +557,44 @@ public class MaterialInfoController {
                     int len = StringUtils.lengthAsSlogan(title);
                     int left = title.indexOf("{");
                     int right = title.indexOf("}");
-                    if(left >= 0 || right >= 0){
+                    if (left >= 0 || right >= 0) {
                         int times = 0;
                         while (matcher.find()) { //此处find()每次被调用后,会偏移到下一个匹配
                             times++;
-                            if(times>=3){
+                            if (times >= 3) {
                                 result.setCode(500);
                                 result.setMessage("动态词包不合法,词包数量超过2个");
-                                return  result;
+                                return result;
                             }
                             String matchStr = matcher.group();//获取当前匹配的值
-                            title = title.replace(matchStr,"");
-                            ByteDanceCreativeWordPackage creativeWordPackage = byteDanceGeneralCopywriterService.selectCreativeWordPackageByName(matchStr.substring(1,matchStr.length()-1));
-                            if(Check.isNull(creativeWordPackage)){
+                            title = title.replace(matchStr, "");
+                            ByteDanceCreativeWordPackage creativeWordPackage = byteDanceGeneralCopywriterService.selectCreativeWordPackageByName(matchStr.substring(1, matchStr.length() - 1));
+                            if (Check.isNull(creativeWordPackage)) {
                                 result.setCode(500);
                                 result.setMessage("动态词包不合法,词包不存在或者含有单独的非词包大括号");
-                                return  result;
+                                return result;
                             }
                             creativeWordIdsArray.add(creativeWordPackage.getCreativeWordId());
                             len = len - (right - left) + creativeWordPackage.getMaxWordLen();
                             left = title.indexOf("{");
                             right = title.indexOf("}");
                         }
-                        if(title.contains("{") || title.contains("}")){
+                        if (title.contains("{") || title.contains("}")) {
                             return result.error500("大括号单独出现或大括号中内容不合法");
                         }
-                        slogenInfo.put("creative_word_ids",creativeWordIdsArray.toJSONString());
+                        slogenInfo.put("creative_word_ids", creativeWordIdsArray.toJSONString());
                     }
                     //校验标题长度,长度小于5和大于30的全部过滤
-                    if(len<5 || len>30){
+                    if (len < 5 || len > 30) {
                         result.setCode(500);
                         result.setMessage("文案长度不合法,小于5或大于30");
-                        return  result;
+                        return result;
                     }
                 }
 
                 LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-                slogenInfoService.deleteAllSlogens(Check.isNull(materialInfo.getProjectId()) ? materialInfoEntity.getProjectId() : materialInfo.getProjectId(),materialInfoEntity.getCode(),user.getId());
-                slogenInfoService.insertSlogans(Check.isNull(materialInfo.getProjectId()) ? materialInfoEntity.getProjectId() : materialInfo.getProjectId() , materialInfoEntity.getCode(), slogans, user.getId());
+                slogenInfoService.deleteAllSlogens(Check.isNull(materialInfo.getProjectId()) ? materialInfoEntity.getProjectId() : materialInfo.getProjectId(), materialInfoEntity.getCode(), user.getId());
+                slogenInfoService.insertSlogans(Check.isNull(materialInfo.getProjectId()) ? materialInfoEntity.getProjectId() : materialInfo.getProjectId(), materialInfoEntity.getCode(), slogans, user.getId());
             }
         }
 

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

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

@@ -2,6 +2,7 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.QueryGenerator;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 
 /**

+ 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("数据更新完成");

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

@@ -269,6 +269,7 @@ public class UserAllocationController {
                  queryWrapper.eq("media_id", project.getMediaId());
             }*/
             queryWrapper.isNotNull("account_id");
+            queryWrapper.orderByDesc("create_time");
             List<UserAllocation> userAllocations = userAllocationMapper.selectList(queryWrapper);
             result.setSuccess(true);
             result.setResult(userAllocations);

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

+ 14 - 12
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ProjectMemberMapper.java

@@ -22,32 +22,34 @@ public interface ProjectMemberMapper extends BaseMapper<ProjectMember> {
 
     List<Long> selectProductsByUserId(@Param("userId") String userId);
 
-    List<ProjectMember> adminProjects(@Param("mediaIds")List<Integer> mediaIds);
+    List<ProjectMember> adminProjects(@Param("mediaIds") List<Integer> mediaIds);
 
-    List<ProjectMember> designLeaderProjects(@Param("companyId")String companyId ,@Param("mediaIds")List<Integer> mediaIds);
+    List<ProjectMember> designLeaderProjects(@Param("companyId") String companyId, @Param("mediaIds") List<Integer> mediaIds);
 
-    List<ProjectMember> designProjects(@Param("userId")String userId, @Param("mediaIds")List<Integer> mediaIds);
+    List<ProjectMember> designProjects(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
 
-    List<ProjectMember> operationProjects(@Param("userId")String userId, @Param("mediaIds")List<Integer> mediaIds);
+    List<ProjectMember> operationProjects(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
 
-    String getRoleCodeByUserId(@Param("userId")String userId);
+    String getRoleCodeByUserId(@Param("userId") String userId);
 
-    String getCompanyIdByUserId(@Param("userId")String userId);
+    String getCompanyIdByUserId(@Param("userId") String userId);
 
-    List<ProjectMember> queryProjectMemberByUserId(@Param("userId")String userId, @Param("mediaIds")List<Integer> mediaIds);
+    List<ProjectMember> queryProjectMemberByUserId(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
 
 
-    List<ProjectMember> getSaleProjects(@Param("userId")String userId, @Param("mediaIds")List<Integer> mediaIds);
+    List<ProjectMember> getSaleProjects(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
 
     List<Long> getProjectByMap(@Param("userId") String userId);
 
-    List<Project> getProjectByUserId(@Param("userId")String userId);
+    List<Project> getProjectByUserId(@Param("userId") String userId);
 
-    List<Long> getProjectByAccountIds(@Param("accountIds")JSONArray accountIds);
+    List<Long> getProjectByAccountIds(@Param("accountIds") JSONArray accountIds);
 
-    List<Long> getProductByAccountIds(@Param("accountIds")JSONArray accountIds);
+    List<Long> getProductByAccountIds(@Param("accountIds") JSONArray accountIds);
 
     List<JSONObject> getProjectByUserIdAndMediaIds(@Param("userId") String userId, @Param("mediaIds") List<Integer> mediaIds);
 
-    List<ProjectMember> getProductIds(@Param("userId") String userId,@Param("mediaList") List<Integer> mediaList,@Param("productId") Long productId);
+    List<ProjectMember> getProductIds(@Param("userId") String userId, @Param("mediaList") List<Integer> mediaList, @Param("productId") Long productId);
+
+    List<Long> getProjectIdsByProductId(@Param("productId") Long productId, @Param("userId") String userId);
 }

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

@@ -99,7 +99,7 @@
         ctop_etl_kuaishou_account_material_report_daily
         WHERE
         1=1
-        <if test="projects !=null">
+        <if test="projects !=null and projects.size() > 0">
             AND project_id IN
             <foreach collection="projects" item="item" separator=","
                      open="(" close=")">
@@ -417,7 +417,8 @@
     <select id="queryBytedanceTopMaterial" 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
+        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,

+ 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,

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml

@@ -262,6 +262,20 @@
         group by t2.id
         order by t2.create_time desc
     </select>
+    <select id="getProjectIdsByProductId" resultType="java.lang.Long">
+        SELECT
+        t1.id
+        FROM
+        ctop_project t1
+        LEFT JOIN ctop_project_member t2 ON t1.id = t2.project_id
+        WHERE
+        t2.user_id = #{userId}
+        <if test="productId != null and productId != ''">
+            AND t1.product_id = #{productId}
+        </if>
+        GROUP BY
+        t1.id
+    </select>
 
 
 </mapper>

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

@@ -50,4 +50,6 @@ public interface IProjectMemberService extends IService<ProjectMember> {
     List<ProjectMember> getMapsByProjectList(List<ProjectMember> projectMembers);
 
     List<ProjectMember> getOwnProducts(List<Integer> mediaList, Long productId);
+
+    List<Long> getProjectIdsByProductId(Long productId, String userId);
 }

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

+ 6 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java

@@ -439,7 +439,7 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         }
         //如果以上角色都不是的话直接查询此角色所属项目
         //   projectMemberList = memberMapper.designProjects(userId, mediaList);
-        List<ProjectMember> projectMemberList  = memberMapper.getProductIds(userId, mediaList,productId);
+        List<ProjectMember> projectMemberList = memberMapper.getProductIds(userId, mediaList, productId);
 
 
         if (null == projectMemberList) {
@@ -449,6 +449,11 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         return projectMemberList;
     }
 
+    @Override
+    public List<Long> getProjectIdsByProductId(Long productId, String userId) {
+        return memberMapper.getProjectIdsByProductId(productId, userId);
+    }
+
 }
 
 

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

@@ -64,10 +64,6 @@ public class SysDepartController {
     private ISysBaseApi sysBaseAPI;
     @Autowired
     private ISysDepartService sysDepartService;
-    @Autowired
-    private ISysUserService sysUserService;
-    @Autowired
-    private ISysUserDepartService sysUserDepartService;
     public RedisTemplate<String, Object> redisTemplate;
 
     /**

+ 1 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@@ -256,7 +256,7 @@ public class SysUserController {
             List<SysUserVo> userList;
 
             PageHelper.startPage(pageNo, pageSize);
-            if ("4b10089775c040119e139087517aed88".equals(companyId) || "6608ed13c0dd42de93c790dbdf124234".equals(companyId) || "d57fecdcf7a94d009736d9c850731582".equals(companyId)) {
+            if ("1648c7ceb4d449a9a13fbed7a8d9976c".equals(companyId) || "4b10089775c040119e139087517aed88".equals(companyId) || "6608ed13c0dd42de93c790dbdf124234".equals(companyId) || "d57fecdcf7a94d009736d9c850731582".equals(companyId)) {
                 userList = sysUserService.getAllUser(userName, null);
             } else {
                 userList = sysUserService.getUserListByCompany(companyId, userName);
@@ -377,8 +377,6 @@ public class SysUserController {
     private ISysDepartService departService;
 
     @RequestMapping(value = "/edit", method = RequestMethod.PUT)
-    //@RequiresRoles({"admin"})
-    //@RequiresPermissions("user:edit")
     public Result<SysUser> edit(@RequestBody JSONObject jsonObject) {
         Result<SysUser> result = new Result<SysUser>();
         try {

+ 19 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/UserCompanyController.java

@@ -23,7 +23,15 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.entity.ImportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
@@ -121,6 +129,16 @@ public class UserCompanyController {
         return result;
     }
 
+    @GetMapping(value = "/allCompany")
+    public Result<Object> allCompany() {
+        try {
+            return userCompanyService.allCompany();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
     /**
      * 添加
      *

+ 31 - 87
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -8,12 +8,9 @@ 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.IKuaiShouReportDailyMaterialService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService2;
+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.material.service.IEtlKuaishouVideoInfoService;
-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;
@@ -35,6 +32,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
 import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
@@ -77,27 +75,26 @@ public class SampleTest {
     private IBytedanceCheckReportTaskInfoService checkReportTaskInfoService;
     @Autowired
     private IEtlBytedanceReportVideoDailyService etlBytedanceReportVideoDailyService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(10);
+    static ExecutorService executorService = null;
     static CountDownLatch countDownLatch = null;
     @Autowired
     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(10494982L);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse = simpleDateFormat.parse("2021-07-27");
+        Date pars1 = simpleDateFormat.parse("2021-07-27");
+        iKuaishouInterfaceService.getAdvertiserReportHourly(token, parse, pars1);
     }
 
 
-
-
     @Test
     public void deleteKuaishouComment() {
         Long start = System.currentTimeMillis();
@@ -132,7 +129,6 @@ public class SampleTest {
     }
 
 
-
     @Test
     public void etlBytedanceVideoInfo() {
         String startDate = "2021-02-01";
@@ -156,7 +152,6 @@ public class SampleTest {
     }
 
 
-
     @Test
     public void formatVideoReportData() {
         for (int i = 1; i < 45; i++) {
@@ -201,35 +196,35 @@ public class SampleTest {
     }
 
     @Test
-    public void checkCostData(){
+    public void checkCostData() {
         String date = "2021-06-11";
-        for (int i=0;i<7;i++){
-            String getDate = DateUtils.addDay(date,i);
+        for (int i = 0; i < 7; i++) {
+            String getDate = DateUtils.addDay(date, i);
             //1:初始化
             checkReportTaskInfoService.initTask(getDate);
             //2: checkCost
-            List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,getDate,0);
-            if(null!=taskInfos&&!taskInfos.isEmpty()){
-                for (BytedanceCheckReportTaskInfo task:taskInfos) {
+            List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, getDate, 0);
+            if (null != taskInfos && !taskInfos.isEmpty()) {
+                for (BytedanceCheckReportTaskInfo task : taskInfos) {
                     checkReportTaskInfoService.checkCost(task);
                 }
-                log.info("{}:数据获取完成",getDate);
+                log.info("{}:数据获取完成", getDate);
             }
         }
     }
 
     @Test
-    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()) {
             countDownLatch = new CountDownLatch(taskInfos.size());
             taskInfos.forEach(taskInfo -> {
                 try {
                     checkReportTaskInfoService.reloadData(taskInfo);
                     checkReportTaskInfoService.checkCost(taskInfo);
-                }catch (Exception e){
-                }finally {
+                } catch (Exception e) {
+                } finally {
                     countDownLatch.countDown();
                 }
             });
@@ -239,70 +234,20 @@ public class SampleTest {
     }
 
     @Test
-    public void loadBkData(){
-        Date startDate = DateUtils.addDay(new Date(),-60);
-        for(int i=0;i<=60;i++){
-            Date getDate = DateUtils.addDay(startDate,i);
-            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
-        }
+    public void testfreshBytedanceUrl() {
+        etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
+        etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
+        etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
     }
 
-    @Autowired
-    private IEtlKuaishouVideoInfoService etlKuaishouVideoInfo;
     @Test
-    public void loadkuaishouVideoData(){
-        String startDate = "2021-05-07";
-        for(int i=0;i<=60;i++){
-            String getDate = DateUtils.formatDate(DateUtils.addDay(startDate,i));
-            etlKuaishouVideoInfo.etlKuaishouVideoInfo(getDate);
+    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"));
         }
     }
-
-    @Autowired
-    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
-    @Test
-    public void loadKuaishouMatData() throws InterruptedException {
-        String startDate = "2021-06-18";
-        String endDate = "2021-06-24";
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> executorService.submit(() -> {
-            try {
-                kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), startDate, endDate, "DAILY", 1);
-            }catch (Exception e){
-            }finally {
-                countDownLatch.countDown();
-            }
-        }));
-        countDownLatch.await();
-        System.out.println("数据获取完成");
-    }
-    @Test
-    public void loadKuaiShouMatHourlyData() throws InterruptedException{
-//        kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(7411077l, tokenService.getOauthTokenByAccountId("7411077").getAccessToken(), "2021-07-02", "2021-07-02", "HOURLY", 1);
-
-        String startDate = "2021-07-19";
-        String endDate = "2021-07-19";
-        System.out.println(DateUtils.now());
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        System.out.println(tokens.size());
-        countDownLatch = new CountDownLatch(tokens.size());
-        tokens.forEach(token -> executorService.submit(() -> {
-            try {
-                kuaiShouReportDailyMaterialService.getMaterialReportByAccountIdAndStatDate(token.getAccountId(), token.getAccessToken(), startDate, endDate, "HOURLY", 1);
-            }catch (Exception e){
-            }finally {
-                countDownLatch.countDown();
-            }
-        }));
-        countDownLatch.await();
-        System.out.println("数据获取完成");
-        System.out.println(DateUtils.now());
-    }
-
-    @Autowired
-    IKuaishouInterfaceService2 kuaishouInterfaceService2;
     @Resource
     private KuaishouOperationRecordMapper kuaishouOperationRecordMapper;
 
@@ -357,7 +302,6 @@ public class SampleTest {
                     }
                 }catch (Exception e){
                 }finally {
-
                     countDownLatch.countDown();
             }}));
             countDownLatch.await();

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/Project.java

@@ -97,6 +97,7 @@ public class Project {
      */
     private BigDecimal maxDeepCpaBid;
     private Integer checkLink;
+    private Integer materialShare;
     /**
      * 创建时间
      */

+ 8 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/UserAllocation.java

@@ -138,6 +138,14 @@ public class UserAllocation implements Serializable {
      * 1 禁用
      */
     private Integer deleteComment;
+    /**
+     * 自动投放,0关闭,1开启
+     */
+    private Integer autoDelivery;
+    /**
+     * 物料类型 0-不同步,1应用包,(2人群包,3定向包)
+     */
+    private String materialType;
 
     /**
      * 修改时间

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 3 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java


+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/ProjectMapper.java

@@ -29,4 +29,6 @@ public interface ProjectMapper extends BaseMapper<Project> {
     List<JSONObject> getListByMap(@Param("ids") Map<Long, Long> projectIdMap);
 
     List<Long> getProjectIdsByProductId(@Param("productId") Long productId);
+
+    List<Long> getProjectIdsByProductIdAndNotIn(@Param("productId") Long productId, @Param("partakeProjectIds") List<Long> partakeProjectIds);
 }

+ 4 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java

@@ -50,4 +50,8 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
     List<UserAllocation> getAccountListByUserIdAndProductId(@Param("userId")String userId,@Param("projectId")Long projectId,@Param("productId")Long productId);
 
     List<JSONObject> getUserIdListByProductId(@Param("productId") Long productId);
+
+    int updateProjectStrategyStatus(@Param("accountId") Long accountId,@Param("projectStrategy") Integer projectStrategy);
+
+    List<Long> queryAutomaticAccounts(@Param("projectId") Long projectId);
 }

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/UserCompanyMapper.java

@@ -1,7 +1,11 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.UserCompany;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.common.api.vo.Result;
+
+import java.util.List;
 
 /**
  * 用户够公司
@@ -12,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface UserCompanyMapper extends BaseMapper<UserCompany> {
 
+    List<JSONObject> allCompany();
 }

+ 16 - 22
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml

@@ -96,15 +96,15 @@
         matInfo.confirm_time
         from ctop_material_info matInfo
         left JOIN (
-            SELECT
-                video_code,
-                count(*) AS slogansCount
-            FROM
-                ctop_bytedance_video_slogen_info
-            WHERE
-                status = 1
-            GROUP BY
-                video_code
+        SELECT
+        video_code,
+        count(*) AS slogansCount
+        FROM
+        ctop_bytedance_video_slogen_info
+        WHERE
+        status = 1
+        GROUP BY
+        video_code
         ) t ON matInfo.code = t.video_code
 
         <if test="tagCode!=null">
@@ -126,24 +126,21 @@
         <if test="planId !=null and planId != ''">
             and ascription.plan_id = #{planId}
         </if>
-        <if test="projectId !=null and projectId != ''">
-            and matInfo.project_id = #{projectId}
-        </if>
-        <if test="status!=null">
+        <if test="status != null">
             and matInfo.status = #{status}
         </if>
-        <if test="userId!=null">
+        <if test="userId != null and userId != ''">
             and matInfo.user_id = #{userId}
         </if>
-        <if test="code!=null">
+        <if test="code != null">
             and matInfo.code = #{code}
         </if>
-        <if test="materialName!=null">
+        <if test="materialName != null">
             and matInfo.material_name like concat('%',#{materialName},'%')
         </if>
-        <if test="productIds!=null">
-            and matInfo.product_id in
-            <foreach item="item" index="index" collection="productIds" open="(" separator="," close=")">
+        <if test="projectIds != null and projectIds.size() != 0 ">
+            and matInfo.project_id in
+            <foreach item="item" index="index" collection="projectIds" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
@@ -153,9 +150,6 @@
         <if test="endDate != null and endDate != '' ">
             and matInfo.create_time &lt;= #{endDate}
         </if>
-        <if test="projectId!=null">
-            and matInfo.project_id = #{projectId}
-        </if>
         <if test="offlineFlag!=null">
             and matInfo.offline_flag = #{offlineFlag}
         </if>

+ 15 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/ProjectMapper.xml

@@ -60,5 +60,20 @@
         from ctop_project
         where product_id = #{productId}
     </select>
+    <select id="getProjectIdsByProductIdAndNotIn" resultType="java.lang.Long">
+        select id from ctop_project
+        where 1 = 1
+        <if test="productId != null and productId != ''">
+            and product_id = #{productId}
+        </if>
+        and material_share = 0
+        <if test="partakeProjectIds != null and partakeProjectIds.size() > 0">
+            and id not in
+            <foreach item="item" index="index" collection="partakeProjectIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+
+    </select>
 
 </mapper>

+ 10 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml

@@ -194,5 +194,15 @@
         </if>
     </select>
 
+    <update id="updateProjectStrategyStatus">
+        update ctop_user_allocation set auto_delivery = #{projectStrategy}
+        where account_id = #{accountId}
+    </update>
+
+    <select id="queryAutomaticAccounts" resultType="java.lang.Long">
+        select account_id from ctop_user_allocation
+        where project_id = #{projectId}
+        AND auto_delivery = 1
+    </select>
 
 </mapper>

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserCompanyMapper.xml

@@ -2,4 +2,11 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.common.module.mapper.UserCompanyMapper">
 
+    <select id="allCompany" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT company_id as 'companyId',
+               company_name as 'companyName'
+        FROM user_company
+        GROUP BY company_id
+    </select>
+
 </mapper>

+ 3 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java

@@ -31,7 +31,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
 
     MaterialInfo getMaterialInfoByCode(String code);
 
-    Map<String, Object> checkMaterialInfo(String code, Long productId);
+    Map<String, Object> checkMaterialInfo(String code, Long projectId);
 
     Map<String, Object> insert(JSONObject jsonObject);
 
@@ -78,7 +78,8 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
 
     List<MaterialInfo> getListByDate(String startDate, String endDate);
 
-    Map<String, Object> getListByParams(String tagCode, String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Long projectId, String clipId, String shotId, String planId,Integer offlineFlag, Integer pageNo, Integer pageSize);
 
     JSONArray getIdListByProject(Long projectId);
+
+    Map<String, Object> getListByParams(String tagCode, String type, Integer status, String materialName, List<Long> projectIds, String code, String startDate, String endDate, String userId, String clipId, String shotId, String planId, Integer offlineFlag, Integer pageNo, Integer pageSize);
 }

+ 2 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/IProjectService.java

@@ -25,8 +25,9 @@ public interface IProjectService extends IService<Project> {
 
     List<JSONObject> getProjectListByIds(JSONArray projectIdArray);
 
-
     Map<Long, String> getProjectMap(Map<Long, Long> projectIdMap);
 
     List<Long> getProjectIdsByProductId(Long productId);
+
+    List<Long> getProjectIdsByProductIdAndNotIn(Long productId, List<Long> partakeProjectIds);
 }

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java

@@ -58,4 +58,7 @@ public interface IUserAllocationService extends IService<UserAllocation> {
      */
     List<Long> getValidProjectIds(Integer mediaId);
 
+    boolean updateProjectStrategyStatus(Long accountId, Integer projectStrategy);
+
+    List<Long> queryAutomaticAccounts(Long projectId);
 }

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IUserCompanyService.java

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service;
 import cn.com.ctop.common.module.entity.SysUser;
 import cn.com.ctop.common.module.entity.UserCompany;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
 
 /**
  * 用户够公司
@@ -18,4 +19,6 @@ public interface IUserCompanyService extends IService<UserCompany> {
     void removeByUserId(String id);
 
     UserCompany getByUserId(String userId);
+
+    Result<Object> allCompany();
 }

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

+ 10 - 7
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -38,6 +38,7 @@ import java.util.concurrent.Executors;
 
 import static cn.com.ctop.common.module.utils.CloudVideoProcessUtil.getTaskDetailResponse;
 import static cn.com.ctop.common.module.utils.CloudVideoProcessUtil.videoWatermarkHandle;
+
 /**
  * 素材信息
  *
@@ -170,10 +171,10 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
 
 
     @Override
-    public MaterialInfo getMaterialInfoByCodeAndProductId(String code, Long productId) {
+    public MaterialInfo getMaterialInfoByCodeAndProductId(String code, Long projectId) {
         QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("code", code);
-        queryWrapper.eq("product_id", productId);
+        queryWrapper.eq("project_id", projectId);
         queryWrapper.orderByDesc("id").last("limit 1");
         return this.getOne(queryWrapper);
     }
@@ -188,9 +189,9 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     }
 
     @Override
-    public Map<String, Object> checkMaterialInfo(String code, Long productId) {
+    public Map<String, Object> checkMaterialInfo(String code, Long projectId) {
         Map<String, Object> result = new HashMap<>();
-        MaterialInfo info = this.getMaterialInfoByCodeAndProductId(code, productId);
+        MaterialInfo info = this.getMaterialInfoByCodeAndProductId(code, projectId);
         if (null != info) {
             //文件已存在
             ResultMapUtils.setResultMap(result, StatusCode.FILE_HAS_UPLOAD.getCode());
@@ -770,8 +771,9 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         return materialInfoMapper.getListByDate(startDate, endDate);
     }
 
+
     @Override
-    public Map<String, Object> getListByParams(String tagCode, String type, Integer status, List<Long> productId, String materialName, String code, String startDate, String endDate, String userId, Long projectId, String clipId, String shotId, String planId,Integer offlineFlag, Integer pageNo, Integer pageSize) {
+    public Map<String, Object> getListByParams(String tagCode, String type, Integer status, String materialName, List<Long> projectIds, String code, String startDate, String endDate, String userId, String clipId, String shotId, String planId, Integer offlineFlag, Integer pageNo, Integer pageSize) {
         Map<String, Object> result = new HashMap<>();
         PageHelper.startPage(pageNo, pageSize);
 
@@ -788,8 +790,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
             endDate = endDate + " 23:59:59";
         }
 
-
-        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, productId, materialName, code, startDate, endDate, userId, projectId, ascription, clipId, shotId, planId,offlineFlag);
+        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, userId, projectIds, ascription, clipId, shotId, planId, offlineFlag);
         List<MaterialInfo> setList = new ArrayList<>();
         PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
         if (null != dailyList && !dailyList.isEmpty()) {
@@ -863,6 +864,8 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     public JSONArray getIdListByProject(Long projectId) {
         return materialInfoMapper.getIdListByProject(projectId);
     }
+
+
 }
 
 

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/ProjectServiceImpl.java

@@ -70,4 +70,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     public List<Long> getProjectIdsByProductId(Long productId) {
         return projectMapper.getProjectIdsByProductId(productId);
     }
+
+    @Override
+    public List<Long> getProjectIdsByProductIdAndNotIn(Long productId, List<Long> partakeProjectIds) {
+        return projectMapper.getProjectIdsByProductIdAndNotIn(productId, partakeProjectIds);
+    }
 }

+ 11 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java

@@ -190,4 +190,15 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     public List<Long> getValidProjectIds(Integer mediaId) {
         return userAllocationMapper.getValidProjectIds(mediaId);
     }
+
+    @Override
+    public boolean updateProjectStrategyStatus(Long accountId, Integer projectStrategy) {
+        int num  = userAllocationMapper.updateProjectStrategyStatus(accountId, projectStrategy);
+        return num>0;
+    }
+
+    @Override
+    public List<Long> queryAutomaticAccounts(Long projectId) {
+        return userAllocationMapper.queryAutomaticAccounts(projectId);
+    }
 }

+ 11 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserCompanyServiceImpl.java

@@ -9,14 +9,17 @@ import cn.com.ctop.common.module.mapper.SysUserDepartMapper;
 import cn.com.ctop.common.module.mapper.UserCompanyMapper;
 import cn.com.ctop.common.module.service.IUserCompanyService;
 import cn.com.ctop.common.module.utils.Check;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -96,9 +99,15 @@ public class UserCompanyServiceImpl extends ServiceImpl<UserCompanyMapper, UserC
 
     @Override
     public UserCompany getByUserId(String userId) {
-        QueryWrapper<UserCompany>queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("user_id",userId);
+        QueryWrapper<UserCompany> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("user_id", userId);
         queryWrapper.last("limit 1");
         return null;
     }
+
+    @Override
+    public Result<Object> allCompany() {
+        List<JSONObject> data = userCompanyMapper.allCompany();
+        return Result.ok(data);
+    }
 }

+ 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 = "制作";
 }

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

@@ -17,9 +17,6 @@ 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=";

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

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

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

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

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

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

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


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio