Bladeren bron

Merge branch 'test' into test-upload

# Conflicts:
#	module-common/src/main/java/cn/com/ctop/common/module/utils/ExportExcelUtils.java
yumeng 5 jaren geleden
bovenliggende
commit
4e2e1db86c
100 gewijzigde bestanden met toevoegingen van 5056 en 270 verwijderingen
  1. 1 1
      jeecg-boot-base-common/src/main/java/org/jeecg/common/system/query/QueryGenerator.java
  2. 7 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  3. 18 0
      jeecg-boot-module-system/pom.xml
  4. 0 2
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  5. 0 3
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ureport/PropertiesConfig.java
  6. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BindAccountLoginController.java
  7. 6 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceAdvertiserPostController.java
  8. 13 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java
  9. 212 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaInfoController.java
  10. 179 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaItemInfoController.java
  11. 164 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DramaRoleInfoController.java
  12. 293 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouAgentAccountController.java
  13. 3 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java
  14. 219 40
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  15. 37 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaInfo.java
  16. 89 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaItemInfo.java
  17. 77 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaRoleInfo.java
  18. 45 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BakDataBaseJob.java
  19. 0 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java
  20. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceCreativeDailyReportLoadJob.java
  21. 5 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java
  22. 2 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanHourlyReportLoadJob.java
  23. 20 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DataeyeJob.java
  24. 1 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DeleteCreativeStaticJob.java
  25. 33 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyCreativeReportLoadJob.java
  26. 78 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyLoadFileJob.java
  27. 41 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyReportTaskJob.java
  28. 38 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHistoryLoadFileJob.java
  29. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/DramaInfoMapper.java
  30. 15 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/DramaItemInfoMapper.java
  31. 15 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/DramaRoleInfoMapper.java
  32. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/DramaInfoMapper.xml
  33. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/DramaItemInfoMapper.xml
  34. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/DramaRoleInfoMapper.xml
  35. 14 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IDramaInfoService.java
  36. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IDramaItemInfoService.java
  37. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IDramaRoleInfoService.java
  38. 18 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaInfoServiceImpl.java
  39. 46 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaItemInfoServiceImpl.java
  40. 28 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaRoleInfoServiceImpl.java
  41. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/controller/QuartzJobController.java
  42. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java
  43. 5 4
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  44. 4 1
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  45. 3 1
      jeecg-boot-module-system/src/main/resources/application-test.yml
  46. 2 2
      jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties
  47. 155 3
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  48. 16 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/CtopOauthToken.java
  49. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/entity/UserAllocation.java
  50. 3 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/CtopAdConstant.java
  51. 78 3
      module-common/src/main/java/cn/com/ctop/common/module/utils/ExportExcelUtils.java
  52. 134 4
      module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java
  53. 149 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/JavacvUtil.java
  54. 3 2
      module-common/src/main/java/cn/com/ctop/common/module/utils/JsonUtil.java
  55. 16 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java
  56. 17 1
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/entity/DataeyeCompany.java
  57. 4 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/entity/DataeyeMedia.java
  58. 7 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/mapper/DataeyeCompanyMapper.java
  59. 8 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/DataeyeCompanyService.java
  60. 71 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeCompanyServiceImpl.java
  61. 3 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/KuaishouAppServiceImpl.java
  62. 248 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouDailyReportTaskController.java
  63. 164 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouReportTaskController.java
  64. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java
  65. 90 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouDailyReportTask.java
  66. 95 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouHistoryReportTask.java
  67. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouDailyReportTaskMapper.java
  68. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouHistoryReportTaskMapper.java
  69. 6 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCreativeMapper.xml
  70. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouDailyReportTaskMapper.xml
  71. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouHistoryReportTaskMapper.xml
  72. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouCampaignService.java
  73. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouDailyReportTaskService.java
  74. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouHistoryReportTaskService.java
  75. 4 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java
  76. 36 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCampaignServiceImpl.java
  77. 145 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouDailyReportTaskServiceImpl.java
  78. 249 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouHistoryReportTaskServiceImpl.java
  79. 134 57
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  80. 16 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java
  81. 134 8
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouReportDailyAgentSumController.java
  82. 108 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouAgentAccount.java
  83. 122 65
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAccount.java
  84. 71 25
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAgent.java
  85. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/ParamsDTO.java
  86. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/job/KuaishouAgentAccountJob.java
  87. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/job/KuaishouReportAgentJob.java
  88. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouAgentAccountMapper.java
  89. 4 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAccountMapper.java
  90. 6 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAgentSumMapper.java
  91. 2 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyCampaignMapper.java
  92. 4 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyCreativeMapper.java
  93. 2 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyGroupMapper.java
  94. 49 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouAgentAccountMapper.xml
  95. 487 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml
  96. 50 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAgentSumMapper.xml
  97. 67 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyCampaignMapper.xml
  98. 96 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyCreativeMapper.xml
  99. 70 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyGroupMapper.xml
  100. 0 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouAgentAccountService.java

+ 1 - 1
jeecg-boot-base-common/src/main/java/org/jeecg/common/system/query/QueryGenerator.java

@@ -357,7 +357,7 @@ public class QueryGenerator {
 			return;
 		}
 		name = oConvertUtils.camelToUnderline(name);
