huangxuechao 3 vuotta sitten
vanhempi
commit
131c3d2942
100 muutettua tiedostoa jossa 1305 lisäystä ja 3281 poistoa
  1. 25 0
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 15 0
      jeecg-boot-module-system/pom.xml
  3. 91 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/Elasticsearch/ElasticsearchConfig.java
  4. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  5. 0 22
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ads/controller/StrategyController.java
  6. 48 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java
  7. 57 34
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  8. 3 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  9. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ReleaseViewRecordController.java
  10. 346 21
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  11. 81 15
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  12. 0 27
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountBidJob.java
  13. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountCpaBidJob.java
  14. 0 16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AppProductJob.java
  15. 0 49
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java
  16. 0 69
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceHourlyAccountWarningLoadJob.java
  17. 0 33
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceRefreshTokenJob.java
  18. 0 45
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDailyReportLoadJob.java
  19. 0 52
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserDataLoadJob.java
  20. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceAdvertiserHourlyReportLoadJob.java
  21. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeDailyReportLoadJob.java
  22. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeHourlyReportLoadJob.java
  23. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportJob.java
  24. 0 82
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyMaterialReportRetryJob.java
  25. 0 67
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyVideoMaterialReportAddJob.java
  26. 0 64
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyVideoMaterialReportJob.java
  27. 0 55
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceMaterialsLoadJob.java
  28. 0 109
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java
  29. 0 40
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportYeterdayLoadJob.java
  30. 0 84
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanHourlyReportLoadJob.java
  31. 0 60
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanLoadJob.java
  32. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanRealTimeLoadJob.java
  33. 0 61
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceSameDayCreativeLoadJob.java
  34. 0 34
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DailyFlowsJob.java
  35. 0 18
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DataeyeJob.java
  36. 0 50
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouCleanMaterialJob.java
  37. 0 30
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouRefreshTokenJob.java
  38. 0 28
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouAdvertiserCrawlerJob.java
  39. 0 55
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCampaignJob.java
  40. 0 20
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCceDataJob.java
  41. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoDelete.java
  42. 0 47
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCommentAutoLoginJob.java
  43. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouCrawlerJob.java
  44. 0 58
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCampaignReportLoadJob.java
  45. 0 87
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCreativeReportLoadJob.java
  46. 0 72
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyLoadFileJob.java
  47. 0 41
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyReportTaskJob.java
  48. 0 57
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouGroupJob.java
  49. 0 38
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHistoryLoadFileJob.java
  50. 0 81
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountReportLoadJob.java
  51. 0 68
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyAccountWarningLoadJob.java
  52. 0 85
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCampaignReportLoadJob.java
  53. 0 84
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyCreativeReportLoadJob.java
  54. 0 57
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouMaterialsLoadJob.java
  55. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateCampaignJob.java
  56. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateCreativeJob.java
  57. 0 66
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouNowDateGroupJob.java
  58. 0 21
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouReportDailyGroupChannelCodeJob.java
  59. 0 37
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MaterialReportAccountUpdateJob.java
  60. 0 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MergeVideoJob.java
  61. 0 29
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/OceanengineJob.java
  62. 0 33
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/PangolinDataJob.java
  63. 0 30
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/PangolinLoginJob.java
  64. 0 42
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/TargetingTagsJob.java
  65. 0 35
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ToutiaoMaterialsLoadJob.java
  66. 0 56
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/WatermarkVideoJob.java
  67. 14 12
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/ProjectMemberMapper.java
  68. 3 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialReportOverViewMapper.xml
  69. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MediaReportMapper.xml
  70. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml
  71. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java
  72. 104 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/TestService.java
  73. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/MaterialReportOverViewServiceImpl.java
  74. 6 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  75. 83 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/elasticsearch/controller/ESController.java
  76. 0 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDepartController.java
  77. 1 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  78. 19 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/UserCompanyController.java
  79. 3 3
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  80. 1 1
      jeecg-boot-module-system/src/main/resources/application-test.yml
  81. 6 6
      jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties
  82. 77 145
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  83. 15 0
      module-common/pom.xml
  84. 27 0
      module-common/src/main/java/cn/com/ctop/common/module/annotation/Document.java
  85. 16 0
      module-common/src/main/java/cn/com/ctop/common/module/annotation/EsId.java
  86. 26 0
      module-common/src/main/java/cn/com/ctop/common/module/annotation/FieId.java
  87. 24 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/DataLabels.java
  88. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/Project.java
  89. 8 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/UserAllocation.java
  90. 29 0
      module-common/src/main/java/cn/com/ctop/common/module/enums/AnalyzerType.java
  91. 40 0
      module-common/src/main/java/cn/com/ctop/common/module/enums/FieldType.java
  92. 3 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java
  93. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/ProjectMapper.java
  94. 14 4
      module-common/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java
  95. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/UserCompanyMapper.java
  96. 16 22
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml
  97. 15 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/ProjectMapper.xml
  98. 52 8
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml
  99. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserCompanyMapper.xml
  100. 0 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.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;