-		log.info("--查询规则-->"+name+" "+rule.getValue()+" "+value);
+//		log.info("--查询规则-->"+name+" "+rule.getValue()+" "+value);
 		switch (rule) {
 		case GT:
 			queryWrapper.gt(name, value);

+ 7 - 2
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -816,10 +816,15 @@ public class DateUtils extends PropertyEditorSupport {
      * @return
      * @throws ParseException
      */
-    public static String getAnotherDay(String format, String date, Integer num) throws ParseException {
+    public static String getAnotherDay(String format, String date, Integer num)  {
 
         SimpleDateFormat sdf = new SimpleDateFormat(format);
-        Date getDate = sdf.parse(date);
+        Date getDate = null;
+        try {
+            getDate = sdf.parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(getDate);
         calendar.add(Calendar.DAY_OF_MONTH, num);

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

@@ -145,6 +145,24 @@
             <artifactId>poi</artifactId>
             <version>3.17</version>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>3.17</version>
+        </dependency>
+        <dependency>
+        <groupId>org.apache.poi</groupId>
+        <artifactId>poi-ooxml-schemas</artifactId>
+        <version>3.17</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.bstek.ureport</groupId>
+            <artifactId>ureport2-core</artifactId>
+            <version>2.2.9</version>
+        </dependency>
         <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <!-- <dependency>
             <groupId>org.apache.poi</groupId>

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

@@ -143,8 +143,6 @@ public class ShiroConfig {
 		//爬虫接口
 		filterChainDefinitionMap.put("/graphql/video", "anon");
 		filterChainDefinitionMap.put("/ks/web/test", "anon");
-		filterChainDefinitionMap.put("/ctop/materialInfo/excellent/set", "anon");
-        filterChainDefinitionMap.put("/ctop/materialInfo/excellent/list", "anon");
         filterChainDefinitionMap.put("/ureport/**", "anon");
 
 		// 添加自己的过滤器并且取名为jwt

+ 0 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/config/ureport/PropertiesConfig.java

@@ -10,9 +10,6 @@ import org.springframework.core.io.ClassPathResource;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
-
-import static java.lang.System.setProperties;
-
 @Slf4j
 @Configuration
 @ConditionalOnBean(UReportConfig.class)

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

@@ -100,6 +100,7 @@ public class BindAccountLoginController {
             String mediaId = json.getString("mediaId");
             Long projectId = json.getLong("projectId");
             String projectName = json.getString("projectName");
+            String systemType = json.getString("systemType");
             UserAllocation userAllocation = new UserAllocation();
             userAllocation.setUserName(userName);
             userAllocation.setUserId(userId);
@@ -110,6 +111,7 @@ public class BindAccountLoginController {
             userAllocation.setProjectId(projectId);
             userAllocation.setProjectName(projectName);
             userAllocation.setMediaId(mediaId);
+            userAllocation.setSystemType(systemType);
             int i = userAllocationMapper.insert(userAllocation);
             if (i > 0) {
                 logger.info("用户分配入库完成,advertiserId:{}", advertiserId);

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

@@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -276,7 +277,11 @@ public class ByteDanceAdvertiserPostController {
         Map<String, Object> result = new HashMap<>();
         CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId + "");
         if (null != token && token.getMediaId() == CtopAdConstant.PLATFORM_TYPE_KUAISHOU) {
-            kuaishouInterfaceService.loadKuaishouDataSingle(token);
+            try {
+                kuaishouInterfaceService.loadKuaishouDataSingle(token);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
         } else {
             log.info("token异常");
         }

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

@@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.text.ParseException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -155,6 +156,7 @@ public class CallbackController {
                     Long projectId = json.getLong("projectId");
                     BigDecimal WarningProportion = json.getBigDecimal("WarningProportion");
                     BigDecimal WarningAmount = json.getBigDecimal("WarningAmount");
+                    String systemType = json.getString("systemType");
 
                     CtopOauthToken topOauthToken = new CtopOauthToken();
                     topOauthToken.setId(String.valueOf(accountId));
@@ -188,6 +190,7 @@ public class CallbackController {
                     userAllocation.setUserName(userName);
                     userAllocation.setUserId(userId);
                     userAllocation.setAdvertiserId(advertiserId);
+                    userAllocation.setSystemType(systemType);
                     // 获取快手昵称
                     Map<String, Object> advertiseBaseInfoMap = kuaishouInterfaceService.advertiserInfo(accountId, token.getAccessToken());
                     if ((Integer) advertiseBaseInfoMap.get("code") == 0) {
@@ -218,7 +221,11 @@ public class CallbackController {
                     Thread t = new Thread() {
                         @Override
                         public void run() {
-                            kuaishouInterfaceService.loadKuaishouDataSingle(topOauthToken);
+                            try {
+                                kuaishouInterfaceService.loadKuaishouDataSingle(topOauthToken);
+                            } catch (ParseException e) {
+                                e.printStackTrace();
+                            }
                         }
                     };
                     t.start();
@@ -244,6 +251,8 @@ public class CallbackController {
             if (code == 0) {
                 return "授权绑定成功";
             }
+            logger.info("返回信息:{}", map.toString());
+            return (String) map.get("desc");
         }
         return "授权绑定失败";
     }
@@ -311,8 +320,10 @@ public class CallbackController {
             if (!Check.isNull(checkUserAllocation)) {
                 returnMap.put("code", -1);
                 returnMap.put("desc", "授权失败,账号已被:" + checkUserAllocation.getUserName() + "绑定");
+                return returnMap;
             }
 
+            String systemType = json.getString("systemType");
             UserAllocation userAllocation = new UserAllocation();
             userAllocation.setUserId(userId);
             userAllocation.setUserName(userName);
@@ -321,6 +332,7 @@ public class CallbackController {
             userAllocation.setMediaId(mediaId);
             userAllocation.setProjectId(projectId);
             userAllocation.setProjectName(projectName);
+            userAllocation.setSystemType(systemType);
             userAllocation.setAuthName((String) advertiserDataMap.get("name"));
             userAllocation.setAdvertiserId(advertiserId);
             userAllocation.setWarningProportion(WarningProportion);
@@ -335,7 +347,6 @@ public class CallbackController {
             int i = allocationMapper.insert(userAllocation);
             if (i > 0) {
                 logger.info("同步分配用户表完成,task_id:{},accountId:{}", state, token.getAccountId());
-
             }
             //账号绑定
             bindAccountAuthService.addBindAccount(token.getAccountId(), KuaishouInterfaceConstant.LOGIN_TYPE_BYTEDANCE, advertiserId);
@@ -345,7 +356,6 @@ public class CallbackController {
             e.printStackTrace();
             returnMap.put("code", -1);
             returnMap.put("desc", "回调token异常");
-
         }
         return returnMap;
     }

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

@@ -0,0 +1,212 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+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.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.ctop.entity.DramaInfo;
+import org.jeecg.modules.ctop.entity.DramaItemInfo;
+import org.jeecg.modules.ctop.entity.DramaRoleInfo;
+import org.jeecg.modules.ctop.service.IDramaInfoService;
+import org.jeecg.modules.ctop.service.IDramaItemInfoService;
+import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
+import org.jeecg.modules.system.entity.SysCategory;
+import org.jeecg.modules.system.service.ISysCategoryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.*;
+
+/**
+ * 剧本信息
+ * @author jeecg-boot
+ * @date   2020-03-04
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="剧本信息")
+@RestController
+@RequestMapping("/ctop/dramaInfo")
+public class DramaInfoController {
+	@Autowired
+	private IDramaInfoService dramaInfoService;
+	@Autowired
+	private IDramaItemInfoService dramaItemInfoService;
+	@Autowired
+	private IDramaRoleInfoService dramaRoleInfoService;
+	@Autowired
+	private ISysCategoryService categoryService;
+
+	@GetMapping("/detail")
+	public Map<String, Object> getDetail(Long dramaId) {
+		Map<String, Object> result = new HashMap<>();
+		List<DramaItemInfo> itemInfos = dramaItemInfoService.getByDramaId(dramaId);
+		List<DramaRoleInfo> roleInfos = dramaRoleInfoService.getByDramaId(dramaId);
+		List<DramaRoleInfo> returnRoleInfos = new ArrayList<>();
+		DramaRoleInfo dramaRoleInfo1 = new DramaRoleInfo("情节描述", "scence");
+		returnRoleInfos.add(dramaRoleInfo1);
+		if (null != roleInfos && roleInfos.size() > 0) {
+			for (DramaRoleInfo roleInfo : roleInfos) {
+				roleInfo.setButtonType("dialogue_" + roleInfo.getId());
+				returnRoleInfos.add(roleInfo);
+			}
+		}
+		DramaRoleInfo dramaRoleInfo2 = new DramaRoleInfo("创建角色", "createRole");
+		returnRoleInfos.add(dramaRoleInfo2);
+		result.put("itemInfos", itemInfos);
+		result.put("roleInfos", returnRoleInfos);
+		ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+		return result;
+	}
+	/**
+	  * 分页列表查询
+	 * @param dramaInfo
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "剧本信息-分页列表查询")
+	@ApiOperation(value="剧本信息-分页列表查询", notes="剧本信息-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<DramaInfo>> queryPageList(DramaInfo dramaInfo,
+												  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+												  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+												  HttpServletRequest req) {
+		Result<IPage<DramaInfo>> result = new Result<IPage<DramaInfo>>();
+		QueryWrapper<DramaInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaInfo, req.getParameterMap());
+		Page<DramaInfo> page = new Page<DramaInfo>(pageNo, pageSize);
+		IPage<DramaInfo> pageList = dramaInfoService.page(page, queryWrapper);
+		if (pageList != null && pageList.getRecords() != null && pageList.getRecords().size() > 0) {
+			List<DramaInfo> list = new ArrayList<>();
+			for (int i = 0; i < pageList.getRecords().size(); i++) {
+				DramaInfo getDramaInfo = pageList.getRecords().get(i);
+				SysCategory sysCategory = categoryService.getById(getDramaInfo.getCategory());
+				if (sysCategory != null) {
+					getDramaInfo.setCategory(sysCategory.getName());
+				}
+				list.add(getDramaInfo);
+			}
+			pageList.setRecords(list);
+		}
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param dramaInfo
+	 * @return
+	 */
+	@AutoLog(value = "剧本信息-添加")
+	@ApiOperation(value="剧本信息-添加", notes="剧本信息-添加")
+	@PostMapping(value = "/add")
+	public Result<DramaInfo> add(@RequestBody DramaInfo dramaInfo) {
+		Result<DramaInfo> result = new Result<>();
+		try {
+			// 获取登录用户信息
+			LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+			dramaInfo.setUserId(sysUser.getId());
+			dramaInfo.setUserName(sysUser.getUsername());
+			dramaInfo.setUpdateTime(new Date());
+			dramaInfoService.save(dramaInfo);
+
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param dramaInfo
+	 * @return
+	 */
+	@AutoLog(value = "剧本信息-编辑")
+	@ApiOperation(value="剧本信息-编辑", notes="剧本信息-编辑")
+	@PostMapping(value = "/edit")
+	public Result<DramaInfo> edit(@RequestBody DramaInfo dramaInfo) {
+		Result<DramaInfo> result = new Result<DramaInfo>();
+		DramaInfo dramaInfoEntity = dramaInfoService.getById(dramaInfo.getId());
+		if(dramaInfoEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = dramaInfoService.updateById(dramaInfo);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "剧本信息-通过id删除")
+	@ApiOperation(value="剧本信息-通过id删除", notes="剧本信息-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			dramaInfoService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "剧本信息-批量删除")
+	@ApiOperation(value="剧本信息-批量删除", notes="剧本信息-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<DramaInfo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<DramaInfo> result = new Result<DramaInfo>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.dramaInfoService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "剧本信息-通过id查询")
+	@ApiOperation(value="剧本信息-通过id查询", notes="剧本信息-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<DramaInfo> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<DramaInfo> result = new Result<DramaInfo>();
+		DramaInfo dramaInfo = dramaInfoService.getById(id);
+		if(dramaInfo==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(dramaInfo);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -0,0 +1,179 @@
+package org.jeecg.modules.ctop.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.ctop.entity.DramaItemInfo;
+import org.jeecg.modules.ctop.service.IDramaItemInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+/**
+ * 剧本内容信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-06
+ */
+@Slf4j
+@Api(tags = "剧本内容信息")
+@RestController
+@RequestMapping("/ctop/dramaItemInfo")
+public class DramaItemInfoController {
+    @Autowired
+    private IDramaItemInfoService dramaItemInfoService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param dramaItemInfo
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-分页列表查询")
+    @ApiOperation(value = "剧本内容信息-分页列表查询", notes = "剧本内容信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<DramaItemInfo>> queryPageList(DramaItemInfo dramaItemInfo,
+                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                      HttpServletRequest req) {
+        Result<IPage<DramaItemInfo>> result = new Result<IPage<DramaItemInfo>>();
+        QueryWrapper<DramaItemInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaItemInfo, req.getParameterMap());
+        Page<DramaItemInfo> page = new Page<DramaItemInfo>(pageNo, pageSize);
+        IPage<DramaItemInfo> pageList = dramaItemInfoService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param dramaItemInfo
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-添加")
+    @ApiOperation(value = "剧本内容信息-添加", notes = "剧本内容信息-添加")
+    @PostMapping(value = "/add")
+    public Result<DramaItemInfo> add(@RequestBody DramaItemInfo dramaItemInfo) {
+        Result<DramaItemInfo> result = new Result<>();
+        try {
+            String buttonType = dramaItemInfo.getButtonType();
+            if (buttonType.startsWith("dialogue")) {
+                dramaItemInfo.setType("dialogue");
+                String[] infos = buttonType.split("_");
+                dramaItemInfo.setRoleId(Long.parseLong(infos[1]));
+            } else if (buttonType.startsWith("scence")) {
+                dramaItemInfo.setType("scence");
+            }
+            dramaItemInfoService.save(dramaItemInfo);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param dramaItemInfo
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-编辑")
+    @ApiOperation(value = "剧本内容信息-编辑", notes = "剧本内容信息-编辑")
+    @PostMapping(value = "/edit")
+    public Result<DramaItemInfo> edit(@RequestBody DramaItemInfo dramaItemInfo) {
+        Result<DramaItemInfo> result = new Result<>();
+        DramaItemInfo dramaItemInfoEntity = dramaItemInfoService.getById(dramaItemInfo.getId());
+        if (dramaItemInfoEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            String buttonType = dramaItemInfo.getButtonType();
+            if (buttonType.startsWith("dialogue")) {
+                dramaItemInfo.setType("dialogue");
+                String[] infos = buttonType.split("_");
+                dramaItemInfo.setRoleId(Long.parseLong(infos[1]));
+            } else if (buttonType.startsWith("scence")) {
+                dramaItemInfo.setType("scence");
+            }
+            boolean ok = dramaItemInfoService.updateById(dramaItemInfo);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-通过id删除")
+    @ApiOperation(value = "剧本内容信息-通过id删除", notes = "剧本内容信息-通过id删除")
+    @PostMapping(value = "/delete")
+    public Result<?> delete(@RequestBody DramaItemInfo dramaItemInfo) {
+        try {
+            dramaItemInfoService.removeById(dramaItemInfo.getId());
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-批量删除")
+    @ApiOperation(value = "剧本内容信息-批量删除", notes = "剧本内容信息-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<DramaItemInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<DramaItemInfo> result = new Result<DramaItemInfo>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.dramaItemInfoService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "剧本内容信息-通过id查询")
+    @ApiOperation(value = "剧本内容信息-通过id查询", notes = "剧本内容信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<DramaItemInfo> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<DramaItemInfo> result = new Result<DramaItemInfo>();
+        DramaItemInfo dramaItemInfo = dramaItemInfoService.getById(id);
+        if (dramaItemInfo == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(dramaItemInfo);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+}

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

@@ -0,0 +1,164 @@
+package org.jeecg.modules.ctop.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.ctop.entity.DramaRoleInfo;
+import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+/**
+ * 剧本角色信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-05
+ */
+@Slf4j
+@Api(tags = "剧本角色信息")
+@RestController
+@RequestMapping("/ctop/dramaRoleInfo")
+public class DramaRoleInfoController {
+    @Autowired
+    private IDramaRoleInfoService dramaRoleInfoService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param dramaRoleInfo
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "剧本角色信息-分页列表查询")
+    @ApiOperation(value = "剧本角色信息-分页列表查询", notes = "剧本角色信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<DramaRoleInfo>> queryPageList(DramaRoleInfo dramaRoleInfo,
+                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                      HttpServletRequest req) {
+        Result<IPage<DramaRoleInfo>> result = new Result<IPage<DramaRoleInfo>>();
+        QueryWrapper<DramaRoleInfo> queryWrapper = QueryGenerator.initQueryWrapper(dramaRoleInfo, req.getParameterMap());
+        Page<DramaRoleInfo> page = new Page<DramaRoleInfo>(pageNo, pageSize);
+        IPage<DramaRoleInfo> pageList = dramaRoleInfoService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param dramaRoleInfo
+     * @return
+     */
+    @AutoLog(value = "剧本角色信息-添加")
+    @ApiOperation(value = "剧本角色信息-添加", notes = "剧本角色信息-添加")
+    @PostMapping(value = "/add")
+    public Result<DramaRoleInfo> add(@RequestBody DramaRoleInfo dramaRoleInfo) {
+        Result<DramaRoleInfo> result = new Result<DramaRoleInfo>();
+        try {
+            dramaRoleInfoService.save(dramaRoleInfo);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param dramaRoleInfo
+     * @return
+     */
+    @AutoLog(value = "剧本角色信息-编辑")
+    @ApiOperation(value = "剧本角色信息-编辑", notes = "剧本角色信息-编辑")
+    @PutMapping(value = "/edit")
+    public Result<DramaRoleInfo> edit(@RequestBody DramaRoleInfo dramaRoleInfo) {
+        Result<DramaRoleInfo> result = new Result<DramaRoleInfo>();
+        DramaRoleInfo dramaRoleInfoEntity = dramaRoleInfoService.getById(dramaRoleInfo.getId());
+        if (dramaRoleInfoEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = dramaRoleInfoService.updateById(dramaRoleInfo);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "剧本角色信息-通过id删除")
+    @ApiOperation(value = "剧本角色信息-通过id删除", notes = "剧本角色信息-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            dramaRoleInfoService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "剧本角色信息-批量删除")
+    @ApiOperation(value = "剧本角色信息-批量删除", notes = "剧本角色信息-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<DramaRoleInfo> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<DramaRoleInfo> result = new Result<DramaRoleInfo>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.dramaRoleInfoService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "剧本角色信息-通过id查询")
+    @ApiOperation(value = "剧本角色信息-通过id查询", notes = "剧本角色信息-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<DramaRoleInfo> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<DramaRoleInfo> result = new Result<DramaRoleInfo>();
+        DramaRoleInfo dramaRoleInfo = dramaRoleInfoService.getById(id);
+        if (dramaRoleInfo == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(dramaRoleInfo);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+}

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

@@ -0,0 +1,293 @@
+package org.jeecg.modules.ctop.controller;
+
+import java.io.OutputStream;
+import java.util.*;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.util.oConvertUtils;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouAgentAccount;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouAgentAccountService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+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.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+ /**
+ * 快手代理商账户表
+ * @author jeecg-boot
+ * @date   2020-03-03
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="快手代理商账户表")
+@RestController
+@RequestMapping("/kuaishou/kuaishouAgentAccount")
+public class KuaishouAgentAccountController {
+	@Autowired
+	private IKuaishouAgentAccountService kuaishouAgentAccountService;
+	
+	/**
+	  * 分页列表查询
+	 * @param kuaishouAgentAccount
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "快手代理商账户表-分页列表查询")
+	@ApiOperation(value="快手代理商账户表-分页列表查询", notes="快手代理商账户表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<KuaishouAgentAccount>> queryPageList(KuaishouAgentAccount kuaishouAgentAccount,
+									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									  HttpServletRequest req) {
+		Result<IPage<KuaishouAgentAccount>> result = new Result<IPage<KuaishouAgentAccount>>();
+		QueryWrapper<KuaishouAgentAccount> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouAgentAccount, req.getParameterMap());
+		Page<KuaishouAgentAccount> page = new Page<KuaishouAgentAccount>(pageNo, pageSize);
+		IPage<KuaishouAgentAccount> pageList = kuaishouAgentAccountService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+	
+	/**
+	  *   添加
+	 * @param kuaishouAgentAccount
+	 * @return
+	 */
+	@AutoLog(value = "快手代理商账户表-添加")
+	@ApiOperation(value="快手代理商账户表-添加", notes="快手代理商账户表-添加")
+	@PostMapping(value = "/add")
+	public Result<KuaishouAgentAccount> add(@RequestBody KuaishouAgentAccount kuaishouAgentAccount) {
+		Result<KuaishouAgentAccount> result = new Result<KuaishouAgentAccount>();
+		try {
+			kuaishouAgentAccountService.save(kuaishouAgentAccount);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+	
+	/**
+	  *  编辑
+	 * @param kuaishouAgentAccount
+	 * @return
+	 */
+	@AutoLog(value = "快手代理商账户表-编辑")
+	@ApiOperation(value="快手代理商账户表-编辑", notes="快手代理商账户表-编辑")
+	@PutMapping(value = "/edit")
+	public Result<KuaishouAgentAccount> edit(@RequestBody KuaishouAgentAccount kuaishouAgentAccount) {
+		Result<KuaishouAgentAccount> result = new Result<KuaishouAgentAccount>();
+		KuaishouAgentAccount kuaishouAgentAccountEntity = kuaishouAgentAccountService.getById(kuaishouAgentAccount.getId());
+		if(kuaishouAgentAccountEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = kuaishouAgentAccountService.updateById(kuaishouAgentAccount);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "快手代理商账户表-通过id删除")
+	@ApiOperation(value="快手代理商账户表-通过id删除", notes="快手代理商账户表-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			kuaishouAgentAccountService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+	
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "快手代理商账户表-批量删除")
+	@ApiOperation(value="快手代理商账户表-批量删除", notes="快手代理商账户表-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<KuaishouAgentAccount> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<KuaishouAgentAccount> result = new Result<KuaishouAgentAccount>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.kuaishouAgentAccountService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+	
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "快手代理商账户表-通过id查询")
+	@ApiOperation(value="快手代理商账户表-通过id查询", notes="快手代理商账户表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<KuaishouAgentAccount> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<KuaishouAgentAccount> result = new Result<KuaishouAgentAccount>();
+		KuaishouAgentAccount kuaishouAgentAccount = kuaishouAgentAccountService.getById(id);
+		if(kuaishouAgentAccount==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(kuaishouAgentAccount);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public void exportXls(HttpServletRequest request, HttpServletResponse response) throws Exception{
+      // Step.1 组装查询条件
+      QueryWrapper<KuaishouAgentAccount> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              KuaishouAgentAccount kuaishouAgentAccount = JSON.parseObject(deString, KuaishouAgentAccount.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(kuaishouAgentAccount, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<KuaishouAgentAccount> pageList = kuaishouAgentAccountService.list(queryWrapper);
+	  List<List<Object>> result = new ArrayList<>();
+      if(pageList != null && pageList.size() > 0){
+      	for (KuaishouAgentAccount kuaishouAgentAccount : pageList){
+			List<Object> rowData = new ArrayList<>();
+			rowData.add(kuaishouAgentAccount.getId());
+			rowData.add(kuaishouAgentAccount.getUserId());
+			rowData.add(kuaishouAgentAccount.getAccountName());
+			rowData.add(kuaishouAgentAccount.getBalance());
+			rowData.add(kuaishouAgentAccount.getCreditBalance());
+			rowData.add(kuaishouAgentAccount.getRebate());
+			rowData.add(kuaishouAgentAccount.getContractRebate());
+			rowData.add(kuaishouAgentAccount.getDirectRebate());
+			rowData.add(kuaishouAgentAccount.getTotalBalance());
+			rowData.add(kuaishouAgentAccount.getCorporationName());
+			if(kuaishouAgentAccount.getReviewStatus() == 1){
+				rowData.add("审核中");
+			}else if(kuaishouAgentAccount.getReviewStatus() == 2){
+				rowData.add("审核通过");
+			}else if(kuaishouAgentAccount.getReviewStatus() == 3){
+				rowData.add("审核拒绝");
+			}
+			result.add(rowData);
+		}
+	  }
+	  String[] accountHeaders = {"广告主ID", "用户ID", "广告主名称", "现金余额", "信用余额", "返点余额", "框返余额", "激励余额", "总余额", "公司名称", "审核状态"};
+	  OutputStream os = response.getOutputStream();
+	  ExportExcelUtils eeu = new ExportExcelUtils();
+	  XSSFWorkbook workbook = new XSSFWorkbook();
+	  eeu.exportExcel(workbook, 0, "账户列表", accountHeaders, result);
+	  this.setResponseHeader(response, "快手代理商账户列表.xls");
+	  workbook.write(os);
+	  os.flush();
+	  os.close();
+//      //导出文件名称
+//      mv.addObject(NormalExcelConstants.FILE_NAME, "快手代理商账户表列表");
+//      mv.addObject(NormalExcelConstants.CLASS, KuaishouAgentAccount.class);
+//      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("快手代理商账户表列表数据", "导出人:Jeecg", "导出信息"));
+//      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+//      return mv;
+  }
+	 //发送响应流方法
+	 public void setResponseHeader(HttpServletResponse response, String fileName) {
+		 try {
+			 try {
+				 fileName = new String(fileName.getBytes(), "ISO8859-1");
+			 } catch (UnsupportedEncodingException e) {
+				 e.printStackTrace();
+			 }
+			 response.setContentType("application/octet-stream;charset=ISO8859-1");
+			 response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
+			 response.addHeader("Pargam", "no-cache");
+			 response.addHeader("Cache-Control", "no-cache");
+		 } catch (Exception ex) {
+			 ex.printStackTrace();
+		 }
+	 }
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<KuaishouAgentAccount> listKuaishouAgentAccounts = ExcelImportUtil.importExcel(file.getInputStream(), KuaishouAgentAccount.class, params);
+              kuaishouAgentAccountService.saveBatch(listKuaishouAgentAccounts);
+              return Result.ok("文件导入成功!数据行数:" + listKuaishouAgentAccounts.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+
+}

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

@@ -124,7 +124,9 @@ public class ProjectController {
                     for (ProjectMember member : projectMemberList) {
                         Long projectId = member.getProjectId();
                         Project project = projectService.getById(projectId);
-                        projects.add(project);
+                        if (null != project) {
+                            projects.add(project);
+                        }
                     }
                 }
             } else {

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

@@ -13,8 +13,14 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCampaignService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeStatisticMapper;
 import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -34,6 +40,8 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+import static org.jeecg.common.util.DateUtils.getAnotherDay;
+
 /**
  * @author jeecg-boot
  */
@@ -48,6 +56,8 @@ public class TestController {
 
     @Autowired
     private CtopOauthTokenMapper oauthTokenMapper;
+    @Autowired
+    private IKuaiShouHistoryReportTaskService historyReportTaskService;
 
     @PostMapping(value = "/create")
     public Map<String, Object> authorization(@RequestBody JSONObject jsonObject) {
@@ -79,6 +89,57 @@ public class TestController {
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
 
+
+
+    @GetMapping(value = "/getHistoryData")
+    public String getHistoryData() {
+        Result<String> result = new Result<String>();
+        try {
+            String endDateStr = DateUtils.getDate("yyyy-MM-dd");
+            String startDate = DateUtils.addMonth(endDateStr, -6);
+            QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
+            tokenQueryWrapper.eq("media_id", 2);
+            System.err.println(startDate);
+            System.err.println(endDateStr);
+
+
+            List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(tokenQueryWrapper);
+            if (!Check.isNull(ctopOauthTokens)) {
+                for (CtopOauthToken token : ctopOauthTokens) {
+                    historyReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), startDate, endDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
+                }
+
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return "success";
+    }
+
+
+    @GetMapping(value = "/getTaskList")
+    public String getTaskList() {
+        Result<String> result = new Result<String>();
+        try {
+            String endDateStr = DateUtils.getDate("yyyy-MM-dd");
+            String startDate = DateUtils.addMonth(endDateStr, -6);
+            QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
+            tokenQueryWrapper.eq("media_id", 2);
+            System.err.println(startDate);
+            System.err.println(endDateStr);
+
+
+            historyReportTaskService.getTaskList();
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+        }
+        return "success";
+    }
+
     @GetMapping(value = "/getGroupData")
     public String getGroupData() {
 
@@ -160,60 +221,181 @@ public class TestController {
 
     }
 
+    @GetMapping("checkFile")
+    public Map<String, Object> checkFile() {
+        String nowDate = DateUtils.getDate("yyyy-MM-dd");
+        String statDate = getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        //  查询快手token
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取快手数据异常:未获取到可用的token");
+        }
+        for (CtopOauthToken token : tokens) {
+            dailyReportTaskService.getTaskList(token.getAccountId(), token.getAccessToken(), statDate);
+        }
+        Map<String, Object> result = new HashMap<>();
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Autowired
+    private IKuaiShouDailyReportTaskService dailyReportTaskService;
+
 
-    @GetMapping(value = "/gerCreativeReport")
-    public void gerCreativeReport() {
+    @Autowired
+    private IKuaiShouCampaignService campaignService;
+
+    @GetMapping(value = "/getCreativeReportByAccount")
+    public void gerCreativeReportByAccount(Long accountId, String startDateStr, String endDateStr) {
         Thread thread = new Thread() {
             @SneakyThrows
             @Override
             public void run() {
                 SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
-                Date startDate = sim.parse("2020-02-10");
-                Date endDate = sim.parse("2020-02-11");
+                Date startDate = sim.parse(startDateStr);
+                Date endDate = sim.parse(endDateStr);
                 //1:查询当日数据
                 //executorService = Executors.newFixedThreadPool(3);
                 QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
                 oauthTokenQueryWrapper.eq("media_id", 2);
-                List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(oauthTokenQueryWrapper);
-                for (CtopOauthToken token : ctopOauthTokens) {
+                oauthTokenQueryWrapper.eq("account_id", accountId);
+                CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
+
+                System.err.println("创意报表accountId:" + ctopOauthToken.getAccountId());
+                QueryWrapper<KuaiShouCampaign> campaignQueryWrapper = new QueryWrapper<>();
+                campaignQueryWrapper.eq("account_id", accountId);
+                List<KuaiShouCampaign> list = campaignService.list(campaignQueryWrapper);
+                if (!Check.isNull(list)) {
+                    for (KuaiShouCampaign campaign : list) {
+                        kuaishouInterfaceService.getAdvertiserCreativeReportDailyV2(campaign.getCampaignId(), ctopOauthToken, startDate, endDate);
+
+                    }
+
+                }
+
+
+            }
+        };
+        thread.start();
+    }
+
+
+    @Autowired
+    private IUserAllocationService userAllocationService;
+    @Autowired
+    private KuaishouReportDailyCreativeStatisticMapper reportDailyCreativeStatisticMapper;
+
+
+    @Autowired
+    private KuaishouReportDailyCreativeMapper reportDailyCreativeMapper;
+
+    @GetMapping(value = "/getCreativeReportByProjectId")
+    public void getCreativeReportByProjectId(Long projectId) {
+
+        try {
+            Map<String, Object> deleteMap = new HashMap<>();
+            String date = DateUtils.getDate("yyyy-MM-dd");
+            String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", date, -1);
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            Date endDate = simpleDateFormat.parse(anotherDay);
+            QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
+            userAllocationQueryWrapper.eq("project_id", projectId);
+            List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
+            if (!Check.isNull(list)) {
+                for (UserAllocation allocation : list) {
                     executorService.submit(new Runnable() {
                         @Override
                         public void run() {
-                            System.err.println("创意报表accountId:" + token.getAccountId());
-                            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, startDate, endDate);
+                            if (!Check.isNull(allocation)) {
+                                log.info("账号id:{}", allocation.getAccountId());
+
+                                QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
+                                oauthTokenQueryWrapper.eq("media_id", 2);
+                                oauthTokenQueryWrapper.eq("account_id", allocation.getAccountId());
+                                CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
+                                if (!Check.isNull(ctopOauthToken)) {
+                                    deleteMap.put("account_id", allocation.getAccountId());
+                                    deleteMap.put("stat_date", anotherDay);
+                                    //   reportDailyCreativeStatisticMapper.deleteByMap(deleteMap);
+                                    //  reportDailyCreativeMapper.deleteByMap(deleteMap);
+
+                                    // 1.计划数据
+                                    log.info("获取计划,账号id:{}", allocation.getAccountId());
+                                    kuaishouInterfaceService.getCampaignList(ctopOauthToken, null, null);
+                                    // 2:广告组数据
+                                    log.info("获取广告组,账号id:{}", allocation.getAccountId());
+                                    kuaishouInterfaceService.getGroupList(ctopOauthToken, null, null);
+                                    // 3:创意数据
+                                    log.info("获取创意,账号id:{}", allocation.getAccountId());
+                                    kuaishouInterfaceService.getCreativeList(ctopOauthToken, null, null);
+
+                                    QueryWrapper<KuaiShouCampaign> campaignQueryWrapper = new QueryWrapper<>();
+                                    campaignQueryWrapper.eq("account_id", ctopOauthToken.getAccountId());
+                                    log.info("获取创意报表,账号id:{}", allocation.getAccountId());
+                                    List<KuaiShouCampaign> campaigns = campaignService.list(campaignQueryWrapper);
+                                    if (!Check.isNull(campaigns)) {
+                                        for (KuaiShouCampaign campaign : campaigns) {
+                                            kuaishouInterfaceService.getAdvertiserCreativeReportDailyV2(campaign.getCampaignId(), ctopOauthToken, endDate, endDate);
+                                        }
+                                    }
+                                }
+                            }
+
                         }
                     });
 
 
                 }
             }
-        };
-        thread.start();
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    public static void main(String[] args) throws ParseException {
+        String date = DateUtils.getDate("yyyy-MM-dd");
+        String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", date, -1);
+        System.err.println(anotherDay);
     }
 
-    @GetMapping(value = "/gerCreativeByAccount")
+
+    @GetMapping(value = "/getPlanAndGroupByAccount")
+    public void getPlanAndGroupByAccount(Long accountId) {
+        QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
+        oauthTokenQueryWrapper.eq("media_id", 2);
+        oauthTokenQueryWrapper.eq("account_id", accountId);
+        oauthTokenQueryWrapper.last("limit 1");
+        CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
+        try {
+            System.err.println("获取计划,广告组:" + accountId);
+            kuaishouInterfaceService.getCampaignList(token, null, null);
+            //1:获取全量广告组数据
+            kuaishouInterfaceService.getGroupList(token, null, null);
+            System.err.println("获取计划,广告组:" + accountId);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+
+    }
+
+
+    @GetMapping(value = "/getCreativeByAccount")
     public void gerCreative(Long accountId) {
         QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
         oauthTokenQueryWrapper.eq("media_id", 2);
         oauthTokenQueryWrapper.eq("account_id", accountId);
         oauthTokenQueryWrapper.last("limit 1");
         CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
-        executorService.submit(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    System.err.println("获取创意,accountId:" + token.getAccountId());
-                    kuaishouInterfaceService.getCreativeList(token, null, null);
-                    //  kuaishouInterfaceService.getVideoList2(token, null, null,1);
-                    //3: 获取图片信息数据
-                    // kuaishouInterfaceService.getImageList2(token, null, null,1);
-                    Thread.sleep(1 * 200);
-                    //  kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
-        });
+
+        try {
+            System.err.println("获取创意,accountId:" + token.getAccountId());
+            kuaishouInterfaceService.getCreativeList(token, null, null);
+            System.err.println("获取创意结束,accountId:" + token.getAccountId());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
 
     }
@@ -235,16 +417,23 @@ public class TestController {
                 oauthTokenQueryWrapper.eq("account_id", accountId);
                 CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
                 System.err.println("创意报表accountId:" + ctopOauthToken.getAccountId());
-                kuaishouInterfaceService.getAdvertiserCreativeReportDaily(ctopOauthToken, startDate, endDate);
 
 
+                QueryWrapper<KuaiShouCampaign> campaignQueryWrapper = new QueryWrapper<>();
+                campaignQueryWrapper.eq("account_id", ctopOauthToken.getAccountId());
+
+                List<KuaiShouCampaign> campaigns = campaignService.list(campaignQueryWrapper);
+                if (!Check.isNull(campaigns)) {
+                    for (KuaiShouCampaign campaign : campaigns) {
+                        kuaishouInterfaceService.getAdvertiserCreativeReportDailyV2(campaign.getCampaignId(), ctopOauthToken, endDate, endDate);
+                    }
+                }
+
             }
         };
         thread.start();
     }
 
-    @Autowired
-    private IUserAllocationService userAllocationService;
 
     @Autowired
     private IBytedancePlanDailyReportService planDailyReportService;
@@ -333,7 +522,6 @@ public class TestController {
             log.info("定时获取头条数据异常:为获取到可用的token");
         }
         tokens.forEach(token -> {
-            //3:获取广告计划信息数据
             advertiserDataService.getMaterialList(token);
         });
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
@@ -418,7 +606,6 @@ public class TestController {
             executorService.submit(new Runnable() {
                 @Override
                 public void run() {
-                    //1: 获取广告主信息数据
                     reportService.getAdvertiserReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
                 }
             });
@@ -465,12 +652,6 @@ public class TestController {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
-        //清洗关于缘多多数据
-        planDailyReportService.cleanYddData(113, finalGetDate);
-        //清洗关于交友数据
-        planDailyReportService.cleanYddData(112, finalGetDate);
-        //清洗关于附近约会数据
-        planDailyReportService.cleanYddData(222, finalGetDate);
         log.info("头条计划时报数据获取完成");
         Map<String, Object> result = new HashMap<>();
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
@@ -655,7 +836,5 @@ public class TestController {
                 }
             }
         });
-
-
     }
 }

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

@@ -0,0 +1,37 @@
+package org.jeecg.modules.ctop.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * 剧本信息
+ * @author jeecg-boot
+ * @date   2020-03-04
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_drama_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_drama_info对象", description="剧本信息")
+public class DramaInfo {
+	@TableId(type = IdType.AUTO)
+	private Long id;
+	private String userId;
+	private String category;
+	private String dramaName;
+	private String tag;
+	private String userName;
+	private Integer nonpublic;
+	private String introduction;
+	private Integer status;
+	private Date createTime;
+	private Date updateTime;
+}

+ 89 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaItemInfo.java

@@ -0,0 +1,89 @@
+package org.jeecg.modules.ctop.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 剧本内容信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-06
+ */
+@Data
+@TableName("ctop_drama_item_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_drama_item_info对象", description = "剧本内容信息")
+public class DramaItemInfo {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 元素类型1:描述 2:对话
+     */
+    @Excel(name = "元素类型1:描述 2:对话", width = 15)
+    @ApiModelProperty(value = "元素类型1:描述 2:对话")
+    private String type;
+    /**
+     * 剧本id
+     */
+    @Excel(name = "剧本id", width = 15)
+    @ApiModelProperty(value = "剧本id")
+    private Long dramaId;
+    /**
+     * roleId
+     */
+    @Excel(name = "roleId", width = 15)
+    @ApiModelProperty(value = "roleId")
+    private Long roleId;
+    /**
+     * content
+     */
+    @Excel(name = "content", width = 15)
+    @ApiModelProperty(value = "content")
+    private String content;
+    /**
+     * 排序号
+     */
+    @Excel(name = "排序号", width = 15)
+    @ApiModelProperty(value = "排序号")
+    private Integer rank;
+    /**
+     * enabled
+     */
+    @Excel(name = "enabled", width = 15)
+    @ApiModelProperty(value = "enabled")
+    private Integer enabled;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private String roleName;
+
+    @TableField(exist = false)
+    private String buttonType;
+
+}

+ 77 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/DramaRoleInfo.java

@@ -0,0 +1,77 @@
+package org.jeecg.modules.ctop.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 剧本角色信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-05
+ */
+@Data
+@TableName("ctop_drama_role_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_drama_role_info对象", description = "剧本角色信息")
+public class DramaRoleInfo {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    private Long dramaId;
+    /**
+     * name
+     */
+    @Excel(name = "name", width = 15)
+    @ApiModelProperty(value = "name")
+    private String name;
+    /**
+     * introduction
+     */
+    @Excel(name = "introduction", width = 15)
+    @ApiModelProperty(value = "introduction")
+    private String introduction;
+    /**
+     * sex
+     */
+    @Excel(name = "sex", width = 15)
+    @ApiModelProperty(value = "sex")
+    private Integer sex;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private String buttonType;
+
+    public DramaRoleInfo(String name, String buttonType) {
+        this.name = name;
+        this.buttonType = buttonType;
+    }
+
+    public DramaRoleInfo() {
+    }
+}

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

@@ -0,0 +1,45 @@
+package org.jeecg.modules.ctop.job;
+
+import cn.com.ctop.common.module.utils.LoadFileUtil;
+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.Value;
+
+import java.util.Date;
+
+@Slf4j
+public class BakDataBaseJob implements Job {
+    @Value("${spring.datasource.master.username}")
+    private String userName;
+    @Value("${spring.datasource.master.password}")
+    private String password;
+    @Value("${jeecg.path.bak-database-file}")
+    private String filePath;
+
+    @Override
+    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        String currentFileName = filePath + "db-" + DateUtils.formatDate(new Date()) + ".sql";
+        String historyFileName = filePath + "db-" + DateUtils.formatDate(DateUtils.addDay(new Date(), -4)) + ".sql";
+        String command = "mysqldump jeecg-boot -h 127.0.0.1 -u" + userName + " -p" + password + " --default-character-set=utf8mb4 --result-file=" + currentFileName;
+        //1:删除历史数据
+        LoadFileUtil.delFile(historyFileName);
+        //2:导出当天数据
+        Runtime runtime = Runtime.getRuntime();
+        Process pro = null;
+        try {
+            pro = runtime.exec(command);
+            int status = pro.waitFor();
+            if (status == 0) {
+                log.info("数据备份shell脚本执行成功");
+            } else {
+                log.info("数据备份shell脚本执行失败");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+}

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

@@ -40,8 +40,6 @@ public class ByteDanceCleanMaterialJob implements Job {
                         }
                     });
                 }
-
-
             }
         };
         thread.start();

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

@@ -44,7 +44,7 @@ public class BytedanceCreativeDailyReportLoadJob implements Job {
             executorService.submit(new Runnable() {
                 @Override
                 public void run() {
-                    //4: 获取广告创意信息数据
+                    //获取广告创意信息数据
                     reportService.getAdvertiserCreativeReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
                 }
             });

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

@@ -46,10 +46,12 @@ public class BytedancePlanDailyReportLoadJob implements Job {
             reportService.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         });
         formatZybData(215, getDate);
-        planDailyReportService.cleanYddData(112, getDate);
-        planDailyReportService.cleanYddData(113, getDate);
-        planDailyReportService.cleanYddData(222, 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) {

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

@@ -1,10 +1,8 @@
 package org.jeecg.modules.ctop.job;
 
-import cn.com.ctop.bytedance.service.IBytedancePlanHourlyReportService;
 import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 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 lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
@@ -28,10 +26,6 @@ public class BytedancePlanHourlyReportLoadJob implements Job {
     @Autowired
     private ICtopOauthTokenService tokenService;
     @Autowired
-    private IBytedancePlanHourlyReportService planHourlyReportService;
-    @Autowired
-    private IUserAllocationService userAllocationService;
-    @Autowired
     private IReportService reportService;
     static ExecutorService executorService = null;
     //线程计数器
@@ -70,6 +64,8 @@ public class BytedancePlanHourlyReportLoadJob implements Job {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
+        //清洗玫瑰相亲渠道号数据
+
         log.info("头条计划时报数据获取完成");
         executorService.shutdown();
     }

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

@@ -0,0 +1,20 @@
+package org.jeecg.modules.ctop.job;
+
+import cn.com.ctop.crawler.modules.dataeye.service.DataeyeCompanyService;
+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 DataeyeCompanyService dataeyeCompanyService;
+    @Override
+    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        for (int i = 1; i < 1000; i++){
+            dataeyeCompanyService.getCompanyInfo(i);
+        }
+    }
+}

+ 1 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/DeleteCreativeStaticJob.java

@@ -7,8 +7,6 @@ import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.text.ParseException;
-
 /**
  * 出价预警
  */
@@ -31,7 +29,7 @@ public class DeleteCreativeStaticJob implements Job {
                     String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
                     String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
                     reportHourlyCreativeStatisticService.deleteHourlyReportByStatDate(anotherDay);
-                } catch (ParseException e) {
+                } catch (Exception e) {
                     e.printStackTrace();
                 }
             }

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

@@ -2,8 +2,11 @@ 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.common.module.utils.CtopAdConstant;
+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;
@@ -30,6 +33,9 @@ public class KuaishouDailyCreativeReportLoadJob implements Job {
 
     static ExecutorService executorService = null;
 
+    @Autowired
+    private IKuaiShouCampaignService campaignService;
+
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         Thread thread = new Thread() {
@@ -39,21 +45,39 @@ public class KuaishouDailyCreativeReportLoadJob implements Job {
                 kuaishouInterfaceService.deleteHourlyReport(deleteDate);
                 Date getDate = DateUtils.addDay(new Date(), -1);
                 //1:查询当日数据
-                executorService = Executors.newFixedThreadPool(3);
+                executorService = Executors.newFixedThreadPool(4);
                 List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
                 if (null == tokens || tokens.size() <= 0) {
                     log.info("定时获取快手数据异常:未获取到可用的token");
                     return;
                 }
-                log.info("开始分天创意报表拉去完成");
                 for (CtopOauthToken token : tokens) {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            log.info("获取创意分天报表开始,accountId:{}", token.getAccountId());
-                            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate);
+                    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);
+                                        } catch (Exception e) {
+                                            log.info("获取创意日报失败,accountId:{}", token.getAccountId());
+                                        }
+
+                                    }
+                                });
+
+                            }
+
                         }
-                    });
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
 
 
                 }
@@ -62,4 +86,5 @@ public class KuaishouDailyCreativeReportLoadJob implements Job {
         thread.start();
 
     }
+
 }

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

@@ -0,0 +1,78 @@
+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;
+    @Autowired
+    private IKuaiShouDailyReportTaskService kuaiShouDailyReportTaskService;
+
+    @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.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+                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();
+                            }
+                        }
+                    });
+                }
+                try {
+                    countDownLatch.await();
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+                kuaiShouDailyReportTaskService.formatCreativeDailyReportData(null, statDate);
+                executorService.shutdown();
+            }
+        };
+        thread.start();
+
+    }
+}

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

@@ -0,0 +1,41 @@
+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.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+        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);
+    }
+}

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

@@ -0,0 +1,38 @@
+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();
+
+    }
+}

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

@@ -0,0 +1,14 @@
+package org.jeecg.modules.ctop.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.ctop.entity.DramaInfo;
+
+/**
+ * 剧本信息
+ * @author: jeecg-boot
+ * @date:   2020-03-04
+ * @cersion: V1.0
+ */
+public interface DramaInfoMapper extends BaseMapper<DramaInfo> {
+
+}

+ 15 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/DramaItemInfoMapper.java

@@ -0,0 +1,15 @@
+package org.jeecg.modules.ctop.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.ctop.entity.DramaItemInfo;
+
+/**
+ * 剧本内容信息
+ *
+ * @author: jeecg-boot
+ * @date: 2020-03-06
+ * @cersion: V1.0
+ */
+public interface DramaItemInfoMapper extends BaseMapper<DramaItemInfo> {
+
+}

+ 15 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/DramaRoleInfoMapper.java

@@ -0,0 +1,15 @@
+package org.jeecg.modules.ctop.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.ctop.entity.DramaRoleInfo;
+
+/**
+ * 剧本角色信息
+ *
+ * @author: jeecg-boot
+ * @date: 2020-03-05
+ * @cersion: V1.0
+ */
+public interface DramaRoleInfoMapper extends BaseMapper<DramaRoleInfo> {
+
+}

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.ctop.mapper.DramaInfoMapper">
+
+</mapper>

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.ctop.mapper.DramaItemInfoMapper">
+
+</mapper>

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

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.ctop.mapper.DramaRoleInfoMapper">
+
+</mapper>

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

@@ -0,0 +1,14 @@
+package org.jeecg.modules.ctop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ctop.entity.DramaInfo;
+
+/**
+ * 剧本信息
+ * @author jeecg-boot
+ * @date   2020-03-04
+ * @version V1.0
+ */
+public interface IDramaInfoService extends IService<DramaInfo> {
+
+}

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

@@ -0,0 +1,18 @@
+package org.jeecg.modules.ctop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ctop.entity.DramaItemInfo;
+
+import java.util.List;
+
+/**
+ * 剧本内容信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-06
+ */
+public interface IDramaItemInfoService extends IService<DramaItemInfo> {
+
+    List<DramaItemInfo> getByDramaId(Long dramaId);
+}

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

@@ -0,0 +1,18 @@
+package org.jeecg.modules.ctop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.ctop.entity.DramaRoleInfo;
+
+import java.util.List;
+
+/**
+ * 剧本角色信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-05
+ */
+public interface IDramaRoleInfoService extends IService<DramaRoleInfo> {
+
+    List<DramaRoleInfo> getByDramaId(Long dramaId);
+}

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaInfoServiceImpl.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.ctop.entity.DramaInfo;
+import org.jeecg.modules.ctop.mapper.DramaInfoMapper;
+import org.jeecg.modules.ctop.service.IDramaInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 剧本信息
+ * @author jeecg-boot
+ * @date   2020-03-04
+ * @version V1.0
+ */
+@Service
+public class DramaInfoServiceImpl extends ServiceImpl<DramaInfoMapper, DramaInfo> implements IDramaInfoService {
+
+}

+ 46 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaItemInfoServiceImpl.java

@@ -0,0 +1,46 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.ctop.entity.DramaItemInfo;
+import org.jeecg.modules.ctop.entity.DramaRoleInfo;
+import org.jeecg.modules.ctop.mapper.DramaItemInfoMapper;
+import org.jeecg.modules.ctop.service.IDramaItemInfoService;
+import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 剧本内容信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-06
+ */
+@Service
+public class DramaItemInfoServiceImpl extends ServiceImpl<DramaItemInfoMapper, DramaItemInfo> implements IDramaItemInfoService {
+
+    @Autowired
+    private IDramaRoleInfoService roleInfoService;
+
+    @Override
+    public List<DramaItemInfo> getByDramaId(Long dramaId) {
+        QueryWrapper<DramaItemInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("drama_id", dramaId).eq("enabled", 1).orderByAsc("rank");
+        List<DramaItemInfo> infos = this.list(queryWrapper);
+        List<DramaItemInfo> returnInfos = new ArrayList<>();
+        if (null != infos && infos.size() > 0) {
+            for (DramaItemInfo itemInfo : infos) {
+                if (null != itemInfo.getRoleId()) {
+                    DramaRoleInfo roleInfo = roleInfoService.getById(itemInfo.getRoleId());
+                    itemInfo.setRoleName(roleInfo.getName());
+                }
+                returnInfos.add(itemInfo);
+            }
+        }
+        return returnInfos;
+    }
+}

+ 28 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/DramaRoleInfoServiceImpl.java

@@ -0,0 +1,28 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.ctop.entity.DramaRoleInfo;
+import org.jeecg.modules.ctop.mapper.DramaRoleInfoMapper;
+import org.jeecg.modules.ctop.service.IDramaRoleInfoService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 剧本角色信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-05
+ */
+@Service
+public class DramaRoleInfoServiceImpl extends ServiceImpl<DramaRoleInfoMapper, DramaRoleInfo> implements IDramaRoleInfoService {
+
+    @Override
+    public List<DramaRoleInfo> getByDramaId(Long dramaId) {
+        QueryWrapper<DramaRoleInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("drama_id", dramaId);
+        return this.list(queryWrapper);
+    }
+}

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/quartz/controller/QuartzJobController.java

@@ -64,7 +64,12 @@ public class QuartzJobController {
 	public Result<IPage<QuartzJob>> queryPageList(QuartzJob quartzJob, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
 			@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
 		Result<IPage<QuartzJob>> result = new Result<IPage<QuartzJob>>();
+		String jobClassName = quartzJob.getJobClassName();
+		quartzJob.setJobClassName(null);
 		QueryWrapper<QuartzJob> queryWrapper = QueryGenerator.initQueryWrapper(quartzJob, req.getParameterMap());
+		if (null != jobClassName && !"".equals(jobClassName.trim())) {
+			queryWrapper.like("job_class_name", jobClassName);
+		}
 		Page<QuartzJob> page = new Page<QuartzJob>(pageNo, pageSize);
 		IPage<QuartzJob> pageList = quartzJobService.page(page, queryWrapper);
 		result.setSuccess(true);

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

@@ -107,7 +107,7 @@ public class SysPermissionController {
             if (oConvertUtils.isEmpty(token)) {
                 return Result.error("TOKEN不允许为空!");
             }
-            log.info(" ------ 通过令牌获取用户拥有的访问菜单 ---- TOKEN ------ " + token);
+//            log.info(" ------ 通过令牌获取用户拥有的访问菜单 ---- TOKEN ------ " + token);
             String username = JwtUtil.getUsername(token);
             List<SysPermission> metaList = sysPermissionService.queryByUser(username);
             String roleCode = sysPermissionService.queryRoleCode(username);

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

@@ -1,4 +1,3 @@
-
 server:
   port: 8080
   ip: 39.106.184.70
@@ -96,14 +95,14 @@ spring:
         poolPreparedStatements: true
         maxPoolPreparedStatementPerConnectionSize: 20
         # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        filters: stat,wall,slf4j
+        filters: stat,slf4j
         # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
           url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: root
-          password: hcst2019
+          username: hcst
+          password: test@20190531
           driver-class-name: com.mysql.jdbc.Driver
           # 多数据源配置
           #multi-datasource1:
@@ -149,6 +148,8 @@ jeecg:
     image-upload: D://upFiles//image//
     chrome-driver: D://chromedriver.exe
     csv-upload: D://upFiles//csv//
+    report-history: D://report//history//
+    report-daily: D://report//daily//
 kuaishou:
   group-control:
     path: http://39.106.184.70

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

@@ -100,7 +100,7 @@ spring:
         poolPreparedStatements: true
         maxPoolPreparedStatementPerConnectionSize: 20
         # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        filters: stat,wall,slf4j
+        filters: stat,slf4j
         # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
@@ -150,6 +150,9 @@ jeecg:
     image-upload: /mnt/upload/image/
     chrome-driver: /usr/bin/chromedriver
     csv-upload: /mnt/upload/csv/
+    bak-database-file: /mnt/data/bak/
+    report-history: /mnt/upload/report/history/
+    report-daily: /mnt/upload/report/daily/
 kuaishou:
   group-control:
     path: http://39.106.184.70

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

@@ -98,7 +98,7 @@ spring:
         poolPreparedStatements: true
         maxPoolPreparedStatementPerConnectionSize: 20
         # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        filters: stat,wall,slf4j
+        filters: stat,slf4j
         # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
@@ -152,6 +152,8 @@ jeecg:
     image-upload: /data/upload/image/
     chrome-driver: /usr/bin/chromedriver
     csv-upload: /data/upload/csv/
+    report-history: /data/report/history/
+    report-daily: /data/report/daily/
 kuaishou:
   group-control:
     path: http://127.0.0.1

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

@@ -1,8 +1,8 @@
 #mysql
 diver_name=com.mysql.jdbc.Driver
 url=jdbc:mysql://39.106.184.70:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF-8
-username=root
-password=hcst2019
+username=hcst
+password=test@20190531
 database_name=jeecg-boot
 #oracle
 #diver_name=oracle.jdbc.driver.OracleDriver

+ 155 - 3
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -1,17 +1,169 @@
 package org.jeecg;
 
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
+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 cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
+import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Value;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
+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;
+
 @RunWith(SpringRunner.class)
 @SpringBootTest
 @Slf4j
 public class SampleTest {
-    @Value("${jeecg.path.chrome-driver}")
-    private String chromeDriver;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+
+
+    @Autowired
+    private IKuaiShouHistoryReportTaskService reportTaskService;
+    @Autowired
+    private CtopOauthTokenMapper tokenMapper;
+
+
+    @Test
+    public void kuaisShouReport() {
+        try {
+
+            QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("account_id",3727345L);
+            CtopOauthToken token = tokenMapper.selectOne(queryWrapper);
+
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            Date parse = simpleDateFormat.parse("2020-03-12");
+            kuaishouInterfaceService.getAdvertiserReportDaily(token,parse,parse);
+
+
+//            reportTaskService.createTask(3727345L, "871fc2c248782a94ad2962c941555abc", "");
+//            reportTaskService.getTaskList();
+
+/*
+            reportTaskService.createTask(3727345L, "871fc2c248782a94ad2962c941555abc");
+            reportTaskService.getTaskList();*/
+
+
+
+         /*   String url = "https://ad.e.kuaishou.com/rest/openapi/v1/async_task/list";
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Content-Type", " application/json");
+            headers.put("Access-Token", "eb9a0d18072eabc339ee26ad010ecd6b");
+            JSONObject param = new JSONObject();
+            param.put("advertiser_id", 142402);
+            JSONArray taskIds = new JSONArray();
+            taskIds.add(1229917);
+
+            param.put("task_ids", taskIds);
+            String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+            JSONObject resultJson = JSONObject.parseObject(result);
+            System.err.println(resultJson);*/
+
+
+          /*  String url = "https://ad.e.kuaishou.com/rest/openapi/v1/async_task/download";
+
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Access-Token", "eb9a0d18072eabc339ee26ad010ecd6b");
+
+            Map<String,Object> param = new HashMap<>();
+            param.put("advertiser_id", 142402);
+            param.put("task_id", "1229917");
+            String result = HttpUtils.KuaiShouttpGetRequest(url, param,headers);*/
+
+
+            /*URL url = new URL("https://ad.e.kuaishou.com/rest/openapi/v1/async_task/download?task_id=1229917&advertiser_id=142402");
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            //设置超时间为3秒
+            conn.setConnectTimeout(10 * 1000);
+            //防止屏蔽程序抓取而返回403错误
+            conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
+            conn.setRequestProperty("Access-Token", "6a1fbe20e49fe519ec8120aac5c9e55a");
+            //得到输入流
+            InputStream inputStream = conn.getInputStream();
+            //获取自己数组
+            byte[] getData = readInputStream(inputStream);
+
+            //文件保存位置
+            File saveDir = new File("D:\\file");
+            if (!saveDir.exists()) {
+                saveDir.mkdirs();
+            }
+            String fileName = "123.csv";
+            File file = new File(saveDir + File.separator + fileName);
+            FileOutputStream fos = new FileOutputStream(file);
+            fos.write(getData);
+            if (fos != null) {
+                fos.close();
+            }
+            if (inputStream != null) {
+                inputStream.close();
+            }*/
+         /*   String localPath = "D:\\file\\123.csv";
+
+            reportDailyAccountMapper.loadAccountDailyReport(142402L,localPath);*/
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+
+        }
+    }
+
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    private static ExecutorService executorService = Executors.newFixedThreadPool(3);
+    private static CountDownLatch countDownLatch = null;
+
+    @Test
+    public void testLoadJob() {
+        log.info("快手获取日报数据任务执行开始");
+        Long start = System.currentTimeMillis();
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("快手获取日报数据任务执行失败:未获取到可用的token");
+            return;
+        }
+        String getDateStr = DateUtils.formatDate(getDate);
+        countDownLatch = new CountDownLatch(tokens.size());
+        for (CtopOauthToken token : tokens) {
+            executorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    //创建任务
+                    try {
+                        reportTaskService.createTask(token.getAccountId(), token.getAccessToken(), getDateStr, getDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    } finally {
+                        countDownLatch.countDown();
+                    }
+                }
+            });
+        }
+        try {
+            countDownLatch.await();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        Long end = System.currentTimeMillis();
+        log.info("快手获取日报数据任务执行结束,执行耗时:{}秒", (end - start) / 1000);
+    }
+
+
 }
 
 

+ 16 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/CtopOauthToken.java

@@ -12,6 +12,7 @@ import lombok.experimental.Accessors;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 
@@ -142,4 +143,19 @@ public class CtopOauthToken {
         calendar.add(Calendar.SECOND, seconds);
         return calendar.getTime();
     }
+
+    @Override
+    public String toString() {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return id +
+                "," + mediaId +
+                "," + advertiserId +
+                "," + accountId +
+                "," + accessToken +
+                "," + sdf.format(accessTokenExpiresIn) +
+                "," + refreshToken +
+                "," + sdf.format(refreshTokenExpiresIn) +
+                "," + sdf.format(createTime) +
+                "," + sdf.format(updateTime);
+    }
 }

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

@@ -60,6 +60,8 @@ public class UserAllocation {
     @ApiModelProperty(value = "广告主ID")
     private String advertiserId;
 
+    private String systemType;
+
     /**
      * 项目id
      */

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

@@ -18,4 +18,7 @@ public class CtopAdConstant {
 
     public static final String CTOP_ORGCODE_NORTH_CHINA_PREFIX = "A01";
     public static final String CTOP_ORGCODE_EAST_CHINA_PREFIX = "A02";
+
+    public static final String KUAISHOU_LOAD_JOB_TYPE_HISTORY = "history";
+    public static final String KUAISHOU_LOAD_JOB_TYPE_DAILY = "daily";
 }

+ 78 - 3
module-common/src/main/java/cn/com/ctop/common/module/utils/ExportExcelUtils.java

@@ -4,6 +4,10 @@ import org.apache.poi.hssf.usermodel.HSSFCellStyle;
 import org.apache.poi.hssf.usermodel.HSSFFont;
 import org.apache.poi.hssf.usermodel.HSSFRichTextString;
 import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.BorderStyle;
+import org.apache.poi.ss.usermodel.FillPatternType;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.IndexedColors;
 import org.apache.poi.xssf.usermodel.*;
 
 import java.math.BigDecimal;
@@ -22,10 +26,11 @@ public class ExportExcelUtils {
      * @throws Exception
      * @Title: exportExcel
      * @Description: 导出Excel的方法
-     *
      */
-    public void exportExcel(XSSFWorkbook workbook, int sheetNum,
+    public void exportExcelOld(XSSFWorkbook workbook, int sheetNum,
                             String sheetTitle, String[] headers, List<List<Object>> result) throws Exception {
+        System.out.println("!!!!!!!!!"+ XSSFCellStyle.class.getProtectionDomain().getCodeSource().getLocation());
+        System.out.println("!!!!!!!!!"+ HSSFCellStyle.class.getProtectionDomain().getCodeSource().getLocation());
         // 生成一个表格
         XSSFSheet sheet = workbook.createSheet();
         workbook.setSheetName(sheetNum, sheetTitle);
@@ -35,7 +40,7 @@ public class ExportExcelUtils {
         XSSFCellStyle style = workbook.createCellStyle();
         // 设置这些样式
         style.setFillForegroundColor(HSSFColor.PALE_BLUE.index);
-        style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+      //  style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
         style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
         style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
         style.setBorderRight(HSSFCellStyle.BORDER_THIN);
@@ -94,5 +99,75 @@ public class ExportExcelUtils {
         }
     }
 
+    public void exportExcel(XSSFWorkbook workbook, int sheetNum,
+                            String sheetTitle, String[] headers, List<List<Object>> result) throws Exception {
+        System.out.println("!!!!!!!!!"+ XSSFCellStyle.class.getProtectionDomain().getCodeSource().getLocation());
+        System.out.println("!!!!!!!!!"+ HSSFCellStyle.class.getProtectionDomain().getCodeSource().getLocation());
+        // 生成一个表格
+        XSSFSheet sheet = workbook.createSheet();
+        workbook.setSheetName(sheetNum, sheetTitle);
+        // 设置表格默认列宽度为20个字节
+        sheet.setDefaultColumnWidth((short) 20);
+        // 生成一个样式
+        XSSFCellStyle style = workbook.createCellStyle();
+        // 设置这些样式
+        style.setFillForegroundColor(IndexedColors.PALE_BLUE.index);
+        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+        style.setBorderBottom(BorderStyle.THIN);
+        style.setBorderLeft(BorderStyle.THIN);
+        style.setBorderRight(BorderStyle.THIN);
+        style.setBorderTop(BorderStyle.THIN);
+        style.setAlignment(HorizontalAlignment.CENTER);
+        // 生成一个字体
+        XSSFFont font = workbook.createFont();
+        font.setColor(IndexedColors.BLACK.index);
+        font.setFontHeightInPoints((short) 12);
+        font.setBold(true);
+        // 把字体应用到当前的样式
+        style.setFont(font);
+
+        // 指定当单元格内容显示不下时自动换行
+        style.setWrapText(true);
+
+        // 产生表格标题行
+        XSSFRow row = sheet.createRow(0);
+        for (int i = 0; i < headers.length; i++) {
+            XSSFCell cell = row.createCell((short) i);
+
+            cell.setCellStyle(style);
+            XSSFRichTextString text = new XSSFRichTextString(headers[i]);
+            cell.setCellValue(headers[i]);
+        }
+        // 遍历集合数据,产生数据行
+        if (result != null) {
+            int index = 1;
+            for (List<Object> m : result) {
+                row = sheet.createRow(index);
+                int cellIndex = 0;
+                for (Object obj : m) {
+                    XSSFCell cell = row.createCell((short) cellIndex);
+                    if (!Check.isNull(obj)) {
+                        if (obj instanceof String) {
+                            cell.setCellValue((String) obj);
+                        } else if (obj instanceof Double) {
+                            cell.setCellValue((Double) obj);
+                        } else if (obj instanceof BigDecimal) {
+                            BigDecimal bigDecimal = (BigDecimal) obj;
+                            cell.setCellValue(bigDecimal.doubleValue());
+                        } else if (obj instanceof Long) {
+                            Long aLong = Long.valueOf(String.valueOf(obj));
+                            cell.setCellValue(aLong.doubleValue());
+                        } else {
+                            cell.setCellValue(obj.toString());
+                        }
+                    } else {
+                        cell.setCellValue(0);
+                    }
 
+                    cellIndex++;
+                }
+                index++;
+            }
+        }
+    }
 }

+ 134 - 4
module-common/src/main/java/cn/com/ctop/common/module/utils/HttpUtils.java

@@ -162,14 +162,55 @@ public class HttpUtils {
         return HttpClients.createDefault();
     }
 
+    public static String httpPostFormRequest(String url, Map<String, Object> param, Map<String, String> headers) {
+        HttpClient httpClient = createSslClientDefault();
+        String strReturn = "";
+        try {
+            HttpPost httppost = new HttpPost(url);
+            if (headers != null) {
+                for (String key : headers.keySet()) {
+                    httppost.setHeader(key, headers.get(key));
+                }
+            }
+            List<NameValuePair> paramList = new ArrayList<NameValuePair>();
+            for (String key : param.keySet()) {
+                BasicNameValuePair basicNameValuePair = new BasicNameValuePair(key, String.valueOf(param.get(key)));
+                paramList.add(basicNameValuePair);
+            }
+
+            // 第二步:我们发现Entity是一个接口,所以只能找实现类,发现实现类又需要一个集合,集合的泛型是NameValuePair类型
+            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(paramList);
+            // 第一步:通过setEntity 将我们的entity对象传递过去
+            httppost.setEntity(formEntity);
+            HttpEntity respentity;
+
+            HttpResponse response = httpClient.execute(httppost);
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY) {
+                String newUrl = response.getFirstHeader("Location").getValue();
+                return httpPostFormRequest(newUrl, param, headers);
+            } else if (statusCode == HttpStatus.SC_OK) {
+                respentity = response.getEntity();
+                strReturn = EntityUtils.toString(respentity);
+                return strReturn;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+        return strReturn;
+    }
+
     public static String httpPostParamRequest(String url, Map<String, Object> param, Map<String, String> headers) {
         HttpClient httpClient = createSslClientDefault();
         String strReturn = "";
         try {
             HttpPost httppost = new HttpPost(url);
             httppost.setHeader("User-Agent", USER_AGENT);
-            for (String key : headers.keySet()) {
-                httppost.setHeader(key, headers.get(key));
+            if (headers != null) {
+                for (String key : headers.keySet()) {
+                    httppost.setHeader(key, headers.get(key));
+                }
             }
             List<NameValuePair> paramList = new ArrayList<NameValuePair>();
             for (String key : param.keySet()) {
@@ -216,8 +257,8 @@ public class HttpUtils {
             if (param != null && param.size() > 0) {
                 httppost.setEntity(new StringEntity(new Gson().toJson(param), Charset.forName("UTF-8")));
             }
-            RequestConfig requestConfig =  RequestConfig.custom().setSocketTimeout(120 * 1000).setConnectTimeout(120 * 1000).build();
-                httppost.setConfig(requestConfig);
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(120 * 1000).setConnectTimeout(120 * 1000).build();
+            httppost.setConfig(requestConfig);
             HttpEntity respentity;
 
             HttpResponse response = httpClient.execute(httppost);
@@ -299,11 +340,14 @@ public class HttpUtils {
         String strReturn = "";
         try {
             HttpPost httppost = new HttpPost(url);
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(120000).setConnectTimeout(120000).build();
+            httppost.setConfig(requestConfig);
             if (!Check.isNullMap(headers)) {
                 for (String key : headers.keySet()) {
                     httppost.setHeader(key, headers.get(key));
                 }
             }
+
             httppost.setHeader("User-Agent", USER_AGENT);
             if (!Check.isNull(body)) {
                 httppost.setEntity(new StringEntity(body, Charset.forName("UTF-8")));
@@ -644,4 +688,90 @@ public class HttpUtils {
         }
         return result;
     }
+
+
+    public static JSONObject kuaiShouHttpGetRequest(String accessToken, String url, JSONObject params) {
+        // 构造请求
+        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
+            @Override
+            public String getMethod() {
+                return "GET";
+            }
+        };
+        httpEntity.setHeader("Access-Token", accessToken);
+        CloseableHttpResponse response = null;
+        CloseableHttpClient client = null;
+        try {
+            client = HttpClientBuilder.create().build();
+            httpEntity.setURI(URI.create(url));
+            httpEntity.setEntity(new StringEntity(params.toJSONString(), ContentType.APPLICATION_JSON));
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(12000).setConnectTimeout(12000).build();
+            httpEntity.setConfig(requestConfig);
+            response = client.execute(httpEntity);
+            if (response != null && response.getStatusLine().getStatusCode() == 200) {
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
+                StringBuilder result = new StringBuilder();
+                String line = "";
+                while ((line = bufferedReader.readLine()) != null) {
+                    result.append(line);
+                }
+                bufferedReader.close();
+                return JSONObject.parseObject(result.toString());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                if (client != null) {
+                    client.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return null;
+    }
+
+
+    public static String KuaiShouttpGetRequest(String url, Map<String, Object> params, Map<String, String> headers) throws Exception {
+        HttpClient httpclient = getHttpclient();
+        String strReturn = "";
+        try {
+
+
+            StringBuilder postBody = new StringBuilder();
+            for (Map.Entry<String, Object> entry : params.entrySet()) {
+                if (entry.getValue() == null) {
+                    continue;
+                }
+                postBody.append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue().toString(),
+                        "utf-8")).append("&");
+            }
+            if (!params.isEmpty()) {
+                postBody.deleteCharAt(postBody.length() - 1);
+            }
+
+            HttpGet httpget = new HttpGet(url + "?" + postBody);
+            System.err.println(url + postBody);
+            if (headers != null) {
+                Iterator<String> keyIter = headers.keySet().iterator();
+                while (keyIter.hasNext()) {
+                    String curKey = keyIter.next();
+                    if (curKey != null && headers.get(curKey) != null) {
+                        httpget.addHeader(curKey, headers.get(curKey));
+                    }
+                }
+            }
+            HttpEntity respentity;
+            HttpResponse response = httpclient.execute(httpget);
+            respentity = response.getEntity();
+            strReturn = EntityUtils.toString(respentity);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return strReturn;
+    }
 }

+ 149 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/JavacvUtil.java

@@ -0,0 +1,149 @@
+package cn.com.ctop.common.module.utils;
+
+import com.google.common.collect.Lists;
+import org.bytedeco.javacpp.opencv_core;
+import org.bytedeco.javacv.FFmpegFrameGrabber;
+import org.bytedeco.javacv.Frame;
+import org.bytedeco.javacv.Java2DFrameConverter;
+import org.opencv.core.CvType;
+import org.opencv.core.Mat;
+import org.opencv.core.MatOfByte;
+import org.opencv.imgcodecs.Imgcodecs;
+import org.opencv.imgproc.Imgproc;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.awt.image.DataBufferByte;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+public class JavacvUtil {
+    /**
+     * 视频文件指定时间段的帧截取
+     * @param file
+     * @param start
+     * @param end
+     */
+    public static List<File> videoIntercept(File file, Integer start, Integer end) {
+        Frame frame = null;
+        List<File> files = Lists.newArrayList();
+        FFmpegFrameGrabber fFmpegFrameGrabber = new FFmpegFrameGrabber(file);
+        String filePath = "D://video//images//";
+        String fileTargetName = "movie";
+        try {
+            fFmpegFrameGrabber.start();
+            int ftp = fFmpegFrameGrabber.getLengthInFrames();
+            System.out.println("开始视频提取帧");
+            for (int i=0 ; i < ftp ; i++){
+                if( i >= start && i <= end){
+                    frame = fFmpegFrameGrabber.grabImage();
+                    doExecuteFrame(frame, filePath, fileTargetName, i ,files);
+                }
+            }
+            System.out.println("============运行结束============");
+            fFmpegFrameGrabber.stop();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return files;
+    }
+
+    public static void doExecuteFrame(Frame frame, String targetFilePath, String targetFileName, int index ,List<File> files) {
+        if ( frame == null || frame.image == null) {
+            return;
+        }
+        Java2DFrameConverter converter = new Java2DFrameConverter();
+        String imageMat = "jpg";
+        String fileName = targetFilePath + targetFileName + "_" + index + "." + imageMat;
+        BufferedImage bi = converter.getBufferedImage(frame);
+
+//        Mat img = Imgcodecs.imread("");
+//        Mat imgHSV = new Mat(img.rows(), img.cols(), CvType.CV_8UC3);
+//        Mat img2 = new Mat(img.rows(), img.cols(), CvType.CV_8UC3);
+
+        //转成HSV空间
+//        Imgproc.cvtColor(img, imgHSV, Imgproc.COLOR_BGR2HSV);
+//        //转回BGR空间
+//        Imgproc.cvtColor(imgHSV, img2, Imgproc.COLOR_HSV2BGR);
+
+        File output = new File(fileName);
+        files.add(output);
+        try{
+            ImageIO.write(bi, imageMat, output);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args) {
+        List<File> files = videoIntercept(new File("C:\\Users\\宋英豪\\Desktop\\nfpHmswW.mp4"), 10, 100);
+        System.out.println(files);
+    }
+
+    /**
+     * Mat转换成BufferedImage
+     *
+     * @param matrix
+     *            要转换的Mat
+     * @param fileExtension
+     *            格式为 ".jpg", ".png", etc
+     * @return
+     */
+    public static BufferedImage Mat2BufImg (Mat matrix, String fileExtension) {
+        // convert the matrix into a matrix of bytes appropriate for
+        // this file extension
+        MatOfByte mob = new MatOfByte();
+        Imgcodecs.imencode(fileExtension, matrix, mob);
+        // convert the "matrix of bytes" into a byte array
+        byte[] byteArray = mob.toArray();
+        BufferedImage bufImage = null;
+        try {
+            InputStream in = new ByteArrayInputStream(byteArray);
+            bufImage = ImageIO.read(in);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return bufImage;
+    }
+
+    /**
+     * BufferedImage转换成Mat
+     *
+     * @param original
+     *            要转换的BufferedImage
+     * @param imgType
+     *            bufferedImage的类型 如 BufferedImage.TYPE_3BYTE_BGR
+     * @param matType
+     *            转换成mat的type 如 CvType.CV_8UC3
+     */
+    public static Mat BufImg2Mat (BufferedImage original, int imgType, int matType) {
+        if (original == null) {
+            throw new IllegalArgumentException("original == null");
+        }
+
+        // Don't convert if it already has correct type
+        if (original.getType() != imgType) {
+
+            // Create a buffered image
+            BufferedImage image = new BufferedImage(original.getWidth(), original.getHeight(), imgType);
+
+            // Draw the image onto the new buffer
+            Graphics2D g = image.createGraphics();
+            try {
+                g.setComposite(AlphaComposite.Src);
+                g.drawImage(original, 0, 0, null);
+            } finally {
+                g.dispose();
+            }
+        }
+
+        byte[] pixels = ((DataBufferByte) original.getRaster().getDataBuffer()).getData();
+        Mat mat = Mat.eye(original.getHeight(), original.getWidth(), matType);
+        mat.put(0, 0, pixels);
+        return mat;
+    }
+}

+ 3 - 2
module-common/src/main/java/cn/com/ctop/common/module/utils/JsonUtil.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.common.module.utils;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JavaType;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -42,9 +43,9 @@ public class JsonUtil {
      * @param jsonData json数据
      * @return
      */
-    public static <T> T jsonToObj(String jsonData, Class<T> beanType) {
+    public static <T> T jsonToObj(JSONObject jsonData, Class<T> beanType) {
         try {
-            T t = MAPPER.readValue(jsonData, beanType);
+            T t = MAPPER.readValue(jsonData.toJSONString(), beanType);
             return t;
         } catch (Exception e) {
             e.printStackTrace();

+ 16 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java

@@ -168,6 +168,22 @@ public class KuaishouInterfaceConstant {
      */
     public static final String IMAGE_LIST = "/rest/openapi/v1/file/ad/image/list";
 
+
+    /**
+     * 历史数据查询任务
+     */
+    public static final String ASYNC_TASK_CREAT = "/rest/openapi/v1/async_task/create";
+    /**
+     * 获取任务列表
+     */
+    public static final String ASYNC_TASK_LIST = "/rest/openapi/v1/async_task/list";
+
+    /**
+     * 下载数据
+     */
+    public static final String ASYNC_TASK_DOWNLOAD = "/rest/openapi/v1/async_task/download";
+
+
     /**
      * 登录
      */

+ 17 - 1
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/entity/DataeyeCompany.java

@@ -1,7 +1,23 @@
 package cn.com.ctop.crawler.modules.dataeye.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.util.Date;
+@Data
+@TableName("ctop_dataeye_company")
 public class DataeyeCompany {
-    private Integer id;
+    @TableId(value = "id", type = IdType.INPUT)
+    private Integer companyId;
     private String companyName;
+    private Date firstSeen;
+    private Date lastSeen;
+    private Integer days;
+    private Integer materialNum;
+    private Integer productNum;
+    private Integer mediaNum;
 
 }

+ 4 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/entity/DataeyeMedia.java

@@ -8,6 +8,10 @@ public class DataeyeMedia {
     private Integer id;
     private String mediaName;
     private String logoUrl;
+    private String supportIos;
+    private String supportAndroid;
+    private String positionList;
+    private Integer isUnion;
     private Integer isShow;
     private Date createTime;
     private Date updateTime;

+ 7 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/mapper/DataeyeCompanyMapper.java

@@ -0,0 +1,7 @@
+package cn.com.ctop.crawler.modules.dataeye.mapper;
+
+import cn.com.ctop.crawler.modules.dataeye.entity.DataeyeCompany;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface DataeyeCompanyMapper extends BaseMapper<DataeyeCompany> {
+}

+ 8 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/DataeyeCompanyService.java

@@ -0,0 +1,8 @@
+package cn.com.ctop.crawler.modules.dataeye.service;
+
+import cn.com.ctop.crawler.modules.dataeye.entity.DataeyeCompany;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface DataeyeCompanyService extends IService<DataeyeCompany> {
+    public void getCompanyInfo(Integer companyId);
+}

+ 71 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/dataeye/service/impl/DataeyeCompanyServiceImpl.java

@@ -0,0 +1,71 @@
+package cn.com.ctop.crawler.modules.dataeye.service.impl;
+
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.crawler.modules.core.util.SignUtil;
+import cn.com.ctop.crawler.modules.dataeye.entity.DataeyeCompany;
+import cn.com.ctop.crawler.modules.dataeye.mapper.DataeyeCompanyMapper;
+import cn.com.ctop.crawler.modules.dataeye.service.DataeyeCompanyService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+import org.apache.http.cookie.Cookie;
+import org.apache.http.impl.cookie.BasicClientCookie;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.stereotype.Service;
+import sun.misc.BASE64Encoder;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+@Service
+public class DataeyeCompanyServiceImpl extends ServiceImpl<DataeyeCompanyMapper, DataeyeCompany> implements DataeyeCompanyService {
+
+    public void getCompanyInfo(Integer companyId){
+        Map<String,String> headerMap = new HashMap<>();
+        headerMap.put("Host","adx.dataeye.com");
+        headerMap.put("Origin","https://adx.dataeye.com");
+        headerMap.put("Referer","https://adx.dataeye.com/");
+        BasicClientCookie ck = new BasicClientCookie("tokenglobal", "721501ec4ec04a50bbffc0c0240cbbdd63a0d5456205b9a5ea1581ce6c6554ca");
+        ck.setDomain("adx.dataeye.com");
+        ck.setExpiryDate(DateUtils.addDay(new Date(),365));
+        ck.setPath("/");
+        HttpUtils.COOKIESTORE.addCookie(ck);
+        Map<String,Object> paramMap = new HashMap<>();
+        paramMap.put("companyId",companyId);
+        paramMap.put("thisTimes",(long)(new Date().getTime()/100));
+        String sign = SignUtil.getDataeyeSign(paramMap);
+        paramMap.put("sign",sign);
+        System.out.println(new Gson().toJson(paramMap));
+        String response = HttpUtils.httpPostFormRequest("https://adx.dataeye.com/company/getCompanyInfo",paramMap,headerMap);
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+        try {
+            JsonNode rootNode = mapper.readTree(response);
+            int statusCode = rootNode.get("statusCode").asInt();
+            if (statusCode == 200){
+                String content = rootNode.get("content").toString();
+                DataeyeCompany company = mapper.readValue(content,DataeyeCompany.class);
+                this.save(company);
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        System.out.println(response);
+    }
+
+
+    public static void main(String[] args){
+        DataeyeCompanyServiceImpl i = new DataeyeCompanyServiceImpl();
+        i.getCompanyInfo(1);
+//        Date date = new Date(1582598505897L);
+//        System.out.println(DateUtils.formatDate(1582598505897L));
+
+
+    }
+}

+ 3 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/KuaishouAppServiceImpl.java

@@ -18,6 +18,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -28,6 +29,7 @@ import java.util.List;
  * @author yumeng
  * 2019年11月12日10:04:00
  */
+@Slf4j
 @Service
 public class KuaishouAppServiceImpl implements IKuaishouAppService {
     @Autowired
@@ -76,6 +78,7 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
                             ad.setHeight(ad.getAdCover().getHeight());
                             ad.setType(appFeeds.getType());
                             ad.setAppName(ad.getAppName().replace(".apk","").replace(".APK","").replace("ios","").replace("IOS",""));
+                            System.out.println(ad.getAdCover());
                             appAdService.saveOrUpdate(ad);
                             try {
                                 KuaishouAdAccount kuaishouAdAccount = kuaishouAdAccountService.getById(ad.getUserId());
@@ -93,7 +96,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
                     }
                 }
             }
-
         } catch (IOException e) {
             e.printStackTrace();
         }
@@ -193,7 +195,6 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
                     }
                 }
             }
-
         } catch (IOException e) {
             e.printStackTrace();
         }

+ 248 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouDailyReportTaskController.java

@@ -0,0 +1,248 @@
+package cn.com.ctop.kuaishou.modules.batch.controller;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouDailyReportTask;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+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.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 分天记录表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-12
+ */
+@Slf4j
+@Api(tags = "分天记录表")
+@RestController
+@RequestMapping("/kuaishou/kuaiShouDailyReportTask")
+public class KuaiShouDailyReportTaskController {
+    @Autowired
+    private IKuaiShouDailyReportTaskService kuaiShouDailyReportTaskService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaiShouDailyReportTask
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "分天记录表-分页列表查询")
+    @ApiOperation(value = "分天记录表-分页列表查询", notes = "分天记录表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaiShouDailyReportTask>> queryPageList(KuaiShouDailyReportTask kuaiShouDailyReportTask,
+                                                                @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                HttpServletRequest req) {
+        Result<IPage<KuaiShouDailyReportTask>> result = new Result<IPage<KuaiShouDailyReportTask>>();
+        QueryWrapper<KuaiShouDailyReportTask> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouDailyReportTask, req.getParameterMap());
+        Page<KuaiShouDailyReportTask> page = new Page<KuaiShouDailyReportTask>(pageNo, pageSize);
+        IPage<KuaiShouDailyReportTask> pageList = kuaiShouDailyReportTaskService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaiShouDailyReportTask
+     * @return
+     */
+    @AutoLog(value = "分天记录表-添加")
+    @ApiOperation(value = "分天记录表-添加", notes = "分天记录表-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaiShouDailyReportTask> add(@RequestBody KuaiShouDailyReportTask kuaiShouDailyReportTask) {
+        Result<KuaiShouDailyReportTask> result = new Result<KuaiShouDailyReportTask>();
+        try {
+            kuaiShouDailyReportTaskService.save(kuaiShouDailyReportTask);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaiShouDailyReportTask
+     * @return
+     */
+    @AutoLog(value = "分天记录表-编辑")
+    @ApiOperation(value = "分天记录表-编辑", notes = "分天记录表-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaiShouDailyReportTask> edit(@RequestBody KuaiShouDailyReportTask kuaiShouDailyReportTask) {
+        Result<KuaiShouDailyReportTask> result = new Result<KuaiShouDailyReportTask>();
+        KuaiShouDailyReportTask kuaiShouDailyReportTaskEntity = kuaiShouDailyReportTaskService.getById(kuaiShouDailyReportTask.getId());
+        if (kuaiShouDailyReportTaskEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaiShouDailyReportTaskService.updateById(kuaiShouDailyReportTask);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "分天记录表-通过id删除")
+    @ApiOperation(value = "分天记录表-通过id删除", notes = "分天记录表-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            kuaiShouDailyReportTaskService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "分天记录表-批量删除")
+    @ApiOperation(value = "分天记录表-批量删除", notes = "分天记录表-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<KuaiShouDailyReportTask> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<KuaiShouDailyReportTask> result = new Result<KuaiShouDailyReportTask>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaiShouDailyReportTaskService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "分天记录表-通过id查询")
+    @ApiOperation(value = "分天记录表-通过id查询", notes = "分天记录表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<KuaiShouDailyReportTask> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaiShouDailyReportTask> result = new Result<KuaiShouDailyReportTask>();
+        KuaiShouDailyReportTask kuaiShouDailyReportTask = kuaiShouDailyReportTaskService.getById(id);
+        if (kuaiShouDailyReportTask == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaiShouDailyReportTask);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<KuaiShouDailyReportTask> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                KuaiShouDailyReportTask kuaiShouDailyReportTask = JSON.parseObject(deString, KuaiShouDailyReportTask.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouDailyReportTask, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<KuaiShouDailyReportTask> pageList = kuaiShouDailyReportTaskService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "分天记录表列表");
+        mv.addObject(NormalExcelConstants.CLASS, KuaiShouDailyReportTask.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("分天记录表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<KuaiShouDailyReportTask> listKuaiShouDailyReportTasks = ExcelImportUtil.importExcel(file.getInputStream(), KuaiShouDailyReportTask.class, params);
+                kuaiShouDailyReportTaskService.saveBatch(listKuaiShouDailyReportTasks);
+                return Result.ok("文件导入成功!数据行数:" + listKuaiShouDailyReportTasks.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.ok("文件导入失败!");
+    }
+
+}

+ 164 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouReportTaskController.java

@@ -0,0 +1,164 @@
+package cn.com.ctop.kuaishou.modules.batch.controller;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouHistoryReportTask;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+/**
+ * 快手历史数据任务记录
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-09
+ */
+@Slf4j
+@Api(tags = "快手历史数据任务记录")
+@RestController
+@RequestMapping("/ctop/kuaiShouReportTask")
+public class KuaiShouReportTaskController {
+    @Autowired
+    private IKuaiShouHistoryReportTaskService kuaiShouReportTaskService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaiShouReportTask
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "快手历史数据任务记录-分页列表查询")
+    @ApiOperation(value = "快手历史数据任务记录-分页列表查询", notes = "快手历史数据任务记录-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaiShouHistoryReportTask>> queryPageList(KuaiShouHistoryReportTask kuaiShouReportTask,
+                                                                  @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                  @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                  HttpServletRequest req) {
+        Result<IPage<KuaiShouHistoryReportTask>> result = new Result<IPage<KuaiShouHistoryReportTask>>();
+        QueryWrapper<KuaiShouHistoryReportTask> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouReportTask, req.getParameterMap());
+        Page<KuaiShouHistoryReportTask> page = new Page<KuaiShouHistoryReportTask>(pageNo, pageSize);
+        IPage<KuaiShouHistoryReportTask> pageList = kuaiShouReportTaskService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaiShouReportTask
+     * @return
+     */
+    @AutoLog(value = "快手历史数据任务记录-添加")
+    @ApiOperation(value = "快手历史数据任务记录-添加", notes = "快手历史数据任务记录-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaiShouHistoryReportTask> add(@RequestBody KuaiShouHistoryReportTask kuaiShouReportTask) {
+        Result<KuaiShouHistoryReportTask> result = new Result<KuaiShouHistoryReportTask>();
+        try {
+            kuaiShouReportTaskService.save(kuaiShouReportTask);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaiShouReportTask
+     * @return
+     */
+    @AutoLog(value = "快手历史数据任务记录-编辑")
+    @ApiOperation(value = "快手历史数据任务记录-编辑", notes = "快手历史数据任务记录-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaiShouHistoryReportTask> edit(@RequestBody KuaiShouHistoryReportTask kuaiShouReportTask) {
+        Result<KuaiShouHistoryReportTask> result = new Result<KuaiShouHistoryReportTask>();
+        KuaiShouHistoryReportTask kuaiShouReportTaskEntity = kuaiShouReportTaskService.getById(kuaiShouReportTask.getId());
+        if (kuaiShouReportTaskEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaiShouReportTaskService.updateById(kuaiShouReportTask);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "快手历史数据任务记录-通过id删除")
+    @ApiOperation(value = "快手历史数据任务记录-通过id删除", notes = "快手历史数据任务记录-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            kuaiShouReportTaskService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "快手历史数据任务记录-批量删除")
+    @ApiOperation(value = "快手历史数据任务记录-批量删除", notes = "快手历史数据任务记录-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<KuaiShouHistoryReportTask> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<KuaiShouHistoryReportTask> result = new Result<KuaiShouHistoryReportTask>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaiShouReportTaskService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "快手历史数据任务记录-通过id查询")
+    @ApiOperation(value = "快手历史数据任务记录-通过id查询", notes = "快手历史数据任务记录-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<KuaiShouHistoryReportTask> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaiShouHistoryReportTask> result = new Result<KuaiShouHistoryReportTask>();
+        KuaiShouHistoryReportTask kuaiShouReportTask = kuaiShouReportTaskService.getById(id);
+        if (kuaiShouReportTask == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaiShouReportTask);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+}

+ 6 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreative.java

@@ -206,4 +206,10 @@ public class KuaiShouCreative {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "修改时间")
     private Date updateTime;
+
+    private Integer firstFrameType;
+
+    private Date creativeCreateTime;
+
+    private Date creativeUpdateTime;
 }

+ 90 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouDailyReportTask.java

@@ -0,0 +1,90 @@
+package cn.com.ctop.kuaishou.modules.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 分天记录表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-12
+ */
+@Data
+@TableName("ctop_kuaishou_daily_report_task")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_daily_report_task对象", description = "分天记录表")
+public class KuaiShouDailyReportTask {
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键ID")
+    private Long id;
+    /**
+     * 广告账户ID(相当于头条返回的access_token数据中的advertiser_id)
+     */
+    @Excel(name = "广告账户ID(相当于头条返回的access_token数据中的advertiser_id)", width = 15)
+    @ApiModelProperty(value = "广告账户ID(相当于头条返回的access_token数据中的advertiser_id)")
+    private Long accountId;
+    /**
+     * 任务id
+     */
+    @Excel(name = "任务id", width = 15)
+    @ApiModelProperty(value = "任务id")
+    private String taskId;
+    /**
+     * 任务名称
+     */
+    @Excel(name = "任务名称", width = 15)
+    @ApiModelProperty(value = "任务名称")
+    private String taskName;
+    /**
+     * 0:新建,1:处理中,2:处理成功,3:处理失败,4:数据已下载 5:文件生成 本地下载失败
+     */
+    @Excel(name = "0:新建,1:处理中,2:处理成功,3:处理失败,4:数据已下载 5:文件生成 本地下载失败", width = 15)
+    @ApiModelProperty(value = "0:新建,1:处理中,2:处理成功,3:处理失败,4:数据已下载 5:文件生成 本地下载失败")
+    private Integer taskStatus;
+    /**
+     * 1:账户维度查询,2:  广告计划维度查询,3:广告组维度查询,4:广告创意维度查询
+     */
+    @Excel(name = "1:账户维度查询,2:  广告计划维度查询,3:广告组维度查询,4:广告创意维度查询", width = 15)
+    @ApiModelProperty(value = "1:账户维度查询,2:  广告计划维度查询,3:广告组维度查询,4:广告创意维度查询")
+    private Integer viewType;
+    /**
+     * 任务查询数据起始时间
+     */
+    @Excel(name = "任务查询数据起始时间", width = 15)
+    @ApiModelProperty(value = "任务查询数据起始时间")
+    private String statDate;
+
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 95 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouHistoryReportTask.java

@@ -0,0 +1,95 @@
+package cn.com.ctop.kuaishou.modules.batch.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 快手历史数据任务记录
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-09
+ */
+@Data
+@TableName("ctop_kuaishou_history_report_task")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_report_task对象", description = "快手历史数据任务记录")
+public class KuaiShouHistoryReportTask {
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键ID")
+    private Long id;
+    /**
+     * 广告账户ID(相当于头条返回的access_token数据中的advertiser_id)
+     */
+    @Excel(name = "广告账户ID(相当于头条返回的access_token数据中的advertiser_id)", width = 15)
+    @ApiModelProperty(value = "广告账户ID(相当于头条返回的access_token数据中的advertiser_id)")
+    private Long accountId;
+    /**
+     * 任务id
+     */
+    @Excel(name = "任务id", width = 15)
+    @ApiModelProperty(value = "任务id")
+    private String taskId;
+    /**
+     * 任务名称
+     */
+    @Excel(name = "任务名称", width = 15)
+    @ApiModelProperty(value = "任务名称")
+    private String taskName;
+    /**
+     * 0:新建,1:处理中,2:处理成功,3:处理失败,4:数据已下载
+     */
+    @Excel(name = "0:新建,1:处理中,2:处理成功,3:处理失败,4:数据已下载", width = 15)
+    @ApiModelProperty(value = "0:新建,1:处理中,2:处理成功,3:处理失败,4:数据已下载")
+    private Integer taskStatus;
+    /**
+     * 1:账户维度查询,2:  广告计划维度查询,3:广告组维度查询,4:广告创意维度查询
+     */
+    @Excel(name = "1:账户维度查询,2:  广告计划维度查询,3:广告组维度查询,4:广告创意维度查询", width = 15)
+    @ApiModelProperty(value = "1:账户维度查询,2:  广告计划维度查询,3:广告组维度查询,4:广告创意维度查询")
+    private Integer viewType;
+    /**
+     * 任务查询数据起始时间
+     */
+    @Excel(name = "任务查询数据起始时间", width = 15)
+    @ApiModelProperty(value = "任务查询数据起始时间")
+    private String startDate;
+    /**
+     * 任务查询数据结束时间
+     */
+    @Excel(name = "任务查询数据结束时间", width = 15)
+    @ApiModelProperty(value = "任务查询数据结束时间")
+    private String endDate;
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * 修改时间
+     */
+    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+}

+ 15 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouDailyReportTaskMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.batch.mapper;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouDailyReportTask;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 分天记录表
+ *
+ * @author: jeecg-boot
+ * @date: 2020-03-12
+ * @cersion: V1.0
+ */
+public interface KuaiShouDailyReportTaskMapper extends BaseMapper<KuaiShouDailyReportTask> {
+
+}

+ 15 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouHistoryReportTaskMapper.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.batch.mapper;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouHistoryReportTask;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 快手历史数据任务记录
+ *
+ * @author: jeecg-boot
+ * @date: 2020-03-09
+ * @cersion: V1.0
+ */
+public interface KuaiShouHistoryReportTaskMapper extends BaseMapper<KuaiShouHistoryReportTask> {
+
+}

+ 6 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCreativeMapper.xml

@@ -29,7 +29,9 @@
         ad_photo_played_t3s_url,
         description,
         action_bar_text,
-
+        first_frame_type,
+        creative_create_time,
+        creative_update_time,
         create_time,
         update_time)
         values
@@ -61,6 +63,9 @@
             #{creative.adPhotoPlayedT3sUrl},
             #{creative.description},
             #{creative.actionBarText},
+            #{creative.firstFrameType},
+            #{creative.creativeCreateTime},
+            #{creative.creativeUpdateTime},
             #{creative.createTime},
             #{creative.updateTime})
         </foreach>

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouDailyReportTaskMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouDailyReportTaskMapper">
+
+</mapper>

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouHistoryReportTaskMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouHistoryReportTaskMapper">
+
+</mapper>

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouCampaignService.java

@@ -1,6 +1,7 @@
 package cn.com.ctop.kuaishou.modules.batch.service;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.List;
@@ -14,4 +15,6 @@ import java.util.List;
 public interface IKuaiShouCampaignService extends IService<KuaiShouCampaign> {
 
     void replaceBatch(List<KuaiShouCampaign> campaigns);
+
+    List<JSONArray> getJsonArrByAccount(Long accountId, int idSize);
 }

+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouDailyReportTaskService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.batch.service;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouDailyReportTask;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 分天记录表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-12
+ */
+public interface IKuaiShouDailyReportTaskService extends IService<KuaiShouDailyReportTask> {
+    void formatCreativeDailyReportData(Long accountId, String statDate);
+
+    void getTaskList(Long accountId, String token, String statDate);
+
+}

+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouHistoryReportTaskService.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.batch.service;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouHistoryReportTask;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 快手历史数据任务记录
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-09
+ */
+public interface IKuaiShouHistoryReportTaskService extends IService<KuaiShouHistoryReportTask> {
+    void createTask(Long accountId, String token, String startDate, String endDate, String taskType);
+
+    void getTaskList();
+
+}

+ 4 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java

@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -37,7 +38,7 @@ public interface IKuaishouInterfaceService {
 
     void loadAllKuaishouData(List<CtopOauthToken> tokens);
 
-    void loadKuaishouDataSingle(CtopOauthToken token);
+    void loadKuaishouDataSingle(CtopOauthToken token) throws ParseException;
 
     /**
      * 创建广告计划
@@ -254,7 +255,7 @@ public interface IKuaishouInterfaceService {
 
     void getAdvertiserGroupReportDaily(CtopOauthToken token, Date startDate, Date endDate);
 
-    void getAdvertiserCreativeReportDaily(CtopOauthToken token, Date startDate, Date endDate);
+    void getAdvertiserCreativeReportDaily(CtopOauthToken token, Date startDate, Date endDate,JSONArray campaignIds);
 
     void getAdvertiserReportHourly(CtopOauthToken token, Date startDate, Date endDate);
 
@@ -352,6 +353,7 @@ public interface IKuaishouInterfaceService {
     void getCreative(String token, Long advertiserId, Long creativeId);
 
 
+    void getAdvertiserCreativeReportDailyV2(Long campaignId, CtopOauthToken ctopOauthToken, Date startDate, Date endDate);
 }
 
 

+ 36 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCampaignServiceImpl.java

@@ -1,12 +1,16 @@
 package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCampaignMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCampaignService;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -24,4 +28,36 @@ public class KuaiShouCampaignServiceImpl extends ServiceImpl<KuaiShouCampaignMap
     public void replaceBatch(List<KuaiShouCampaign> campaigns) {
         campaignMapper.replaceBatch(campaigns);
     }
+
+
+    /**
+     * 获取创意
+     *
+     * @param accountId
+     * @return
+     */
+    @Override
+    public List<JSONArray> getJsonArrByAccount(Long accountId, int idSize) {
+        QueryWrapper<KuaiShouCampaign> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId);
+        List<KuaiShouCampaign> list = this.list(queryWrapper);
+        List<JSONArray> campaignArr = new ArrayList<>();
+        if (!Check.isNull(list)) {
+            int arrSize = list.size() % idSize == 0 ? list.size() / idSize : list.size() / idSize + 1;
+            for (int i = 0; i < arrSize; i++) {
+                JSONArray arr = new JSONArray();
+                for (int j = i * idSize; j <= idSize * (i + 1) - 1; j++) {
+                    if (j <= list.size() - 1) {
+                        KuaiShouCampaign campaign = list.get(i);
+                        arr.add(campaign.getCampaignId());
+                    }
+                }
+                campaignArr.add(arr);
+            }
+            return campaignArr;
+        }
+
+        return null;
+    }
+
 }

+ 145 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouDailyReportTaskServiceImpl.java

@@ -0,0 +1,145 @@
+package cn.com.ctop.kuaishou.modules.batch.service.impl;
+
+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.batch.entity.KuaiShouDailyReportTask;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouDailyReportTaskMapper;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
+import cn.com.ctop.kuaishou.modules.utils.DownloadUtils;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 分天记录表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-12
+ */
+@Slf4j
+@Service
+public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDailyReportTaskMapper, KuaiShouDailyReportTask> implements IKuaiShouDailyReportTaskService {
+
+
+    @Value("${jeecg.path.report-daily}")
+    private String downloadPath;
+    @Autowired
+    private KuaishouReportDailyCampaignMapper reportDailyCampaignMapper;
+
+    @Autowired
+    private KuaishouReportDailyGroupMapper reportDailyGroupMapper;
+
+    @Autowired
+    private KuaishouReportDailyCreativeMapper reportDailyCreativeMapper;
+
+    @Override
+    public void formatCreativeDailyReportData(Long accountId, String statDate) {
+        reportDailyCreativeMapper.formatCreativeDailyReportData(accountId, statDate);
+    }
+
+    /**
+     * 获取任务列表
+     */
+    @Override
+    public void getTaskList(Long accountId, String token, String statDate) {
+        QueryWrapper<KuaiShouDailyReportTask> taskQueryWrapper = new QueryWrapper<>();
+
+
+        taskQueryWrapper.eq("task_status", 0);
+        taskQueryWrapper.eq("account_id", accountId);
+        taskQueryWrapper.eq("stat_date", statDate);
+        taskQueryWrapper.orderByDesc("create_time");
+        List<KuaiShouDailyReportTask> dailyTaskList = this.list(taskQueryWrapper);
+        if (!Check.isNull(dailyTaskList)) {
+            for (KuaiShouDailyReportTask task : dailyTaskList) {
+                String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ASYNC_TASK_LIST;
+                Map<String, String> headers = new HashMap<>();
+                headers.put("Content-Type", "application/json");
+                headers.put("Access-Token", token);
+                JSONObject param = new JSONObject();
+                param.put("advertiser_id", task.getAccountId());
+                JSONArray taskIds = new JSONArray();
+                taskIds.add(task.getTaskId());
+                param.put("task_ids", taskIds);
+                String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+                JSONObject resultJson = JSONObject.parseObject(result);
+                if (!Check.isNull(resultJson)) {
+                    Integer code = resultJson.getInteger("code");
+                    if (code == 0) {
+                        JSONObject dataJson = resultJson.getJSONObject("data");
+                        if (!Check.isNull(dataJson)) {
+                            JSONArray details = dataJson.getJSONArray("details");
+                            if (!Check.isNull(details)) {
+                                for (int i = 0; i < details.size(); i++) {
+                                    JSONObject detailJson = details.getJSONObject(i);
+                                    if (!Check.isNull(detailJson)) {
+                                        Integer taskStatus = detailJson.getInteger("task_status");
+                                        if (taskStatus == 2) {
+                                            loadFile(token, task);
+                                        } else if (taskStatus == 3) {
+                                            task.setTaskStatus(3);
+                                            task.setUpdateTime(new Date());
+                                            this.updateById(task);
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    } else {
+                        log.error("快手获取任务列表返回错误,accountId:{},返回结果:{}", task.getAccountId(), resultJson);
+                    }
+                } else {
+                    log.error("快手获取任务列表返回信息为空,accountId:{}", task.getAccountId());
+                }
+            }
+        }
+
+    }
+
+
+    private void loadFile(String token, KuaiShouDailyReportTask task) {
+        try {
+            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ASYNC_TASK_DOWNLOAD;
+            String fileName = task.getAccountId() + "_" + task.getStatDate() + "_" + task.getViewType() + ".csv";
+            Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("advertiser_id", task.getAccountId());
+            requestMap.put("task_id", task.getTaskId());
+            String localPath = DownloadUtils.downloadByUrl(requestMap, downloadPath + task.getStatDate() + "//", url, token, fileName);
+            if (!Check.isNull(localPath)) {
+                if (task.getViewType() == 2) {
+                    reportDailyCampaignMapper.loadCampaignDailyReport(task.getAccountId(), localPath);
+                } else if (task.getViewType() == 3) {
+                    reportDailyGroupMapper.loadGroupDailyReport(task.getAccountId(), localPath);
+
+                } else if (task.getViewType() == 4) {
+                    reportDailyCreativeMapper.loadCreativeDailyReport(task.getAccountId(), localPath);
+                }
+            }
+
+            task.setTaskStatus(4);
+        } catch (Exception e) {
+            e.printStackTrace();
+            task.setTaskStatus(5);
+        }
+        task.setUpdateTime(new Date());
+        this.updateById(task);
+    }
+
+
+}

+ 249 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouHistoryReportTaskServiceImpl.java

@@ -0,0 +1,249 @@
+package cn.com.ctop.kuaishou.modules.batch.service.impl;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.*;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouDailyReportTask;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouHistoryReportTask;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouHistoryReportTaskMapper;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
+import cn.com.ctop.kuaishou.modules.utils.DownloadUtils;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 快手历史数据任务记录
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-03-09
+ */
+@Slf4j
+@Service
+public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHistoryReportTaskMapper, KuaiShouHistoryReportTask> implements IKuaiShouHistoryReportTaskService {
+    @Value("${jeecg.path.report-history}")
+    private String downloadPath;
+    static List<Integer> historyTypeList;
+    static List<Integer> dailyTypeList;
+    @Autowired
+    private ICtopOauthTokenService ctopOauthTokenService;
+    @Autowired
+    private KuaishouReportDailyAccountMapper reportDailyAccountMapper;
+
+    @Autowired
+    private KuaishouReportDailyCampaignMapper reportDailyCampaignMapper;
+
+
+    @Autowired
+    private KuaishouReportDailyGroupMapper reportDailyGroupMapper;
+
+    @Autowired
+    private KuaishouReportDailyCreativeMapper reportDailyCreativeMapper;
+    @Autowired
+    private IKuaiShouDailyReportTaskService dailyReportTaskService;
+
+    @Override
+    public void createTask(Long accountId, String token, String startDate, String endDate, String taskType) {
+        if (Check.isNull(accountId) || Check.isNull(token)) {
+            log.error("token或accountId为空");
+            return;
+        }
+        try {
+            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ASYNC_TASK_CREAT;
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Content-Type", "application/json");
+            headers.put("Access-Token", token);
+            JSONObject param = new JSONObject();
+            param.put("advertiser_id", accountId);
+            JSONObject taskParams = new JSONObject();
+            taskParams.put("start_date", startDate);
+            taskParams.put("end_date", endDate);
+            if (null != taskType && taskType.equals(CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_DAILY)) {
+                if (Check.isNull(dailyTypeList)) {
+                    getDailyTypeList();
+                }
+                for (int i = 0; i < dailyTypeList.size(); i++) {
+                    Integer type = dailyTypeList.get(i);
+                    String taskName = accountId + "_" + type + "_" + System.currentTimeMillis();
+                    param.put("task_name", taskName);
+                    taskParams.put("view_type", type);
+                    param.put("task_params", taskParams);
+                    String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+                    JSONObject resultJson = JSONObject.parseObject(result);
+                    if (!Check.isNull(resultJson)) {
+                        Integer code = resultJson.getInteger("code");
+                        if (code == 0) {
+                            JSONObject dataJson = resultJson.getJSONObject("data");
+                            KuaiShouDailyReportTask dailyReportTask = new KuaiShouDailyReportTask();
+                            dailyReportTask.setAccountId(accountId);
+                            dailyReportTask.setStatDate(startDate);
+                            dailyReportTask.setTaskId(dataJson.getString("task_id"));
+                            dailyReportTask.setViewType(type);
+                            dailyReportTask.setTaskStatus(0);
+                            dailyReportTask.setTaskName(taskName);
+                            dailyReportTaskService.save(dailyReportTask);
+                        } else {
+                            log.error("快手历史报表请求失败,accountId:{},返回数据:{}", accountId, resultJson);
+                        }
+                    }
+                }
+            } else {
+                if (Check.isNull(historyTypeList)) {
+                    getHistoryTypeList();
+                }
+                for (int i = 0; i < historyTypeList.size(); i++) {
+                    Integer type = historyTypeList.get(i);
+                    String taskName = accountId + "_" + type + "_" + System.currentTimeMillis();
+                    param.put("task_name", taskName);
+                    taskParams.put("view_type", type);
+                    param.put("task_params", taskParams);
+                    String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+                    JSONObject resultJson = JSONObject.parseObject(result);
+                    log.info("请求状态返回数据:{}", resultJson);
+                    if (!Check.isNull(resultJson)) {
+                        Integer code = resultJson.getInteger("code");
+                        if (code == 0) {
+                            JSONObject dataJson = resultJson.getJSONObject("data");
+                            KuaiShouHistoryReportTask reportTask = new KuaiShouHistoryReportTask();
+                            reportTask.setAccountId(accountId);
+                            reportTask.setStartDate(startDate);
+                            reportTask.setEndDate(endDate);
+                            reportTask.setTaskId(dataJson.getString("task_id"));
+                            reportTask.setViewType(type);
+                            reportTask.setTaskStatus(0);
+                            reportTask.setTaskName(taskName);
+                            this.save(reportTask);
+                        } else {
+                            log.error("快手历史报表请求失败,accountId:{},返回数据:{}", accountId, resultJson);
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    /**
+     * 获取任务列表
+     */
+    @Override
+    public void getTaskList() {
+        log.info("开始历史数据文件检查下载");
+        QueryWrapper<KuaiShouHistoryReportTask> taskQueryWrapper = new QueryWrapper<>();
+        taskQueryWrapper.eq("task_status", 0);
+        taskQueryWrapper.orderByDesc("create_time");
+        List<KuaiShouHistoryReportTask> taskList = this.list(taskQueryWrapper);
+        if (!Check.isNull(taskList)) {
+            for (KuaiShouHistoryReportTask task : taskList) {
+                CtopOauthToken token = ctopOauthTokenService.getTokenByAccountId(task.getAccountId());
+                if (!Check.isNull(token)) {
+                    String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ASYNC_TASK_LIST;
+                    Map<String, String> headers = new HashMap<>();
+                    headers.put("Content-Type", "application/json");
+                    headers.put("Access-Token", token.getAccessToken());
+                    JSONObject param = new JSONObject();
+                    param.put("advertiser_id", task.getAccountId());
+                    JSONArray taskIds = new JSONArray();
+                    taskIds.add(task.getTaskId());
+                    param.put("task_ids", taskIds);
+                    String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+                    JSONObject resultJson = JSONObject.parseObject(result);
+                    log.info("请求状态返回数据:{}", resultJson);
+                    if (!Check.isNull(resultJson)) {
+                        Integer code = resultJson.getInteger("code");
+                        if (code == 0) {
+                            JSONObject dataJson = resultJson.getJSONObject("data");
+                            if (!Check.isNull(dataJson)) {
+                                JSONArray details = dataJson.getJSONArray("details");
+                                if (!Check.isNull(details)) {
+                                    for (int i = 0; i < details.size(); i++) {
+                                        JSONObject detailJson = details.getJSONObject(i);
+                                        if (!Check.isNull(detailJson)) {
+                                            Integer taskStatus = detailJson.getInteger("task_status");
+                                            if (taskStatus == 2) {
+                                                loadFile(token.getAccessToken(), task);
+                                            } else if (taskStatus == 3) {
+                                                task.setTaskStatus(3);
+                                                this.updateById(task);
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        } else {
+                            log.error("快手获取任务列表返回错误,accountId:{},返回结果:{}", task.getAccountId(), resultJson);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+
+    private void loadFile(String token, KuaiShouHistoryReportTask task) {
+        try {
+            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ASYNC_TASK_DOWNLOAD;
+            String fileName = task.getAccountId() + "_" + task.getViewType() + ".csv";
+            Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("advertiser_id", task.getAccountId());
+            requestMap.put("task_id", task.getTaskId());
+            String localPath = DownloadUtils.downloadByUrl(requestMap, downloadPath, url, token, fileName);
+            if (!Check.isNull(localPath)) {
+                if (task.getViewType() == 1) {
+                    reportDailyAccountMapper.loadAccountDailyReport(task.getAccountId(), localPath);
+                } else if (task.getViewType() == 2) {
+                    reportDailyCampaignMapper.loadCampaignDailyReport(task.getAccountId(), localPath);
+
+                } else if (task.getViewType() == 3) {
+                    reportDailyGroupMapper.loadGroupDailyReport(task.getAccountId(), localPath);
+
+                } else if (task.getViewType() == 4) {
+                    reportDailyCreativeMapper.loadCreativeDailyReport(task.getAccountId(), localPath);
+                    reportDailyCreativeMapper.formatCreativeDailyReportData(task.getAccountId(), null);
+                }
+            }
+            task.setTaskStatus(4);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            task.setTaskStatus(5);
+        }
+        this.updateById(task);
+
+    }
+
+
+    private void getHistoryTypeList() {
+        historyTypeList = new ArrayList<>();
+        historyTypeList.add(1);
+        historyTypeList.add(2);
+        historyTypeList.add(3);
+        historyTypeList.add(4);
+    }
+
+    private void getDailyTypeList() {
+        dailyTypeList = new ArrayList<>();
+        dailyTypeList.add(2);
+        dailyTypeList.add(3);
+        dailyTypeList.add(4);
+    }
+
+}

+ 134 - 57
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -14,6 +14,7 @@ import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResult;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResultToken;
 import cn.com.ctop.kuaishou.modules.report.entity.*;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
 import cn.com.ctop.kuaishou.modules.report.service.*;
 import com.alibaba.fastjson.JSONArray;
@@ -77,15 +78,11 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     private KuaiShouConversionInfosMapper conversionInfosMapper;
     @Autowired
     private KuaiShouConversionTypesMapper conversionTypesMapper;
-    @Autowired
-    private KuaiShouCreativeCreateMapper creativeCreateMapper;
+
     @Autowired
     private KuaiShouVideoUploadMapper videoUploadMapper;
     @Autowired
     private KuaiShouVideoMapper kuaiShouVideoMapper;
-
-    @Autowired
-    private KuaiShouImageGetMapper imageGetMapper;
     @Autowired
     private KuaiShouRegionListChildrenMapper regionListChildrenMapper;
     @Autowired
@@ -106,6 +103,15 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     private KuaiShouAdvertiserBaseInfoMapper advertiserBaseInfoMapper;
     @Autowired
     private IKuaiShouImageGetService iKuaiShouImageGetService;
+    @Autowired
+    private MaterialInfoMapper materialInfoMapper;
+    @Autowired
+    private KuaiShouGroupTargetMapper groupTargetMapper;
+    @Autowired
+    private KuaiShouTargetingTagsMapper targetingTagsMapper;
+
+    @Autowired
+    private KuaishouReportDailyAccountMapper dailyAccountMapper;
 
     @Override
     public void getAdvertiserReportHourly(CtopOauthToken token, Date startDate, Date endDate) {
@@ -370,15 +376,22 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         }
 
         for (int i = 0; i < details.size(); i++) {
-            var detailJson = details.getJSONObject(i);
-            var show = detailJson.getLong("show");
-            detailJson.put("photo_show", show);
-            var like = detailJson.getLong("like");
-            detailJson.put("photo_like", like);
-            var kuaishouReportDailyAccount = JSONObject.toJavaObject(detailJson, KuaishouReportDailyAccount.class);
-            kuaishouReportDailyAccount.setAccountId(token.getAccountId());
-            kuaishouReportDailyAccount.setId("" + token.getAccountId() + kuaishouReportDailyAccount.getStatDate());
-            dailyAccountService.saveOrUpdate(kuaishouReportDailyAccount);
+            JSONObject detailJson = details.getJSONObject(i);
+            if (!Check.isNull(detailJson)) {
+                detailJson.put("photo_share", detailJson.getString("share"));
+                detailJson.put("photo_comment", detailJson.getString("comment"));
+                detailJson.put("photo_like", detailJson.getString("like"));
+                detailJson.put("photo_show", detailJson.getString("show"));
+                detailJson.remove("share");
+                detailJson.remove("comment");
+                detailJson.remove("like");
+                detailJson.remove("show");
+                detailJson.remove("adScene");
+                detailJson.remove("stat_hour");
+                KuaishouReportDailyAccount kuaishouReportDailyAccount = JsonUtil.jsonToObj(detailJson, KuaishouReportDailyAccount.class);
+                kuaishouReportDailyAccount.setAccountId(token.getAccountId());
+                dailyAccountMapper.insertSelective(kuaishouReportDailyAccount);
+            }
         }
         getAccountDailyReportByPage(token, startDate, endDate, page + 1);
     }
@@ -420,7 +433,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                             KuaishouReportDailyAccount kuaishouReportDailyAccount = JSONObject.toJavaObject(detailJson, KuaishouReportDailyAccount.class);
                             kuaishouReportDailyAccount.setAccountId(advertiserId);
                             kuaishouReportDailyAccount.setId("" + advertiserId + kuaishouReportDailyAccount.getStatDate());
-                            dailyAccountService.saveOrUpdate(kuaishouReportDailyAccount);
+                            //dailyAccountService.saveOrUpdate(kuaishouReportDailyAccount);
                         }
                     }
                 }
@@ -777,11 +790,11 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
     @Override
-    public void getAdvertiserCreativeReportDaily(CtopOauthToken token, Date startDate, Date endDate) {
-        getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, 1);
+    public void getAdvertiserCreativeReportDaily(CtopOauthToken token, Date startDate, Date endDate, JSONArray campaignIds) {
+        getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, campaignIds, 1);
     }
 
-    private void getAdvertiserCreativeReportDailyByPage(CtopOauthToken token, Date startDate, Date endDate, int page) {
+    private void getAdvertiserCreativeReportDailyByPage(CtopOauthToken token, Date startDate, Date endDate, JSONArray campaignIds, int page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
         headers.put("Content-Type", "application/json");
@@ -793,9 +806,14 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         if (!Check.isNull(endDate)) {
             param.put("end_date", DateUtils.formatDate(endDate));
         }
+        if (!Check.isNull(campaignIds) && campaignIds.size() > 0) {
+            param.put("campaign_ids", campaignIds);
+
+        }
+
         param.put("advertiser_id", token.getAccountId());
         param.put("temporal_granularity", "DAILY");
-        param.put("page_size", 500);
+        param.put("page_size", 1000);
         param.put("page", page);
 
         String result = HttpUtils.httpPostRequest(url, param, headers);
@@ -830,7 +848,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             dailyCreativeStatisticService.saveOrUpdate(statistic);
             dailyCreativeService.saveOrUpdate(creative);
         }
-        getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, page + 1);
+        getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, campaignIds, page + 1);
     }
 
     private KuaishouReportDailyCreativeStatistic setDailyStatistic(KuaishouReportDailyCreative creative, CtopOauthToken token) {
@@ -1020,13 +1038,27 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     public void loadAllKuaishouData(List<CtopOauthToken> tokens) {
         if (null != tokens && tokens.size() > 0) {
             for (CtopOauthToken token : tokens) {
-                loadKuaishouDataSingle(token);
+                try {
+                    loadKuaishouDataSingle(token);
+                } catch (java.text.ParseException e) {
+                    e.printStackTrace();
+                }
             }
         }
     }
 
+    @Autowired
+    private IKuaiShouHistoryReportTaskService historyReportTaskService;
+
     @Override
-    public void loadKuaishouDataSingle(CtopOauthToken token) {
+    public void loadKuaishouDataSingle(CtopOauthToken token) throws java.text.ParseException {
+        log.info("----------------开始历史数据获取,accountId:{}", token.getAccountId());
+
+        String endDateStr = DateUtils.getDate("yyyy-MM-dd");
+        String startDate = DateUtils.addMonth(endDateStr, -6);
+
+        historyReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), startDate, endDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
+
         Date endDate = new Date();
         for (int i = 0; i < 7; i++) {
             Date getStartDate = DateUtils.addDay(endDate, -i);
@@ -1039,39 +1071,22 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             //4: 获取广告创意信息数据
             getAdvertiserCreativeReportHourly(token, getStartDate, getStartDate);
         }
-        for (int i = 0; i < 6; i++) {
-            Date getStartDate = new Date();
-            Date getEndDate = new Date();
-            if (i == 0) {
-                getStartDate = DateUtils.addDay(endDate, -175 + i * 30);
-                getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
-            } else {
-                getStartDate = DateUtils.addDay(endDate, -180 + i * 30);
-                getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
-            }
-            //1: 获取广告主信息数据
-            getAdvertiserReportDaily(token, getStartDate, getEndDate);
-            //2:获取广告计划信息数据
-            getAdvertiserCampaignReportDaily(token, getStartDate, getEndDate);
-            //3:获取广告组信息数据
-            getAdvertiserGroupReportDaily(token, getStartDate, getEndDate);
-            //4: 获取广告创意信息数据
-            getAdvertiserCreativeReportDaily(token, getStartDate, getEndDate);
 
-            //获取全量广告计划数据
-            getCampaignList(token, null, null);
-            //获取全量广组主数据
-            getGroupList(token, null, null);
-            //获取全量创意数据
-            getCreativeList(token, null, null);
-            //获取全量视频素材数据
-            getVideoList(token, null, null);
-            //获取图片信息数据
-            getImageList(token, null, null);
-        }
+        //获取全量广告计划数据
+        getCampaignList(token, null, null);
+        //获取全量广组主数据
+        getGroupList(token, null, null);
+        //获取全量创意数据
+        getCreativeList(token, null, null);
+        //获取全量视频素材数据
+        getVideoList(token, null, null);
+        //获取图片信息数据
+        getImageList(token, null, null);
 
 
         getAppList(token.getAccountId(), token.getAccessToken());
+
+
     }
 
 
@@ -1557,8 +1572,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     }
 
-    @Autowired
-    private KuaiShouGroupTargetMapper groupTargetMapper;
 
     private void addGroup(Long advertiserId, JSONArray details) {
         if (!Check.isNull(details)) {
@@ -1800,6 +1813,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                         creative.setDescription(displayInfoJson.getString("description"));
                         creative.setActionBarText(displayInfoJson.getString("action_bar_text"));
                     }
+
                     creative.setCreateTime(new Date());
                     creative.setUpdateTime(new Date());
                     creatives.add(creative);
@@ -1969,6 +1983,11 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                         creative.setDescription(displayInfoJson.getString("description"));
                         creative.setActionBarText(displayInfoJson.getString("action_bar_text"));
                     }
+
+                    creative.setFirstFrameType(detailJson.getInteger("first_frame_type"));
+                    creative.setCreativeCreateTime(detailJson.get("create_time") == null ? null : detailJson.getDate("create_time"));
+                    creative.setCreativeUpdateTime(detailJson.get("update_time") == null ? null : detailJson.getDate("update_time"));
+
                     creative.setCreateTime(new Date());
                     creative.setUpdateTime(new Date());
                     creatives.add(creative);
@@ -2440,8 +2459,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     }
 
-    @Autowired
-    private MaterialInfoMapper materialInfoMapper;
 
     @Override
     public Map<String, Object> videoUpload(Long advertiserId, String accessToken, String videoUrl) {
@@ -3625,8 +3642,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
      * @param accountId
      * @param accessToken
      */
-    @Autowired
-    private KuaiShouTargetingTagsMapper targetingTagsMapper;
+
 
     @Override
     public void getTargetingTags(Long accountId, String accessToken) {
@@ -3723,5 +3739,66 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return null;
     }
 
+    @Override
+    public void getAdvertiserCreativeReportDailyV2(Long campaignId, CtopOauthToken token, Date startDate, Date endDate) {
+        getAdvertiserCreativeReportDailyByPageV2(campaignId, token, startDate, endDate, 1);
+    }
+
+    private void getAdvertiserCreativeReportDailyByPageV2(Long campaignId, CtopOauthToken token, Date startDate, Date endDate, int page) {
+        String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_REPORT;
+        Map<String, String> headers = new HashMap<String, String>();
+        headers.put("Content-Type", "application/json");
+        headers.put("Access-Token", token.getAccessToken());
+        Map<String, Object> param = new HashMap<String, Object>();
+        if (!Check.isNull(startDate)) {
+            param.put("start_date", DateUtils.formatDate(startDate));
+        }
+        if (!Check.isNull(endDate)) {
+            param.put("end_date", DateUtils.formatDate(endDate));
+        }
+
+        JSONArray jsonArray = new JSONArray();
+        jsonArray.add(campaignId);
+        param.put("campaign_ids", jsonArray);
+        param.put("advertiser_id", token.getAccountId());
+        param.put("temporal_granularity", "DAILY");
+        param.put("page_size", 500);
+        param.put("page", page);
+
+        String result = HttpUtils.httpPostRequest(url, param, headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+        Integer code = resultJson.getInteger("code");
+        String message = resultJson.getString("message");
+        if (null == code || code != 0) {
+            log.error("获取快手广告创意分天报表异常:{},accountId:{}", message, token.getAccountId());
+            return;
+        }
+        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+        if (null == details || details.size() <= 0) {
+            log.info("快手广告创意分天报表信息为空=》accountId:{}", token.getAccountId());
+            return;
+        }
+        for (int i = 0; i < details.size(); i++) {
+            var detailJson = details.getJSONObject(i);
+            var show = detailJson.getLong("show");
+            detailJson.put("photo_show", show);
+            var like = detailJson.getLong("like");
+            detailJson.put("photo_like", like);
+            var creative = JSONObject.toJavaObject(detailJson, KuaishouReportDailyCreative.class);
+            creative.setAccountId(token.getAccountId());
+            creative.setId("" + creative.getAccountId() + creative.getCreativeId() + creative.getStatDate());
+
+            // 取得MD5
+            String signature = creativeService.getCodeByCreativeId(creative.getCreativeId());
+            if (!Check.isNull(signature)) {
+                creative.setSignature(signature);
+            }
+            KuaishouReportDailyCreativeStatistic statistic = setDailyStatistic(creative, token);
+            dailyCreativeStatisticService.saveOrUpdate(statistic);
+            dailyCreativeService.saveOrUpdate(creative);
+        }
+        getAdvertiserCreativeReportDailyByPageV2(campaignId, token, startDate, endDate, page + 1);
+    }
+
 
 }

+ 16 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java

@@ -611,6 +611,18 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
             //等待2秒用于页面加载,保证Cookie响应全部获取。
             Thread.sleep(10000);
 
+//            WebElement iframeElement = webDriver.findElement(By.tagName("iframe"));
+//            if (iframeElement != null) {
+//                log.error("【错误】快手登录出现验证码!");
+//                File scrFile = captureElement(webDriver.findElement(By.tagName("iframe")));
+//                //clickCharBg
+//                String savePath = "D:/capter.png";
+//                FileUtils.copyFile(scrFile, new File(savePath));
+//                webDriver.switchTo().frame(webDriver.findElement(By.tagName("iframe")));
+//                String result = ChaojiyingUtils.process(Base64Utils.imageToBase64(savePath));
+//                System.out.println(result);
+//                ((JavascriptExecutor) webDriver).executeScript("arguments[0].click();", webDriver.findElement(By.className("aq_icon_refresh")));
+//            }
             webDriver.get("https://b.e.kuaishou.com/#/home/profile");
             //获取Cookie并打印
             Set<org.openqa.selenium.Cookie> cookies = webDriver.manage().getCookies();
@@ -947,6 +959,10 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
             mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
             JsonNode node = mapper.readTree(str);
             Integer result = node.get("result").asInt();
+            JsonNode pcursoNode = node.get("pcursor");
+            if (null == pcursoNode) {
+                log.info("异常数据:{}", str);
+            }
             String pcursor = node.get("pcursor").asText();
             if (result == 1) {
                 Iterator<JsonNode> nodes = node.get("photos").iterator();

+ 134 - 8
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouReportDailyAgentSumController.java

@@ -1,24 +1,28 @@
 package cn.com.ctop.kuaishou.modules.report.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.io.OutputStream;
+import java.util.*;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
+import cn.com.ctop.common.module.utils.RateUtil;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgent;
 import cn.com.ctop.kuaishou.modules.report.entity.ParamsDTO;
+import com.alibaba.fastjson.JSONObject;
 import org.apache.commons.lang.StringUtils;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.oConvertUtils;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgentSum;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentSumService;
-import java.util.Date;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -256,11 +260,12 @@ public class KuaishouReportDailyAgentSumController {
 	  * @param dto
 	  * @return Result<KuaishouReportDailyAgentSum>
 	  */
-	 @AutoLog(value = "公司报表按时间汇总")
-	 @ApiOperation(value="公司报表按时间汇总", notes="公司报表按时间汇总")
+	 @AutoLog(value = "公司报表按天明细")
+	 @ApiOperation(value="公司报表按天明细", notes="公司报表按天明细")
 	 @PostMapping(value = "/companyReportAccountDetailList")
 	 public Result<List<KuaishouReportDailyAgent>> companyReportAccountDetailList(@RequestBody ParamsDTO dto) {
 		 Result<List<KuaishouReportDailyAgent>> result = new Result<>();
+		 String advertiserName = dto.getAdvertiserName();
 		 String date = dto.getDate();
 		 if(StringUtils.isBlank(date)){
 			 result.setSuccess(false);
@@ -268,7 +273,7 @@ public class KuaishouReportDailyAgentSumController {
 			 return result;
 		 }
 
-		 List<KuaishouReportDailyAgent> kuaishouReportDailyAgentList = kuaishouReportDailyAgentSumService.companyReportAccountDetailList(date);
+		 List<KuaishouReportDailyAgent> kuaishouReportDailyAgentList = kuaishouReportDailyAgentSumService.companyReportAccountDetailList(date, advertiserName, null);
 		 result.setResult(kuaishouReportDailyAgentList);
 		 result.setSuccess(true);
 		 result.setMessage("success");
@@ -276,4 +281,125 @@ public class KuaishouReportDailyAgentSumController {
 		 return result;
 	 }
 
-}
+	 @AutoLog(value = "公司报表按天导出Excel")
+	 @ApiOperation(value="公司报表按天导出Excel", notes="公司报表按天导出Excel")
+	 @PostMapping(value = "/companyReportExportExcel")
+	 public void companyReportExportExcel( @RequestBody ParamsDTO dto,
+										   //@RequestParam("startDate")String startDate,
+										   //@RequestParam("endDate")String endDate,
+										   HttpServletRequest request,
+										   HttpServletResponse response) throws Exception{
+		 Result result = new Result<>();
+		 result.setSuccess(true);
+		 result.setMessage("success");
+
+		 //公司报表
+		 List<KuaishouReportDailyAgentSum> kuaishouReportDailyAgentSumList = kuaishouReportDailyAgentSumService.companyReport(dto.getStartDate(),dto.getEndDate());
+
+		 //导出excel
+		 List<List<Object>> group = new ArrayList<>();
+		 if (!Check.isNull(kuaishouReportDailyAgentSumList)) {
+			 for (KuaishouReportDailyAgentSum sum : kuaishouReportDailyAgentSumList) {
+				 List<Object> kuaishouReportDailyAgentSum = new ArrayList();
+				 kuaishouReportDailyAgentSum.add(DateUtils.formatDate(sum.getDate()));  //日期
+				 kuaishouReportDailyAgentSum.add(sum.getCostCampaignCount() );  //有消费计划数
+				 kuaishouReportDailyAgentSum.add(sum.getBalance());  //总余额
+				 kuaishouReportDailyAgentSum.add(sum.getCost());  //总消耗
+				 kuaishouReportDailyAgentSum.add(sum.getXianjinCost());  //现金消耗
+				 kuaishouReportDailyAgentSum.add(sum.getFandianCost());  //后返消耗
+				 kuaishouReportDailyAgentSum.add(sum.getKuangfanCost());  //框返消耗
+				 kuaishouReportDailyAgentSum.add(sum.getJiliCost());  //激励账户消耗
+				 kuaishouReportDailyAgentSum.add(sum.getXinyongCost());  //信用账户消耗
+				 kuaishouReportDailyAgentSum.add(sum.getFengmianShowCount());  //封面曝光数
+				 kuaishouReportDailyAgentSum.add(sum.getFengmianClickCount());  //封面点击数
+				 kuaishouReportDailyAgentSum.add(sum.getSucaiShowCount());  //素材曝光数
+				 kuaishouReportDailyAgentSum.add(sum.getConvertCount());  //行为数
+				 kuaishouReportDailyAgentSum.add(sum.getFengmianClickCount());  //封面点击率
+				 kuaishouReportDailyAgentSum.add(sum.getConvertClickRate());  //转化点击率
+				 group.add(kuaishouReportDailyAgentSum);
+			 }
+		 }
+
+		 String[] groupHeaders = {"日期", "有消费计划数", "总余额", "总消耗", "现金消耗", "后返消耗", "框返消耗", "激励账户消耗", "信用账户消耗", "封面曝光数", "封面点击数", "素材曝光数", "行为数", "封面点击率", "转化点击率"};
+		 OutputStream os = response.getOutputStream();
+		 ExportExcelUtils eeu = new ExportExcelUtils();
+		 XSSFWorkbook workbook = new XSSFWorkbook();
+		 eeu.exportExcel(workbook, 0, "公司日报表", groupHeaders, group);
+		 this.setResponseHeader(response, "公司日报表.xlsx");
+		 workbook.write(os);
+		 os.flush();
+		 os.close();
+
+	 }
+
+	 @AutoLog(value = "公司日报明细表按天导出Excel")
+	 @ApiOperation(value="公司日报明细表按天导出Excel", notes="公司报表按天导出Excel")
+	 @PostMapping(value = "/companyReportAccountDetailListExportExcel")
+	 public void companyReportAccountDetailListExportExcel( @RequestBody ParamsDTO dto,
+										   //@RequestParam("date")String date,
+										   HttpServletRequest request,
+										   HttpServletResponse response) throws Exception{
+		 Result result = new Result<>();
+		 result.setSuccess(true);
+		 result.setMessage("success");
+
+		 //公司报表按天明细
+		 List<KuaishouReportDailyAgent> kuaishouReportDailyAgentList = kuaishouReportDailyAgentSumService.companyReportAccountDetailList(dto.getDate(), dto.getAdvertiserName(), dto.getIsExportNullData());
+
+		 //导出excel
+		 List<List<Object>> group = new ArrayList<>();
+		 if (!Check.isNull(kuaishouReportDailyAgentList)) {
+			 for (KuaishouReportDailyAgent agent : kuaishouReportDailyAgentList) {
+				 List<Object> kuaishouReportDailyAgentSum = new ArrayList();
+				 kuaishouReportDailyAgentSum.add(DateUtils.formatDate(agent.getDate()));  //日期
+				 kuaishouReportDailyAgentSum.add(agent.getKid());  //快手id
+				 kuaishouReportDailyAgentSum.add(agent.getAdvertiserName());  //广告主名称
+				 kuaishouReportDailyAgentSum.add(DateUtils.formatDate(agent.getAdvertiserCreateTime()));  //广告主创建时间
+				 kuaishouReportDailyAgentSum.add(agent.getCostCampaignCount());  //有消费计划数量
+				 kuaishouReportDailyAgentSum.add(agent.getBalance());  //总余额
+				 kuaishouReportDailyAgentSum.add(agent.getCost());  //总消耗
+				 kuaishouReportDailyAgentSum.add(agent.getXianjinCost());  //现金消耗
+				 kuaishouReportDailyAgentSum.add(agent.getFandianCost());  //后返消耗
+				 kuaishouReportDailyAgentSum.add(agent.getKuangfanCost());  //框返消耗
+				 kuaishouReportDailyAgentSum.add(agent.getJiliCost());  //激励账户消耗
+				 kuaishouReportDailyAgentSum.add(agent.getXinyongCost());  //信用账户消耗
+				 kuaishouReportDailyAgentSum.add(agent.getFengmianShowCount());  //封面曝光数
+				 kuaishouReportDailyAgentSum.add(agent.getFengmianClickCount());  //封面点击数
+				 kuaishouReportDailyAgentSum.add(agent.getSucaiShowCount());  //素材曝光数
+				 kuaishouReportDailyAgentSum.add(agent.getConvertCount());  //行为数
+				 kuaishouReportDailyAgentSum.add(agent.getFengmianClickRate());  //封面点击率
+				 kuaishouReportDailyAgentSum.add(agent.getConvertClickRate());  //转化点击率
+				 group.add(kuaishouReportDailyAgentSum);
+			 }
+		 }
+
+		 String[] groupHeaders = {"日期", "快手id", "广告主名称", "广告主创建时间", "有消费计划数量", "总余额", "总消耗", "现金消耗", "后返消耗", "框返消耗", "激励账户消耗", "信用账户消耗", "封面曝光数", "封面点击数", "素材曝光数", "行为数", "封面点击率", "转化点击率"};
+		 OutputStream os = response.getOutputStream();
+		 ExportExcelUtils eeu = new ExportExcelUtils();
+		 XSSFWorkbook workbook = new XSSFWorkbook();
+		 eeu.exportExcel(workbook, 0, "公司日报明细表", groupHeaders, group);
+		 this.setResponseHeader(response, "公司日报明细表.xlsx");
+		 workbook.write(os);
+		 os.flush();
+		 os.close();
+	 }
+
+
+	 //发送响应流方法
+	 public void setResponseHeader(HttpServletResponse response, String fileName) {
+		 try {
+			 try {
+				 fileName = new String(fileName.getBytes(), "ISO8859-1");
+			 } catch (UnsupportedEncodingException e) {
+				 e.printStackTrace();
+			 }
+			 response.setContentType("application/octet-stream;charset=ISO8859-1");
+			 response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
+			 response.addHeader("Pargam", "no-cache");
+			 response.addHeader("Cache-Control", "no-cache");
+		 } catch (Exception ex) {
+			 ex.printStackTrace();
+		 }
+	 }
+
+ }

+ 108 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouAgentAccount.java

@@ -0,0 +1,108 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * 快手代理商账户表
+ * @author jeecg-boot
+ * @date   2020-03-03
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_agent_account")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_kuaishou_agent_account对象", description="快手代理商账户表")
+public class KuaishouAgentAccount {
+    
+	/**id*/
+	@TableId(type = IdType.INPUT)
+    @ApiModelProperty(value = "id")
+	@JsonProperty("accountId")
+	private Integer id;
+	/**accountId*/
+	@Excel(name = "userId", width = 15)
+    @ApiModelProperty(value = "userId")
+	private Integer userId;
+	/**accountName*/
+	@Excel(name = "accountName", width = 15)
+    @ApiModelProperty(value = "accountName")
+	private String accountName;
+	/**balance*/
+	@Excel(name = "balance", width = 15)
+    @ApiModelProperty(value = "balance")
+	private java.math.BigDecimal balance;
+	/**creditBalance*/
+	@Excel(name = "creditBalance", width = 15)
+    @ApiModelProperty(value = "creditBalance")
+	private java.math.BigDecimal creditBalance;
+	/**extendedBalance*/
+	@Excel(name = "extendedBalance", width = 15)
+    @ApiModelProperty(value = "extendedBalance")
+	private java.math.BigDecimal extendedBalance;
+	/**rebate*/
+	@Excel(name = "rebate", width = 15)
+    @ApiModelProperty(value = "rebate")
+	private java.math.BigDecimal rebate;
+	/**preRebate*/
+	@Excel(name = "preRebate", width = 15)
+    @ApiModelProperty(value = "preRebate")
+	private java.math.BigDecimal preRebate;
+	/**contractRebate*/
+	@Excel(name = "contractRebate", width = 15)
+    @ApiModelProperty(value = "contractRebate")
+	private java.math.BigDecimal contractRebate;
+	/**directRebate*/
+	@Excel(name = "directRebate", width = 15)
+    @ApiModelProperty(value = "directRebate")
+	private java.math.BigDecimal directRebate;
+	/**totalBalance*/
+	@Excel(name = "totalBalance", width = 15)
+    @ApiModelProperty(value = "totalBalance")
+	private java.math.BigDecimal totalBalance;
+	/**kuaibiBalance*/
+	@Excel(name = "kuaibiBalance", width = 15)
+    @ApiModelProperty(value = "kuaibiBalance")
+	private java.math.BigDecimal kuaibiBalance;
+	/**pushBalance*/
+	@Excel(name = "pushBalance", width = 15)
+    @ApiModelProperty(value = "pushBalance")
+	private java.math.BigDecimal pushBalance;
+	/**recharged*/
+	@Excel(name = "recharged", width = 15)
+    @ApiModelProperty(value = "recharged")
+	private Boolean recharged;
+	/**corporationName*/
+	@Excel(name = "corporationName", width = 15)
+    @ApiModelProperty(value = "corporationName")
+	private String corporationName;
+	/**reviewStatus*/
+	@Excel(name = "reviewStatus", width = 15)
+    @ApiModelProperty(value = "reviewStatus")
+	private Integer reviewStatus;
+	/**frozenStatus*/
+	@Excel(name = "frozenStatus", width = 15)
+    @ApiModelProperty(value = "frozenStatus")
+	private Integer frozenStatus;
+	/**transferAccountStatus*/
+	@Excel(name = "transferAccountStatus", width = 15)
+    @ApiModelProperty(value = "transferAccountStatus")
+	private Boolean transferAccountStatus;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+}

+ 122 - 65
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAccount.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.kuaishou.modules.report.entity;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonProperty;
@@ -19,106 +18,164 @@ public class KuaishouReportDailyAccount implements Serializable {
 
     private Long accountId;
 
-    @JsonProperty("stat_date")
-    private String statDate;
-
-    @JsonProperty
+    @JsonProperty("charge")
     private BigDecimal charge;
 
-    @JsonProperty
+    @JsonProperty("photo_show")
     private Long photoShow;
 
-    @JsonProperty("photo_click")
-    private Long photoClick;
-
-    @JsonProperty
+    @JsonProperty("aclick")
     private Long aclick;
-    @JsonProperty
+
+    @JsonProperty("bclick")
     private Long bclick;
-    @JsonProperty
-    private Long share;
-    @JsonProperty
-    private Long comment;
-    @JsonProperty
+
+    @JsonProperty("photo_share")
+    private Long photoShare;
+
+    @JsonProperty("photo_comment")
+    private Long photoComment;
+
+    @JsonProperty("photo_like")
     private Long photoLike;
-    @JsonProperty
+
+    @JsonProperty("follow")
     private Long follow;
+
     @JsonProperty("cancel_follow")
     private Long cancelFollow;
-    @JsonProperty
+
+    @JsonProperty("report")
     private Long report;
-    @JsonProperty
+
+    @JsonProperty("block")
     private Long block;
-    @JsonProperty
+
+    @JsonProperty("negative")
     private Long negative;
-    @JsonProperty
-    private Long submit;
+
     @JsonProperty("download_started")
     private Long downloadStarted;
+
     @JsonProperty("download_completed")
     private Long downloadCompleted;
-    @JsonProperty
+
+    @JsonProperty("activation")
     private Long activation;
 
-    @JsonProperty
-    private BigDecimal photoClickRatio;
-    @JsonProperty
-    private BigDecimal actionRatio;
+    @JsonProperty("submit")
+    private Long submit;
+
+    @JsonProperty("stat_date")
+    private String statDate;
+
+    @JsonProperty("photo_click")
+    private Long photoClick;
+
+    @JsonProperty("photo_click_ratio")
+    private Double photoClickRatio;
+
+    @JsonProperty("action_ratio")
+    private Double actionRatio;
+
     @JsonProperty("impression_1k_cost")
-    @TableField("impression_1k_cost")
     private BigDecimal impression1kCost;
-    @JsonProperty
+
+    @JsonProperty("photo_click_cost")
     private BigDecimal photoClickCost;
-    @JsonProperty
+
+    @JsonProperty("action_cost")
     private BigDecimal actionCost;
-    @JsonProperty
+
+    @JsonProperty("event_pay_first_day")
     private Long eventPayFirstDay;
-    @JsonProperty
-    private BigDecimal eventPayFirstDayRoi;
-    @JsonProperty
-    private BigDecimal eventPay;
-    @JsonProperty
+
+    @JsonProperty("event_pay_purchase_amount_first_day")
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+
+    @JsonProperty("event_pay_first_day_roi")
+    private Double eventPayFirstDayRoi;
+
+    @JsonProperty("event_pay")
+    private Long eventPay;
+
+    @JsonProperty("event_pay_purchase_amount")
     private BigDecimal eventPayPurchaseAmount;
-    @JsonProperty
-    private BigDecimal eventPayRoi;
-    @JsonProperty
+
+    @JsonProperty("event_pay_roi")
+    private Double eventPayRoi;
+
+    @JsonProperty("event_register")
     private Long eventRegister;
-    @JsonProperty
+
+    @JsonProperty("event_register_cost")
     private BigDecimal eventRegisterCost;
-    @JsonProperty
+
+    @JsonProperty("event_register_ratio")
+    private Double eventRegisterRatio;
+
+    @JsonProperty("event_jin_jian_app")
     private Long eventJinJianApp;
-    @JsonProperty
+
+    @JsonProperty("event_jin_jian_app_cost")
     private BigDecimal eventJinJianAppCost;
-    @JsonProperty
-    private BigDecimal eventPayPurchaseAmountFirstDay;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_app")
     private Long eventCreditGrantApp;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_app_cost")
     private BigDecimal eventCreditGrantAppCost;
-    @JsonProperty
-    private BigDecimal eventCreditGrantAppRatio;
-    @JsonProperty
-    private BigDecimal eventOrderPaid;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_app_ratio")
+    private Double eventCreditGrantAppRatio;
+
+    @JsonProperty("event_order_paid")
+    private Long eventOrderPaid;
+
+    @JsonProperty("event_order_paid_purchase_amount")
     private BigDecimal eventOrderPaidPurchaseAmount;
-    @JsonProperty
-    private BigDecimal eventOrderPaidCost;
-    @JsonProperty
-    private Long formCount;
-    @JsonProperty
-    private BigDecimal formCost;
-    @JsonProperty
-    private BigDecimal formActionRatio;
-    @JsonProperty
+
+    @JsonProperty("event_jin_jian_landing_page")
     private Long eventJinJianLandingPage;
-    @JsonProperty
+
+    @JsonProperty("event_jin_jian_landing_page_cost")
     private BigDecimal eventJinJianLandingPageCost;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_landing_page")
     private Long eventCreditGrantLandingPage;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_landing_page_cost")
     private BigDecimal eventCreditGrantLandingPageCost;
-    @JsonProperty
+
+    @JsonProperty("event_credit_grant_landing_ratio")
+    private Double eventCreditGrantLandingRatio;
+
+    @JsonProperty("event_next_day_stay_cost")
+    private BigDecimal eventNextDayStayCost;
+
+    @JsonProperty("event_next_day_stay_ratio")
+    private Long eventNextDayStayRatio;
+
+    @JsonProperty("form_action_ratio")
+    private Double formActionRatio;
+
+    @JsonProperty("event_order_paid_cost")
+    private BigDecimal eventOrderPaidCost;
+
+    @JsonProperty("event_next_day_stay")
+    private Long eventNextDayStay;
+
+    @JsonProperty("form_cost")
+    private BigDecimal formCost;
+
+    @JsonProperty("form_count")
+    private Long formCount;
+
+    @JsonProperty("play_3s_ratio")
+    private Double play3sRatio;
+
     private Date createTime;
-    @JsonProperty
+
     private Date updateTime;
 }
+

+ 71 - 25
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAgent.java

@@ -28,92 +28,138 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 @ApiModel(value="ctop_kuaishou_report_daily_agent对象", description="代理商报表")
 public class KuaishouReportDailyAgent {
 
-	/**日期*/
+	/**
+	 * 日期
+	 */
 	@Excel(name = "日期", width = 15, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
 	@ApiModelProperty(value = "日期")
 	@TableId(type = IdType.INPUT)
 	private java.util.Date date;
-	/**账户ID*/
+	/**
+	 * 账户ID
+	 */
 	@Excel(name = "账户ID", width = 15)
 	@ApiModelProperty(value = "账户ID")
 	@TableId(type = IdType.INPUT)
 	private java.lang.Integer accountId;
-	/**快手ID*/
+	/**
+	 * 快手ID
+	 */
 	@Excel(name = "快手ID", width = 15)
 	@ApiModelProperty(value = "快手ID")
 	private java.lang.Integer kid;
-	/**广告主名称*/
+	/**
+	 * 广告主名称
+	 */
 	@Excel(name = "广告主名称", width = 15)
 	@ApiModelProperty(value = "广告主名称")
 	private java.lang.String advertiserName;
-	/**广告主创建时间*/
+	/**
+	 * 广告主创建时间
+	 */
 	@Excel(name = "广告主创建时间", width = 15, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
 	@ApiModelProperty(value = "广告主创建时间")
 	private java.util.Date advertiserCreateTime;
-	/**有消费计划数*/
+	/**
+	 * 有消费计划数
+	 */
 	@Excel(name = "有消费计划数", width = 15)
 	@ApiModelProperty(value = "有消费计划数")
 	private java.lang.Integer costCampaignCount;
-	/**总余额*/
+	/**
+	 * 总余额
+	 */
 	@Excel(name = "总余额", width = 15)
 	@ApiModelProperty(value = "总余额")
 	private java.math.BigDecimal balance;
-	/**总消耗*/
+	/**
+	 * 总消耗
+	 */
 	@Excel(name = "总消耗", width = 15)
 	@ApiModelProperty(value = "总消耗")
 	private java.math.BigDecimal cost;
-	/**现金消耗*/
+	/**
+	 * 现金消耗
+	 */
 	@Excel(name = "现金消耗", width = 15)
 	@ApiModelProperty(value = "现金消耗")
 	private java.math.BigDecimal xianjinCost;
-	/**后返消耗*/
+	/**
+	 * 后返消耗
+	 */
 	@Excel(name = "后返消耗", width = 15)
 	@ApiModelProperty(value = "后返消耗")
 	private java.math.BigDecimal fandianCost;
-	/**框返消耗*/
+	/**
+	 * 框返消耗
+	 */
 	@Excel(name = "框返消耗", width = 15)
 	@ApiModelProperty(value = "框返消耗")
 	private java.math.BigDecimal kuangfanCost;
-	/**激励账户消耗*/
+	/**
+	 * 激励账户消耗
+	 */
 	@Excel(name = "激励账户消耗", width = 15)
 	@ApiModelProperty(value = "激励账户消耗")
 	private java.math.BigDecimal jiliCost;
-	/**信用账户消耗*/
+	/**
+	 * 信用账户消耗
+	 */
 	@Excel(name = "信用账户消耗", width = 15)
 	@ApiModelProperty(value = "信用账户消耗")
 	private java.math.BigDecimal xinyongCost;
-	/**封面曝光数*/
+	/**
+	 * 封面曝光数
+	 */
 	@Excel(name = "封面曝光数", width = 15)
 	@ApiModelProperty(value = "封面曝光数")
 	private java.lang.Integer fengmianShowCount;
-	/**封面点击数*/
+	/**
+	 * 封面点击数
+	 */
 	@Excel(name = "封面点击数", width = 15)
 	@ApiModelProperty(value = "封面点击数")
 	private java.lang.Integer fengmianClickCount;
-	/**素材曝光数*/
+	/**
+	 * 素材曝光数
+	 */
 	@Excel(name = "素材曝光数", width = 15)
 	@ApiModelProperty(value = "素材曝光数")
 	private java.lang.Integer sucaiShowCount;
-	/**行为数*/
+	/**
+	 * 行为数
+	 */
 	@Excel(name = "行为数", width = 15)
 	@ApiModelProperty(value = "行为数")
 	private java.lang.Integer convertCount;
-	/**封面点击率*/
+	/**
+	 * 封面点击率
+	 */
 	@Excel(name = "封面点击率", width = 15)
 	@ApiModelProperty(value = "封面点击率")
 	private java.math.BigDecimal fengmianClickRate;
-	/**转化点击率*/
+	/**
+	 * 转化点击率
+	 */
 	@Excel(name = "转化点击率", width = 15)
 	@ApiModelProperty(value = "转化点击率")
 	private java.math.BigDecimal convertClickRate;
-	/**创建时间*/
+	/**
+	 * 创建时间
+	 */
 	@ApiModelProperty(value = "创建时间")
 	private java.util.Date createTime;
-	/**修改时间*/
+	/**
+	 * 修改时间
+	 */
 	@ApiModelProperty(value = "修改时间")
 	private java.util.Date updateTime;
+
+	@TableField(exist = false)
+	private Integer isHasData;
+
 }

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/ParamsDTO.java

@@ -10,4 +10,6 @@ public class ParamsDTO implements Serializable {
     private String startDate;
     private String endDate;
     private String date;
+    private String advertiserName;  //广告主名称
+    private Integer isExportNullData; //是否导出为0数据
 }

+ 19 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/job/KuaishouAgentAccountJob.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.report.job;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class KuaishouAgentAccountJob implements Job {
+
+    @Autowired
+    private IKuaishouReportDailyAgentService kuaishouReportDailyAgentService;
+    @Override
+    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        int currentPage = 1;
+        while (kuaishouReportDailyAgentService.getAccount(currentPage)){
+            currentPage++;
+        }
+    }
+}

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/job/KuaishouReportAgentJob.java

@@ -31,9 +31,9 @@ public class KuaishouReportAgentJob implements Job {
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
         String currentDate = DateUtils.formatDate(DateUtils.addDay(new Date(),-1));
-        kuaishouReportDailyAgentService.getReport(currentDate,currentDate);
+        kuaishouReportDailyAgentService.getReport(currentDate,DateUtils.getNowDate("yyyy-MM-dd"));
 
-        //kuaishouReportDailyAgentService.getReport("2019-01-01","2019-12-12");
+//        kuaishouReportDailyAgentService.getReport("2019-12-12","2020-03-05");
 
     }
 }

+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouAgentAccountMapper.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import java.util.List;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgent;
+import org.apache.ibatis.annotations.Param;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouAgentAccount;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 快手代理商账户表
+ * @author: jeecg-boot
+ * @date:   2020-03-03
+ * @cersion: V1.0
+ */
+public interface KuaishouAgentAccountMapper extends BaseMapper<KuaishouAgentAccount> {
+    public void replaceBatch(List<KuaishouAgentAccount> list);
+}

+ 4 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAccountMapper.java

@@ -1,8 +1,11 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportHourlyAccount;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 public interface KuaishouReportDailyAccountMapper extends BaseMapper<KuaishouReportDailyAccount> {
+    void loadAccountDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);
+
+    void insertSelective(KuaishouReportDailyAccount dailyAccount);
 }

+ 6 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAgentSumMapper.java

@@ -18,5 +18,10 @@ public interface KuaishouReportDailyAgentSumMapper extends BaseMapper<KuaishouRe
 
     KuaishouReportDailyAgentSum companyReportSum(@Param("startDate")String startDate, @Param("endDate")String endDate);
 
-    List<KuaishouReportDailyAgent> companyReporAccountDetailList(@Param("date")String date);
+    //根据某天的时间获取公司报表明细
+    List<KuaishouReportDailyAgent> companyReportAccountDetailList(@Param("date")String date, @Param("advertiserName")String advertiserName, @Param("isExportNullData")Integer isExportNullData);
+
+    //根据时间段获取公司报表明细
+    List<KuaishouReportDailyAgent> companyReportAccountDetailListByDateRange(@Param("startDate")String startDate, @Param("endDate")String endDate);
 }
+

+ 2 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyCampaignMapper.java

@@ -1,8 +1,9 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCampaign;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 public interface KuaishouReportDailyCampaignMapper extends BaseMapper<KuaishouReportDailyCampaign> {
+    void loadCampaignDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);
 }

+ 4 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyCreativeMapper.java

@@ -1,8 +1,11 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 public interface KuaishouReportDailyCreativeMapper extends BaseMapper<KuaishouReportDailyCreative> {
+    void loadCreativeDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);
+
+    void formatCreativeDailyReportData(@Param("accountId") Long accountId, @Param("statDate") String statDate);
 }

+ 2 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyGroupMapper.java

@@ -1,8 +1,9 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyGroup;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 public interface KuaishouReportDailyGroupMapper extends BaseMapper<KuaishouReportDailyGroup> {
+    void loadGroupDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);
 }

+ 49 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouAgentAccountMapper.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaishouAgentAccountMapper">
+    <insert id="replaceBatch">
+        replace into ctop_kuaishou_agent_account(
+        `id`,
+        `user_id`,
+        `account_name`,
+        `balance`,
+        `credit_balance`,
+        `extended_balance`,
+        `rebate`,
+        `pre_rebate`,
+        `contract_rebate`,
+        `direct_rebate`,
+        `total_balance`,
+        `kuaibi_balance`,
+        `push_balance`,
+        `recharged`,
+        `corporation_name`,
+        `review_status`,
+        `frozen_status`,
+        `transfer_account_status`,
+        `create_time`
+        )
+        values
+        <foreach collection="list" item="agent" separator=",">
+            (#{agent.id},
+            #{agent.userId},
+            #{agent.accountName},
+            #{agent.balance},
+            #{agent.creditBalance},
+            #{agent.extendedBalance},
+            #{agent.rebate},
+            #{agent.preRebate},
+            #{agent.contractRebate},
+            #{agent.directRebate},
+            #{agent.totalBalance},
+            #{agent.kuaibiBalance},
+            #{agent.pushBalance},
+            #{agent.recharged},
+            #{agent.corporationName},
+            #{agent.reviewStatus},
+            #{agent.frozenStatus},
+            #{agent.transferAccountStatus},
+            #{agent.createTime})
+        </foreach>
+    </insert>
+</mapper>

+ 487 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -2,4 +2,491 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper">
 
+    <resultMap id="BaseResultMap" type="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount">
+        <id column="id" property="id" jdbcType="BIGINT"/>
+        <result column="account_id" property="account_id" jdbcType="BIGINT"/>
+        <result column="charge" property="charge" jdbcType="DECIMAL"/>
+        <result column="photo_show" property="photo_show" jdbcType="BIGINT"/>
+        <result column="aclick" property="aclick" jdbcType="BIGINT"/>
+        <result column="bclick" property="bclick" jdbcType="BIGINT"/>
+        <result column="photo_share" property="photo_share" jdbcType="BIGINT"/>
+        <result column="photo_comment" property="photo_comment" jdbcType="BIGINT"/>
+        <result column="photo_like" property="photo_like" jdbcType="BIGINT"/>
+        <result column="follow" property="follow" jdbcType="BIGINT"/>
+        <result column="cancel_follow" property="cancel_follow" jdbcType="BIGINT"/>
+        <result column="report" property="report" jdbcType="BIGINT"/>
+        <result column="block" property="block" jdbcType="BIGINT"/>
+        <result column="negative" property="negative" jdbcType="BIGINT"/>
+        <result column="download_started" property="download_started" jdbcType="BIGINT"/>
+        <result column="download_completed" property="download_completed" jdbcType="BIGINT"/>
+        <result column="activation" property="activation" jdbcType="BIGINT"/>
+        <result column="submit" property="submit" jdbcType="BIGINT"/>
+        <result column="stat_date" property="stat_date" jdbcType="VARCHAR"/>
+        <result column="photo_click" property="photo_click" jdbcType="BIGINT"/>
+        <result column="photo_click_ratio" property="photo_click_ratio" jdbcType="DOUBLE"/>
+        <result column="action_ratio" property="action_ratio" jdbcType="DOUBLE"/>
+        <result column="impression_1k_cost" property="impression_1k_cost" jdbcType="DECIMAL"/>
+        <result column="photo_click_cost" property="photo_click_cost" jdbcType="DECIMAL"/>
+        <result column="action_cost" property="action_cost" jdbcType="DECIMAL"/>
+        <result column="event_pay_first_day" property="event_pay_first_day" jdbcType="BIGINT"/>
+        <result column="event_pay_purchase_amount_first_day" property="event_pay_purchase_amount_first_day"
+                jdbcType="DECIMAL"/>
+        <result column="event_pay_first_day_roi" property="event_pay_first_day_roi" jdbcType="DOUBLE"/>
+        <result column="event_pay" property="event_pay" jdbcType="BIGINT"/>
+        <result column="event_pay_purchase_amount" property="event_pay_purchase_amount" jdbcType="DECIMAL"/>
+        <result column="event_pay_roi" property="event_pay_roi" jdbcType="DOUBLE"/>
+        <result column="event_register" property="event_register" jdbcType="BIGINT"/>
+        <result column="event_register_cost" property="event_register_cost" jdbcType="DECIMAL"/>
+        <result column="event_register_ratio" property="event_register_ratio" jdbcType="DOUBLE"/>
+        <result column="event_jin_jian_app" property="event_jin_jian_app" jdbcType="BIGINT"/>
+        <result column="event_jin_jian_app_cost" property="event_jin_jian_app_cost" jdbcType="DECIMAL"/>
+        <result column="event_credit_grant_app" property="event_credit_grant_app" jdbcType="BIGINT"/>
+        <result column="event_credit_grant_app_cost" property="event_credit_grant_app_cost" jdbcType="DECIMAL"/>
+        <result column="event_credit_grant_app_ratio" property="event_credit_grant_app_ratio" jdbcType="DOUBLE"/>
+        <result column="event_order_paid" property="event_order_paid" jdbcType="BIGINT"/>
+        <result column="event_order_paid_purchase_amount" property="event_order_paid_purchase_amount"
+                jdbcType="DECIMAL"/>
+        <result column="event_jin_jian_landing_page" property="event_jin_jian_landing_page" jdbcType="BIGINT"/>
+        <result column="event_jin_jian_landing_page_cost" property="event_jin_jian_landing_page_cost"
+                jdbcType="DECIMAL"/>
+        <result column="event_credit_grant_landing_page" property="event_credit_grant_landing_page" jdbcType="BIGINT"/>
+        <result column="event_credit_grant_landing_page_cost" property="event_credit_grant_landing_page_cost"
+                jdbcType="DECIMAL"/>
+        <result column="event_credit_grant_landing_ratio" property="event_credit_grant_landing_ratio"
+                jdbcType="DOUBLE"/>
+        <result column="event_next_day_stay_cost" property="event_next_day_stay_cost" jdbcType="DECIMAL"/>
+        <result column="event_next_day_stay_ratio" property="event_next_day_stay_ratio" jdbcType="BIGINT"/>
+        <result column="form_action_ratio" property="form_action_ratio" jdbcType="DOUBLE"/>
+        <result column="event_order_paid_cost" property="event_order_paid_cost" jdbcType="DECIMAL"/>
+        <result column="event_next_day_stay" property="event_next_day_stay" jdbcType="BIGINT"/>
+        <result column="form_cost" property="form_cost" jdbcType="DECIMAL"/>
+        <result column="form_count" property="form_count" jdbcType="BIGINT"/>
+        <result column="play_3s_ratio" property="play_3s_ratio" jdbcType="DOUBLE"/>
+        <result column="create_time" property="create_time" jdbcType="TIMESTAMP"/>
+        <result column="update_time" property="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+    id, account_id, charge, photo_show, aclick, bclick, photo_share, photo_comment, photo_like,
+    follow, cancel_follow, report, block, negative, download_started, download_completed,
+    activation, submit, stat_date, photo_click, photo_click_ratio, action_ratio, impression_1k_cost,
+    photo_click_cost, action_cost, event_pay_first_day, event_pay_purchase_amount_first_day,
+    event_pay_first_day_roi, event_pay, event_pay_purchase_amount, event_pay_roi, event_register,
+    event_register_cost, event_register_ratio, event_jin_jian_app, event_jin_jian_app_cost,
+    event_credit_grant_app, event_credit_grant_app_cost, event_credit_grant_app_ratio,
+    event_order_paid, event_order_paid_purchase_amount, event_jin_jian_landing_page,
+    event_jin_jian_landing_page_cost, event_credit_grant_landing_page, event_credit_grant_landing_page_cost,
+    event_credit_grant_landing_ratio, event_next_day_stay_cost, event_next_day_stay_ratio,
+    form_action_ratio, event_order_paid_cost, event_next_day_stay, form_cost, form_count,
+    play_3s_ratio, create_time, update_time
+  </sql>
+
+
+    <insert id="insertSelective" parameterType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount">
+        replace into ctop_kuaishou_report_daily_account
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="accountId != null">
+                account_id,
+            </if>
+            <if test="charge != null">
+                charge,
+            </if>
+            <if test="photoShow != null">
+                photo_show,
+            </if>
+            <if test="aclick != null">
+                aclick,
+            </if>
+            <if test="bclick != null">
+                bclick,
+            </if>
+            <if test="photoShare != null">
+                photo_share,
+            </if>
+            <if test="photoComment != null">
+                photo_comment,
+            </if>
+            <if test="photoLike != null">
+                photo_like,
+            </if>
+            <if test="follow != null">
+                follow,
+            </if>
+            <if test="cancelFollow != null">
+                cancel_follow,
+            </if>
+            <if test="report != null">
+                report,
+            </if>
+            <if test="block != null">
+                block,
+            </if>
+            <if test="negative != null">
+                negative,
+            </if>
+            <if test="downloadStarted != null">
+                download_started,
+            </if>
+            <if test="downloadCompleted != null">
+                download_completed,
+            </if>
+            <if test="activation != null">
+                activation,
+            </if>
+            <if test="submit != null">
+                submit,
+            </if>
+            <if test="statDate != null">
+                stat_date,
+            </if>
+            <if test="photoClick != null">
+                photo_click,
+            </if>
+            <if test="photoClickRatio != null">
+                photo_click_ratio,
+            </if>
+            <if test="actionRatio != null">
+                action_ratio,
+            </if>
+            <if test="impression1kCost != null">
+                impression_1k_cost,
+            </if>
+            <if test="photoClickCost != null">
+                photo_click_cost,
+            </if>
+            <if test="actionCost != null">
+                action_cost,
+            </if>
+            <if test="eventPayFirstDay != null">
+                event_pay_first_day,
+            </if>
+            <if test="eventPayPurchaseAmountFirstDay != null">
+                event_pay_purchase_amount_first_day,
+            </if>
+            <if test="eventPayFirstDayRoi != null">
+                event_pay_first_day_roi,
+            </if>
+            <if test="eventPay != null">
+                event_pay,
+            </if>
+            <if test="eventPayPurchaseAmount != null">
+                event_pay_purchase_amount,
+            </if>
+            <if test="eventPayRoi != null">
+                event_pay_roi,
+            </if>
+            <if test="eventRegister != null">
+                event_register,
+            </if>
+            <if test="eventRegisterCost != null">
+                event_register_cost,
+            </if>
+            <if test="eventRegisterRatio != null">
+                event_register_ratio,
+            </if>
+            <if test="eventJinJianApp != null">
+                event_jin_jian_app,
+            </if>
+            <if test="eventJinJianAppCost != null">
+                event_jin_jian_app_cost,
+            </if>
+            <if test="eventCreditGrantApp != null">
+                event_credit_grant_app,
+            </if>
+            <if test="eventCreditGrantAppCost != null">
+                event_credit_grant_app_cost,
+            </if>
+            <if test="eventCreditGrantAppRatio != null">
+                event_credit_grant_app_ratio,
+            </if>
+            <if test="eventOrderPaid != null">
+                event_order_paid,
+            </if>
+            <if test="eventOrderPaidPurchaseAmount != null">
+                event_order_paid_purchase_amount,
+            </if>
+            <if test="eventJinJianLandingPage != null">
+                event_jin_jian_landing_page,
+            </if>
+            <if test="eventJinJianLandingPageCost != null">
+                event_jin_jian_landing_page_cost,
+            </if>
+            <if test="eventCreditGrantLandingPage != null">
+                event_credit_grant_landing_page,
+            </if>
+            <if test="eventCreditGrantLandingPageCost != null">
+                event_credit_grant_landing_page_cost,
+            </if>
+            <if test="eventCreditGrantLandingRatio != null">
+                event_credit_grant_landing_ratio,
+            </if>
+            <if test="eventNextDayStayCost != null">
+                event_next_day_stay_cost,
+            </if>
+            <if test="eventNextDayStayRatio != null">
+                event_next_day_stay_ratio,
+            </if>
+            <if test="formActionRatio != null">
+                form_action_ratio,
+            </if>
+            <if test="eventOrderPaidCost != null">
+                event_order_paid_cost,
+            </if>
+            <if test="eventNextDayStay != null">
+                event_next_day_stay,
+            </if>
+            <if test="formCost != null">
+                form_cost,
+            </if>
+            <if test="formCount != null">
+                form_count,
+            </if>
+            <if test="play3sRatio != null">
+                play_3s_ratio,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="updateTime != null">
+                update_time,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="accountId != null">
+                #{accountId,jdbcType=BIGINT},
+            </if>
+            <if test="charge != null">
+                #{charge,jdbcType=DECIMAL},
+            </if>
+            <if test="photoShow != null">
+                #{photoShow,jdbcType=BIGINT},
+            </if>
+            <if test="aclick != null">
+                #{aclick,jdbcType=BIGINT},
+            </if>
+            <if test="bclick != null">
+                #{bclick,jdbcType=BIGINT},
+            </if>
+            <if test="photoShare != null">
+                #{photoShare,jdbcType=BIGINT},
+            </if>
+            <if test="photoComment != null">
+                #{photoComment,jdbcType=BIGINT},
+            </if>
+            <if test="photoLike != null">
+                #{photoLike,jdbcType=BIGINT},
+            </if>
+            <if test="follow != null">
+                #{follow,jdbcType=BIGINT},
+            </if>
+            <if test="cancelFollow != null">
+                #{cancelFollow,jdbcType=BIGINT},
+            </if>
+            <if test="report != null">
+                #{report,jdbcType=BIGINT},
+            </if>
+            <if test="block != null">
+                #{block,jdbcType=BIGINT},
+            </if>
+            <if test="negative != null">
+                #{negative,jdbcType=BIGINT},
+            </if>
+            <if test="downloadStarted != null">
+                #{downloadStarted,jdbcType=BIGINT},
+            </if>
+            <if test="downloadCompleted != null">
+                #{downloadCompleted,jdbcType=BIGINT},
+            </if>
+            <if test="activation != null">
+                #{activation,jdbcType=BIGINT},
+            </if>
+            <if test="submit != null">
+                #{submit,jdbcType=BIGINT},
+            </if>
+            <if test="statDate != null">
+                #{statDate,jdbcType=VARCHAR},
+            </if>
+            <if test="photoClick != null">
+                #{photoClick,jdbcType=BIGINT},
+            </if>
+            <if test="photoClickRatio != null">
+                #{photoClickRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="actionRatio != null">
+                #{actionRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="impression1kCost != null">
+                #{impression1kCost,jdbcType=DECIMAL},
+            </if>
+            <if test="photoClickCost != null">
+                #{photoClickCost,jdbcType=DECIMAL},
+            </if>
+            <if test="actionCost != null">
+                #{actionCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventPayFirstDay != null">
+                #{eventPayFirstDay,jdbcType=BIGINT},
+            </if>
+            <if test="eventPayPurchaseAmountFirstDay != null">
+                #{eventPayPurchaseAmountFirstDay,jdbcType=DECIMAL},
+            </if>
+            <if test="eventPayFirstDayRoi != null">
+                #{eventPayFirstDayRoi,jdbcType=DOUBLE},
+            </if>
+            <if test="eventPay != null">
+                #{eventPay,jdbcType=BIGINT},
+            </if>
+            <if test="eventPayPurchaseAmount != null">
+                #{eventPayPurchaseAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="eventPayRoi != null">
+                #{eventPayRoi,jdbcType=DOUBLE},
+            </if>
+            <if test="eventRegister != null">
+                #{eventRegister,jdbcType=BIGINT},
+            </if>
+            <if test="eventRegisterCost != null">
+                #{eventRegisterCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventRegisterRatio != null">
+                #{eventRegisterRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventJinJianApp != null">
+                #{eventJinJianApp,jdbcType=BIGINT},
+            </if>
+            <if test="eventJinJianAppCost != null">
+                #{eventJinJianAppCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantApp != null">
+                #{eventCreditGrantApp,jdbcType=BIGINT},
+            </if>
+            <if test="eventCreditGrantAppCost != null">
+                #{eventCreditGrantAppCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantAppRatio != null">
+                #{eventCreditGrantAppRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventOrderPaid != null">
+                #{eventOrderPaid,jdbcType=BIGINT},
+            </if>
+            <if test="eventOrderPaidPurchaseAmount != null">
+                #{eventOrderPaidPurchaseAmount,jdbcType=DECIMAL},
+            </if>
+            <if test="eventJinJianLandingPage != null">
+                #{eventJinJianLandingPage,jdbcType=BIGINT},
+            </if>
+            <if test="eventJinJianLandingPageCost != null">
+                #{eventJinJianLandingPageCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantLandingPage != null">
+                #{eventCreditGrantLandingPage,jdbcType=BIGINT},
+            </if>
+            <if test="eventCreditGrantLandingPageCost != null">
+                #{eventCreditGrantLandingPageCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventCreditGrantLandingRatio != null">
+                #{eventCreditGrantLandingRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventNextDayStayCost != null">
+                #{eventNextDayStayCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventNextDayStayRatio != null">
+                #{eventNextDayStayRatio,jdbcType=BIGINT},
+            </if>
+            <if test="formActionRatio != null">
+                #{formActionRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="eventOrderPaidCost != null">
+                #{eventOrderPaidCost,jdbcType=DECIMAL},
+            </if>
+            <if test="eventNextDayStay != null">
+                #{eventNextDayStay,jdbcType=BIGINT},
+            </if>
+            <if test="formCost != null">
+                #{formCost,jdbcType=DECIMAL},
+            </if>
+            <if test="formCount != null">
+                #{formCount,jdbcType=BIGINT},
+            </if>
+            <if test="play3sRatio != null">
+                #{play3sRatio,jdbcType=DOUBLE},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+        </trim>
+    </insert>
+
+
+    <insert id="loadAccountDailyReport">
+		LOAD DATA local INFILE  #{localPath}
+		REPLACE INTO TABLE ctop_kuaishou_report_daily_account CHARACTER SET utf8mb4
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(@ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        @stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
 </mapper>

+ 50 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAgentSumMapper.xml

@@ -5,7 +5,7 @@
     <!-- 公司报表sql -->
     <select id="companyReport" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgentSum">
             select
-            date as date,  <!-- 日期 -->
+            date_format(date, '%Y-%m-%d') as date,  <!-- 日期 -->
             cost_campaign_count as costCampaignCount,  <!-- 有消费计划数 -->
             balance as balance,  <!-- 总余额 -->
             cost as cost,  <!-- 总消耗 -->
@@ -25,6 +25,7 @@
         where
         date &lt;= #{endDate} and
         date &gt;= #{startDate}
+        order by date desc
     </select>
 
     <select id="companyReportSum" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgentSum">
@@ -51,9 +52,9 @@
     </select>
 
     <!-- 根据传入时间获取公司报表账户的列表 -->
-    <select id="companyReporAccountDetailList" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgent">
+    <select id="companyReportAccountDetailList" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgent">
             select
-            date as date,  <!-- 日期 -->
+            date_format(date, '%Y-%m-%d') as date,  <!-- 日期 -->
             account_id as accountId,  <!-- 账户id -->
             kid as kid, <!-- 快手id -->
             advertiser_name as advertiserName, <!-- 广告主名称 -->
@@ -71,11 +72,56 @@
             sucai_show_count as sucaiShowCount, <!-- 素材曝光数 -->
             convert_count as convertCount, <!-- 行为数 -->
             fengmian_click_rate as fengmianClickRate, <!-- 封面点击率 -->
-            convert_click_rate as convertClickRate <!-- 转化点击率 -->
+            convert_click_rate as convertClickRate, <!-- 转化点击率 -->
+            case
+                when
+                cost_campaign_count + balance + cost + xianjin_cost + fandian_cost + kuangfan_cost + jili_cost +
+                xinyong_cost + fengmian_show_count + fengmian_click_count + sucai_show_count + convert_count +
+                fengmian_click_rate + convert_click_rate = 0 then 0
+                else 1
+                end as isHasData
         from
         ctop_kuaishou_report_daily_agent
         where
         date_format(date, '%Y-%m-%d') = #{date}
+        <if test="advertiserName != null and advertiserName != ''">
+            and advertiser_name like concat('%',#{advertiserName},'%')
+        </if>
+        <if test="isExportNullData == 0 or isExportNullData == '0'">  <!-- 判断是否导出公司明细中各字段总合为0的数据  1-导出 0-不导出 -->
+            and
+            (cost_campaign_count + balance + cost + xianjin_cost + fandian_cost + kuangfan_cost + jili_cost +
+            xinyong_cost + fengmian_show_count + fengmian_click_count + sucai_show_count + convert_count +
+            fengmian_click_rate + convert_click_rate) != 0
+        </if>
+    </select>
+
+    <!-- 根据传入开始时间和结束获取公司报表账户的列表 -->
+    <select id="companyReportAccountDetailListByDateRange" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAgent">
+        select
+        date as date,  <!-- 日期 -->
+        account_id as accountId,  <!-- 账户id -->
+        kid as kid, <!-- 快手id -->
+        advertiser_name as advertiserName, <!-- 广告主名称 -->
+        advertiser_create_time as advertiserCreateTime, <!-- 广告主创建时间 -->
+        cost_campaign_count as costCampaignCount, <!-- 有消费计划数 -->
+        balance as balance, <!-- 总余额 -->
+        cost as cost, <!-- 总消耗 -->
+        xianjin_cost as xianjinCost, <!-- 现金消耗 -->
+        fandian_cost as fandianCost, <!-- 后返消耗 -->
+        kuangfan_cost as kuangfanCost, <!-- 框返消耗 -->
+        jili_cost as jiliCost, <!-- 激励账户消耗 -->
+        xinyong_cost as xinyongCost, <!-- 信用账户消耗 -->
+        fengmian_show_count as fengmianShowCount, <!-- 封面曝光数 -->
+        fengmian_click_count as fengmianClickCount, <!-- 封面点击数 -->
+        sucai_show_count as sucaiShowCount, <!-- 素材曝光数 -->
+        convert_count as convertCount, <!-- 行为数 -->
+        fengmian_click_rate as fengmianClickRate, <!-- 封面点击率 -->
+        convert_click_rate as convertClickRate <!-- 转化点击率 -->
+        from
+        ctop_kuaishou_report_daily_agent
+        where
+        date_format(date, '%Y-%m-%d') &gt; #{startDate} and
+        date_format(date, '%Y-%m-%d') &lt; #{endDate}
     </select>
 
 </mapper>

+ 67 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyCampaignMapper.xml

@@ -2,4 +2,71 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper">
 
+
+    <insert id="loadCampaignDailyReport">
+		LOAD DATA local INFILE  #{localPath}
+	    REPLACE INTO TABLE ctop_kuaishou_report_daily_campaign CHARACTER SET utf8mb4
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(campaign_id,
+		campaign_name,
+		status,
+		@ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        @stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
+
 </mapper>

+ 96 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyCreativeMapper.xml

@@ -2,4 +2,99 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper">
 
-</mapper>
+
+    <insert id="loadCreativeDailyReport">
+		LOAD DATA local INFILE  #{localPath}
+		REPLACE INTO TABLE ctop_kuaishou_report_daily_creative CHARACTER SET utf8mb4
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(
+		creative_id,
+		creative_name,
+		status,
+		campaign_id,
+		campaign_name,
+		unit_id,
+		unit_name,
+		@ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        @stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
+    <update id="formatCreativeDailyReportData">
+        UPDATE
+        ctop_kuaishou_report_daily_creative t1
+        SET
+        t1.signature = (
+        SELECT
+        DISTINCT t3.signature
+        FROM
+        ctop_kuaishou_creative t2
+        LEFT JOIN
+        ctop_kuaishou_video_get t3 ON t2.photo_id = t3.photo_id
+        WHERE
+        t2.creative_id = t1.creative_id
+        )
+        WHERE
+        1=1
+        <if test="accountId != null">
+            and t1.account_id = #{accountId}
+        </if>
+        <if test="statDate != null">
+            and t1.stat_date = #{statDate}
+        </if>
+    </update>
+
+</mapper>

+ 70 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyGroupMapper.xml

@@ -2,4 +2,74 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper">
 
+    <insert id="loadGroupDailyReport">
+		LOAD DATA local INFILE  #{localPath}
+		REPLACE INTO TABLE ctop_kuaishou_report_daily_group CHARACTER SET utf8mb4
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(
+		unit_id,
+		unit_name,
+		status,
+		campaign_id,
+		campaign_name,
+		@ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        @stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
+
+
 </mapper>

+ 0 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouAgentAccountService.java


Some files were not shown because too many files changed in this diff