+        }
+    }
 }
 
 

+ 15 - 0
jeecg-boot-module-system/pom.xml

@@ -174,6 +174,21 @@
             <artifactId>spring-boot-starter-jimureport</artifactId>
             <version>1.1-beta</version>
         </dependency>
+        <dependency>
+            <groupId>org.elasticsearch.client</groupId>
+            <artifactId>elasticsearch-rest-high-level-client</artifactId>
+            <version>7.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.elasticsearch.client</groupId>
+            <artifactId>elasticsearch-rest-client</artifactId>
+            <version>7.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.elasticsearch</groupId>
+            <artifactId>elasticsearch</artifactId>
+            <version>7.1.0</version>
+        </dependency>
     </dependencies>
 
     <dependencyManagement>

+ 91 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/config/Elasticsearch/ElasticsearchConfig.java

@@ -0,0 +1,91 @@
+package org.jeecg.config.Elasticsearch;
+
+import org.apache.http.HttpHost;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
+import org.elasticsearch.client.RestClient;
+import org.elasticsearch.client.RestClientBuilder;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.ArrayList;
+
+/**
+ * @className: ElasticsearchConfig
+ * @description: elasticsearch 配置类
+ * @author: zzy
+ * @date: 2021-07-12
+ */
+@Configuration
+public class ElasticsearchConfig {
+    @Value("${elasticsearch.address}")
+    private String address;
+
+    /**
+     *  连接超时时间
+     */
+    @Value("${elasticsearch.connect-timeout}")
+    private int connectTimeOut = 1000;
+
+    /**
+     * 连接超时时间
+     */
+    @Value("${elasticsearch.socket-timeout}")
+    private int socketTimeOut = 30000;
+
+    /**
+     * 获取连接的超时时间
+     */
+    @Value("${elasticsearch.connection-request-timeout}")
+    private int connectionRequestTimeOut = 500;
+
+    /**
+     * 最大连接数
+     */
+    @Value("${elasticsearch.max-connect-num}")
+    private int maxConnectNum = 100;
+
+    /**
+     * 最大路由连接数
+     */
+    @Value("${elasticsearch.max-connect-per-route}")
+    private int maxConnectPerRoute = 100;
+
+
+    @Bean
+    RestHighLevelClient restHighLevelClient() {
+        ArrayList<HttpHost> hostList = new ArrayList<>();
+        String[] addrss = address.split(",");
+        for(String addr : addrss){
+            String[] arr = addr.split(":");
+            hostList.add(new HttpHost(arr[0], Integer.parseInt(arr[1]), "http"));
+        }
+
+        RestClientBuilder builder = RestClient.builder(hostList.toArray(new HttpHost[0]));
+        // 异步httpclient连接延时配置
+        builder.setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
+            @Override
+            public RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder requestConfigBuilder) {
+                requestConfigBuilder.setConnectTimeout(connectTimeOut);
+                requestConfigBuilder.setSocketTimeout(socketTimeOut);
+                requestConfigBuilder.setConnectionRequestTimeout(connectionRequestTimeOut);
+                return requestConfigBuilder;
+            }
+        });
+        // 异步httpclient连接数配置
+        builder.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
+            @Override
+            public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) {
+                httpClientBuilder.setMaxConnTotal(maxConnectNum);
+                httpClientBuilder.setMaxConnPerRoute(maxConnectPerRoute);
+                return httpClientBuilder;
+            }
+        });
+
+        RestHighLevelClient client = new RestHighLevelClient(builder);
+        return client;
+    }
+
+}

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

@@ -200,6 +200,8 @@ public class ShiroConfig {
         //filterChainDefinitionMap.put("/overView/*", "anon");
         filterChainDefinitionMap.put("/kuaishouCrowdPack/**", "anon");
         filterChainDefinitionMap.put("/kuaishou/batch/*", "anon");
+        filterChainDefinitionMap.put("/dimension/kuaiShouDimensionAccount/*", "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("数据更新完成");

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

@@ -15,10 +15,10 @@ import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.QueryGenerator;
 import cn.com.ctop.common.module.utils.StringUtils;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAdvertiserBaseInfo;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAdvertiserBaseInfoService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -75,6 +75,30 @@ public class UserAllocationController {
     private IKuaiShouAdvertiserBaseInfoService kuaiShouAdvertiserBaseInfoService;
     @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
+
+
+    @PostMapping(value = "/getAccountDetailByAccountIds")
+    public Result<List<JSONObject>> getAccountDetailByAccountId(@RequestBody JSONObject requestJson) {
+        Result<List<JSONObject>> result = new Result<>();
+        try {
+            if (Check.isNull(requestJson)) {
+                throw new Exception("请选择账户id");
+            }
+            JSONArray accountIds = requestJson.getJSONArray("accountIds");
+            if (Check.isNull(accountIds)) {
+                throw new Exception("账户id列表不能为空");
+            }
+            List<JSONObject> accountDetails = userAllocationService.getByAccountIds(accountIds);
+            result.setSuccess(true);
+            result.setResult(accountDetails);
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.success(e.getMessage());
+        }
+        return result;
+    }
+
+
     @GetMapping(value = "/getUserIdListByProductId")
     public Result<List<JSONObject>> getUserIdListByProductId(Long productId) {
         Result<List<JSONObject>> result = new Result<>();
@@ -91,8 +115,48 @@ public class UserAllocationController {
         }
         return result;
     }
+
+
+    /**
+     * 根据项目id查询
+     *
+     * @param projectId
+     * @return
+     */
+    @GetMapping(value = "/getByProjectId")
+    public Result<JSONArray> getByProjectId(Long projectId) {
+        Result<JSONArray> result = new Result<>();
+        try {
+            if (Check.isNull(projectId)) {
+                throw new Exception("请选择项目id");
+            }
+            JSONArray array = new JSONArray();
+            List<Long> userIdList = userAllocationService.getKuaiShouUserIdListByProjectId(projectId);
+            if (!Check.isNull(userIdList)) {
+
+                for (int i = 0; i < userIdList.size(); i++) {
+                    Long userId = userIdList.get(i);
+                    JSONObject json = new JSONObject();
+                    json.put("userId", userId);
+                    List<JSONObject> accountList = userAllocationService.selectAccountsByKuaishouUserId(userId);
+                    if (!Check.isNull(accountList)) {
+                        json.put("accounts", accountList);
+                    }
+                    array.add(json);
+                }
+            }
+            result.setSuccess(true);
+            result.setResult(array);
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.success(e.getMessage());
+        }
+        return result;
+    }
+
+
     @GetMapping(value = "/getAccountListByUserIdAndProductId")
-    public Result<List<ProjectMember>> getAccountListByUserIdAndProductId(String userId,Long productId,Integer mediaId){
+    public Result<List<ProjectMember>> getAccountListByUserIdAndProductId(String userId, Long productId, Integer mediaId) {
         Result<List<ProjectMember>> result = new Result<>();
         String roleCode = sysRoleService.getRoleCodeByUserId(userId);
         if ("admin".equals(roleCode)) {
@@ -100,17 +164,17 @@ public class UserAllocationController {
         }
         List<Integer> mediaList = new ArrayList<>();
         mediaList.add(mediaId);
-    //    List<ProjectMember> projectList = projectMemberService.getOwnProjects(mediaList);
-        List<ProjectMember> productList = projectMemberService.getOwnProducts(mediaList,productId);
-        log.info("產品列表:{}",productList);
+        //    List<ProjectMember> projectList = projectMemberService.getOwnProjects(mediaList);
+        List<ProjectMember> productList = projectMemberService.getOwnProducts(mediaList, productId);
+        log.info("產品列表:{}", productList);
 
-      //  projectMemberService.getOwnProjects(mediaList);
+        //  projectMemberService.getOwnProjects(mediaList);
         List<ProjectMember> projectMemberList = new ArrayList<>();
-        for (ProjectMember projectMember: productList){
-            if (!projectMember.getProductId().equals(productId)){
+        for (ProjectMember projectMember : productList) {
+            if (!projectMember.getProductId().equals(productId)) {
                 continue;
             }
-            List<UserAllocation> userAllocationList = userAllocationService.getAccountListByUserIdAndProductId(userId,projectMember.getProjectId(),productId);
+            List<UserAllocation> userAllocationList = userAllocationService.getAccountListByUserIdAndProductId(userId, projectMember.getProjectId(), productId);
             projectMember.setUserAllocationList(userAllocationList);
             projectMemberList.add(projectMember);
         }
@@ -118,8 +182,9 @@ public class UserAllocationController {
         result.setSuccess(true);
         return result;
     }
+
     @GetMapping(value = "/getBytedanceAccountListByUserIdAndProductId")
-    public Result<List<ProjectMember>> getBytedanceAccountListByUserIdAndProductId(String userId,Long productId,Integer mediaId){
+    public Result<List<ProjectMember>> getBytedanceAccountListByUserIdAndProductId(String userId, Long productId, Integer mediaId) {
         Result<List<ProjectMember>> result = new Result<>();
         String roleCode = sysRoleService.getRoleCodeByUserId(userId);
         if ("admin".equals(roleCode)) {
@@ -130,11 +195,11 @@ public class UserAllocationController {
         List<ProjectMember> projectList = projectMemberService.getOwnProjects(mediaList);
         projectMemberService.getOwnProjects(mediaList);
         List<ProjectMember> projectMemberList = new ArrayList<>();
-        for (ProjectMember projectMember: projectList){
-            if (projectMember.getProductId() != productId){
+        for (ProjectMember projectMember : projectList) {
+            if (projectMember.getProductId() != productId) {
                 continue;
             }
-            List<UserAllocation> userAllocationList = userAllocationService.getAccountListByUserIdAndProductId(userId,projectMember.getProjectId(),productId);
+            List<UserAllocation> userAllocationList = userAllocationService.getAccountListByUserIdAndProductId(userId, projectMember.getProjectId(), productId);
             projectMember.setUserAllocationList(userAllocationList);
             projectMemberList.add(projectMember);
         }
@@ -269,6 +334,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);
@@ -364,7 +430,7 @@ public class UserAllocationController {
      */
     @GetMapping(value = "/queryAccountIdsByProjectId")
     public Result<Object> queryAccountIdsByProjectId(Long projectId) {
-        if(Check.isNull(projectId)){
+        if (Check.isNull(projectId)) {
             return Result.error("请选择项目");
         }
         try {
@@ -373,7 +439,7 @@ public class UserAllocationController {
         } catch (Exception e) {
             e.printStackTrace();
         }
-        return  Result.error("查询失败");
+        return Result.error("查询失败");
     }
 
 

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

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

@@ -498,7 +498,7 @@ public class MaterialReportOverViewServiceImpl implements IMaterialReportOverVie
         if (roleCode.equals("admin")) {
             return null;
         }
-        return queryProjectIdBy(recursiveQuerySubordinate(currentUser), mediaId);
+        return Check.isNull(queryProjectIdBy(recursiveQuerySubordinate(currentUser), mediaId)) ? null : queryProjectIdBy(recursiveQuerySubordinate(currentUser), mediaId);
     }
     private List<String> getfileIds(Map<String, Map<String, Object>> kuaishouVideoReportMap, JSONArray columns) {
         List<String> titles = new ArrayList<>();

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

+ 83 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/elasticsearch/controller/ESController.java

@@ -0,0 +1,83 @@
+package org.jeecg.modules.elasticsearch.controller;
+
+import cn.com.ctop.common.module.entity.DataLabels;
+import cn.com.ctop.common.module.utils.ElasticsearchUtil;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.elasticsearch.action.index.IndexResponse;
+import org.elasticsearch.index.query.BoolQueryBuilder;
+import org.elasticsearch.index.query.QueryBuilders;
+import org.elasticsearch.index.query.WildcardQueryBuilder;
+import org.elasticsearch.search.builder.SearchSourceBuilder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.UUID;
+
+/**
+ * es请求
+ *
+ * @author zzy
+ * @create: 2021-07-12
+ */
+@Slf4j
+@RestController
+@RequestMapping("/es")
+public class ESController {
+
+    @Autowired
+    ElasticsearchUtil elasticsearchUtil;
+
+    @RequestMapping("createIndex")
+    public void createIndex() {
+        DataLabels dataLabels = new DataLabels();
+        dataLabels
+                .setId("3");
+        dataLabels
+                .setContent("哦哦哦,测试es啦,I LOVE CHINA");
+        dataLabels
+                .setSize(1024);
+        try {
+            boolean indexIfNotExist = elasticsearchUtil.createIndexIfNotExist(DataLabels.class);
+            log.info("创建成功:{}", indexIfNotExist);
+        } catch (Exception e) {
+            log.info("创建错误:{}", e.toString());
+        }
+    }
+
+    @RequestMapping("addData")
+    public void addData() {
+        DataLabels dataLabels = new DataLabels();
+        dataLabels
+                .setId(UUID.randomUUID().toString());
+        dataLabels
+                .setContent("哦哦哦,测试es啦,I LOVE CHINA");
+        dataLabels
+                .setSize(1024);
+        try {
+            IndexResponse indexResponse = elasticsearchUtil.index(dataLabels);
+            log.info("添加数据成功:{}", indexResponse.toString());
+        } catch (Exception e) {
+            log.info("添加数据错误:{}", e.toString());
+            e.printStackTrace();
+        }
+    }
+
+    @RequestMapping("searchData")
+    public void searchData() {
+        SearchSourceBuilder SearchSourceBuilder = new SearchSourceBuilder();
+        WildcardQueryBuilder wildcardQueryBuilder = QueryBuilders.wildcardQuery("content", "*LOVE*");
+
+        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
+        boolQueryBuilder.must(wildcardQueryBuilder);
+        SearchSourceBuilder.query(boolQueryBuilder);
+        try {
+            PageInfo<DataLabels> indexResponse = elasticsearchUtil.search(SearchSourceBuilder, 1, 10, DataLabels.class);
+            log.info("查询数据成功:{}", indexResponse.toString());
+        } catch (Exception e) {
+            log.info("查询数据错误:{}", e.toString());
+            e.printStackTrace();
+        }
+    }
+}

+ 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("查询失败");
+    }
+
     /**
      * 添加
      *

+ 3 - 3
jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -135,9 +135,9 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: data
-          password: hcst@2021
+          url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true
+          username: hcst
+          password: hcst@2020
           driver-class-name: com.mysql.jdbc.Driver
           # 多数据源配置
           #multi-datasource1:

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

@@ -118,7 +118,7 @@ spring:
         max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
         min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
       shutdown-timeout: 100ms
-    password: hcst@2020
+    password: #hcst@2020
     port: 6379
 #mybatis plus 设置
 mybatis-plus:

+ 6 - 6
jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties

@@ -1,10 +1,10 @@
 #mysql
 diver_name=com.mysql.jdbc.Driver
-#url=jdbc:mysql://139.186.151.174:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-#username=hcst
-#password=hcst@2020
-url=jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-username=data
-password=hcst@2021
+url=jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+username=hcst
+password=hcst@2020
+#url=jdbc:mysql://139.186.27.96:4000/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+#username=data
+#password=hcst@2021
 database_name=jeecg-boot
 

+ 77 - 145
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -13,9 +13,11 @@ 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.impl.KuaishouInterfaceServiceImpl2;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.dimension.service.IKuaiShouDimensionStrategyService;
+import cn.com.ctop.kuaishou.modules.dimension.service.IKuaiShouDimensionVariableService;
 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.IKuaishouAudienceReportDailyService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
@@ -80,27 +82,36 @@ 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;
+    @Autowired
+    private IKuaiShouDimensionVariableService kuaiShouDimensionVariableService;
+    @Autowired
+    private IKuaiShouDimensionStrategyService dimensionStrategyService;
+    @Autowired
+    private IKuaiShouDimensionVariableService dimensionVariableService;
 
 
     @Test
     public void loadKuaishouCookie() throws ParseException {
-        CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1700996735138951L);
-        advertiserDataService.getMaterialList(tokenByAccountId);
-
-        CtopOauthToken tokenByAccountId1 = tokenService.getTokenByAccountId(1700996735589383L);
-        advertiserDataService.getMaterialList(tokenByAccountId1);
+      //  JSONArray dimensionVariableList = kuaiShouDimensionVariableService.getDimensionVariableList(1L);
+        JSONArray array = new JSONArray();
+        array.add(1);
+        array.add(2);
+        array.add(3);
+        // dimensionStrategyService.create(1L, array);
+        JSONArray dimensionVariableList = dimensionVariableService.getDimensionVariableList(8L); // 获取变量排列组合
+
+        System.err.println(dimensionVariableList);
     }
 
 
-
-
     @Test
     public void deleteKuaishouComment() {
         Long start = System.currentTimeMillis();
@@ -135,7 +146,6 @@ public class SampleTest {
     }
 
 
-
     @Test
     public void etlBytedanceVideoInfo() {
         String startDate = "2021-02-01";
@@ -159,7 +169,6 @@ public class SampleTest {
     }
 
 
-
     @Test
     public void formatVideoReportData() {
         for (int i = 1; i < 45; i++) {
@@ -204,35 +213,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();
                 }
             });
@@ -329,44 +338,46 @@ public class SampleTest {
 //            List<KuaishouOperationRecord> records = kuaishouOperationRecordMapper.selectPackageRecordByStatDate(DateUtils.formatDate(beginDate, "yyyy-MM-dd"));
 //            List<KuaishouOperationRecord> records = kuaishouOperationRecordMapper.selectUnitRecordByStatDate(DateUtils.formatDate(beginDate, "yyyy-MM-dd"));    //已执行完毕
 //            List<KuaishouOperationRecord> records = kuaishouOperationRecordMapper.selectVideoRecordByStatDate(DateUtils.formatDate(beginDate, "yyyy-MM-dd"));
-            if(Check.isNull(records)){
-                System.out.print("     -> 今日的数据为空!!!");
-                beginDate = DateUtils.addDay(beginDate, 1);
-                continue;
-            }
-            recordsCount += records.size();
-            countDownLatch = new CountDownLatch(records.size());
-
-            List<KuaishouOperationRecord> newRecords = new ArrayList<>();
-
-            records.forEach(record -> executorService.submit(() -> {
-                try{
-                    String log = record.getLog();
-                    JSONArray jsonArray = JSONArray.parseArray(log);
-                    for(int i=0;i<jsonArray.size();i++){
-                        JSONObject object = jsonArray.getJSONObject(i);
-                        String originalData = object.getString("original_data");
-                        String updateData = object.getString("update_data");
-                        String fieldName = object.getString("field_name");
-                        KuaishouOperationRecord newRecord = new KuaishouOperationRecord(record);
-                        newRecord.setOriginalData(originalData);
-                        newRecord.setUpdateData(updateData);
-                        newRecord.setFieldName(fieldName);
-
-                        if("".equals(newRecord.getOriginalData()) && "".equals(newRecord.getUpdateData())){
-                            continue;
+            if (!Check
+                    .isNull(records)) {
+                recordsCount += records.size();
+                countDownLatch = new CountDownLatch(records.size());
+
+                List<KuaishouOperationRecord> newRecords = new ArrayList<>();
+
+                records.forEach(record -> executorService.submit(() -> {
+                    try {
+                        String log = record.getLog();
+                        JSONArray jsonArray = JSONArray.parseArray(log);
+                        for (int i = 0; i < jsonArray.size(); i++) {
+                            JSONObject object = jsonArray.getJSONObject(i);
+                            String originalData = object.getString("original_data");
+                            String updateData = object.getString("update_data");
+                            String fieldName = object.getString("field_name");
+                            KuaishouOperationRecord newRecord = new KuaishouOperationRecord(record);
+                            newRecord.setOriginalData(originalData);
+                            newRecord.setUpdateData(updateData);
+                            newRecord.setFieldName(fieldName);
+
+                            if ("".equals(newRecord.getOriginalData()) && "".equals(newRecord.getUpdateData())) {
+                                continue;
+                            }
+                            newRecords.add(newRecord);
                         }
-                        newRecords.add(newRecord);
-                    }
-                }catch (Exception e){
-                }finally {
+                    } catch (Exception e) {
+                    } finally {
 
-                    countDownLatch.countDown();
-            }}));
-            countDownLatch.await();
-            newRecordCount += newRecords.size();
-            this.saveOperationRecordListToDb(newRecords);
-            beginDate = DateUtils.addDay(beginDate, 1);
+                        countDownLatch.countDown();
+                    }
+                }));
+                countDownLatch.await();
+                newRecordCount += newRecords.size();
+                this.saveOperationRecordListToDb(newRecords);
+                beginDate = DateUtils.addDay(beginDate, 1);
+            } else {
+        System.out.print("     -> 今日的数据为空!!!");
+        beginDate = DateUtils.addDay(beginDate, 1);
+            }
         }
         System.out.println("---------------------------------------------------------------");
         System.out.println("------------获取数据结束"+recordsCount+"条原始数据变成了"+newRecordCount+"条数据------------");
@@ -383,7 +394,6 @@ public class SampleTest {
         Integer operationTarget = records.get(0).getOperationTarget();
 
 
-
         for (KuaishouOperationRecord sumPosition : records) {
             batchList.add(sumPosition);
 
@@ -429,10 +439,15 @@ public class SampleTest {
             }
             batchList.clear();
         }
+    }
 
+    public void testfreshBytedanceUrl(){
+        etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
+        etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
+        etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
     }
     @Autowired
-    KuaishouInterfaceServiceImpl2 kuaishouInterfaceServiceImpl2;
+    IKuaishouInterfaceService2 kuaishouInterfaceServiceImpl2;
 
     @Test
     public void getUnitData() throws InterruptedException {
@@ -522,87 +537,4 @@ public class SampleTest {
 
     }
 
-    @Test
-    public void haha(){
-        try{
-            CtopOauthToken token = tokenService.getTokenByAccountId(9766982l);
-            if(!Check.isNull(token)){
-                Date startDate = DateUtils.parseDate("2021-03-03","yyyy-MM-dd");
-                Date enDate = DateUtils.addDay(startDate, 2);
-                JSONArray units = new JSONArray();
-                units.add(162424553l);
-                units.add(162424693l);
-                units.add(162424707l);
-                units.add(162424718l);
-                units.add(162424732l);
-                units.add(162424744l);
-                units.add(162424854l);
-                units.add(162424868l);
-                units.add(162424878l);
-                units.add(162424899l);
-                units.add(162424909l);
-                units.add(162424946l);
-                units.add(162424955l);
-                units.add(162424992l);
-                units.add(162425014l);
-                units.add(162425049l);
-                units.add(162425073l);
-                units.add(162425166l);
-                units.add(162425181l);
-                units.add(162425200l);
-                units.add(162425234l);
-                units.add(162425249l);
-                units.add(162425293l);
-                units.add(162425433l);
-                units.add(162425455l);
-                units.add(162697794l);
-                units.add(162697799l);
-                units.add(162697800l);
-                units.add(162697802l);
-                units.add(162718546l);
-                units.add(162718554l);
-                units.add(162718558l);
-                units.add(162718559l);
-                units.add(162718563l);
-                units.add(162718566l);
-                units.add(162718572l);
-                units.add(162718574l);
-                units.add(162718577l);
-                units.add(162718583l);
-                units.add(162718588l);
-                units.add(162718598l);
-                units.add(162718604l);
-                units.add(162718617l);
-                units.add(162718635l);
-                units.add(162718653l);
-                units.add(162718657l);
-                units.add(162718660l);
-                units.add(162718663l);
-                units.add(162718667l);
-                units.add(162718676l);
-                units.add(162718708l);
-                units.add(162718797l);
-                units.add(162718801l);
-                units.add(162718837l);
-                units.add(162718847l);
-                units.add(162718871l);
-                units.add(162718921l);
-                units.add(162718952l);
-                units.add(162718971l);
-                units.add(162719041l);
-                units.add(162719052l);
-                // province: 省级地域分布, city: 地级地域分布,gender: 性别分布,ageSegment: 年龄分布clientId: 系统分布 businessInterestTags: 商业兴趣分布
-                while (startDate.before(enDate)){
-                    kuaishouAudienceReportDailyService.crowdAnalysisReport3(token, DateUtils.formatDate(startDate,"yyyy-MM-dd"), "ageSegment", 36372197l, units, 1, 2000);
-                    System.out.println("获取完毕 -> unit:" + 216642581 +",日期:" + DateUtils.formatDate(startDate,"yyyy-MM-dd"));
-                    startDate = DateUtils.addDay(startDate, 1);
-                }
-
-            }else {
-                System.out.println("token异常 -》 accountId:"+9766982l);
-            }
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-    }
 }

+ 15 - 0
module-common/pom.xml

@@ -102,6 +102,21 @@
             <version>1.16</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.elasticsearch.client</groupId>
+            <artifactId>elasticsearch-rest-high-level-client</artifactId>
+            <version>7.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.elasticsearch.client</groupId>
+            <artifactId>elasticsearch-rest-client</artifactId>
+            <version>7.6.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.elasticsearch</groupId>
+            <artifactId>elasticsearch</artifactId>
+            <version>7.6.1</version>
+        </dependency>
 
     </dependencies>
 

+ 27 - 0
module-common/src/main/java/cn/com/ctop/common/module/annotation/Document.java

@@ -0,0 +1,27 @@
+package cn.com.ctop.common.module.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * Es 文档注解,用于做索引实体映射
+ * 作用在类上
+ * @author zzy
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Documented
+@Inherited
+public @interface  Document {
+
+    /**
+     * index : 索引名称
+     * @return
+     */
+    String index();
+
+    /**
+     * 类型名称
+     * @return
+     */
+    String type();
+}

+ 16 - 0
module-common/src/main/java/cn/com/ctop/common/module/annotation/EsId.java

@@ -0,0 +1,16 @@
+package cn.com.ctop.common.module.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 用于标识使用 该字段作为ES数据中的id
+ * @author zzy
+ * @create: 2021-07-12
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+@Documented
+@Inherited
+public @interface EsId {
+
+}

+ 26 - 0
module-common/src/main/java/cn/com/ctop/common/module/annotation/FieId.java

@@ -0,0 +1,26 @@
+package cn.com.ctop.common.module.annotation;
+
+import cn.com.ctop.common.module.enums.AnalyzerType;
+import cn.com.ctop.common.module.enums.FieldType;
+
+import java.lang.annotation.*;
+
+/**
+ * 作用在字段上,用于定义类型,映射关系
+ * @author zzy
+ * @create: 2021-07-12
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+@Documented
+@Inherited
+public @interface FieId {
+    FieldType type() default FieldType.TEXT;
+
+    /**
+     * 指定分词器
+     * @return
+     */
+    AnalyzerType analyzer() default AnalyzerType.STANDARD;
+
+}

+ 24 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/DataLabels.java

@@ -0,0 +1,24 @@
+package cn.com.ctop.common.module.entity;
+
+import cn.com.ctop.common.module.annotation.Document;
+import cn.com.ctop.common.module.annotation.EsId;
+import cn.com.ctop.common.module.annotation.FieId;
+
+import cn.com.ctop.common.module.enums.AnalyzerType;
+import cn.com.ctop.common.module.enums.FieldType;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@Document(index = "data_labels", type = "lable")
+public class DataLabels implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @EsId
+    @FieId(type = FieldType.KEYWORD)
+    private String id;
+    @FieId(type = FieldType.KEYWORD,analyzer = AnalyzerType.IK_SMART)
+    private String content;
+    @FieId(type = FieldType.KEYWORD)
+    private Integer size;
+}

+ 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;
 
     /**
      * 修改时间

+ 29 - 0
module-common/src/main/java/cn/com/ctop/common/module/enums/AnalyzerType.java

@@ -0,0 +1,29 @@
+package cn.com.ctop.common.module.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum AnalyzerType {
+    NO("不使用分词"),
+    /**
+     * 标准分词,默认分词器
+     */
+    STANDARD("standard"),
+
+    /**
+     * ik_smart:会做最粗粒度的拆分;已被分出的词语将不会再次被其它词语占有
+     */
+    IK_SMART("ik_smart"),
+
+    /**
+     * ik_max_word :会将文本做最细粒度的拆分;尽可能多的拆分出词语
+     */
+    IK_MAX_WORD("ik_max_word");
+
+    private String type;
+
+    AnalyzerType(String type) {
+        this.type = type;
+    }
+
+}

+ 40 - 0
module-common/src/main/java/cn/com/ctop/common/module/enums/FieldType.java

@@ -0,0 +1,40 @@
+package cn.com.ctop.common.module.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum FieldType {
+    /**
+     * text
+     */
+    TEXT("text"),
+
+    KEYWORD("keyword"),
+
+    INTEGER("integer"),
+
+    DOUBLE("double"),
+
+    DATE("date"),
+
+    /**
+     * 单条数据
+     */
+    OBJECT("object"),
+
+    /**
+     * 嵌套数组
+     */
+    NESTED("nested"),
+
+
+    ;
+
+
+    FieldType(String type) {
+        this.type = type;
+    }
+
+    private String type;
+
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 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);
 }

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

@@ -37,17 +37,27 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
 
     JSONObject getSwitchStatusByAccount(@Param("accountId") Long accountId);
 
-    List<Long>  queryAccountsByDeleteComment();
+    List<Long> queryAccountsByDeleteComment();
 
     String getCompanyNameByUserId(@Param("planId") String planId);
 
-    List<UserAllocation> listByMediaId(@Param("mediaId")String mediaId, @Param("accountStatus")Integer accountStatus);
+    List<UserAllocation> listByMediaId(@Param("mediaId") String mediaId, @Param("accountStatus") Integer accountStatus);
 
     List<JSONObject> getAccountListByProjectList(@Param("list") List list);
 
-    List<Long> getValidProjectIds(@Param("mediaId")  Integer mediaId);
+    List<Long> getValidProjectIds(@Param("mediaId") Integer mediaId);
 
-    List<UserAllocation> getAccountListByUserIdAndProductId(@Param("userId")String userId,@Param("projectId")Long projectId,@Param("productId")Long productId);
+    List<UserAllocation> getAccountListByUserIdAndProductId(@Param("userId") String userId, @Param("projectId") Long projectId, @Param("productId") Long productId);
 
     List<JSONObject> getUserIdListByProductId(@Param("productId") Long productId);
+
+    List<JSONObject> getByAccountIds(@Param("accountIds") JSONArray accountIds);
+
+    List<Long> getKuaiShouUserIdListByProjectId(@Param("projectId") Long projectId);
+
+    List<JSONObject> selectAccountsByKuaishouUserId(@Param("userId") Long userId);
+
+    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>

+ 52 - 8
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml

@@ -17,14 +17,14 @@
     <select id="getAccountListByUserIdAndProductId" resultType="cn.com.ctop.common.module.entity.UserAllocation">
         select cua.account_id, cua.auth_name, cua.user_name
         from ctop_user_allocation cua
-                 left join ctop_project cp on cua.project_id = cp.id
+        left join ctop_project cp on cua.project_id = cp.id
         where
-              cua.project_id = #{projectId}
-          and
-              cp.product_id=#{productId}
-          <if test="userId != null and userId != ''">
-              and cua.user_id = #{userId}
-          </if>
+        cua.project_id = #{projectId}
+        and
+        cp.product_id=#{productId}
+        <if test="userId != null and userId != ''">
+            and cua.user_id = #{userId}
+        </if>
 
     </select>
 
@@ -102,7 +102,7 @@
         SELECT project_id FROM ctop_user_allocation t1
         where account_status = 0
         <if test="mediaId != null">
-              AND media_id = #{mediaId}
+            AND media_id = #{mediaId}
         </if>
         GROUP BY project_id
     </select>
@@ -193,6 +193,50 @@
             and p.media_id = #{mediaId}
         </if>
     </select>
+    <select id="getByAccountIds" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        account_id as 'accountId',
+        auth_name as 'authName'
+        from ctop_user_allocation where
+        account_id in
+        <foreach collection="accountIds" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+
+
+    </select>
+    <select id="getKuaiShouUserIdListByProjectId" resultType="java.lang.Long">
+        select t2.user_id from ctop_user_allocation t1
+        left join  ctop_kuaishou_advertiser_base_info t2
+        on t1.account_id = t2.account_id
+        where t1.project_id = #{projectId}
+        group by t2.user_id
+    </select>
+    <select id="selectAccountsByKuaishouUserId" resultType="com.alibaba.fastjson.JSONObject">
+    SELECT
+	t2.account_id AS 'accountId',
+	t2.user_name AS 'userName',
+	t2.auth_name AS 'authName',
+	t2.account_status AS 'accountStatus'
+    FROM
+	ctop_kuaishou_advertiser_base_info t1
+    LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
+    WHERE
+	t1.user_id = #{userId}
+    AND t2.id IS NOT NULL;
 
+    </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>

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


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä