Procházet zdrojové kódy

Merge branch 'master' into jiaoyang

# Conflicts:
#	jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
#	jeecg-boot-module-system/src/main/resources/application-test.yml
#	jeecg-boot-module-system/src/main/resources/application-wps.yml
#	module-kuaishou/src/main/resources/kuaishou_config.properties
yumeng před 4 roky
rodič
revize
8c89973828
100 změnil soubory, kde provedl 5136 přidání a 604 odebrání
  1. 36 0
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 18 10
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AiKuaishouAdvertiserStrategyController.java
  3. 154 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouAccountSpeedExploreLogController.java
  4. 12 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouVideoEtlInfoController.java
  5. 0 62
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyAccountReportLoadJob.java
  6. 0 60
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyAccountReportNextDayStayJob.java
  7. 4 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyGroupReportLoadJob.java
  8. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/MergeVideoJob.java
  9. 2 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  10. 2 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/TransferAccountServiceImpl.java
  11. 43 15
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  12. 3 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/ProjectMapper.java
  13. 11 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/ProjectMapper.xml
  14. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IProjectService.java
  15. 1 2
      module-common/src/main/java/cn/com/ctop/common/module/service/ISysUserService.java
  16. 8 5
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java
  17. 18 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/ProjectServiceImpl.java
  18. 15 2
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/SysUserServiceImpl.java
  19. 5 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java
  20. 8 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceMaterialsLoadJob.java
  21. 30 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAccountAudienceReportEtlJob.java
  22. 29 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadEtlJob.java
  23. 19 5
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadJob.java
  24. 27 38
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAudienceReportJob.java
  25. 5 4
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyGroupReportLoadJob.java
  26. 85 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDingPanCleanJob.java
  27. 5 1
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupDailyReportJob.java
  28. 31 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupExploreJob.java
  29. 30 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyAccountReportLoadEtlJob.java
  30. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouMaterialControer.java
  31. 48 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/KuaishouAccountSpeedExploreLog.java
  32. 37 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/KuaishouGroupSpeedExploreLog.java
  33. 23 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/KuaishouAccountSpeedExploreLogMapper.java
  34. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/KuaishouGroupSpeedExploreLogMapper.java
  35. 49 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaishouAccountSpeedExploreLogMapper.xml
  36. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaishouGroupSpeedExploreLogMapper.xml
  37. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouAdvertiserStrategyService.java
  38. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaishouAccountSpeedExploreLogService.java
  39. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaishouGroupSpeedExploreLogService.java
  40. 49 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAdvertiserStrategyServiceImpl.java
  41. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouBatchUpdateServiceImpl.java
  42. 100 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouAccountSpeedExploreLogServiceImpl.java
  43. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouGroupSpeedExploreLogServiceImpl.java
  44. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/vo/SpeedExploreGroupVO.java
  45. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  46. 240 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/DingPanController.java
  47. 0 36
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouController.java
  48. 6 53
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouGroup.java
  49. 4 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouCampaignMapper.java
  50. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouCreativeMapper.java
  51. 5 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouGroupMapper.java
  52. 8 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouVideoGetMapper.java
  53. 7 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCampaignMapper.xml
  54. 22 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCreativeMapper.xml
  55. 33 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml
  56. 54 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml
  57. 3 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouCampaignService.java
  58. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouCreativeService.java
  59. 6 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouGroupService.java
  60. 7 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouVideoGetService.java
  61. 1 10
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java
  62. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouVideoRelateCreativesService.java
  63. 6 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCampaignServiceImpl.java
  64. 25 8
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCreativeServiceImpl.java
  65. 25 11
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java
  66. 20 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java
  67. 45 105
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  68. 30 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouVideoRelateCreativesServiceImpl.java
  69. 259 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaiShouAccountMaterialOverviewController.java
  70. 266 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaiShouGroupDailyReportController.java
  71. 270 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaiShouNewlyController.java
  72. 334 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaishouAudienceAccountDailyController.java
  73. 266 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaishouReportAccountDailyController.java
  74. 354 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaishouReportAccountHourlyController.java
  75. 4 108
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouGroupExploreController.java
  76. 91 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaiShouAccountMaterialOverview.java
  77. 181 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaiShouGroupDailyReport.java
  78. 108 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaiShouNewly.java
  79. 139 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaishouAudienceAccountDaily.java
  80. 253 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaishouReportAccountDaily.java
  81. 322 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaishouReportAccountHourly.java
  82. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyAccount.java
  83. 24 18
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportHourlyAccount.java
  84. 80 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/enums/CheckParametersEnum.java
  85. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaiShouAccountMaterialOverviewMapper.java
  86. 26 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaiShouGroupDailyReportMapper.java
  87. 22 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaiShouNewlyMapper.java
  88. 32 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaishouAudienceAccountDailyMapper.java
  89. 29 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaishouReportAccountDailyMapper.java
  90. 28 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaishouReportAccountHourlyMapper.java
  91. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouAudienceReportDailyAccountMapper.java
  92. 25 19
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAccountMapper.java
  93. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyGroupMapper.java
  94. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportHourlyAccountMapper.java
  95. 10 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouVideoEtlInfoMapper.java
  96. 74 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaiShouAccountMaterialOverviewMapper.xml
  97. 116 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaiShouGroupDailyReportMapper.xml
  98. 43 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaiShouNewlyMapper.xml
  99. 174 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouAudienceAccountDailyMapper.xml
  100. 0 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountDailyMapper.xml

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

@@ -138,6 +138,9 @@ public class DateUtils extends PropertyEditorSupport {
         return format;
     }
 
+
+
+
     // 指定模式的时间格式
     private static SimpleDateFormat getSDFormat(String pattern) {
         return new SimpleDateFormat(pattern);
@@ -1563,6 +1566,39 @@ public class DateUtils extends PropertyEditorSupport {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         return sdf.format(calendar.getTime());
     }
+
+    /**
+     * 获取两个日期之间的所有日期集合
+     * @author ZHAOXA
+     * @param
+     * @return java.util.List<java.lang.String>
+     * @throws
+     */
+    public static List<String> getDays(String startTime, String endTime) {
+        // 返回的日期集合
+        List<String> days = new ArrayList<String>();
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        try {
+            Date start = dateFormat.parse(startTime);
+            Date end = dateFormat.parse(endTime);
+
+            Calendar tempStart = Calendar.getInstance();
+            tempStart.setTime(start);
+
+            Calendar tempEnd = Calendar.getInstance();
+            tempEnd.setTime(end);
+            tempEnd.add(Calendar.DATE, +1);// 日期加1(包含结束)
+            while (tempStart.before(tempEnd)) {
+                days.add(dateFormat.format(tempStart.getTime()));
+                tempStart.add(Calendar.DAY_OF_YEAR, 1);
+            }
+
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        return days;
+    }
 }
 
 

+ 18 - 10
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AiKuaishouAdvertiserStrategyController.java

@@ -8,11 +8,11 @@ import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouVideoRelateCreativesService;
 import com.alibaba.fastjson.JSONArray;
 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.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
@@ -36,9 +36,14 @@ import java.util.*;
 @RequestMapping("/ctop/aiKuaishouAdvertiserStrategy")
 public class AiKuaishouAdvertiserStrategyController {
     @Autowired
+    private IKuaishouVideoRelateCreativesService kuaishouVideoRelateCreativesService;
+    @Autowired
     private IAiKuaishouAdvertiserStrategyService aiKuaishouAdvertiserStrategyService;
     @Autowired
+    private IUserAllocationService allocationService;
+    @Autowired
     private ISysRoleService sysRoleService;
+
     /**
      * 分页列表查询
      *
@@ -48,7 +53,6 @@ public class AiKuaishouAdvertiserStrategyController {
      * @param req
      * @return
      */
-    @ApiOperation(value = "快手账户策略设置信息表-分页列表查询", notes = "快手账户策略设置信息表-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<AiKuaishouAdvertiserStrategy>> queryPageList(AiKuaishouAdvertiserStrategy aiKuaishouAdvertiserStrategy,
                                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -82,16 +86,12 @@ public class AiKuaishouAdvertiserStrategyController {
         return result;
     }
 
-    @Autowired
-    private IUserAllocationService allocationService;
-
     /**
      * 添加
      *
      * @param aiKuaishouAdvertiserStrategy
      * @return
      */
-    @ApiOperation(value = "快手账户策略设置信息表-添加", notes = "快手账户策略设置信息表-添加")
     @PostMapping(value = "/add")
     public Result<AiKuaishouAdvertiserStrategy> add(@RequestBody AiKuaishouAdvertiserStrategy aiKuaishouAdvertiserStrategy) {
         Result<AiKuaishouAdvertiserStrategy> result = new Result<>();
@@ -112,6 +112,13 @@ public class AiKuaishouAdvertiserStrategyController {
                 aiKuaishouAdvertiserStrategy.setAppId(appId);
             }
             aiKuaishouAdvertiserStrategyService.save(aiKuaishouAdvertiserStrategy);
+            Thread thread = new Thread(){
+                @Override
+                public void run() {
+                    kuaishouVideoRelateCreativesService.videoRelateCreatives(aiKuaishouAdvertiserStrategy.getAccountId());
+                }
+            };
+            thread.start();
             result.success("添加成功!");
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -119,7 +126,6 @@ public class AiKuaishouAdvertiserStrategyController {
         }
         return result;
     }
-
     /**
      * 编辑
      *
@@ -205,7 +211,6 @@ public class AiKuaishouAdvertiserStrategyController {
      * @param id
      * @return
      */
-    @ApiOperation(value = "快手账户策略设置信息表-通过id删除", notes = "快手账户策略设置信息表-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
         try {
@@ -223,7 +228,6 @@ public class AiKuaishouAdvertiserStrategyController {
      * @param ids
      * @return
      */
-    @ApiOperation(value = "快手账户策略设置信息表-批量删除", notes = "快手账户策略设置信息表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<AiKuaishouAdvertiserStrategy> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         Result<AiKuaishouAdvertiserStrategy> result = new Result<>();
@@ -242,7 +246,6 @@ public class AiKuaishouAdvertiserStrategyController {
      * @param id
      * @return
      */
-    @ApiOperation(value = "快手账户策略设置信息表-通过id查询", notes = "快手账户策略设置信息表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AiKuaishouAdvertiserStrategy> queryById(@RequestParam(name = "id", required = true) String id) {
         Result<AiKuaishouAdvertiserStrategy> result = new Result<>();
@@ -255,4 +258,9 @@ public class AiKuaishouAdvertiserStrategyController {
         }
         return result;
     }
+
+    @GetMapping(value = "testCreate")
+    public Map<String,Object> testCreate(Long accountId){
+        return aiKuaishouAdvertiserStrategyService.testCreate(accountId);
+    }
 }

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

@@ -0,0 +1,154 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountSpeedExploreLog;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAccountSpeedExploreLogService;
+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.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.vo.LoginUser;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 快手账户加速探索触发记录信息
+ * @author jeecg-boot
+ * @date   2021-03-08
+ * @version V1.0
+ */
+@Slf4j
+@RestController
+@RequestMapping("/ctop/kuaishouAccountSpeedExploreLog")
+public class KuaishouAccountSpeedExploreLogController {
+	@Autowired
+	private IKuaishouAccountSpeedExploreLogService kuaishouAccountSpeedExploreLogService;
+
+	/**
+	  * 分页列表查询
+	 * @param kuaishouAccountSpeedExploreLog
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<KuaishouAccountSpeedExploreLog>> queryPageList(KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog,
+																	   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+																	   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+																	   HttpServletRequest req) {
+		Result<IPage<KuaishouAccountSpeedExploreLog>> result = new Result<>();
+		QueryWrapper<KuaishouAccountSpeedExploreLog> queryWrapper = QueryGenerator.initQueryWrapper(kuaishouAccountSpeedExploreLog, req.getParameterMap());
+		Page<KuaishouAccountSpeedExploreLog> page = new Page<>(pageNo, pageSize);
+		IPage<KuaishouAccountSpeedExploreLog> pageList = kuaishouAccountSpeedExploreLogService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param kuaishouAccountSpeedExploreLog
+	 * @return
+	 */
+	@PostMapping(value = "/open")
+	public Map<String,Object> add(@RequestBody KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog) {
+		Map<String,Object>result = new HashMap<>();
+		try {
+			LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+			kuaishouAccountSpeedExploreLog.setUserId(user.getId());
+			//1:查询此账户当前是否存在正在加速探索的账户
+			if(null!=kuaishouAccountSpeedExploreLog.getConvertType()&&(kuaishouAccountSpeedExploreLog.getConvertType()==2||kuaishouAccountSpeedExploreLog.getConvertType()==180||kuaishouAccountSpeedExploreLog.getConvertType()==53||kuaishouAccountSpeedExploreLog.getConvertType()==190)){
+				return kuaishouAccountSpeedExploreLogService.openSpeedExplore(kuaishouAccountSpeedExploreLog);
+			}else {
+				ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_SPEED_EXPLORE_ACTION_TYPE_NOT_CONFIG);
+				return result;
+			}
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			ResultMapUtils.setResultMap(result, StatusCode.COMMON_SERVER_ERROR);
+			return result;
+		}
+	}
+
+	/**
+	  *  编辑
+	 * @param kuaishouAccountSpeedExploreLog
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<KuaishouAccountSpeedExploreLog> edit(@RequestBody KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog) {
+		Result<KuaishouAccountSpeedExploreLog> result = new Result<>();
+		KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLogEntity = kuaishouAccountSpeedExploreLogService.getById(kuaishouAccountSpeedExploreLog.getId());
+		if(kuaishouAccountSpeedExploreLogEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = kuaishouAccountSpeedExploreLogService.updateById(kuaishouAccountSpeedExploreLog);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			kuaishouAccountSpeedExploreLogService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<KuaishouAccountSpeedExploreLog> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<KuaishouAccountSpeedExploreLog> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.kuaishouAccountSpeedExploreLogService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<KuaishouAccountSpeedExploreLog> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<KuaishouAccountSpeedExploreLog> result = new Result<>();
+		KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog = kuaishouAccountSpeedExploreLogService.getById(id);
+		if(kuaishouAccountSpeedExploreLog==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(kuaishouAccountSpeedExploreLog);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -8,6 +8,7 @@ import cn.com.ctop.kuaishou.modules.report.service.IKuaishouVideoEtlInfoService;
 import com.alibaba.excel.EasyExcelFactory;
 import com.alibaba.excel.ExcelWriter;
 import com.alibaba.excel.metadata.Sheet;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -98,6 +99,17 @@ public class KuaishouVideoEtlInfoController {
 		return result;
 	}
 
+	 @PostMapping(value = "/queryPageList")
+	 public Result<Object> queryPageList(@RequestBody JSONObject request) {
+		 try {
+			 return kuaishouVideoEtlInfoService.queryPageList(request);
+		 } catch (Exception e) {
+			 log.error("查询异常,", e.getMessage());
+			 e.printStackTrace();
+		 }
+		 return Result.error("查询失败");
+	 }
+
 	/**
 	  *   添加
 	 * @param kuaishouVideoEtlInfo

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

@@ -1,62 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 快手广告主分天数据
- *
- * @author syh
- */
-@Slf4j
-public class KuaishouDailyAccountReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                Date getDate2 = DateUtils.addDay(new Date(), -2);
-                Date getDate = DateUtils.addDay(new Date(), -1);
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                if (null == tokens || tokens.size() <= 0) {
-                    log.info("定时获取快手数据异常:未获取到可用的token");
-                    return;
-                }
-
-                executorService = Executors.newFixedThreadPool(3);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            //跑两天前的账户报表---次留统计用
-                            kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate2);
-                            //1: 获取广告主信息数据
-                            kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate);
-                        }
-                    });
-                });
-            }
-        };
-        thread.start();
-
-    }
-}

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

@@ -1,60 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 快手广告主次留数据--凌晨跑两天前的次留,统一跑起来
- *
- * @author sunzhen
- */
-@Slf4j
-public class KuaishouDailyAccountReportNextDayStayJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        log.info("快手次留率定时任务开始");
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                Date getDate = DateUtils.addDay(new Date(), -1);
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-                if (null == tokens || tokens.size() <= 0) {
-                    log.info("定时获取快手数据异常:未获取到可用的token");
-                    return;
-                }
-
-                executorService = Executors.newFixedThreadPool(3);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            //1: 获取广告主信息数据
-                            kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate);
-                        }
-                    });
-                });
-            }
-        };
-        thread.start();
-
-    }
-}

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

@@ -3,6 +3,7 @@ package org.jeecg.modules.ctop.job;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyGroupService;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
@@ -26,6 +27,8 @@ public class KuaishouDailyGroupReportLoadJob implements Job {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private IKuaishouReportDailyGroupService reportDailyGroupService;
     static ExecutorService executorService = null;
 
     @Override
@@ -48,7 +51,7 @@ public class KuaishouDailyGroupReportLoadJob implements Job {
                         @Override
                         public void run() {
                             //获取广告组信息数据
-                            kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getDate, getDate);
+                            reportDailyGroupService.getAdvertiserGroupReportDaily(token, getDate, getDate);
                         }
                     });
                 });

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

@@ -36,7 +36,6 @@ public class MergeVideoJob implements Job {
 
                     try {
                         String localPath = LoadFileUtil.downLoadFromUrl(url, PropertiesUtils.getValue("kuaishou_config", "video_sava_path"));
-//                        String localPath = LoadFileUtil.downLoadFromUrl(url,"D:/video/");
                         String md5 = LoadFileUtil.getMD5(localPath);
                         LoadFileUtil.delFile(localPath);
                         MaterialInfo materialInfo = new MaterialInfo();

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

@@ -361,14 +361,9 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         }
         Map<String, String> userMap = new HashMap<>();
         if (!Check.isNullMap(userIdMap)) {
-            List<JSONObject> userList = userService.getUserMapByMap(userIdMap);
-            if (!Check.isNull(userList)) {
-                for (int i = 0; i < userList.size(); i++) {
-                    JSONObject userJson = userList.get(i);
-                    userMap.put(userJson.getString("id"), userJson.getString("realname"));
-                }
-            }
+            userMap = userService.getUserMapByMap(userIdMap);
         }
+
         Map<String, String> advertiserMap = new HashMap<>();
         if (!Check.isNullMap(advertiserIdMap)) {
             List<JSONObject> advertiserList = advertiserService.getAdvertiserByMap(advertiserIdMap);

+ 2 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/TransferAccountServiceImpl.java

@@ -84,14 +84,9 @@ public class TransferAccountServiceImpl extends ServiceImpl<TransferAccountMappe
         }
         Map<String, String> userMap = new HashMap<>();
         if (!Check.isNullMap(userIdMap)) {
-            List<JSONObject> userList = userService.getUserMapByMap(userIdMap);
-            if (!Check.isNull(userList)) {
-                for (int i = 0; i < userList.size(); i++) {
-                    JSONObject userJson = userList.get(i);
-                    userMap.put(userJson.getString("id"), userJson.getString("realname"));
-                }
-            }
+            userMap = userService.getUserMapByMap(userIdMap);
         }
+
         Map<String, String> advertiserMap = new HashMap<>();
         if (!Check.isNullMap(advertiserIdMap)) {
             List<JSONObject> advertiserList = advertiserService.getAdvertiserByMap(advertiserIdMap);

+ 43 - 15
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -20,6 +20,7 @@ import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataServ
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.*;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -62,14 +63,37 @@ public class SampleTest {
     private IBindAccountLoginService bindAccountLoginService;
     @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
- /*   @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
+    /*   @Autowired
+       private IByteDanceAdvertiserDataService advertiserDataService;
 
-*/
+   */
+    @Autowired
+    private IKuaishouReportDailyGroupService reportDailyGroupService;
+    @Autowired
+    private IEtlKuaiShouAccountMaterialOverviewService kuaiShouAccountMaterialOverviewService;
 
 
     @Test
     public void loadBytedanceCreativeData() throws ParseException {
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        Date getDate2 = DateUtils.addDay(new Date(), -2);
+
+        CtopOauthToken token = new CtopOauthToken();
+        token.setAccountId(9901975L);
+        token.setAccessToken("1c7cebebc3174c39fe941d136df65b1d");
+        kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate,"adScene");
+
+     /*   JSONObject materialOverview = kuaiShouAccountMaterialOverviewService.getMaterialOverview(5473041L, "2021-03-09");
+        System.err.println(materialOverview);*/
+
+      /*  CtopOauthToken token = new CtopOauthToken();
+        token.setAccountId(9901975L);
+        token.setAccessToken("e609f9d3f56f3d6b4653f32c98a6d119");
+        kuaiShouAccountMaterialOverviewService.cleanAccountMaterialOverview(9901975L, "2021-03-09");
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse = simpleDateFormat.parse("2021-03-09");
+        reportDailyGroupService.getAdvertiserGroupReportDaily(token, parse, parse);*/
+
         //    1662234704806924
        /* CtopOauthToken token = new CtopOauthToken();
         token.setAccountId(9549277L);
@@ -81,12 +105,12 @@ public class SampleTest {
         Date parse = simpleDateFormat.parse("2021-02-02");
         kuaishouInterfaceService.getAdvertiserReportDaily(token, parse, parse);*/
 
-        CtopOauthToken token = new CtopOauthToken();
+     /*   CtopOauthToken token = new CtopOauthToken();
         token.setAccountId(9767055L);
         token.setAccessToken("28e4e6b124e1443d6971ba4c699de6c9");
 
         kuaishouInterfaceService.getVideoList(token, null, null);
-        kuaishouInterfaceService.getVideoInfo("28e4e6b124e1443d6971ba4c699de6c9",9767055L,"5208131540349742192");
+        kuaishouInterfaceService.getVideoInfo("28e4e6b124e1443d6971ba4c699de6c9", 9767055L, "5208131540349742192");*/
 
      /*   CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(1662234704806924L);
         advertiserDataService.getMaterialList(tokenByAccountId);*/
@@ -477,9 +501,10 @@ public class SampleTest {
     IRuleByteDanceAccountService ruleByteDanceAccountService;
     @Autowired
     IAiKuaishouNewCreateCampaign aiKuaishouNewCreateCampaign;
+
     @Test
-    public void testLoadBytedanceDataV2(){
-        String accountIds=
+    public void testLoadBytedanceDataV2() {
+        String accountIds =
                 "1675440464386062," +
                         "1688606248211533," +
                         "1669181787105294," +
@@ -532,11 +557,11 @@ public class SampleTest {
                         "1674634579279885," +
                         "1650263841162253," +
                         "1672178052130888";
-        String [] accountArray = accountIds.split(",");
-        for (int i=0;i<accountArray.length;i++){
+        String[] accountArray = accountIds.split(",");
+        for (int i = 0; i < accountArray.length; i++) {
             CtopOauthToken token = tokenService.getTokenByAccountId(Long.parseLong(accountArray[i]));
 
-            reportService.getAdvertiserReport(token, DateUtils.parseDate("2021-01-14","yyyy-MM-dd"), DateUtils.parseDate("2021-01-14","yyyy-MM-dd"),CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+            reportService.getAdvertiserReport(token, DateUtils.parseDate("2021-01-14", "yyyy-MM-dd"), DateUtils.parseDate("2021-01-14", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         }
     }
 
@@ -556,7 +581,7 @@ public class SampleTest {
         countDownLatch = new CountDownLatch(tokens.size());
         tokens.forEach(token -> executorService.submit(() -> {
             try {
-                kuaishouReportDailyImageService.getMaterialImageReport(token.getAccountId(),token.getAccessToken(), "2021-01-17", "2021-01-31", 1);
+                kuaishouReportDailyImageService.getMaterialImageReport(token.getAccountId(), token.getAccessToken(), "2021-01-17", "2021-01-31", 1);
             } catch (Exception e) {
 
             } finally {
@@ -572,15 +597,18 @@ public class SampleTest {
 
     @Autowired
     private IEtlKuaishouAccountMaterialReportDailyService dailyService;
+
     @Test
-    public void etlKuaishouInfo(){
-        Date startDate = DateUtils.parseDate("2020-05-03","yyyy-MM-dd");
-        for(int i=0;i<365;i++){
-            dailyService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(startDate,i)));
+    public void etlKuaishouInfo() {
+        Date startDate = DateUtils.parseDate("2020-05-03", "yyyy-MM-dd");
+        for (int i = 0; i < 365; i++) {
+            dailyService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(startDate, i)));
         }
     }
+
     @Autowired
     private IEtlKuaishouVideoInfoService videoEtlInfoService;
+
     @Test
     public void etlKuaishouVideoInfo(){
         Date startDate = DateUtils.parseDate("2020-09-11","yyyy-MM-dd");

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

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 项目
@@ -24,4 +25,6 @@ public interface ProjectMapper extends BaseMapper<Project> {
     String querySupplierCodeById(@Param("projectId") Long projectId);
 
     List<JSONObject> getProjectListByIds(@Param("ids") JSONArray projectIdArray);
+
+    List<JSONObject> getListByMap(@Param("ids") Map<Long, Long> projectIdMap);
 }

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

@@ -43,5 +43,16 @@
 
 
     </select>
+    <select id="getListByMap" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        id as 'id',
+        project_name as 'projectName'
+        from ctop_project
+        where id in
+        <foreach collection="ids" item="ids" separator="," open="(" close=")">
+            #{ids}
+        </foreach>
+
+    </select>
 
 </mapper>

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

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 项目
@@ -23,4 +24,7 @@ public interface IProjectService extends IService<Project> {
     String getSupplierCodeById(Long projectId);
 
     List<JSONObject> getProjectListByIds(JSONArray projectIdArray);
+
+
+    Map<Long, String> getProjectMap(Map<Long, Long> projectIdMap);
 }

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

@@ -3,7 +3,6 @@ package cn.com.ctop.common.module.service;
 import cn.com.ctop.common.module.entity.SysUser;
 import cn.com.ctop.common.module.model.SysUserSysDepartModel;
 import cn.com.ctop.common.module.vo.SysUserVo;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -269,5 +268,5 @@ public interface ISysUserService extends IService<SysUser> {
 
     List<SysUser> queryPageList(SysUser user);
 
-    List<JSONObject> getUserMapByMap(Map<String, String> userIdMap);
+    Map<String, String> getUserMapByMap(Map<String, String> userIdMap);
 }

+ 8 - 5
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -13,10 +13,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xxl.job.core.context.XxlJobHelper;
 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 javax.annotation.Resource;
 import java.util.*;
 
 /**
@@ -36,9 +36,12 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
     private String bytedanceUrlApiPrefix;
     @Value("${bytedance.url.refresh-token}")
     private String bytedanceUrlRefreshToken;
-    @Autowired
+    @Value("${kuaishou.api-url}")
+    private String kuaishouApiUrl;
+
+    @Resource
     private CtopOauthTokenMapper ctopOauthTokenMapper;
-    @Autowired
+    @Resource
     private OauthAgentTokenMapper agentTokenMapper;
 
     @Override
@@ -123,7 +126,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
     @Override
     public void getKuaiShouRefreshToken(Long accountId, String token, String refreshToken, Long appId, String secret) {
         log.info("快手刷新token入参,accountId:{},token:{},refreshToken:{}", accountId, token, refreshToken);
-        String url = PropertiesUtils.getConfig("kuaishou_api_url") + "/rest/openapi/oauth2/authorize/refresh_token";
+        String url = kuaishouApiUrl + "/rest/openapi/oauth2/authorize/refresh_token";
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", " application/json");
         Map<String, Object> param = new HashMap<>();
@@ -245,7 +248,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
     @Override
     public void getKuaiShouAgentRefreshToken(Long agentId, String accessToken, String refreshToken) {
         log.info("快手刷新token入参,token:{},refreshToken:{}", accessToken, refreshToken);
-        String url = PropertiesUtils.getConfig("kuaishou_api_url") + "/rest/openapi/oauth2/authorize/refresh_token";
+        String url = kuaishouApiUrl + "/rest/openapi/oauth2/authorize/refresh_token";
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", " application/json");
         Map<String, Object> param = new HashMap<>();

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

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service.impl;
 import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.mapper.ProjectMapper;
 import cn.com.ctop.common.module.service.IProjectService;
+import cn.com.ctop.common.module.utils.Check;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -10,7 +11,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 项目
@@ -47,4 +50,19 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     public List<JSONObject> getProjectListByIds(JSONArray projectIdArray) {
         return projectMapper.getProjectListByIds(projectIdArray);
     }
+
+    @Override
+    public Map<Long, String> getProjectMap(Map<Long, Long> projectIdMap) {
+        Map<Long, String> projectMap = new HashMap<>();
+        if (!Check.isNullMap(projectIdMap)) {
+            List<JSONObject> projectList = projectMapper.getListByMap(projectIdMap);
+            if (!Check.isNull(projectList)) {
+                for (int i = 0; i < projectList.size(); i++) {
+                    JSONObject projectJson = projectList.get(i);
+                    projectMap.put(projectJson.getLong("id"), projectJson.getString("projectName"));
+                }
+            }
+        }
+        return projectMap;
+    }
 }

+ 15 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/impl/SysUserServiceImpl.java

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.mapper.*;
 import cn.com.ctop.common.module.model.SysUserSysDepartModel;
 import cn.com.ctop.common.module.service.ISysBaseApi;
 import cn.com.ctop.common.module.service.ISysUserService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.vo.SysUserDepVo;
 import cn.com.ctop.common.module.vo.SysUserVo;
 import com.alibaba.fastjson.JSONObject;
@@ -289,8 +290,20 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     }
 
     @Override
-    public List<JSONObject> getUserMapByMap(Map<String, String> userIdMap) {
-        return userMapper.getUserMapByMap(userIdMap);
+    public Map<String, String> getUserMapByMap(Map<String, String> userIdMap) {
+
+        Map<String, String> userMap = new HashMap<>();
+        if (!Check.isNullMap(userIdMap)) {
+            List<JSONObject> userList = userMapper.getUserMapByMap(userIdMap);
+            if (!Check.isNull(userList)) {
+                for (int i = 0; i < userList.size(); i++) {
+                    JSONObject userJson = userList.get(i);
+                    userMap.put(userJson.getString("id"), userJson.getString("realname"));
+                }
+            }
+        }
+
+        return userMap;
     }
 
     @Override

+ 5 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/StatusCode.java

@@ -57,6 +57,11 @@ public enum StatusCode {
 
     BYTEDACNE_API_GROUP_CREATE_ERROR("头条API创建广告组异常",-4001,false),
 
+    KUAISHOU_API_ACCOUNT_SPEED_EXPLORING("此账户加速探索尚未完成",-5001,false),
+
+    KUAISHOU_SPEED_EXPLORE_ACTION_TYPE_NOT_CONFIG("加速探索尚不支持此类优化目标",-6001,false),
+    KUAISHOU_SPEED_EXPLORE_FAIL("加速探索失败",-6002,false),
+
     KUAISHOU_CRAWLER_APP_SUCCESS("爬虫运行正常", 0, true),
     KUAISHOU_CRAWLER_APP_TASK_END("爬虫任务运行结束", 1, true),
     KUAISHOU_CRAWLER_APP_JOB_StART("任务开始执行开始", 0, true),

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

@@ -3,6 +3,8 @@ package cn.com.ctop.job.bytedance.handler;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceVideoInfoService;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceImageInfoService;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,6 +24,10 @@ public class BytedanceMaterialsLoadJob {
     static CountDownLatch countDownLatch = null;
     @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
+    @Autowired
+    private IByteDanceVideoInfoService videoInfoService;
+    @Autowired
+    private IBytedanceImageInfoService imageInfoService;
 
     @XxlJob("bytedanceMaterialsLoadJob")
     public void execute() throws Exception{
@@ -47,6 +53,8 @@ public class BytedanceMaterialsLoadJob {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
+        videoInfoService.updateMaterialType();
+        imageInfoService.updateType();
         XxlJobHelper.log("物料数据同步完成");
     }
 }

+ 30 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAccountAudienceReportEtlJob.java

@@ -0,0 +1,30 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouAudienceAccountDailyService;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountDailyService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 清洗盯盘人群——年龄、性别数据
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouAccountAudienceReportEtlJob {
+
+    @Autowired
+    private IEtlKuaishouAudienceAccountDailyService etlKuaishouAudienceAccountDailyService;
+
+    @XxlJob("kuaishouAccountAudienceReportEtlJob")
+    public void execute() throws Exception {
+        try {
+            etlKuaishouAudienceAccountDailyService.queryEveryDayAudienceInfo();
+            XxlJobHelper.log("queryEveryDayAudienceInfo success");
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+        }
+    }
+}

+ 29 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadEtlJob.java

@@ -0,0 +1,29 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountDailyService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 账户维度-盯盘每日数据
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouDailyAccountReportLoadEtlJob {
+
+    @Autowired
+    private IEtlKuaishouReportAccountDailyService iEtlKuaishouReportAccountDailyService;
+
+    @XxlJob("kuaishouDailyAccountReportLoadEtl")
+    public void execute() throws Exception {
+        try {
+            iEtlKuaishouReportAccountDailyService.queryEveryDayDataForAccount();
+            XxlJobHelper.log("queryEveryDayDataForAccount success");
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+        }
+    }
+}

+ 19 - 5
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadJob.java

@@ -31,19 +31,33 @@ public class KuaishouDailyAccountReportLoadJob {
     public void execute() throws Exception {
         Date getDate = DateUtils.addDay(new Date(), -1);
         Date getDate2 = DateUtils.addDay(new Date(), -2);
-
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         if (null == tokens || tokens.isEmpty()) {
             XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
             XxlJobHelper.handleFail();
-            return ;
+            return;
         }
-        tokens.forEach(token -> executorService.submit(() ->{
-                    kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate2);
-                    kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate);
+        tokens.forEach(token -> executorService.submit(() -> {
+            kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate, null);
+        }));
+    }
 
 
+    @XxlJob("kuaishouDailyAccountAdSceneReport")
+    public void kuaishouDailyAccountAdSceneReport() throws Exception {
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        Date getDate2 = DateUtils.addDay(new Date(), -2);
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        if (null == tokens || tokens.isEmpty()) {
+            XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        tokens.forEach(token -> executorService.submit(() -> {
+            kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate, "adScene");
         }));
     }
+
 }

+ 27 - 38
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAudienceReportJob.java

@@ -2,7 +2,6 @@ package cn.com.ctop.job.kuaishou.handler;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouStrategyService;
@@ -34,53 +33,43 @@ public class KuaishouDailyAudienceReportJob {
     @Autowired
     private IKuaishouStrategyService kuaishouStrategyService;
 
-    static ExecutorService executorService = Executors.newFixedThreadPool(6);
+    static ExecutorService executorService = null;
 
     @XxlJob("kuaishouDailyAudienceReportJob")
     public void execute() throws Exception {
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        if (null == tokens || tokens.isEmpty()) {
-            XxlJobHelper.log("定时获取人群分析报表数据异常:未获取到可用的token");
-            XxlJobHelper.handleFail();
-            return;
-        }
-        //查询手淘有效账户数据
-        List<Long> accountIds = kuaishouStrategyService.queryShouTaoAccounts();
-        if (Check.isNull(accountIds) || accountIds.size() == 0) {
-            XxlJobHelper.log("定时获取人群分析报表数据异常:未获取到有效策略账户信息");
-            XxlJobHelper.handleFail();
-            return;
-        }
-        //筛选出有效账户,获取该账户的组级人群报表数据
-        List<CtopOauthToken> activeTokens = new ArrayList<>();
-        for (Long accountId : accountIds) {
-            for (CtopOauthToken token : tokens) {
-                if (token.getAccountId() - accountId == 0) {
-                    activeTokens.add(token);
+        Thread thread = new Thread() {
+            @Override
+            public void run() {
+                List<String> dates = new ArrayList<>();
+                for (int i = 5; i < 36; i++) {
+                    String dat = DateUtils.getLastDay(DateUtils.date2Str(), i);
+                    dates.add(dat);
+                }
+                XxlJobHelper.log("-----------清洗日期:" + dates.toString());
+                //  9556344、9743727、9743738、9812668、9901966、9767034
+                CtopOauthToken token = tokenService.getTokenByAccountId(9812668L);
+                int page = 1;
+                int pageSize = 2000;
+                List<KuaiShouGroup> kuaiShouGroups = kuaiShouGroupService.queryUnitInfoByAccountId(token.getAccountId());
+                executorService = Executors.newFixedThreadPool(8);
+                for (String date : dates) {
+                    executorService.submit(new Runnable() {
+                        @Override
+                        public void run() {
+                            getAudienceReportData(kuaiShouGroups, token, date, "ageSegment", page, pageSize);
+                        }
+                    });
                 }
             }
-        }
-        if (!Check.isNull(activeTokens) && activeTokens.size() > 0) {
-            int page = 1;
-            int pageSize = 2000;
-            //查询两天前日期
-            String date = DateUtils.getLastDay(DateUtils.date2Str(), 2);
-            activeTokens.forEach(token -> executorService.submit(() -> {
-                getAudienceReportData(token, date, "province", page, pageSize);
-                getAudienceReportData(token, date, "city", page, pageSize);
-                getAudienceReportData(token, date, "gender", page, pageSize);
-                getAudienceReportData(token, date, "ageSegment", page, pageSize);
-                getAudienceReportData(token, date, "clientId", page, pageSize);
-                getAudienceReportData(token, date, "businessInterestTags", page, pageSize);
-            }));
-        }
+        };
+        thread.start();
     }
 
-    private void getAudienceReportData(CtopOauthToken token, String date, String type, Integer page, Integer pageSize) {
+    private void getAudienceReportData(List<KuaiShouGroup> kuaiShouGroups, CtopOauthToken token, String date, String type, Integer page, Integer pageSize) {
         try {
-            List<KuaiShouGroup> kuaiShouGroups = kuaiShouGroupService.queryUnitInfoByAccountId(token.getAccountId());
             for (KuaiShouGroup kuaiShouGroup : kuaiShouGroups) {
                 kuaishouAudienceReportDailyService.crowdAnalysisReport(token, date, type, kuaiShouGroup.getCampaignId(), kuaiShouGroup.getUnitId(), page, pageSize);
+                Thread.sleep(600);
             }
         } catch (Exception e) {
             XxlJobHelper.log("定时获取人群分析报表数据异常", e);

+ 5 - 4
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyGroupReportLoadJob.java

@@ -2,7 +2,7 @@ package cn.com.ctop.job.kuaishou.handler;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyGroupService;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import org.jeecg.common.util.DateUtils;
@@ -24,8 +24,9 @@ public class KuaishouDailyGroupReportLoadJob {
     @Autowired
     private ICtopOauthTokenService tokenService;
     @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
+    private IKuaishouReportDailyGroupService reportDailyGroupService;
     static ExecutorService executorService = Executors.newFixedThreadPool(3);
+
     @XxlJob("kuaishouDailyGroupReport")
     public void execute() throws Exception {
         Date getDate = DateUtils.addDay(new Date(), -1);
@@ -34,8 +35,8 @@ public class KuaishouDailyGroupReportLoadJob {
         if (null == tokens || tokens.size() <= 0) {
             XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
             XxlJobHelper.handleFail();
-            return ;
+            return;
         }
-        tokens.forEach(token -> executorService.submit(() -> kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getDate, getDate)));
+        tokens.forEach(token -> executorService.submit(() -> reportDailyGroupService.getAdvertiserGroupReportDaily(token, getDate, getDate)));
     }
 }

+ 85 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDingPanCleanJob.java

@@ -0,0 +1,85 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaiShouAccountMaterialOverviewService;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaiShouGroupDailyReportService;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaiShouNewlyService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class KuaishouDingPanCleanJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IEtlKuaiShouGroupDailyReportService etlKuaiShouGroupDailyReportService;
+    @Autowired
+    private IEtlKuaiShouAccountMaterialOverviewService accountMaterialOverviewService;
+
+    @Autowired
+    private IEtlKuaiShouNewlyService newlyService;
+
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(8);
+    static ExecutorService materialExecutorService = Executors.newFixedThreadPool(8);
+
+    @XxlJob("cleanNewlyData")
+    public void cleanNewlyData() {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesterdayDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        newlyService.cleanNewlyData(yesterdayDate);
+        XxlJobHelper.log("快手清洗上新计划数据完成");
+    }
+
+
+    @XxlJob("cleanGroupReport")
+    public void cleanGroupReport() throws Exception {
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        if (null == tokens || tokens.isEmpty()) {
+            XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        for (CtopOauthToken token : tokens) {
+            executorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    etlKuaiShouGroupDailyReportService.getGroupReport(token.getAccountId(), token.getAccessToken(), nowDate, nowDate, 1);
+                }
+            });
+        }
+    }
+
+
+    @XxlJob("cleanAccountMaterialOverview")
+    public void cleanAccountMaterialOverview() throws Exception {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String yesterdayDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        if (null == tokens || tokens.isEmpty()) {
+            XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
+            XxlJobHelper.handleFail();
+            return;
+        }
+        for (CtopOauthToken token : tokens) {
+            materialExecutorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    accountMaterialOverviewService.cleanAccountMaterialOverview(token.getAccountId(), yesterdayDate);
+                }
+            });
+        }
+
+
+    }
+
+}

+ 5 - 1
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupDailyReportJob.java

@@ -3,6 +3,7 @@ package cn.com.ctop.job.kuaishou.handler;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyGroupService;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import org.jeecg.common.util.DateUtils;
@@ -22,8 +23,11 @@ public class KuaishouGroupDailyReportJob {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private IKuaishouReportDailyGroupService reportDailyGroupService;
 
     static ExecutorService executorService = Executors.newFixedThreadPool(5);
+
     @XxlJob("kuaishouGroupDailyReportJob")
     public void execute() throws ParseException {
         String date = DateUtils.getDate("yyyy-MM-dd");
@@ -34,7 +38,7 @@ public class KuaishouGroupDailyReportJob {
         Date parse2 = simpleDateFormat.parse(endDate);
         List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
         tokens.forEach(token -> executorService.submit(() ->
-                kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, parse, parse2))
+                reportDailyGroupService.getAdvertiserGroupReportDaily(token, parse, parse2))
         );
         XxlJobHelper.log("快手物料数据同步完成");
     }

+ 31 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupExploreJob.java

@@ -0,0 +1,31 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouGroupExploreService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class KuaishouGroupExploreJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouGroupExploreService kuaishouGroupExploreService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+    @XxlJob("kuaishouGroupExploreReportJob")
+    public void execute() throws ParseException {
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        tokens.forEach(token -> executorService.submit(() ->
+                kuaishouGroupExploreService.getReportByAccount(token))
+        );
+        XxlJobHelper.log("快手物料数据同步完成");
+    }
+}

+ 30 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyAccountReportLoadEtlJob.java

@@ -0,0 +1,30 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountDailyService;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountHourlyService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 账户维度-盯盘每小时数据
+ *
+ * @author syh
+ */
+@Component
+public class KuaishouHourlyAccountReportLoadEtlJob {
+
+    @Autowired
+    private IEtlKuaishouReportAccountHourlyService hourlyService;
+
+    @XxlJob("kuaishouHourlyAccountReportLoadEtl")
+    public void execute() throws Exception {
+        try {
+            hourlyService.queryEveryhourlyDataForAccount();
+            XxlJobHelper.log("queryEveryhourlyDataForAccount success");
+        } catch (Exception e) {
+            XxlJobHelper.log(e.getMessage());
+        }
+    }
+}

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouMaterialControer.java

@@ -100,7 +100,7 @@ public class KuaiShouMaterialControer {
             if (!Check.isNull(videoLastTime)) {
                 startTime = videoLastTime.getLastTime();
             } else {
-                startTime = DateUtils.addTime(endDate, 5);
+                startTime = DateUtils.addTime(endDate, 72);
             }
             Map<String, Object> requestMap = new HashMap<>();
             requestMap.put("startTime", DateUtils.formatDate(startTime, "yyyy-MM-dd HH:mm:ss"));

+ 48 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/KuaishouAccountSpeedExploreLog.java

@@ -0,0 +1,48 @@
+package cn.com.ctop.kuaishou.modules.ai.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 快手账户加速探索触发记录信息
+ * @author jeecg-boot
+ * @date   2021-03-08
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_account_speed_explore_log")
+@EqualsAndHashCode(callSuper = false)
+public class KuaishouAccountSpeedExploreLog {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+	private Long id;
+	/**accountId*/
+	private Long accountId;
+	/**groupAccount*/
+	private BigDecimal groupAccount;
+	/**groupCount*/
+	private Integer groupCount;
+	private Integer convertType;
+	/**convertCount*/
+	private Integer convertCount;
+	/**userId*/
+	private String userId;
+	/**
+	 * status
+	 * 0:默认
+	 * 1:探索中
+	 * 2:探索完成
+	 * */
+	private Integer status;
+	/**createTime*/
+	private Date createTime;
+	/**updateTime*/
+	private Date updateTime;
+}

+ 37 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/KuaishouGroupSpeedExploreLog.java

@@ -0,0 +1,37 @@
+package cn.com.ctop.kuaishou.modules.ai.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 快手组级别加速探索执行记录
+ * @author jeecg-boot
+ * @date   2021-03-10
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_kuaishou_group_speed_explore_log")
+public class KuaishouGroupSpeedExploreLog {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+	private Long id;
+	/**accountId*/
+	private Long accountId;
+	/**accountExploreId*/
+	private Long accountExploreId;
+	/**unitId*/
+	private Long unitId;
+	/**status*/
+	private Integer status;
+	/**message*/
+	private String message;
+	/**createTime*/
+	private Date createTime;
+	/**updateTime*/
+	private Date updateTime;
+}

+ 23 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/KuaishouAccountSpeedExploreLogMapper.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.kuaishou.modules.ai.mapper;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountSpeedExploreLog;
+import cn.com.ctop.kuaishou.modules.ai.vo.SpeedExploreGroupVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 快手账户加速探索触发记录信息
+ * @author: jeecg-boot
+ * @date:   2021-03-08
+ * @cersion: V1.0
+ */
+public interface KuaishouAccountSpeedExploreLogMapper extends BaseMapper<KuaishouAccountSpeedExploreLog> {
+
+    List<SpeedExploreGroupVO> getSpeedExploreGroupVosByParams(@Param(value = "date") String date,
+                                                              @Param(value = "accountId")Long accountId,
+                                                              @Param(value = "convertType")Integer convertType,
+                                                              @Param(value = "convertCount")Integer convertCount,
+                                                              @Param(value = "groupCount")Integer groupCount);
+}

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/KuaishouGroupSpeedExploreLogMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.ai.mapper;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouGroupSpeedExploreLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 快手组级别加速探索执行记录
+ * @author: jeecg-boot
+ * @date:   2021-03-10
+ * @cersion: V1.0
+ */
+public interface KuaishouGroupSpeedExploreLogMapper extends BaseMapper<KuaishouGroupSpeedExploreLog> {
+
+}

+ 49 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaishouAccountSpeedExploreLogMapper.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.ai.mapper.KuaishouAccountSpeedExploreLogMapper">
+
+    <select id="getSpeedExploreGroupVosByParams"
+            resultType="cn.com.ctop.kuaishou.modules.ai.vo.SpeedExploreGroupVO">
+        select *from (select report.account_id,
+                report.unit_id,
+                report.campaign_id,
+                report.charge,
+                report.activation,
+                report.bclick,
+                report.form_count,
+                report.event_pay,
+        <if test="convertType=180">
+            (case when activation=0 then 0 else round(report.charge/report.activation,2) end)as account,
+        </if>
+        <if test="convertType=2">
+            (case when bclick=0 then 0 else round(report.charge/report.bclick,2) end)as account,
+        </if>
+        <if test="convertType=53">
+            (case when form_count=0 then 0 else round(report.charge/report.form_count,2) end)as account,
+        </if>
+        <if test="convertType=190">
+            (case when event_pay=0 then 0 else round(report.charge/report.event_pay,2) end)as account,
+        </if>
+        round(g.cpa_bid/1000,2) as cpaBid
+         from ctop_kuaishou_group g
+                  left join ctop_kuaishou_report_daily_group report
+                            on report.unit_id = g.unit_id and report.stat_date = #{date}
+         where g.study_status = 1
+           and g.group_create_time like '2021-03-10%'
+           and g.account_id = #{accountId}
+           and report.account_id is not null
+        <if test="convertType=180">
+            and report.activation >= #{convertCount}
+        </if>
+        <if test="convertType=2">
+            and report.bclick >= #{convertCount}
+        </if>
+        <if test="convertType=53">
+            and report.form_count >= #{convertCount}
+        </if>
+        <if test="convertType=190">
+            and report.event_pay >= #{convertCount}
+        </if>) a
+where a.cpaBid>a.activation_account order by a.account limit #{groupCount}
+    </select>
+</mapper>

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaishouGroupSpeedExploreLogMapper.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.ai.mapper.KuaishouGroupSpeedExploreLogMapper">
+
+</mapper>

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

@@ -3,6 +3,8 @@ package cn.com.ctop.kuaishou.modules.ai.service;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.Map;
+
 /**
  * @Description: 快手账户策略设置信息表
  * @Author: jeecg-boot
@@ -13,4 +15,5 @@ public interface IAiKuaishouAdvertiserStrategyService extends IService<AiKuaisho
 
     AiKuaishouAdvertiserStrategy getByAccountId(Long accountId);
 
+    Map<String, Object> testCreate(Long accountId);
 }

+ 19 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaishouAccountSpeedExploreLogService.java

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.ai.service;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountSpeedExploreLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Map;
+
+/**
+ * @Description: 快手账户加速探索触发记录信息
+ * @Author: jeecg-boot
+ * @Date:   2021-03-08
+ * @Version: V1.0
+ */
+public interface IKuaishouAccountSpeedExploreLogService extends IService<KuaishouAccountSpeedExploreLog> {
+
+    Map<String, Object> openSpeedExplore(KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog)throws Exception;
+
+    KuaishouAccountSpeedExploreLog getByParams(Long accountId, Integer status);
+}

+ 14 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaishouGroupSpeedExploreLogService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.ai.service;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouGroupSpeedExploreLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 快手组级别加速探索执行记录
+ * @Author: jeecg-boot
+ * @Date:   2021-03-10
+ * @Version: V1.0
+ */
+public interface IKuaishouGroupSpeedExploreLogService extends IService<KuaishouGroupSpeedExploreLog> {
+
+}

+ 49 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAdvertiserStrategyServiceImpl.java

@@ -1,12 +1,22 @@
 package cn.com.ctop.kuaishou.modules.ai.service.impl;
 
+import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
 import cn.com.ctop.kuaishou.modules.ai.mapper.AiKuaishouAdvertiserStrategyMapper;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
+import com.alibaba.fastjson.JSONObject;
 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.HashMap;
+import java.util.Map;
+
 /**
  * 快手账户策略设置信息表
  * @author jeecg-boot
@@ -15,7 +25,10 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class AiKuaishouAdvertiserStrategyServiceImpl extends ServiceImpl<AiKuaishouAdvertiserStrategyMapper, AiKuaishouAdvertiserStrategy> implements IAiKuaishouAdvertiserStrategyService {
-
+    public static final String TEST_CREATIVE_URL= "http://139.186.27.96:31012/ai_historical_missing_material";
+    public static final String TEST_PROGRAM_CREATIVE_URL= "http://139.186.27.96:31012/ai_programme_new_material";
+    @Autowired
+    private IUserAllocationService userAllocationService;
     @Override
     public AiKuaishouAdvertiserStrategy getByAccountId(Long accountId) {
         QueryWrapper<AiKuaishouAdvertiserStrategy>queryWrapper =new QueryWrapper<>();
@@ -24,4 +37,39 @@ public class AiKuaishouAdvertiserStrategyServiceImpl extends ServiceImpl<AiKuais
         queryWrapper.last("limit 1");
         return this.getOne(queryWrapper);
     }
+
+    @Override
+    public Map<String, Object> testCreate(Long accountId) {
+        Map<String,Object>result = new HashMap<>();
+        if(null == accountId||accountId == 0){
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        AiKuaishouAdvertiserStrategy aiKuaishouAdvertiserStrategy = this.getByAccountId(accountId);
+        if(null == aiKuaishouAdvertiserStrategy||null == aiKuaishouAdvertiserStrategy.getStatus()||aiKuaishouAdvertiserStrategy.getStatus()!=1){
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        UserAllocation allocation = userAllocationService.getByAccountId(accountId);
+        if(null == allocation){
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        JSONObject params = new JSONObject();
+        params.put("account_id",accountId);
+        params.put("test_video_cnt",1);
+        String request = null;
+        //程序化
+        if(aiKuaishouAdvertiserStrategy.getOpenProgramCreate() == 1){
+            request = HttpUtils.httpPostRequest(TEST_PROGRAM_CREATIVE_URL,params,new HashMap<>());
+        }else{
+            request = HttpUtils.httpPostRequest(TEST_CREATIVE_URL, params, new HashMap<>());
+        }
+        JSONObject requestObject = JSONObject.parseObject(request);
+        String message = requestObject.getString("message");
+        Integer code = requestObject.getInteger("code");
+        result.put("code",code);
+        result.put("message",message);
+        return result;
+    }
 }

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouBatchUpdateServiceImpl.java

@@ -20,7 +20,7 @@ import java.util.concurrent.Executors;
 public class KuaiShouBatchUpdateServiceImpl implements IKuaiShouBatchUpdateService {
     @Autowired
     private IKuaiShouGroupService groupService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(40);
+    static ExecutorService executorService = Executors.newFixedThreadPool(20);
     @Autowired
     private IBatchService batchService;
     @Autowired

+ 100 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouAccountSpeedExploreLogServiceImpl.java

@@ -0,0 +1,100 @@
+package cn.com.ctop.kuaishou.modules.ai.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.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouAccountSpeedExploreLog;
+import cn.com.ctop.kuaishou.modules.ai.mapper.KuaishouAccountSpeedExploreLogMapper;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAccountSpeedExploreLogService;
+import cn.com.ctop.kuaishou.modules.ai.vo.SpeedExploreGroupVO;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouGroupExploreService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 快手账户加速探索触发记录信息
+ * @author jeecg-boot
+ * @date   2021-03-08
+ * @version V1.0
+ */
+@Service
+public class KuaishouAccountSpeedExploreLogServiceImpl extends ServiceImpl<KuaishouAccountSpeedExploreLogMapper, KuaishouAccountSpeedExploreLog> implements IKuaishouAccountSpeedExploreLogService {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private IKuaishouGroupExploreService kuaishouGroupExploreService;
+    @Resource
+    private KuaishouAccountSpeedExploreLogMapper kuaishouAccountSpeedExploreLogMapper;
+    @Override
+    public Map<String, Object> openSpeedExplore(KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog) throws Exception{
+        Map<String,Object> result = new HashMap<>();
+        //查询当前账户是否加速探索中
+        KuaishouAccountSpeedExploreLog getEntity = this.getByParams(kuaishouAccountSpeedExploreLog.getAccountId(),1);
+        if(null!=getEntity){
+            ResultMapUtils.setResultMap(result, StatusCode.KUAISHOU_API_ACCOUNT_SPEED_EXPLORING);
+            return result;
+        }
+        //创建加速探索记录
+        kuaishouAccountSpeedExploreLog.setStatus(1);
+        this.save(kuaishouAccountSpeedExploreLog);
+        //触发加速探索任务
+        this.startSpeedExplore(kuaishouAccountSpeedExploreLog);
+        return result;
+    }
+
+    private void startSpeedExplore(KuaishouAccountSpeedExploreLog kuaishouAccountSpeedExploreLog) throws Exception{
+        Date endDate = new Date();
+        String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", DateUtils.formatDate(endDate), -1);
+        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
+        Date startDate = sim.parse(anotherDay);
+        CtopOauthToken token = tokenService.getTokenByAccountId(kuaishouAccountSpeedExploreLog.getAccountId());
+        //1: 拉取账户下所有的广告组信息
+        kuaishouInterfaceService.getGroupList(token, startDate, endDate);
+        //2: 查询处于学习期的广告组数据
+// TODO       kuaishouInterfaceService.getAdvertiserGroupReportDaily(token,startDate,endDate);
+        //3:根据转化目标查询相应的符合条件的广告组数据
+        //优化目标 2 行为数 180 激活数 53 表单数 190 付费 191 首日ROI
+        //查询相关符合条件的广告组数据
+        List<SpeedExploreGroupVO> speedExploreGroupVos = this.getSpeedExploreGroupVOSByParams(DateUtils.formatDate(endDate),kuaishouAccountSpeedExploreLog.getAccountId(),kuaishouAccountSpeedExploreLog.getConvertType(),kuaishouAccountSpeedExploreLog.getConvertCount(),kuaishouAccountSpeedExploreLog.getGroupCount());
+        if(null==speedExploreGroupVos||speedExploreGroupVos.isEmpty()){
+            speedExploreGroupVos.forEach(speedExploreGroupVO -> {
+                //触发加速探索逻辑
+                kuaishouGroupExploreService.unitOpenSpeedExplore(speedExploreGroupVO.getAccountId(),speedExploreGroupVO.getUnitId(),kuaishouAccountSpeedExploreLog.getGroupAccount(),kuaishouAccountSpeedExploreLog.getId());
+            });
+        }
+
+
+    }
+
+    private List<SpeedExploreGroupVO> getSpeedExploreGroupVOSByParams(String date, Long accountId, Integer convertType, Integer convertCount,Integer groupCount) {
+        return kuaishouAccountSpeedExploreLogMapper.getSpeedExploreGroupVosByParams(date,accountId,convertType,convertCount,groupCount);
+    }
+
+    @Override
+    public KuaishouAccountSpeedExploreLog getByParams(Long accountId, Integer status) {
+        QueryWrapper<KuaishouAccountSpeedExploreLog> queryWrapper = new QueryWrapper<>();
+        if(null!=accountId&&accountId!=0){
+            queryWrapper.eq("account_id",accountId);
+        }
+        if(null!=status){
+            queryWrapper.eq("status",accountId);
+        }
+        queryWrapper.orderByDesc("id");
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+}

+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouGroupSpeedExploreLogServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.ai.service.impl;
+
+import cn.com.ctop.kuaishou.modules.ai.entity.KuaishouGroupSpeedExploreLog;
+import cn.com.ctop.kuaishou.modules.ai.mapper.KuaishouGroupSpeedExploreLogMapper;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouGroupSpeedExploreLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 快手组级别加速探索执行记录
+ * @author jeecg-boot
+ * @date   2021-03-10
+ * @version V1.0
+ */
+@Service
+public class KuaishouGroupSpeedExploreLogServiceImpl extends ServiceImpl<KuaishouGroupSpeedExploreLogMapper, KuaishouGroupSpeedExploreLog> implements IKuaishouGroupSpeedExploreLogService {
+
+}

+ 18 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/vo/SpeedExploreGroupVO.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.ai.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class SpeedExploreGroupVO {
+    private Long accountId;
+    private Long unitId;
+    private Long campaignId;
+    private BigDecimal charge;
+    private Long activation;
+    private Long bclick;
+    private Long formCount;
+    private Long eventPay;
+    private BigDecimal account;
+}

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

@@ -16,6 +16,7 @@ import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCampaignMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouTargetingTagsMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaiShouGroupDailyReportService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -875,6 +876,8 @@ public class BatchController {
         return result;
     }
 
+    @Autowired
+    private IEtlKuaiShouGroupDailyReportService shouGroupDailyReportService;
 
     /**
      * 批量修改广告组状态
@@ -913,6 +916,9 @@ public class BatchController {
                                     failJson.put("campaignName", group.getUnitName());
                                 }
                                 failArr.add(failJson);
+                            } else {
+                                //更新数据状态
+                                shouGroupDailyReportService.updateStatus(accountId,unitId,putStatus);
                             }
                         }
                     }

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

@@ -0,0 +1,240 @@
+package cn.com.ctop.kuaishou.modules.batch.controller;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
+import cn.com.ctop.kuaishou.modules.batch.service.*;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaiShouGroupDailyReport;
+import cn.com.ctop.kuaishou.modules.report.entity.ProjectMember;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaiShouGroupDailyReportService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/kuaishou/dingpan")
+public class DingPanController {
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+    @Autowired
+    private IKuaishouInterfaceService interfaceService;
+    @Autowired
+    private IKuaiShouGroupService groupService;
+    @Autowired
+    private IKuaiShouCreativeService creativeService;
+    @Autowired
+    private IBatchService batchService;
+    @Autowired
+    private IKuaiShouUpdateService updateService;
+    @Autowired
+    private IKuaiShouGroupTemplateService groupTemplateService;
+    @Autowired
+    private IEtlKuaiShouGroupDailyReportService etlKuaiShouGroupDailyReportService;
+
+    /**
+     * 获取创意监测链接
+     *
+     * @param accountId
+     * @param unitId
+     * @return
+     */
+    @GetMapping(value = "/getClickTrackUrlByUnitId")
+    public Result<String> getClickTrackUrlByUnitId(Long accountId, Long unitId) {
+        Result<String> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("请输入账户id");
+            }
+            if (Check.isNull(unitId)) {
+                throw new Exception("请输入组id");
+            }
+            CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(token)) {
+                throw new Exception("未获取到账户授权信息");
+            }
+            groupService.getCreativeByUnit(token.getAccessToken(), token.getAccountId(), unitId);
+            String clickTrackUr = creativeService.getClickTrackUrl(accountId, unitId);
+            result.setSuccess(true);
+            result.setResult(clickTrackUr);
+
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+    /**
+     * 修改监测链接
+     *
+     * @param accountId
+     * @param unitId
+     * @param clickTrackUr
+     * @return
+     */
+    @GetMapping(value = "/updateClickTrackUrlByUnitId")
+    public Result<String> updateClickTrackUrlByUnitId(Long accountId, Long unitId, String clickTrackUr) {
+        Result<String> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("请输入账户id");
+            }
+            if (Check.isNull(unitId)) {
+                throw new Exception("请输入组id");
+            }
+            if (Check.isNull(clickTrackUr)) {
+                throw new Exception("请输入监测链接");
+            }
+            CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(token)) {
+                throw new Exception("未获取到账户授权信息");
+            }
+            List<KuaiShouCreative> creatives = creativeService.getCreativeListByAccountIdAndUnitId(accountId, unitId);
+            if (Check.isNull(creatives)) {
+                throw new Exception("此组下暂无创意");
+            }
+            for (KuaiShouCreative creative : creatives) {
+                JSONObject json = new JSONObject();
+                json.put("creativeId", creative.getCreativeId());
+                if (creative.getCreativeMaterialType() == 1) {
+                    json.put("clickTrackUrl", clickTrackUr);
+                } else if (creative.getCreativeMaterialType() == 4) {
+                    json.put("impressionUrl", clickTrackUr);
+                    json.put("clickTrackUrl", clickTrackUr);
+                }
+                batchService.updateCreative(json, token);
+            }
+            result.setSuccess(true);
+            result.setResult("修改成功");
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+    @GetMapping(value = "/updateTemplate")
+    public Result<String> updateTemplate(Long accountId, Long unitId, Long templateId) {
+        Result<String> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("请输入账户id");
+            }
+            if (Check.isNull(unitId)) {
+                throw new Exception("请输入组id");
+            }
+            if (Check.isNull(templateId)) {
+                throw new Exception("请输入模板Id");
+            }
+            CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(token)) {
+                throw new Exception("未获取到账户授权信息");
+            }
+            groupService.getGroupByUnitId(token.getAccessToken(), token.getAccountId(), unitId);
+            KuaiShouGroup kuaiShouGroup = groupService.selectGroupByUnitId(accountId, unitId);
+            if (Check.isNull(kuaiShouGroup)) {
+                throw new Exception("组信息为空");
+            }
+            Integer sceneId = JSONArray.parseArray(kuaiShouGroup.getSceneId()).getInteger(0);
+            JSONObject unitJson = new JSONObject();
+            unitJson.put("advertiser_id", accountId);
+            unitJson.put("unit_id", unitId);
+            if (sceneId != 5) {
+                unitJson.put("template_id", templateId);
+            } else {
+                JSONObject unionJson = groupTemplateService.getUnionJson(templateId);
+                if (Check.isNullMap(unionJson)) {
+                    throw new Exception("根据定向模板未获取到相关信息");
+                }
+                unitJson.put("target", unionJson);
+            }
+            JSONObject jsonObject = updateService.updateUnit(token.getAccessToken(), unitJson);
+            Integer code = jsonObject.getInteger("code");
+            if (code == 0) {
+                result.setSuccess(true);
+                result.setMessage("修改成功");
+            } else {
+                result.setSuccess(false);
+                result.setMessage(jsonObject.getString("message"));
+            }
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+    /**
+     * 修改出价
+     *
+     * @param accountId
+     * @param unitId
+     * @param bid
+     * @param bidType
+     * @return
+     */
+    @GetMapping(value = "/updateBid")
+    public Result<String> updateBid(Long accountId, Long unitId, Long bid, Integer bidType) {
+        Result<String> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("请输入账户id");
+            }
+            if (Check.isNull(unitId)) {
+                throw new Exception("请输入组id");
+            }
+            if (Check.isNull(bidType)) {
+                throw new Exception("请输入出价类型");
+            }
+            if (Check.isNull(bid)) {
+                throw new Exception("请输入出价");
+            }
+            CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(token)) {
+                throw new Exception("未获取到账户授权信息");
+            }
+
+            JSONObject unitJson = new JSONObject();
+            unitJson.put("advertiser_id", accountId);
+            unitJson.put("unit_id", unitId);
+            if (bidType == 2) {
+                unitJson.put("bid", bid);
+            } else if (bidType == 10) {
+                unitJson.put("cpa_bid", bid);
+            }
+            JSONObject jsonObject = updateService.updateUnit(token.getAccessToken(), unitJson);
+            Integer code = jsonObject.getInteger("code");
+            if (code == 0) {
+                QueryWrapper<EtlKuaiShouGroupDailyReport> wrapper = new QueryWrapper<>();
+                wrapper.eq("account_id", accountId);
+                wrapper.eq("unit_id", unitId);
+                EtlKuaiShouGroupDailyReport etl = new EtlKuaiShouGroupDailyReport();
+                etl.setBid(bid);
+                etlKuaiShouGroupDailyReportService.update(etl, wrapper);
+                result.setSuccess(true);
+                result.setMessage("修改成功");
+            } else {
+                result.setSuccess(false);
+                result.setMessage(jsonObject.getString("message"));
+            }
+        } catch (Exception e) {
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+        return result;
+    }
+
+
+}

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

@@ -1,6 +1,5 @@
 package cn.com.ctop.kuaishou.modules.batch.controller;
 
-import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.common.module.vo.KuaishouReportAccountDailyDTOEntity;
@@ -27,8 +26,6 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
 
 /**
  * @author yumeng
@@ -46,39 +43,6 @@ public class KuaiShouController {
     @Autowired
     private IKuaishouReportDailyAccountService accountService;
 
-    @RequestMapping("report")
-    public Map<String, Object> getReport(String accountId, String startDate, String endDate, Integer type, String temporalGranularity) {
-        Map<String, Object> result = new HashMap<>();
-        CtopOauthToken token = tokenService.getOauthTokenByAccountId(accountId);
-        if (null != type) {
-            if (type == 1) {
-                //广告主
-
-            } else if (type == 2) {
-                //广告组
-                if (null != temporalGranularity && "hourly".equals(temporalGranularity)) {
-                    result.put("data", kuaishouInterfaceService.getGroupHourlyReport(token.getAccessToken(), token.getAccountId(), startDate, endDate, 500, 1));
-                } else {
-                    result.put("data", kuaishouInterfaceService.getGroupDailyReport(token.getAccessToken(), token.getAccountId(), startDate, endDate, 500, 1));
-                }
-            } else if (type == 3) {
-                //广告计划
-                if (null != temporalGranularity && "hourly".equals(temporalGranularity)) {
-                    result.put("data", kuaishouInterfaceService.getCampaignHourlyReport(token.getAccessToken(), token.getAccountId(), startDate, endDate, 500, 1));
-                } else {
-                    result.put("data", kuaishouInterfaceService.getCampaignDailyReport(token.getAccessToken(), token.getAccountId(), startDate, endDate, 500, 1));
-                }
-            } else {
-                //广告创意
-                if (null != temporalGranularity && "hourly".equals(temporalGranularity)) {
-                    result.put("data", kuaishouInterfaceService.getCreativeHourlyReport(token.getAccessToken(), token.getAccountId(), startDate, endDate, 500, 1));
-                } else {
-                    result.put("data", kuaishouInterfaceService.getCreativeDailyReport(token.getAccessToken(), token.getAccountId(), startDate, endDate, 500, 1));
-                }
-            }
-        }
-        return result;
-    }
 
     @RequestMapping("/getKuaishouProjectInfo")
     public Result<PageInfo<ProjectAccountDTO>> getKuaishouProjectInfo(@RequestBody KuaishouInfoDTO dto) {

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

@@ -3,14 +3,10 @@ package cn.com.ctop.kuaishou.modules.batch.entity;
 import com.baomidou.mybatisplus.annotation.TableField;
 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;
 
@@ -31,19 +27,14 @@ public class KuaiShouGroup {
      * id
      */
     @TableId
-    @ApiModelProperty(value = "id")
     private String id;
     /**
      * 账户ID
      */
-    @Excel(name = "账户ID", width = 15)
-    @ApiModelProperty(value = "账户ID")
     private Long accountId;
     /**
      * 广告活动ID
      */
-    @Excel(name = "广告活动ID", width = 15)
-    @ApiModelProperty(value = "广告活动ID")
     private Long campaignId;
 
     @TableField(exist = false)
@@ -51,46 +42,33 @@ public class KuaiShouGroup {
     /**
      * 广告组ID
      */
-    @Excel(name = "广告组ID", width = 15)
-    @ApiModelProperty(value = "广告组ID")
     private Long unitId;
     /**
      * 广告组名称
      */
-    @Excel(name = "广告组名称", width = 15)
-    @ApiModelProperty(value = "广告组名称")
     private String unitName;
     /**
      * 广告组状态
      */
-    @Excel(name = "广告组状态", width = 15)
-    @ApiModelProperty(value = "广告组状态")
     private Integer status;
     private Integer putStatus;
+    private Integer studyStatus;
     private Integer createChannel;
     /**
      * 审核拒绝理由
      */
-    @Excel(name = "审核拒绝理由", width = 15)
-    @ApiModelProperty(value = "审核拒绝理由")
     private String reviewDetail;
     /**
      * 出价类型
      */
-    @Excel(name = "出价类型", width = 15)
-    @ApiModelProperty(value = "出价类型")
     private Integer bidType;
     /**
      * 出价
      */
-    @Excel(name = "出价", width = 15)
-    @ApiModelProperty(value = "出价")
     private Long bid;
     /**
      * OCPC出价
      */
-    @Excel(name = "OCPC出价", width = 15)
-    @ApiModelProperty(value = "OCPC出价")
     private Long cpaBid;
 
     private Integer deepConversionType;
@@ -99,32 +77,22 @@ public class KuaiShouGroup {
     /**
      * OCPX行为类型   1: CPM, 2: CPC,
      */
-    @Excel(name = "OCPX行为类型   1: CPM, 2: CPC,", width = 15)
-    @ApiModelProperty(value = "OCPX行为类型   1: CPM, 2: CPC,")
     private Integer ocpxActionType;
     /**
      * 单日预算
      */
-    @Excel(name = "单日预算", width = 15)
-    @ApiModelProperty(value = "单日预算")
     private Long dayBudget;
     /**
      * 投放方式  0:未知, 1:正常投
      */
-    @Excel(name = "投放方式  0:未知, 1:正常投", width = 15)
-    @ApiModelProperty(value = "投放方式  0:未知, 1:正常投")
     private Integer speed;
     /**
      * 投放开始时间
      */
-    @Excel(name = "投放开始时间", width = 15)
-    @ApiModelProperty(value = "投放开始时间")
     private String beginTime;
     /**
      * 投放结束时间
      */
-    @Excel(name = "投放结束时间", width = 15)
-    @ApiModelProperty(value = "投放结束时间")
     private String endTime;
     private String scheduleTime;
     private String sceneId;
@@ -132,38 +100,31 @@ public class KuaiShouGroup {
     /**
      * 创意展现方式  0:未知, 1:轮播,
      */
-    @Excel(name = "创意展现方式  0:未知, 1:轮播,", width = 15)
-    @ApiModelProperty(value = "创意展现方式  0:未知, 1:轮播,")
     private Integer showMode;
     private Integer unitType;
     /**
      * url类型
      */
-    @Excel(name = "url类型 ", width = 15)
-    @ApiModelProperty(value = "url类型 ")
     private Integer urlType;
     /**
      * 落地页链接
      */
-    @Excel(name = "落地页链接", width = 15)
-    @ApiModelProperty(value = "落地页链接")
     private Object url;
     /**
      * APP ID
      */
-    @Excel(name = "APP ID", width = 15)
-    @ApiModelProperty(value = "APP ID")
     private Long appId;
     /**
      * APP图标存储地址
      */
-    @Excel(name = "APP图标存储地址", width = 15)
-    @ApiModelProperty(value = "APP图标存储地址")
     private String appIconUrl;
 
 
-    private Long convertId; // 转化目标
-    private Integer useAppMarket; // 转化目标
+
+    // 转化目标
+    private Long convertId;
+    // 转化目标
+    private Integer useAppMarket;
     private String groupCreateTime;
     private String groupUpdateTime;
 
@@ -174,18 +135,10 @@ public class KuaiShouGroup {
     /**
      * 创建时间
      */
-    @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;
 
     @TableField(exist = false)

+ 4 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouCampaignMapper.java

@@ -1,7 +1,6 @@
 package cn.com.ctop.kuaishou.modules.batch.mapper;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
-import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -17,7 +16,9 @@ public interface KuaiShouCampaignMapper extends BaseMapper<KuaiShouCampaign> {
 
     void replaceBatch(@Param(value = "campaigns") List<KuaiShouCampaign> campaigns);
 
-    List<Long> queryIdsByPutStatus(Long accountId,String putStatus);
+    List<Long> queryIdsByPutStatus(Long accountId, String putStatus);
 
-    JSONArray queryCampaignIdByAccountId(Long accountId);
+    List<Long> queryCampaignIdByAccountId(Long accountId);
+
+    Integer getNewDataByAccountIdAndDate(@Param("accountId") Long accountId, @Param("statDate") String statDate);
 }

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

@@ -28,4 +28,10 @@ public interface KuaiShouCreativeMapper extends BaseMapper<KuaiShouCreative> {
     List<KuaiShouCreative> queryCreativeInfoByCampaignId(@Param("accountId") Long accountId, @Param("campaignId") Long campaignId);
 
     List<Long> getCreativeIds(@Param("accountId") Long accountId);
+
+    Integer getNewDataByAccountIdAndDate(Long accountId, String statDate);
+
+    Integer getRejectedCountsforAccountId(Long accountId);
+
+    String getClickTrackUrl(@Param("accountId") Long accountId, @Param("unitId") Long unitId);
 }

+ 5 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouGroupMapper.java

@@ -1,9 +1,9 @@
 package cn.com.ctop.kuaishou.modules.batch.mapper;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
-import org.jeecg.common.api.vo.Result;
 
 import java.math.BigDecimal;
 import java.util.List;
@@ -33,4 +33,8 @@ public interface KuaiShouGroupMapper extends BaseMapper<KuaiShouGroup> {
     Integer queryToDayBuiltCount(@Param("accountId") Long accountId, @Param("date") String date);
 
     void deleteByAccountId(@Param("accountId") Long accountId);
+
+    Integer getNewDataByAccountIdAndDate(Long accountId, String statDate);
+
+    List<JSONObject> getUnitListByMapAndAccountId(@Param("unitIds") Map<Long, Long> unitMap, @Param("accountId") Long accountId);
 }

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

@@ -32,4 +32,12 @@ public interface KuaiShouVideoGetMapper extends BaseMapper<KuaiShouVideoGet> {
     void etlVideoBaseInfoByStaDate(@Param("statDate") String statDate);
 
     List<JSONObject> getVideoInfoByPhotoIds(@Param("photoIdList") List<Long> photoIdList);
+
+    Integer getTotalCountByAccount(@Param("accountId") Long accountId);
+
+    Integer getTotalCountByAccountAndStatDate(@Param("accountId") Long accountId, @Param("statDate") String statDate);
+
+    Integer getEffectiveCountByAccountId(Long accountId);
+
+    Integer getHotMoneyCountByAccountId(Long accountId);
 }

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

@@ -47,4 +47,11 @@
         ctop_kuaishou_campaign
         WHERE account_id = #{accountId}
     </select>
+    <select id="getNewDataByAccountIdAndDate" resultType="java.lang.Integer">
+     select
+     count(1)
+     from ctop_kuaishou_campaign
+     where account_id = #{accountId}
+     and DATE_FORMAT(put_create_time,'%Y-%m-%d') = #{statDate}
+    </select>
 </mapper>

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

@@ -147,5 +147,27 @@
      where  account_id = #{accountId}
      and  status = 42
     </select>
+    <select id="getNewDataByAccountIdAndDate" resultType="java.lang.Integer">
+     select
+     count(1)
+     from ctop_kuaishou_creative
+     where account_id = #{accountId}
+     and DATE_FORMAT(creative_create_time,'%Y-%m-%d') = #{statDate}
+    </select>
+
+    <select id="getRejectedCountsforAccountId" resultType="java.lang.Integer">
+     select  count(1)
+     from ctop_kuaishou_creative
+     where  account_id = #{accountId}
+     and  status = 42
+    </select>
+    <select id="getClickTrackUrl" resultType="java.lang.String">
+        select  click_track_url  from ctop_kuaishou_creative
+        where  account_id = #{accountId}
+        and unit_id = #{unitId}
+        order by creative_create_time desc
+        limit 1
+
+    </select>
 
 </mapper>

+ 33 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml

@@ -36,7 +36,8 @@
         group_create_time,
         group_update_time,
         create_time,
-        update_time)
+        update_time,
+        study_status)
         values
         <foreach collection="groups" item="getGroup" separator=",">
             (
@@ -73,7 +74,8 @@
             #{getGroup.groupCreateTime},
             #{getGroup.groupUpdateTime},
             #{getGroup.createTime},
-            #{getGroup.updateTime})
+            #{getGroup.updateTime},
+            #{getGroup.studyStatus})
         </foreach>
     </insert>
 
@@ -113,7 +115,7 @@
 
     <select id="queryUnitInfoByAccountId" resultType="cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup">
         SELECT
-        account_id,campaign_id,unit_id,unit_id
+        account_id,campaign_id,unit_id
         FROM ctop_kuaishou_group
         WHERE account_id = #{accountId}
     </select>
@@ -137,9 +139,37 @@
           AND create_channel =1
           AND LOCATE(#{date}, group_create_time)
     </select>
+    <select id="getNewDataByAccountIdAndDate" resultType="java.lang.Integer">
+     select
+     count(1)
+     from ctop_kuaishou_group
+     where account_id = #{accountId}
+     and DATE_FORMAT(group_create_time,'%Y-%m-%d') = #{statDate}
+    </select>
+
     <delete id="deleteByAccountId">
         delete from ctop_kuaishou_group
         where  account_id = #{accountId}
     </delete>
 
+    <select id="getUnitListByMapAndAccountId" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        unit_id as unitId,
+        put_status as unitStatus,
+        bid_type as bidType,
+        (case when bid_type = 2
+        then bid
+        when bid_type = 10
+        then cpa_bid
+        else 0
+        end
+        ) as bid
+        from ctop_kuaishou_group
+        where account_id = #{accountId}
+        and unit_id in
+        <foreach collection="unitIds" item="unitIds" separator="," open="(" close=")">
+            #{unitIds}
+        </foreach>
+    </select>
+
 </mapper>

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

@@ -166,4 +166,58 @@
         and signature is not null
         group by photo_id
     </select>
+    <select id="getTotalCountByAccount" resultType="java.lang.Integer">
+        select
+        count(distinct signature)
+        from ctop_kuaishou_video_get
+        where  account_id = #{accountId}
+    </select>
+    <select id="getTotalCountByAccountAndStatDate" resultType="java.lang.Integer">
+        SELECT
+    	count(DISTINCT signature)
+        FROM
+	    ctop_kuaishou_video_get
+        WHERE
+	    account_id = #{accountId}
+        AND DATE_FORMAT(stat_date, '%Y-%m-%d') = #{statDate}
+    </select>
+    <select id="getEffectiveCountByAccountId" resultType="java.lang.Integer">
+        SELECT
+        count(1)
+        FROM
+        (
+        SELECT
+        signature
+        FROM
+        ctop_kuaishou_video_get
+        WHERE
+        account_id = #{accountId}
+        GROUP BY
+        signature
+        ) t1
+        LEFT JOIN ctop_kuaishou_video_etl_info t2 ON t1.signature = t2.video_code
+        WHERE
+        t2.effect_date IS NOT NULL
+        AND t2.effect_day_num &lt;= 7
+
+    </select>
+    <select id="getHotMoneyCountByAccountId" resultType="java.lang.Integer">
+        SELECT
+        count(1)
+        FROM
+        (
+        SELECT
+        signature
+        FROM
+        ctop_kuaishou_video_get
+        WHERE
+        account_id = #{accountId}
+        GROUP BY
+        signature
+        ) t1
+        LEFT JOIN ctop_kuaishou_video_etl_info t2 ON t1.signature = t2.video_code
+        WHERE
+        t2.faddish_date is not null
+        and faddish_day_num &lt;=14
+    </select>
 </mapper>

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

@@ -18,7 +18,9 @@ public interface IKuaiShouCampaignService extends IService<KuaiShouCampaign> {
 
     List<JSONArray> getJsonArrByAccount(Long accountId, int idSize);
 
-    JSONArray queryCampaignIdByAccountId(Long accountId);
+    List<Long> queryCampaignIdByAccountId(Long accountId);
 
     KuaiShouCampaign getCampaignByAccountAndCampaign(Long accountId, Long campaignId);
+
+    Integer getNewDataByAccountIdAndDate(Long accountId, String statDate);
 }

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

@@ -64,4 +64,10 @@ public interface IKuaiShouCreativeService extends IService<KuaiShouCreative> {
     String convertMoString(String sMo);
 
     List<KuaiShouCreative> getByParams(Long accountId, String photoId, Integer putStatus);
+
+    Integer getNewDataByAccountIdAndDate(Long accountId, String statDate);
+
+    String getClickTrackUrl(Long accountId, Long unitId);
+
+    List<KuaiShouCreative> getCreativeListByAccountIdAndUnitId(Long accountId, Long unitId);
 }

+ 6 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouGroupService.java

@@ -1,10 +1,11 @@
 package cn.com.ctop.kuaishou.modules.batch.service;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.common.api.vo.Result;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 广告组信息
@@ -41,4 +42,8 @@ public interface IKuaiShouGroupService extends IService<KuaiShouGroup> {
     Integer queryToDayBuiltCount(Long accountId);
 
     void deleteByAccountId(Long accountId);
+
+    Integer getNewDataByAccountIdAndDate(Long accountId, String statDate);
+
+    Map<Long, JSONObject> getBidMapByMap(Long accountId, Map<Long, Long> unitIdMap);
 }

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

@@ -41,4 +41,11 @@ public interface IKuaiShouVideoGetService extends IService<KuaiShouVideoGet> {
 
     List<KuaiShouVideoGet> getVideoInfoGroupBySignature(String date);
 
+    Integer getTotalCountByAccount(Long accountId);
+
+    Integer getTotalCountByAccountAndStatDate(Long accountId, String statDate);
+
+    Integer getEffectiveCountByAccountId(Long accountId);
+
+    Integer getHotMoneyCountByAccountId(Long accountId);
 }

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

@@ -60,7 +60,6 @@ public interface IKuaishouInterfaceService {
      * @param pageNum
      * @return
      */
-    KuaishouResult<KuaishouReportDailyGroup> getGroupDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum);
 
     /**
      * 组时报
@@ -273,7 +272,7 @@ public interface IKuaishouInterfaceService {
      * @param startDate
      * @param endDate
      */
-    void getAdvertiserReportDaily(CtopOauthToken token, Date startDate, Date endDate);
+    void getAdvertiserReportDaily(CtopOauthToken token, Date startDate, Date endDate, String reportDims);
 
     /**
      * 获取计划分天报表
@@ -284,14 +283,6 @@ public interface IKuaishouInterfaceService {
      */
     void getAdvertiserCampaignReportDaily(CtopOauthToken token, Date startDate, Date endDate);
 
-    /**
-     * 获取广告计划分天报表 暂停使用
-     *
-     * @param token
-     * @param startDate
-     * @param endDate
-     */
-    void getAdvertiserGroupReportDaily(CtopOauthToken token, Date startDate, Date endDate);
 
     /**
      * 获取创意分天报表 暂停使用

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

@@ -29,4 +29,6 @@ public interface IKuaishouVideoRelateCreativesService extends IService<KuaishouV
     List<JSONObject> getVideoZeroListByMap(Map<String, Object> requestMap);
 
     List<JSONObject> getHistoryTopVideoList(Map<String, Object> requestMap);
+
+    void videoRelateCreatives(Long accountId);
 }

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

@@ -61,7 +61,7 @@ public class KuaiShouCampaignServiceImpl extends ServiceImpl<KuaiShouCampaignMap
     }
 
     @Override
-    public JSONArray queryCampaignIdByAccountId(Long accountId) {
+    public List<Long> queryCampaignIdByAccountId(Long accountId) {
         return campaignMapper.queryCampaignIdByAccountId(accountId);
     }
 
@@ -76,4 +76,9 @@ public class KuaiShouCampaignServiceImpl extends ServiceImpl<KuaiShouCampaignMap
         return campaign;
     }
 
+    @Override
+    public Integer getNewDataByAccountIdAndDate(Long accountId, String statDate) {
+        return campaignMapper.getNewDataByAccountIdAndDate(accountId, statDate);
+    }
+
 }

+ 25 - 8
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCreativeServiceImpl.java

@@ -14,7 +14,6 @@ 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.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -273,18 +272,36 @@ public class KuaiShouCreativeServiceImpl extends ServiceImpl<KuaiShouCreativeMap
 
     @Override
     public List<KuaiShouCreative> getByParams(Long accountId, String photoId, Integer putStatus) {
-        QueryWrapper<KuaiShouCreative>queryWrapper =new QueryWrapper<>();
-        if(null!=accountId&&accountId!=0){
-            queryWrapper.eq("account_id",accountId);
+        QueryWrapper<KuaiShouCreative> queryWrapper = new QueryWrapper<>();
+        if (null != accountId && accountId != 0) {
+            queryWrapper.eq("account_id", accountId);
         }
-        if(null!=photoId&&!"".equals(photoId.trim())){
-            queryWrapper.eq("photo_id",photoId);
+        if (null != photoId && !"".equals(photoId.trim())) {
+            queryWrapper.eq("photo_id", photoId);
         }
-        if(null!=putStatus&&putStatus!=0){
-            queryWrapper.eq("put_status",putStatus);
+        if (null != putStatus && putStatus != 0) {
+            queryWrapper.eq("put_status", putStatus);
         }
         return this.list(queryWrapper);
     }
 
+    @Override
+    public Integer getNewDataByAccountIdAndDate(Long accountId, String statDate) {
+        return kuaiShouCreativeMapper.getNewDataByAccountIdAndDate(accountId, statDate);
+    }
+
+    @Override
+    public String getClickTrackUrl(Long accountId, Long unitId) {
+        return kuaiShouCreativeMapper.getClickTrackUrl(accountId, unitId);
+    }
+
+    @Override
+    public List<KuaiShouCreative> getCreativeListByAccountIdAndUnitId(Long accountId, Long unitId) {
+        QueryWrapper<KuaiShouCreative> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId);
+        queryWrapper.eq("unit_id", unitId);
+        return this.list(queryWrapper);
+    }
+
 
 }

+ 25 - 11
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java

@@ -4,12 +4,7 @@ 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.KuaiShouAppInfo;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroupTarget;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouSchedule;
+import cn.com.ctop.kuaishou.modules.batch.entity.*;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouAppInfoMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouGroupTargetMapper;
@@ -27,11 +22,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -149,6 +140,29 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
         groupMapper.deleteByAccountId(accountId);
     }
 
+    @Override
+    public Integer getNewDataByAccountIdAndDate(Long accountId, String statDate) {
+        return groupMapper.getNewDataByAccountIdAndDate(accountId, statDate);
+    }
+
+    @Override
+    public Map<Long, JSONObject> getBidMapByMap(Long accountId, Map<Long, Long> unitIdMap) {
+        Map<Long, JSONObject> unitMap = new HashMap<>();
+        if (Check.isNullMap(unitIdMap)) {
+            return unitMap;
+        }
+        List<JSONObject> unitList = groupMapper.getUnitListByMapAndAccountId(unitIdMap, accountId);
+        if (Check.isNull(unitList)) {
+            return unitMap;
+        }
+        for (int i = 0; i < unitList.size(); i++) {
+            JSONObject jsonObject = unitList.get(i);
+            unitMap.put(jsonObject.getLong("unitId"), jsonObject);
+        }
+
+        return unitMap;
+    }
+
 
     @Override
     public void getGroupByUnitId(String accessToken, Long accountId, Long unitId) {

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

@@ -245,4 +245,24 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
         queryWrapper.groupBy("signature");
         return this.list(queryWrapper);
     }
+
+    @Override
+    public Integer getTotalCountByAccount(Long accountId) {
+        return videoGetMapper.getTotalCountByAccount(accountId);
+    }
+
+    @Override
+    public Integer getTotalCountByAccountAndStatDate(Long accountId, String statDate) {
+        return videoGetMapper.getTotalCountByAccountAndStatDate(accountId, statDate);
+    }
+
+    @Override
+    public Integer getEffectiveCountByAccountId(Long accountId) {
+        return videoGetMapper.getEffectiveCountByAccountId(accountId);
+    }
+
+    @Override
+    public Integer getHotMoneyCountByAccountId(Long accountId) {
+        return videoGetMapper.getHotMoneyCountByAccountId(accountId);
+    }
 }

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

@@ -132,7 +132,13 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     @Override
     public void getAdvertiserReportHourly(CtopOauthToken token, Date startDate, Date endDate) {
-        getAdvertiserReportHourlyByPage(token, startDate, endDate, 1);
+        try {
+            Thread.sleep(200L);
+            getAdvertiserReportHourlyByPage(token, startDate, endDate, 1);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
     }
 
 
@@ -145,7 +151,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         param.put("end_date", DateUtils.formatDate(endDate));
         param.put("advertiser_id", token.getAccountId());
         param.put("temporal_granularity", "HOURLY");
-        param.put("page_size", 500);
+        param.put("page_size", 2000);
         param.put("page", page);
         String result = HttpUtils.httpPostRequest(url, param, headers);
         JSONObject resultJson = JSONObject.parseObject(result);
@@ -159,19 +165,20 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         if (null == details || details.size() <= 0) {
             return;
         }
+        List<KuaishouReportHourlyAccount> addList = new ArrayList<>();
         for (int i = 0; i < details.size(); i++) {
             JSONObject 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 kuaishouReportHourlyAccount = JSONObject.toJavaObject(detailJson, KuaishouReportHourlyAccount.class);
+            KuaishouReportHourlyAccount kuaishouReportHourlyAccount = JSONObject.toJavaObject(detailJson, KuaishouReportHourlyAccount.class);
             kuaishouReportHourlyAccount.setAccountId(token.getAccountId());
             kuaishouReportHourlyAccount.setId("" + token.getAccountId() + kuaishouReportHourlyAccount.getStatDate() + kuaishouReportHourlyAccount.getStatHour());
-            kuaishouReportHourlyAccount.setCreateTime(new Date());
-            kuaishouReportHourlyAccount.setUpdateTime(new Date());
-            hourlyAccountService.saveOrUpdate(kuaishouReportHourlyAccount);
+            //  hourlyAccountService.saveOrUpdate(kuaishouReportHourlyAccount);
+            addList.add(kuaishouReportHourlyAccount);
         }
+        hourlyAccountService.replaceBatch(addList);
     }
 
 
@@ -269,14 +276,19 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     }
 
-
     @Override
-    public void getAdvertiserReportDaily(CtopOauthToken token, Date startDate, Date endDate) {
-        getAccountDailyReportByPage(token, startDate, endDate, 1);
+    public void getAdvertiserReportDaily(CtopOauthToken token, Date startDate, Date endDate, String reportDims) {
+        try {
+            Thread.sleep(400L);
+            getAccountDailyReportByPage(token, startDate, endDate, 1, reportDims);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
     }
 
 
-    private void getAccountDailyReportByPage(CtopOauthToken token, Date startDate, Date endDate, int page) {
+    private void getAccountDailyReportByPage(CtopOauthToken token, Date startDate, Date endDate, int page, String reportDims) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ACCOUNT_REPORT;
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
@@ -289,11 +301,15 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         if (!Check.isNull(endDate)) {
             param.put("end_date", DateUtils.formatDate(endDate));
         }
-
+        if (!Check.isNull(reportDims)) {
+            JSONArray array = new JSONArray();
+            array.add(reportDims);
+            param.put("report_dims", array);
+        }
 
         param.put("advertiser_id", token.getAccountId());
         param.put("temporal_granularity", "DAILY");
-        param.put("page_size", 500);
+        param.put("page_size", 2000);
         param.put("page", page);
         String result = HttpUtils.httpPostRequest(url, param, headers);
         JSONObject resultJson = JSONObject.parseObject(result);
@@ -308,7 +324,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             log.info("快手广告主报表信息为空=》accountId:{}", token.getAccountId());
             return;
         }
-
+        List<KuaishouReportDailyAccount> addList = new ArrayList<>();
         for (int i = 0; i < details.size(); i++) {
             JSONObject detailJson = details.getJSONObject(i);
             if (!Check.isNull(detailJson)) {
@@ -316,15 +332,19 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                 detailJson.put("photo_comment", detailJson.getString("comment"));
                 detailJson.put("photo_like", detailJson.getString("like"));
                 detailJson.put("photo_show", detailJson.getString("show"));
-                var KuaishouReportDailyAccount = JSONObject.toJavaObject(detailJson, KuaishouReportDailyAccount.class);
+                KuaishouReportDailyAccount KuaishouReportDailyAccount = JSONObject.toJavaObject(detailJson, KuaishouReportDailyAccount.class);
                 KuaishouReportDailyAccount.setAccountId(token.getAccountId());
-                dailyAccountMapper.insertSelective(KuaishouReportDailyAccount);
+                addList.add(KuaishouReportDailyAccount);
             }
         }
-        getAccountDailyReportByPage(token, startDate, endDate, page + 1);
+        if (Check.isNull(reportDims)) {
+            dailyAccountMapper.replaceBatch(addList);
+        } else {
+            dailyAccountMapper.replaceBatchAdScene(addList);
+        }
+        getAccountDailyReportByPage(token, startDate, endDate, page + 1, reportDims);
     }
 
-
     @Override
     public void getAdvertiserCampaignReportDaily(CtopOauthToken token, Date startDate, Date endDate) {
         getCampaignDailyReportByPage(token, startDate, endDate, 1);
@@ -456,7 +476,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             campaigns.add(hourlyCampaign);
         }
         hourlyCampaignService.replaceBatch(campaigns);
-        getAdvertiserReportHourlyByPage(token, startDate, endDate, page + 1);
+        getCampaignReportHourlyByPage(token, startDate, endDate, page + 1);
     }
 
 
@@ -494,91 +514,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
 
     @Override
-    public void getAdvertiserGroupReportDaily(CtopOauthToken token, Date startDate, Date endDate) {
-        getAdvertiserGroupReportDailyByPage(token, startDate, endDate, 1);
-    }
-
-    private void getAdvertiserGroupReportDailyByPage(CtopOauthToken token, Date startDate, Date endDate, int page) {
-        log.info("获取广告组日报,accountId:{},开始时间:{},结束时间:{}", token.getAccountId(), DateUtils.formatDate(startDate), DateUtils.formatDate(endDate));
-        String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GTOUP_REPORT;
-        Map<String, String> headers = new HashMap<>();
-        headers.put("Content-Type", "application/json");
-        headers.put("Access-Token", token.getAccessToken());
-        Map<String, Object> param = new HashMap<>();
-        if (!Check.isNull(startDate)) {
-            param.put("start_date", DateUtils.formatDate(startDate));
-        }
-
-        if (!Check.isNull(endDate)) {
-            param.put("end_date", DateUtils.formatDate(endDate));
-        }
-
-        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);
-
-            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"));
-
-            var dailyGroup = JSONObject.toJavaObject(detailJson, KuaishouReportDailyGroup.class);
-            dailyGroup.setAccountId(token.getAccountId());
-            dailyGroupMapper.insertSelective(dailyGroup);
-        }
-        getAdvertiserGroupReportDailyByPage(token, startDate, endDate, page + 1);
-    }
-
-    @Override
-    public KuaishouResult<KuaishouReportDailyGroup> getGroupDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
-        String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GTOUP_REPORT;
-        Map<String, String> headers = new HashMap<>();
-        headers.put("Content-Type", "application/json");
-        headers.put("Access-Token", accessToken);
-        Map<String, Object> param = new HashMap<>();
-        param.put("start_date", startDate);
-        param.put("end_date", endDate);
-        param.put("advertiser_id", advertiserId);
-        param.put("temporal_granularity", "DAILY");
-        param.put("page_size", pageSize);
-        param.put("page", pageNum);
-        KuaishouResult<KuaishouReportDailyGroup> kuaishouResult = null;
-        try {
-            String result = HttpUtils.httpPostRequest(url, param, headers);
-            ObjectMapper mapper = new ObjectMapper();
-            mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-            kuaishouResult = mapper.readValue(result, new TypeReference<KuaishouResult<KuaishouReportDailyGroup>>() {
-            });
-            List<KuaishouReportDailyGroup> dailyGroups = kuaishouResult.getData().getDetails();
-            dailyGroups.forEach((dailyGroup) -> {
-                dailyGroup.setAccountId(advertiserId);
-                //  dailyGroup.setId("" + dailyGroup.getAccountId() + dailyGroup.getUnitId() + dailyGroup.getStatDate());
-                dailyGroupMapper.insertSelective(dailyGroup);
-            });
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return kuaishouResult;
-    }
-
-    @Override
     public void getAdvertiserGroupReportHourly(CtopOauthToken token, Date startDate, Date endDate) {
         getGroupHourlyReportByPage(token, startDate, endDate, 1);
     }
@@ -903,7 +838,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             Date getStartDate = DateUtils.addDay(endDate, -i);
             //1: 获取广告主信息数据
             getAdvertiserReportHourly(token, getStartDate, getStartDate);
-            getAdvertiserReportDaily(token, getStartDate, getStartDate);
+            getAdvertiserReportDaily(token, getStartDate, getStartDate, "adScene");
             //2:获取广告计划信息数据
             // getAdvertiserCampaignReportHourly(token, getStartDate, getStartDate);
             //3:获取广告组信息数据
@@ -1121,6 +1056,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
 
+    @Override
     public JSONArray getCampaignList(CtopOauthToken token, Date startDate, Date endDate, int timeFilterType) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_LIST;
         Map<String, String> headers = new HashMap<>();
@@ -1219,6 +1155,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         kuaiShouCampaignService.replaceBatch(campaigns);
     }
 
+    @Override
     public JSONArray getGroupList(CtopOauthToken token, Long campaignId, Date startDate,
                                   Date endDate, int time_filter_type) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GROUP_LIST;
@@ -1371,10 +1308,12 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     group.setUnitName(unit_name);
                     group.setStatus(status);
                     group.setPutStatus(put_status);
+                    group.setStudyStatus(detail.getInteger("study_status"));
                     group.setCreateChannel(detail.getInteger("create_channel"));
                     group.setReviewDetail(detail.getString("review_detail"));
                     group.setBidType(bid_type);
                     group.setBid(bid);
+                    group.setStudyStatus(detail.getInteger("study_status"));
                     group.setCpaBid(cpa_bid);
                     group.setOcpxActionType(ocpx_action_type);
                     group.setDeepConversionType(detail.getInteger("deep_conversion_type"));
@@ -1415,6 +1354,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
 
+    @Override
     public JSONArray getCreativeList(CtopOauthToken token, Long unitId, Date startDate, Date endDate, int timeFilterType) {
         Long advertiserId = token.getAccountId();
         String accessToken = token.getAccessToken();
@@ -2615,7 +2555,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     }
 
                 } else {
-                    log.error("获取账户余额失败");
+                    log.error("获取账户余额失败" + resultJson.getString("message"));
                 }
             } else {
                 log.error("获取账户余额返回为空");

+ 30 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouVideoRelateCreativesServiceImpl.java

@@ -9,6 +9,7 @@ import cn.com.ctop.common.module.utils.PropertiesUtils;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouVideoRelateCreatives;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouVideoRelateCreativesMapper;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouVideoRelateCreativesService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -21,11 +22,9 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.*;
 
 /**
  * 频库-视频关联创意数查询
@@ -175,4 +174,33 @@ public class KuaishouVideoRelateCreativesServiceImpl extends ServiceImpl<Kuaisho
     public List<JSONObject> getHistoryTopVideoList(Map<String, Object> requestMap) {
         return kuaishouVideoRelateCreativesMapper.getHistoryTopVideoList(requestMap);
     }
+
+    @Autowired
+    private IKuaiShouVideoGetService videoGetService;
+
+    @Override
+    public void videoRelateCreatives(Long accountId) {
+        List<KuaiShouVideoGet> KuaiShouVideoGets = videoGetService.selectPhotoIdsByAccountId(accountId);
+        if (!Check.isNull(KuaiShouVideoGets)) {
+            JSONArray dateList = new JSONArray();
+            JSONArray photoIds = new JSONArray();
+            Map<String, KuaiShouVideoGet> statdateMap = new HashMap<>();
+            int count = 0;
+            for (KuaiShouVideoGet video : KuaiShouVideoGets) {
+                count++;
+                if (count < 20) {
+                    photoIds.add(video.getPhotoId());
+                    statdateMap.put(video.getPhotoId(), video);
+                } else {
+                    photoIds.add(video.getPhotoId());
+                    statdateMap.put(video.getPhotoId(),video);
+                    dateList.add(photoIds);
+                    photoIds = new JSONArray();
+                    count = 0;
+                }
+            }
+            dateList.add(photoIds);
+            this.videoRelateCreatives(accountId, dateList, statdateMap);
+        }
+    }
 }

+ 259 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaiShouAccountMaterialOverviewController.java

@@ -0,0 +1,259 @@
+package cn.com.ctop.kuaishou.modules.report.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaiShouAccountMaterialOverview;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaiShouAccountMaterialOverviewService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+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.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 2021-03-10
+ */
+@Slf4j
+@Api(tags = "清洗数据账户素材概览数据")
+@RestController
+@RequestMapping("/material/etlKuaiShouAccountMaterialOverview")
+public class EtlKuaiShouAccountMaterialOverviewController {
+    @Autowired
+    private IEtlKuaiShouAccountMaterialOverviewService etlKuaiShouAccountMaterialOverviewService;
+
+
+    @GetMapping(value = "/getMaterialOverview")
+    public Result<JSONObject> queryPageList(Long accountId, String statDate) {
+        Result<JSONObject> result = new Result<>();
+        JSONObject returnJson = etlKuaiShouAccountMaterialOverviewService.getMaterialOverview(accountId, statDate);
+        result.setSuccess(true);
+        result.setResult(returnJson);
+        return result;
+    }
+
+    /**
+     * 分页列表查询
+     *
+     * @param etlKuaiShouAccountMaterialOverview
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "清洗数据账户素材概览数据-分页列表查询")
+    @ApiOperation(value = "清洗数据账户素材概览数据-分页列表查询", notes = "清洗数据账户素材概览数据-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<EtlKuaiShouAccountMaterialOverview>> queryPageList(EtlKuaiShouAccountMaterialOverview etlKuaiShouAccountMaterialOverview,
+                                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                           HttpServletRequest req) {
+        Result<IPage<EtlKuaiShouAccountMaterialOverview>> result = new Result<>();
+        QueryWrapper<EtlKuaiShouAccountMaterialOverview> queryWrapper = QueryGenerator.initQueryWrapper(etlKuaiShouAccountMaterialOverview, req.getParameterMap());
+        Page<EtlKuaiShouAccountMaterialOverview> page = new Page<EtlKuaiShouAccountMaterialOverview>(pageNo, pageSize);
+        IPage<EtlKuaiShouAccountMaterialOverview> pageList = etlKuaiShouAccountMaterialOverviewService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param etlKuaiShouAccountMaterialOverview
+     * @return
+     */
+    @AutoLog(value = "清洗数据账户素材概览数据-添加")
+    @ApiOperation(value = "清洗数据账户素材概览数据-添加", notes = "清洗数据账户素材概览数据-添加")
+    @PostMapping(value = "/add")
+    public Result<EtlKuaiShouAccountMaterialOverview> add(@RequestBody EtlKuaiShouAccountMaterialOverview etlKuaiShouAccountMaterialOverview) {
+        Result<EtlKuaiShouAccountMaterialOverview> result = new Result<>();
+        try {
+            etlKuaiShouAccountMaterialOverviewService.save(etlKuaiShouAccountMaterialOverview);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param etlKuaiShouAccountMaterialOverview
+     * @return
+     */
+    @AutoLog(value = "清洗数据账户素材概览数据-编辑")
+    @ApiOperation(value = "清洗数据账户素材概览数据-编辑", notes = "清洗数据账户素材概览数据-编辑")
+    @PutMapping(value = "/edit")
+    public Result<EtlKuaiShouAccountMaterialOverview> edit(@RequestBody EtlKuaiShouAccountMaterialOverview etlKuaiShouAccountMaterialOverview) {
+        Result<EtlKuaiShouAccountMaterialOverview> result = new Result<EtlKuaiShouAccountMaterialOverview>();
+        EtlKuaiShouAccountMaterialOverview etlKuaiShouAccountMaterialOverviewEntity = etlKuaiShouAccountMaterialOverviewService.getById(etlKuaiShouAccountMaterialOverview.getId());
+        if (etlKuaiShouAccountMaterialOverviewEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = etlKuaiShouAccountMaterialOverviewService.updateById(etlKuaiShouAccountMaterialOverview);
+            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 {
+            etlKuaiShouAccountMaterialOverviewService.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<EtlKuaiShouAccountMaterialOverview> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<EtlKuaiShouAccountMaterialOverview> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.etlKuaiShouAccountMaterialOverviewService.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<EtlKuaiShouAccountMaterialOverview> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<EtlKuaiShouAccountMaterialOverview> result = new Result<>();
+        EtlKuaiShouAccountMaterialOverview etlKuaiShouAccountMaterialOverview = etlKuaiShouAccountMaterialOverviewService.getById(id);
+        if (etlKuaiShouAccountMaterialOverview == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(etlKuaiShouAccountMaterialOverview);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<EtlKuaiShouAccountMaterialOverview> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                EtlKuaiShouAccountMaterialOverview etlKuaiShouAccountMaterialOverview = JSON.parseObject(deString, EtlKuaiShouAccountMaterialOverview.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(etlKuaiShouAccountMaterialOverview, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<EtlKuaiShouAccountMaterialOverview> pageList = etlKuaiShouAccountMaterialOverviewService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "清洗数据账户素材概览数据列表");
+        mv.addObject(NormalExcelConstants.CLASS, EtlKuaiShouAccountMaterialOverview.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<EtlKuaiShouAccountMaterialOverview> listEtlKuaiShouAccountMaterialOverviews = ExcelImportUtil.importExcel(file.getInputStream(), EtlKuaiShouAccountMaterialOverview.class, params);
+                etlKuaiShouAccountMaterialOverviewService.saveBatch(listEtlKuaiShouAccountMaterialOverviews);
+                return Result.ok("文件导入成功!数据行数:" + listEtlKuaiShouAccountMaterialOverviews.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("文件导入失败!");
+    }
+
+}

+ 266 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaiShouGroupDailyReportController.java

@@ -0,0 +1,266 @@
+package cn.com.ctop.kuaishou.modules.report.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaiShouGroupDailyReport;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaiShouGroupDailyReportService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+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.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.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+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 2021-03-09
+ */
+@Slf4j
+@Api(tags = "快手组日报数据清洗")
+@RestController
+@RequestMapping("/etl/kuaiShouGroupDailyReport")
+public class EtlKuaiShouGroupDailyReportController {
+    @Autowired
+    private IEtlKuaiShouGroupDailyReportService etlKuaiShouGroupDailyReportService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param etlKuaiShouGroupDailyReport
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "快手组日报数据清洗-分页列表查询")
+    @ApiOperation(value = "快手组日报数据清洗-分页列表查询", notes = "快手组日报数据清洗-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<EtlKuaiShouGroupDailyReport>> queryPageList(EtlKuaiShouGroupDailyReport etlKuaiShouGroupDailyReport,
+                                                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                    HttpServletRequest req) {
+        Result<IPage<EtlKuaiShouGroupDailyReport>> result = new Result<>();
+        QueryWrapper<EtlKuaiShouGroupDailyReport> queryWrapper = QueryGenerator.initQueryWrapper(etlKuaiShouGroupDailyReport, req.getParameterMap());
+        Page<EtlKuaiShouGroupDailyReport> page = new Page<EtlKuaiShouGroupDailyReport>(pageNo, pageSize);
+        IPage<EtlKuaiShouGroupDailyReport> pageList = etlKuaiShouGroupDailyReportService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+    @PostMapping(value = "/queryPageList")
+    public Result<Object> queryPageList(@RequestBody JSONObject request) {
+        try {
+            return etlKuaiShouGroupDailyReportService.queryPageList(request);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+    /**
+     * 添加
+     *
+     * @param etlKuaiShouGroupDailyReport
+     * @return
+     */
+    @AutoLog(value = "快手组日报数据清洗-添加")
+    @ApiOperation(value = "快手组日报数据清洗-添加", notes = "快手组日报数据清洗-添加")
+    @PostMapping(value = "/add")
+    public Result<EtlKuaiShouGroupDailyReport> add(@RequestBody EtlKuaiShouGroupDailyReport etlKuaiShouGroupDailyReport) {
+        Result<EtlKuaiShouGroupDailyReport> result = new Result<>();
+        try {
+            etlKuaiShouGroupDailyReportService.save(etlKuaiShouGroupDailyReport);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param etlKuaiShouGroupDailyReport
+     * @return
+     */
+    @AutoLog(value = "快手组日报数据清洗-编辑")
+    @ApiOperation(value = "快手组日报数据清洗-编辑", notes = "快手组日报数据清洗-编辑")
+    @PutMapping(value = "/edit")
+    public Result<EtlKuaiShouGroupDailyReport> edit(@RequestBody EtlKuaiShouGroupDailyReport etlKuaiShouGroupDailyReport) {
+        Result<EtlKuaiShouGroupDailyReport> result = new Result<EtlKuaiShouGroupDailyReport>();
+        EtlKuaiShouGroupDailyReport etlKuaiShouGroupDailyReportEntity = etlKuaiShouGroupDailyReportService.getById(etlKuaiShouGroupDailyReport.getId());
+        if (etlKuaiShouGroupDailyReportEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = etlKuaiShouGroupDailyReportService.updateById(etlKuaiShouGroupDailyReport);
+            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 {
+            etlKuaiShouGroupDailyReportService.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<EtlKuaiShouGroupDailyReport> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<EtlKuaiShouGroupDailyReport> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.etlKuaiShouGroupDailyReportService.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<EtlKuaiShouGroupDailyReport> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<EtlKuaiShouGroupDailyReport> result = new Result<>();
+        EtlKuaiShouGroupDailyReport etlKuaiShouGroupDailyReport = etlKuaiShouGroupDailyReportService.getById(id);
+        if (etlKuaiShouGroupDailyReport == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(etlKuaiShouGroupDailyReport);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<EtlKuaiShouGroupDailyReport> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                EtlKuaiShouGroupDailyReport etlKuaiShouGroupDailyReport = JSON.parseObject(deString, EtlKuaiShouGroupDailyReport.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(etlKuaiShouGroupDailyReport, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<EtlKuaiShouGroupDailyReport> pageList = etlKuaiShouGroupDailyReportService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "快手组日报数据清洗列表");
+        mv.addObject(NormalExcelConstants.CLASS, EtlKuaiShouGroupDailyReport.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<EtlKuaiShouGroupDailyReport> listEtlKuaiShouGroupDailyReports = ExcelImportUtil.importExcel(file.getInputStream(), EtlKuaiShouGroupDailyReport.class, params);
+                etlKuaiShouGroupDailyReportService.saveBatch(listEtlKuaiShouGroupDailyReports);
+                return Result.ok("文件导入成功!数据行数:" + listEtlKuaiShouGroupDailyReports.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("文件导入失败!");
+    }
+
+}

+ 270 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaiShouNewlyController.java

@@ -0,0 +1,270 @@
+package cn.com.ctop.kuaishou.modules.report.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaiShouNewly;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaiShouNewlyService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+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.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 2021-03-08
+ */
+@Slf4j
+@Api(tags = "快手 新上计划数据汇总")
+@RestController
+@RequestMapping("/etl/kuaiShouNewly")
+public class EtlKuaiShouNewlyController {
+    @Autowired
+    private IEtlKuaiShouNewlyService etlKuaiShouNewlyService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param etlKuaiShouNewly
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "快手 新上计划数据汇总-分页列表查询")
+    @ApiOperation(value = "快手 新上计划数据汇总-分页列表查询", notes = "快手 新上计划数据汇总-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<EtlKuaiShouNewly>> queryPageList(EtlKuaiShouNewly etlKuaiShouNewly,
+                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                         HttpServletRequest req) {
+        Result<IPage<EtlKuaiShouNewly>> result = new Result<>();
+        QueryWrapper<EtlKuaiShouNewly> queryWrapper = QueryGenerator.initQueryWrapper(etlKuaiShouNewly, req.getParameterMap());
+        Page<EtlKuaiShouNewly> page = new Page<EtlKuaiShouNewly>(pageNo, pageSize);
+        IPage<EtlKuaiShouNewly> pageList = etlKuaiShouNewlyService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 各维度近七日上线数量
+     * @author ZHAOXA
+     * @param
+     * @return
+     * @throws
+     */
+    @AutoLog(value = "各维度近七日上线数量")
+    @ApiOperation(value = "各维度近七日上线数量", notes = "各维度近七日上线数量")
+    @GetMapping(value = "/getNewlyCounts")
+    public Result<Object> getNewlyCounts(Long accountId) {
+        try {
+            return etlKuaiShouNewlyService.getNewlyCounts(accountId);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 添加
+     *
+     * @param etlKuaiShouNewly
+     * @return
+     */
+    @AutoLog(value = "快手 新上计划数据汇总-添加")
+    @ApiOperation(value = "快手 新上计划数据汇总-添加", notes = "快手 新上计划数据汇总-添加")
+    @PostMapping(value = "/add")
+    public Result<EtlKuaiShouNewly> add(@RequestBody EtlKuaiShouNewly etlKuaiShouNewly) {
+        Result<EtlKuaiShouNewly> result = new Result<>();
+        try {
+            etlKuaiShouNewlyService.save(etlKuaiShouNewly);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param etlKuaiShouNewly
+     * @return
+     */
+    @AutoLog(value = "快手 新上计划数据汇总-编辑")
+    @ApiOperation(value = "快手 新上计划数据汇总-编辑", notes = "快手 新上计划数据汇总-编辑")
+    @PutMapping(value = "/edit")
+    public Result<EtlKuaiShouNewly> edit(@RequestBody EtlKuaiShouNewly etlKuaiShouNewly) {
+        Result<EtlKuaiShouNewly> result = new Result<EtlKuaiShouNewly>();
+        EtlKuaiShouNewly etlKuaiShouNewlyEntity = etlKuaiShouNewlyService.getById(etlKuaiShouNewly.getId());
+        if (etlKuaiShouNewlyEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = etlKuaiShouNewlyService.updateById(etlKuaiShouNewly);
+            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 {
+            etlKuaiShouNewlyService.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<EtlKuaiShouNewly> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<EtlKuaiShouNewly> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.etlKuaiShouNewlyService.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<EtlKuaiShouNewly> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<EtlKuaiShouNewly> result = new Result<>();
+        EtlKuaiShouNewly etlKuaiShouNewly = etlKuaiShouNewlyService.getById(id);
+        if (etlKuaiShouNewly == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(etlKuaiShouNewly);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<EtlKuaiShouNewly> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                EtlKuaiShouNewly etlKuaiShouNewly = JSON.parseObject(deString, EtlKuaiShouNewly.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(etlKuaiShouNewly, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<EtlKuaiShouNewly> pageList = etlKuaiShouNewlyService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "快手 新上计划数据汇总列表");
+        mv.addObject(NormalExcelConstants.CLASS, EtlKuaiShouNewly.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<EtlKuaiShouNewly> listEtlKuaiShouNewlys = ExcelImportUtil.importExcel(file.getInputStream(), EtlKuaiShouNewly.class, params);
+                etlKuaiShouNewlyService.saveBatch(listEtlKuaiShouNewlys);
+                return Result.ok("文件导入成功!数据行数:" + listEtlKuaiShouNewlys.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("文件导入失败!");
+    }
+
+}

+ 334 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaishouAudienceAccountDailyController.java

@@ -0,0 +1,334 @@
+package cn.com.ctop.kuaishou.modules.report.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouAudienceAccountDaily;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouAudienceAccountDailyService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+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.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.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+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 2021-03-09
+ */
+@Slf4j
+@Api(tags = "人群分析报表——年龄、性别数据")
+@RestController
+@RequestMapping("/etl/audienceAccountDaily")
+public class EtlKuaishouAudienceAccountDailyController {
+    @Autowired
+    private IEtlKuaishouAudienceAccountDailyService etlKuaishouAudienceAccountDailyService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param etlKuaishouAudienceAccountDaily
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "人群分析报表——年龄、性别数据-分页列表查询")
+    @ApiOperation(value = "人群分析报表——年龄、性别数据-分页列表查询", notes = "人群分析报表——年龄、性别数据-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<EtlKuaishouAudienceAccountDaily>> queryPageList(EtlKuaishouAudienceAccountDaily etlKuaishouAudienceAccountDaily,
+                                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                        HttpServletRequest req) {
+        Result<IPage<EtlKuaishouAudienceAccountDaily>> result = new Result<>();
+        QueryWrapper<EtlKuaishouAudienceAccountDaily> queryWrapper = QueryGenerator.initQueryWrapper(etlKuaishouAudienceAccountDaily, req.getParameterMap());
+        Page<EtlKuaishouAudienceAccountDaily> page = new Page<EtlKuaishouAudienceAccountDaily>(pageNo, pageSize);
+        IPage<EtlKuaishouAudienceAccountDaily> pageList = etlKuaishouAudienceAccountDailyService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param etlKuaishouAudienceAccountDaily
+     * @return
+     */
+    @AutoLog(value = "人群分析报表——年龄、性别数据-添加")
+    @ApiOperation(value = "人群分析报表——年龄、性别数据-添加", notes = "人群分析报表——年龄、性别数据-添加")
+    @PostMapping(value = "/add")
+    public Result<EtlKuaishouAudienceAccountDaily> add(@RequestBody EtlKuaishouAudienceAccountDaily etlKuaishouAudienceAccountDaily) {
+        Result<EtlKuaishouAudienceAccountDaily> result = new Result<>();
+        try {
+            etlKuaishouAudienceAccountDailyService.save(etlKuaishouAudienceAccountDaily);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    @GetMapping(value = "/createDate")
+    public Result<Object> createDate() {
+        try {
+            etlKuaishouAudienceAccountDailyService.queryEveryDayAudienceInfo();
+            return Result.ok("success");
+        } catch (Exception e) {
+            log.error("error:", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("error");
+    }
+
+
+    /**
+     * 按照年龄查询数据
+     *
+     * @param
+     * @return
+     * @throws
+     * @author ZHAOXA
+     */
+    @AutoLog(value = "按照年龄查询数据")
+    @ApiOperation(value = "按照年龄查询数据", notes = "按照年龄查询数据")
+    @PostMapping(value = "/getAgeInfo")
+    public Result<Object> getAgeInfo(@RequestBody JSONObject request) {
+        try {
+            return etlKuaishouAudienceAccountDailyService.getAgeInfo(request);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 按照性别查询数据
+     *
+     * @param
+     * @return
+     * @throws
+     * @author ZHAOXA
+     */
+    @AutoLog(value = "按照性别查询数据")
+    @ApiOperation(value = "按照性别查询数据", notes = "按照性别查询数据")
+    @PostMapping(value = "/getSexInfo")
+    public Result<Object> getSexInfo(@RequestBody JSONObject request) {
+        try {
+            return etlKuaishouAudienceAccountDailyService.getSexInfo(request);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+
+    /**
+     * 按照板位查询数据
+     *分版位
+     * @param
+     * @return
+     * @throws
+     * @author ZHAOXA
+     */
+    @AutoLog(value = "按照板位查询数据")
+    @ApiOperation(value = "按照板位查询数据", notes = "按照板位查询数据")
+    @PostMapping(value = "/getSceneInfo")
+    public Result<Object> getSceneInfo(@RequestBody JSONObject request) {
+        try {
+            return etlKuaishouAudienceAccountDailyService.getSceneInfo(request);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param etlKuaishouAudienceAccountDaily
+     * @return
+     */
+    @AutoLog(value = "人群分析报表——年龄、性别数据-编辑")
+    @ApiOperation(value = "人群分析报表——年龄、性别数据-编辑", notes = "人群分析报表——年龄、性别数据-编辑")
+    @PutMapping(value = "/edit")
+    public Result<EtlKuaishouAudienceAccountDaily> edit(@RequestBody EtlKuaishouAudienceAccountDaily etlKuaishouAudienceAccountDaily) {
+        Result<EtlKuaishouAudienceAccountDaily> result = new Result<EtlKuaishouAudienceAccountDaily>();
+        EtlKuaishouAudienceAccountDaily etlKuaishouAudienceAccountDailyEntity = etlKuaishouAudienceAccountDailyService.getById(etlKuaishouAudienceAccountDaily.getId());
+        if (etlKuaishouAudienceAccountDailyEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = etlKuaishouAudienceAccountDailyService.updateById(etlKuaishouAudienceAccountDaily);
+            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 {
+            etlKuaishouAudienceAccountDailyService.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<EtlKuaishouAudienceAccountDaily> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<EtlKuaishouAudienceAccountDaily> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.etlKuaishouAudienceAccountDailyService.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<EtlKuaishouAudienceAccountDaily> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<EtlKuaishouAudienceAccountDaily> result = new Result<>();
+        EtlKuaishouAudienceAccountDaily etlKuaishouAudienceAccountDaily = etlKuaishouAudienceAccountDailyService.getById(id);
+        if (etlKuaishouAudienceAccountDaily == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(etlKuaishouAudienceAccountDaily);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<EtlKuaishouAudienceAccountDaily> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                EtlKuaishouAudienceAccountDaily etlKuaishouAudienceAccountDaily = JSON.parseObject(deString, EtlKuaishouAudienceAccountDaily.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(etlKuaishouAudienceAccountDaily, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<EtlKuaishouAudienceAccountDaily> pageList = etlKuaishouAudienceAccountDailyService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "人群分析报表——年龄、性别数据列表");
+        mv.addObject(NormalExcelConstants.CLASS, EtlKuaishouAudienceAccountDaily.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<EtlKuaishouAudienceAccountDaily> listEtlKuaishouAudienceAccountDailys = ExcelImportUtil.importExcel(file.getInputStream(), EtlKuaishouAudienceAccountDaily.class, params);
+                etlKuaishouAudienceAccountDailyService.saveBatch(listEtlKuaishouAudienceAccountDailys);
+                return Result.ok("文件导入成功!数据行数:" + listEtlKuaishouAudienceAccountDailys.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("文件导入失败!");
+    }
+
+}

+ 266 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaishouReportAccountDailyController.java

@@ -0,0 +1,266 @@
+package cn.com.ctop.kuaishou.modules.report.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+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.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.oConvertUtils;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountDaily;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountDailyService;
+
+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;
+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
+ * @version V1.0
+ * @date 2021-03-04
+ */
+@Slf4j
+@Api(tags = "盯盘日数据")
+@RestController
+@RequestMapping("/etl/reportAccountDaily")
+public class EtlKuaishouReportAccountDailyController {
+    @Autowired
+    private IEtlKuaishouReportAccountDailyService etlKuaishouReportAccountDailyService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param etlKuaishouReportAccountDaily
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "盯盘日数据-分页列表查询")
+    @ApiOperation(value = "盯盘日数据-分页列表查询", notes = "盯盘日数据-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<EtlKuaishouReportAccountDaily>> queryPageList(EtlKuaishouReportAccountDaily etlKuaishouReportAccountDaily,
+                                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                      HttpServletRequest req) {
+        Result<IPage<EtlKuaishouReportAccountDaily>> result = new Result<>();
+        QueryWrapper<EtlKuaishouReportAccountDaily> queryWrapper = QueryGenerator.initQueryWrapper(etlKuaishouReportAccountDaily, req.getParameterMap());
+        Page<EtlKuaishouReportAccountDaily> page = new Page<EtlKuaishouReportAccountDaily>(pageNo, pageSize);
+        IPage<EtlKuaishouReportAccountDaily> pageList = etlKuaishouReportAccountDailyService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
+    @GetMapping(value = "/createDate")
+    public Result<Object> createDate() {
+        try {
+            etlKuaishouReportAccountDailyService.queryEveryDayDataForAccount();
+            return Result.ok("success");
+        } catch (Exception e) {
+            log.error("error:", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("error");
+    }
+
+    /**
+     * 添加
+     *
+     * @param etlKuaishouReportAccountDaily
+     * @return
+     */
+    @AutoLog(value = "盯盘日数据-添加")
+    @ApiOperation(value = "盯盘日数据-添加", notes = "盯盘日数据-添加")
+    @PostMapping(value = "/add")
+    public Result<EtlKuaishouReportAccountDaily> add(@RequestBody EtlKuaishouReportAccountDaily etlKuaishouReportAccountDaily) {
+        Result<EtlKuaishouReportAccountDaily> result = new Result<>();
+        try {
+            etlKuaishouReportAccountDailyService.save(etlKuaishouReportAccountDaily);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param etlKuaishouReportAccountDaily
+     * @return
+     */
+    @AutoLog(value = "盯盘日数据-编辑")
+    @ApiOperation(value = "盯盘日数据-编辑", notes = "盯盘日数据-编辑")
+    @PutMapping(value = "/edit")
+    public Result<EtlKuaishouReportAccountDaily> edit(@RequestBody EtlKuaishouReportAccountDaily etlKuaishouReportAccountDaily) {
+        Result<EtlKuaishouReportAccountDaily> result = new Result<EtlKuaishouReportAccountDaily>();
+        EtlKuaishouReportAccountDaily etlKuaishouReportAccountDailyEntity = etlKuaishouReportAccountDailyService.getById(etlKuaishouReportAccountDaily.getId());
+        if (etlKuaishouReportAccountDailyEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = etlKuaishouReportAccountDailyService.updateById(etlKuaishouReportAccountDaily);
+            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 {
+            etlKuaishouReportAccountDailyService.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<EtlKuaishouReportAccountDaily> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<EtlKuaishouReportAccountDaily> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.etlKuaishouReportAccountDailyService.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<EtlKuaishouReportAccountDaily> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<EtlKuaishouReportAccountDaily> result = new Result<>();
+        EtlKuaishouReportAccountDaily etlKuaishouReportAccountDaily = etlKuaishouReportAccountDailyService.getById(id);
+        if (etlKuaishouReportAccountDaily == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(etlKuaishouReportAccountDaily);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<EtlKuaishouReportAccountDaily> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                EtlKuaishouReportAccountDaily etlKuaishouReportAccountDaily = JSON.parseObject(deString, EtlKuaishouReportAccountDaily.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(etlKuaishouReportAccountDaily, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<EtlKuaishouReportAccountDaily> pageList = etlKuaishouReportAccountDailyService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "盯盘日数据列表");
+        mv.addObject(NormalExcelConstants.CLASS, EtlKuaishouReportAccountDaily.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<EtlKuaishouReportAccountDaily> listEtlKuaishouReportAccountDailys = ExcelImportUtil.importExcel(file.getInputStream(), EtlKuaishouReportAccountDaily.class, params);
+                etlKuaishouReportAccountDailyService.saveBatch(listEtlKuaishouReportAccountDailys);
+                return Result.ok("文件导入成功!数据行数:" + listEtlKuaishouReportAccountDailys.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("文件导入失败!");
+    }
+
+}

+ 354 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaishouReportAccountHourlyController.java

@@ -0,0 +1,354 @@
+package cn.com.ctop.kuaishou.modules.report.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.QueryGenerator;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportAccountHourlyService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+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.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.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+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 2021-03-04
+ */
+@Slf4j
+@Api(tags = "账户维度-每小时盯盘数据")
+@RestController
+@RequestMapping("/etl/reportAccountHourly")
+public class EtlKuaishouReportAccountHourlyController {
+    @Autowired
+    private IEtlKuaishouReportAccountHourlyService etlKuaishouReportAccountHourlyService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param etlKuaishouReportAccountHourly
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "账户维度-每小时盯盘数据-分页列表查询")
+    @ApiOperation(value = "账户维度-每小时盯盘数据-分页列表查询", notes = "账户维度-每小时盯盘数据-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<EtlKuaishouReportAccountHourly>> queryPageList(EtlKuaishouReportAccountHourly etlKuaishouReportAccountHourly,
+                                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                       HttpServletRequest req) {
+        Result<IPage<EtlKuaishouReportAccountHourly>> result = new Result<>();
+        QueryWrapper<EtlKuaishouReportAccountHourly> queryWrapper = QueryGenerator.initQueryWrapper(etlKuaishouReportAccountHourly, req.getParameterMap());
+        Page<EtlKuaishouReportAccountHourly> page = new Page<EtlKuaishouReportAccountHourly>(pageNo, pageSize);
+        IPage<EtlKuaishouReportAccountHourly> pageList = etlKuaishouReportAccountHourlyService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    @GetMapping(value = "/createDate")
+    public Result<Object> createDate() {
+        try {
+            etlKuaishouReportAccountHourlyService.queryEveryhourlyDataForAccount();
+            return Result.ok("success");
+        } catch (Exception e) {
+            log.error("error:", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("error");
+    }
+
+
+    /**
+     * 获取当日花费最大的账户
+     *
+     * @param
+     * @return
+     * @throws
+     * @author ZHAOXA
+     */
+    @AutoLog(value = "获取当日花费最大的账户")
+    @ApiOperation(value = "获取当日花费最大的账户", notes = "获取当日花费最大的账户")
+    @GetMapping(value = "/getMaxChargeAccountIdByUser")
+    public Result<Object> getMaxChargeAccountIdByUser(String userId) {
+        try {
+            return etlKuaishouReportAccountHourlyService.getMaxChargeAccountIdByUser(userId);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 获取当日花费最大的账户
+     *
+     * @param
+     * @return
+     * @throws
+     * @author ZHAOXA
+     */
+    @AutoLog(value = "获取当日花费最大的账户")
+    @ApiOperation(value = "获取当日花费最大的账户", notes = "获取当日花费最大的账户")
+    @GetMapping(value = "/getMaxChargeAccountId")
+    public Result<Object> getMaxChargeAccountId(Long accountId) {
+        try {
+            return etlKuaishouReportAccountHourlyService.getMaxChargeAccountId(accountId);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 获取时间趋势汇总投放数据
+     *
+     * @param
+     * @return
+     * @throws
+     * @author ZHAOXA
+     */
+    @AutoLog(value = "获取时间趋势汇总投放数据")
+    @ApiOperation(value = "获取时间趋势汇总投放数据", notes = "获取时间趋势汇总投放数据")
+    @PostMapping(value = "/getAggregateByHour")
+    public Result<Object> getAggregateByHour(@RequestBody JSONObject request) {
+        try {
+            return etlKuaishouReportAccountHourlyService.getAggregateByHour(request);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 获取时间趋势数据集
+     *
+     * @param
+     * @return
+     * @throws
+     * @author ZHAOXA
+     */
+    @AutoLog(value = "获取时间趋势数据集")
+    @ApiOperation(value = "获取时间趋势数据集", notes = "获取时间趋势数据集")
+    @PostMapping(value = "/getEtlReportList")
+    public Result<Object> getEtlReportList(@RequestBody JSONObject request) {
+        try {
+            return etlKuaishouReportAccountHourlyService.getEtlReportList(request);
+        } catch (Exception e) {
+            log.error("查询异常,", e.getMessage());
+            e.printStackTrace();
+        }
+        return Result.error("查询失败");
+    }
+
+    /**
+     * 添加
+     *
+     * @param etlKuaishouReportAccountHourly
+     * @return
+     */
+    @AutoLog(value = "账户维度-每小时盯盘数据-添加")
+    @ApiOperation(value = "账户维度-每小时盯盘数据-添加", notes = "账户维度-每小时盯盘数据-添加")
+    @PostMapping(value = "/add")
+    public Result<EtlKuaishouReportAccountHourly> add(@RequestBody EtlKuaishouReportAccountHourly etlKuaishouReportAccountHourly) {
+        Result<EtlKuaishouReportAccountHourly> result = new Result<>();
+        try {
+            etlKuaishouReportAccountHourlyService.save(etlKuaishouReportAccountHourly);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param etlKuaishouReportAccountHourly
+     * @return
+     */
+    @AutoLog(value = "账户维度-每小时盯盘数据-编辑")
+    @ApiOperation(value = "账户维度-每小时盯盘数据-编辑", notes = "账户维度-每小时盯盘数据-编辑")
+    @PutMapping(value = "/edit")
+    public Result<EtlKuaishouReportAccountHourly> edit(@RequestBody EtlKuaishouReportAccountHourly etlKuaishouReportAccountHourly) {
+        Result<EtlKuaishouReportAccountHourly> result = new Result<EtlKuaishouReportAccountHourly>();
+        EtlKuaishouReportAccountHourly etlKuaishouReportAccountHourlyEntity = etlKuaishouReportAccountHourlyService.getById(etlKuaishouReportAccountHourly.getId());
+        if (etlKuaishouReportAccountHourlyEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = etlKuaishouReportAccountHourlyService.updateById(etlKuaishouReportAccountHourly);
+            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 {
+            etlKuaishouReportAccountHourlyService.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<EtlKuaishouReportAccountHourly> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<EtlKuaishouReportAccountHourly> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.etlKuaishouReportAccountHourlyService.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<EtlKuaishouReportAccountHourly> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<EtlKuaishouReportAccountHourly> result = new Result<>();
+        EtlKuaishouReportAccountHourly etlKuaishouReportAccountHourly = etlKuaishouReportAccountHourlyService.getById(id);
+        if (etlKuaishouReportAccountHourly == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(etlKuaishouReportAccountHourly);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<EtlKuaishouReportAccountHourly> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                EtlKuaishouReportAccountHourly etlKuaishouReportAccountHourly = JSON.parseObject(deString, EtlKuaishouReportAccountHourly.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(etlKuaishouReportAccountHourly, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<EtlKuaishouReportAccountHourly> pageList = etlKuaishouReportAccountHourlyService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "账户维度-每小时盯盘数据列表");
+        mv.addObject(NormalExcelConstants.CLASS, EtlKuaishouReportAccountHourly.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<EtlKuaishouReportAccountHourly> listEtlKuaishouReportAccountHourlys = ExcelImportUtil.importExcel(file.getInputStream(), EtlKuaishouReportAccountHourly.class, params);
+                etlKuaishouReportAccountHourlyService.saveBatch(listEtlKuaishouReportAccountHourlys);
+                return Result.ok("文件导入成功!数据行数:" + listEtlKuaishouReportAccountHourlys.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("文件导入失败!");
+    }
+
+}

+ 4 - 108
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaishouGroupExploreController.java

@@ -1,38 +1,20 @@
 package cn.com.ctop.kuaishou.modules.report.controller;
 
-import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.utils.QueryGenerator;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouGroupExplore;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouGroupExploreService;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 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.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;
 
 /**
  * 广告组的加速探索报表
@@ -58,8 +40,6 @@ public class KuaishouGroupExploreController {
      * @param req
      * @return
      */
-    @AutoLog(value = "广告组的加速探索报表-分页列表查询")
-    @ApiOperation(value = "广告组的加速探索报表-分页列表查询", notes = "广告组的加速探索报表-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<KuaishouGroupExplore>> queryPageList(KuaishouGroupExplore kuaishouGroupExplore,
                                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -77,11 +57,9 @@ public class KuaishouGroupExploreController {
     /**
      * 查询加速探索信息接口
      *
-     * @param kuaishouGroupExplore
+     * @param data
      * @return
      */
-    @AutoLog(value = "查询加速探索信息接口")
-    @ApiOperation(value = "查询加速探索信息接口", notes = "查询加速探索信息接口")
     @PostMapping(value = "/unitExploreInfoGet")
     public Result<Object> unitExploreInfoGet(@RequestBody JSONObject data) {
         try {
@@ -95,11 +73,9 @@ public class KuaishouGroupExploreController {
     /**
      * 广告组的加速探索预算设置接口
      *
-     * @param kuaishouGroupExplore
+     * @param data
      * @return
      */
-    @AutoLog(value = "广告组的加速探索预算设置接口")
-    @ApiOperation(value = "广告组的加速探索预算设置接口", notes = "广告组的加速探索预算设置接口")
     @PostMapping(value = "/unitExploreBudgetUpdate")
     public Result<Object> unitExploreBudgetUpdate(@RequestBody JSONObject data) {
         try {
@@ -113,11 +89,9 @@ public class KuaishouGroupExploreController {
     /**
      * 暂停广告组的加速探索预算接口
      *
-     * @param kuaishouGroupExplore
+     * @param data
      * @return
      */
-    @AutoLog(value = "暂停广告组的加速探索预算接口")
-    @ApiOperation(value = "暂停广告组的加速探索预算接口", notes = "暂停广告组的加速探索预算接口")
     @PostMapping(value = "/unitExploreStatusPause")
     public Result<Object> unitExploreStatusPause(@RequestBody JSONObject data) {
         try {
@@ -131,11 +105,9 @@ public class KuaishouGroupExploreController {
     /**
      * 查询广告组的加速探索报表接口
      *
-     * @param kuaishouGroupExplore
+     * @param data
      * @return
      */
-    @AutoLog(value = "查询广告组的加速探索报表接口")
-    @ApiOperation(value = "查询广告组的加速探索报表接口", notes = "查询广告组的加速探索报表接口")
     @PostMapping(value = "/querySpeedExploreReport")
     public Result<Object> querySpeedExploreReport(@RequestBody JSONObject data) {
         try {
@@ -153,8 +125,6 @@ public class KuaishouGroupExploreController {
      * @param kuaishouGroupExplore
      * @return
      */
-    @AutoLog(value = "广告组的加速探索报表-添加")
-    @ApiOperation(value = "广告组的加速探索报表-添加", notes = "广告组的加速探索报表-添加")
     @PostMapping(value = "/add")
     public Result<KuaishouGroupExplore> add(@RequestBody KuaishouGroupExplore kuaishouGroupExplore) {
         Result<KuaishouGroupExplore> result = new Result<>();
@@ -174,8 +144,6 @@ public class KuaishouGroupExploreController {
      * @param kuaishouGroupExplore
      * @return
      */
-    @AutoLog(value = "广告组的加速探索报表-编辑")
-    @ApiOperation(value = "广告组的加速探索报表-编辑", notes = "广告组的加速探索报表-编辑")
     @PutMapping(value = "/edit")
     public Result<KuaishouGroupExplore> edit(@RequestBody KuaishouGroupExplore kuaishouGroupExplore) {
         Result<KuaishouGroupExplore> result = new Result<KuaishouGroupExplore>();
@@ -198,8 +166,6 @@ public class KuaishouGroupExploreController {
      * @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 {
@@ -217,8 +183,6 @@ public class KuaishouGroupExploreController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "广告组的加速探索报表-批量删除")
-    @ApiOperation(value = "广告组的加速探索报表-批量删除", notes = "广告组的加速探索报表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<KuaishouGroupExplore> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         Result<KuaishouGroupExplore> result = new Result<>();
@@ -237,8 +201,6 @@ public class KuaishouGroupExploreController {
      * @param id
      * @return
      */
-    @AutoLog(value = "广告组的加速探索报表-通过id查询")
-    @ApiOperation(value = "广告组的加速探索报表-通过id查询", notes = "广告组的加速探索报表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<KuaishouGroupExplore> queryById(@RequestParam(name = "id", required = true) String id) {
         Result<KuaishouGroupExplore> result = new Result<>();
@@ -252,71 +214,5 @@ public class KuaishouGroupExploreController {
         return result;
     }
 
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<KuaishouGroupExplore> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                KuaishouGroupExplore kuaishouGroupExplore = JSON.parseObject(deString, KuaishouGroupExplore.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(kuaishouGroupExplore, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<KuaishouGroupExplore> pageList = kuaishouGroupExploreService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "广告组的加速探索报表列表");
-        mv.addObject(NormalExcelConstants.CLASS, KuaishouGroupExplore.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<KuaishouGroupExplore> listKuaishouGroupExplores = ExcelImportUtil.importExcel(file.getInputStream(), KuaishouGroupExplore.class, params);
-                kuaishouGroupExploreService.saveBatch(listKuaishouGroupExplores);
-                return Result.ok("文件导入成功!数据行数:" + listKuaishouGroupExplores.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("文件导入失败!");
-    }
 
 }

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

@@ -0,0 +1,91 @@
+package cn.com.ctop.kuaishou.modules.report.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 2021-03-10
+ */
+@Data
+@TableName("ctop_etl_kuaishou_account_material_overview")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_etl_kuaishou_account_material_overview对象", description = "清洗数据账户素材概览数据")
+public class EtlKuaiShouAccountMaterialOverview {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 新上素材数
+     */
+    @Excel(name = "新上素材数", width = 15)
+    @ApiModelProperty(value = "新上素材数")
+    private Integer newlyCount;
+    /**
+     * 新上素材素材使用数
+     */
+    @Excel(name = "新上素材素材使用数", width = 15)
+    @ApiModelProperty(value = "新上素材素材使用数")
+    private Integer newlyUseCount;
+    /**
+     * 总素材数
+     */
+    @Excel(name = "总素材数", width = 15)
+    @ApiModelProperty(value = "总素材数")
+    private Integer totalCount;
+    /**
+     * 有效素材数
+     */
+    @Excel(name = "有效素材数", width = 15)
+    @ApiModelProperty(value = "有效素材数")
+    private Integer effectiveCount;
+    /**
+     * 爆款素材数
+     */
+    @Excel(name = "爆款素材数", width = 15)
+    @ApiModelProperty(value = "爆款素材数")
+    private Integer hotMoneyCount;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "日期")
+    private Date stateDate;
+    /**
+     * createTime
+     */
+    @ApiModelProperty(value = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+}

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

@@ -0,0 +1,181 @@
+package cn.com.ctop.kuaishou.modules.report.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 2021-03-09
+ */
+@Data
+@TableName("ctop_etl_kuaishou_group_daily_report")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_etl_kuaishou_group_daily_report对象", description = "快手组日报数据清洗")
+public class EtlKuaiShouGroupDailyReport {
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键ID")
+    private Long id;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 计划ID
+     */
+    @Excel(name = "计划ID", width = 15)
+    @ApiModelProperty(value = "计划ID")
+    private Long campaignId;
+    /**
+     * 计划名称
+     */
+    @Excel(name = "计划名称", width = 15)
+    @ApiModelProperty(value = "计划名称")
+    private String campaignName;
+    /**
+     * 组id
+     */
+    @Excel(name = "组id", width = 15)
+    @ApiModelProperty(value = "组id")
+    private Long unitId;
+    /**
+     * 组名称
+     */
+    @Excel(name = "组名称", width = 15)
+    @ApiModelProperty(value = "组名称")
+    private String unitName;
+    /**
+     * 花费(元)
+     */
+    @Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+    private java.math.BigDecimal charge;
+    /**
+     * 出价
+     */
+    @Excel(name = "出价", width = 15)
+    @ApiModelProperty(value = "出价")
+    private Long bid;
+    private Integer bidType;
+    private Integer unitStatus;
+    /**
+     * 曝光数
+     */
+    @Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+    private Long photoShow;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    @Excel(name = "应用下载数据-安卓下载开始数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载开始数")
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    @Excel(name = "应用下载数据-安卓下载完成数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载完成数")
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    @Excel(name = "应用下载数据-激活数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-激活数")
+    private Long activation;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    @Excel(name = "应用下载数据-首日付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费次数")
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-付费次数
+     */
+    @Excel(name = "应用下载数据-付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费次数")
+    private Long eventPay;
+    /**
+     * 应用下载数据-注册数
+     */
+    @Excel(name = "应用下载数据-注册数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册数")
+    private Long eventRegister;
+    /**
+     * 应用下载数据-完件数
+     */
+    @Excel(name = "应用下载数据-完件数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-完件数")
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    @Excel(name = "应用下载数据-付款成功数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功数")
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    @Excel(name = "应用下载数据-次留数(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留数(仅支持分日查询)")
+    private Long eventNextDayStay;
+    /**
+     * 3s播放数
+     */
+    @Excel(name = "3s播放数", width = 15)
+    @ApiModelProperty(value = "3s播放数")
+    private Long play3sCount;
+    /**
+     * 时间
+     */
+    @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;
+}

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

@@ -0,0 +1,108 @@
+package cn.com.ctop.kuaishou.modules.report.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 2021-03-08
+ */
+@Data
+@TableName("ctop_etl_kuaishou_newly")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_etl_kuaishou_newly对象", description = "快手 新上计划数据汇总")
+public class EtlKuaiShouNewly {
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键ID")
+    private Long id;
+    /**
+     * 项目id
+     */
+    @Excel(name = "项目id", width = 15)
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称", width = 15)
+    @ApiModelProperty(value = "项目名称")
+    private String projectName;
+    /**
+     * 账户id
+     */
+    @Excel(name = "账户id", width = 15)
+    @ApiModelProperty(value = "账户id")
+    private Long accountId;
+    /**
+     * 账户授权名称
+     */
+    @Excel(name = "账户授权名称", width = 15)
+    @ApiModelProperty(value = "账户授权名称")
+    private String oauthName;
+    /**
+     * 绑定人id
+     */
+    @Excel(name = "绑定人id", width = 15)
+    @ApiModelProperty(value = "绑定人id")
+    private String userId;
+    /**
+     * 绑定人名称
+     */
+    @Excel(name = "绑定人名称", width = 15)
+    @ApiModelProperty(value = "绑定人名称")
+    private String userName;
+    /**
+     * 新上数量
+     */
+    @Excel(name = "新上数量", width = 15)
+    @ApiModelProperty(value = "新上数量")
+    private Integer newCount;
+    /**
+     * campaign:计划  unit:组 creative:创意
+     */
+    @Excel(name = "campaign:计划  unit:组 creative:创意", width = 15)
+    @ApiModelProperty(value = "campaign:计划  unit:组 creative:创意")
+    private String newType;
+    /**
+     * 时间
+     */
+    @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;
+}

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

@@ -0,0 +1,139 @@
+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 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
+ * @version V1.0
+ * @date 2021-03-09
+ */
+@Data
+@TableName("ctop_etl_kuaishou_audience_account_daily")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_etl_kuaishou_audience_account_daily对象", description = "人群分析报表——年龄、性别数据")
+public class EtlKuaishouAudienceAccountDaily {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.INPUT)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * province: 省级地域分布,city: 地级地域分布,gender: 性别分布,ageSegment: 年龄分布,clientId: 系统分布,businessInterestTags: 商业兴趣分布
+     */
+    @Excel(name = "province: 省级地域分布,city: 地级地域分布,gender: 性别分布,ageSegment: 年龄分布,clientId: 系统分布,businessInterestTags: 商业兴趣分布", width = 15)
+    @ApiModelProperty(value = "province: 省级地域分布,city: 地级地域分布,gender: 性别分布,ageSegment: 年龄分布,clientId: 系统分布,businessInterestTags: 商业兴趣分布")
+    private String audienceType;
+    /**
+     * 花费
+     */
+    @Excel(name = "花费", width = 15)
+    @ApiModelProperty(value = "花费")
+    private Double charge;
+    /**
+     * 应用下载数据-激活数
+     */
+    @Excel(name = "应用下载数据-激活数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-激活数")
+    private Long activation;
+    /**
+     * 应用下载数据-付费次数
+     */
+    @Excel(name = "应用下载数据-付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费次数")
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    @Excel(name = "应用下载数据-付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费金额")
+    private java.math.BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    @Excel(name = "应用下载数据-次留数(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留数(仅支持分日查询)")
+    private Long eventNextDayStay;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 封面点击数
+     */
+    @Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+    private Long photoClick;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long photoShow;
+    /**
+     * 性别
+     */
+    @Excel(name = "性别", width = 15)
+    @ApiModelProperty(value = "性别")
+    private String gender;
+    /**
+     * 年龄
+     */
+    @Excel(name = "年龄", width = 15)
+    @ApiModelProperty(value = "年龄")
+    private String ageSegment;
+    /**
+     * 创建时间
+     */
+    @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;
+}

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

@@ -0,0 +1,253 @@
+package cn.com.ctop.kuaishou.modules.report.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 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.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 账户维度-每日盯盘数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2021-03-04
+ */
+@Data
+@TableName("ctop_etl_kuaishou_report_account_daily")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_etl_kuaishou_report_account_daily对象", description = "账户维度-每日盯盘数据")
+public class EtlKuaishouReportAccountDaily {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.INPUT)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 花费(元)
+     */
+    @Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long photoShow;
+    /**
+     * 封面点击数
+     */
+    @Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 分享数
+     */
+    @Excel(name = "分享数", width = 15)
+    @ApiModelProperty(value = "分享数")
+    private Long photoShare;
+    /**
+     * 评论数
+     */
+    @Excel(name = "评论数", width = 15)
+    @ApiModelProperty(value = "评论数")
+    private Long photoComment;
+    /**
+     * 点赞数
+     */
+    @Excel(name = "点赞数", width = 15)
+    @ApiModelProperty(value = "点赞数")
+    private Long photoLike;
+    /**
+     * 新增关注数
+     */
+    @Excel(name = "新增关注数", width = 15)
+    @ApiModelProperty(value = "新增关注数")
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    @Excel(name = "取消关注数", width = 15)
+    @ApiModelProperty(value = "取消关注数")
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    @Excel(name = "举报数", width = 15)
+    @ApiModelProperty(value = "举报数")
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    @Excel(name = "拉黑数", width = 15)
+    @ApiModelProperty(value = "拉黑数")
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    @Excel(name = "减少此类作品数", width = 15)
+    @ApiModelProperty(value = "减少此类作品数")
+    private Long negative;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    @Excel(name = "应用下载数据-安卓下载开始数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载开始数")
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    @Excel(name = "应用下载数据-安卓下载完成数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载完成数")
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    @Excel(name = "应用下载数据-激活数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-激活数")
+    private Long activation;
+    /**
+     * 提交按钮点击数
+     */
+    @Excel(name = "提交按钮点击数", width = 15)
+    @ApiModelProperty(value = "提交按钮点击数")
+    private Long submit;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    @Excel(name = "应用下载数据-首日付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费次数")
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    @Excel(name = "应用下载数据-首日付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费金额")
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-付费次数
+     */
+    @Excel(name = "应用下载数据-付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费次数")
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    @Excel(name = "应用下载数据-付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费金额")
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-注册数
+     */
+    @Excel(name = "应用下载数据-注册数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册数")
+    private Long eventRegister;
+    /**
+     * 应用下载数据-完件数
+     */
+    @Excel(name = "应用下载数据-完件数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-完件数")
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-授信数
+     */
+    @Excel(name = "应用下载数据-授信数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信数")
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    @Excel(name = "应用下载数据-付款成功数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功数")
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    @Excel(name = "应用下载数据-付款成功金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功金额")
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    @Excel(name = "落地页数据-落地页完件数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页完件数")
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    @Excel(name = "落地页数据-落地页授信数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信数")
+    private Long eventCreditGrantLandingPage;
+    /**
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    @Excel(name = "应用下载数据-次留数(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留数(仅支持分日查询)")
+    private Long eventNextDayStay;
+    /**
+     * 落地页数据-表单提交数
+     */
+    @Excel(name = "落地页数据-表单提交数", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交数")
+    private Long formCount;
+    /**
+     * 3s播放数
+     */
+    @Excel(name = "3s播放数", width = 15)
+    @ApiModelProperty(value = "3s播放数")
+    private long play3sCount;
+    /**
+     * 创建时间
+     */
+    @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;
+}

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

@@ -0,0 +1,322 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+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 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
+ * @version V1.0
+ * @date 2021-03-04
+ */
+@Data
+@TableName("ctop_etl_kuaishou_report_account_hourly")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_etl_kuaishou_report_account_hourly对象", description = "账户维度-每小时盯盘数据")
+public class EtlKuaishouReportAccountHourly {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.INPUT)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 时间
+     */
+    @Excel(name = "时间", width = 15)
+    @ApiModelProperty(value = "时间")
+    private Long statHour;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 花费(元)
+     */
+    @Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+    private BigDecimal charge;
+    /**
+     * 封面曝光数
+     */
+    @Excel(name = "封面曝光数", width = 15)
+    @ApiModelProperty(value = "封面曝光数")
+    private Long photoShow;
+    /**
+     * 封面点击数
+     */
+    @Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+    private Long photoClick;
+    /**
+     * 素材曝光数
+     */
+    @Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * 分享数
+     */
+    @Excel(name = "分享数", width = 15)
+    @ApiModelProperty(value = "分享数")
+    private Long photoShare;
+    /**
+     * 评论数
+     */
+    @Excel(name = "评论数", width = 15)
+    @ApiModelProperty(value = "评论数")
+    private Long photoComment;
+    /**
+     * 点赞数
+     */
+    @Excel(name = "点赞数", width = 15)
+    @ApiModelProperty(value = "点赞数")
+    private Long photoLike;
+    /**
+     * 新增关注数
+     */
+    @Excel(name = "新增关注数", width = 15)
+    @ApiModelProperty(value = "新增关注数")
+    private Long follow;
+    /**
+     * 取消关注数
+     */
+    @Excel(name = "取消关注数", width = 15)
+    @ApiModelProperty(value = "取消关注数")
+    private Long cancelFollow;
+    /**
+     * 举报数
+     */
+    @Excel(name = "举报数", width = 15)
+    @ApiModelProperty(value = "举报数")
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    @Excel(name = "拉黑数", width = 15)
+    @ApiModelProperty(value = "拉黑数")
+    private Long block;
+    /**
+     * 减少此类作品数
+     */
+    @Excel(name = "减少此类作品数", width = 15)
+    @ApiModelProperty(value = "减少此类作品数")
+    private Long negative;
+    /**
+     * 应用下载数据-安卓下载开始数
+     */
+    @Excel(name = "应用下载数据-安卓下载开始数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载开始数")
+    private Long downloadStarted;
+    /**
+     * 应用下载数据-安卓下载完成数
+     */
+    @Excel(name = "应用下载数据-安卓下载完成数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载完成数")
+    private Long downloadCompleted;
+    /**
+     * 应用下载数据-激活数
+     */
+    @Excel(name = "应用下载数据-激活数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-激活数")
+    private Long activation;
+    /**
+     * 提交按钮点击数
+     */
+    @Excel(name = "提交按钮点击数", width = 15)
+    @ApiModelProperty(value = "提交按钮点击数")
+    private Long submit;
+    /**
+     * 应用下载数据-首日付费次数
+     */
+    @Excel(name = "应用下载数据-首日付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费次数")
+    private Long eventPayFirstDay;
+    /**
+     * 应用下载数据-首日付费金额
+     */
+    @Excel(name = "应用下载数据-首日付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费金额")
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * 应用下载数据-付费次数
+     */
+    @Excel(name = "应用下载数据-付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费次数")
+    private Long eventPay;
+    /**
+     * 应用下载数据-付费金额
+     */
+    @Excel(name = "应用下载数据-付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费金额")
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * 应用下载数据-注册数
+     */
+    @Excel(name = "应用下载数据-注册数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册数")
+    private Long eventRegister;
+    /**
+     * 应用下载数据-完件数
+     */
+    @Excel(name = "应用下载数据-完件数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-完件数")
+    private Long eventJinJianApp;
+    /**
+     * 应用下载数据-授信数
+     */
+    @Excel(name = "应用下载数据-授信数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信数")
+    private Long eventCreditGrantApp;
+    /**
+     * 应用下载数据-付款成功数
+     */
+    @Excel(name = "应用下载数据-付款成功数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功数")
+    private Long eventOrderPaid;
+    /**
+     * 应用下载数据-付款成功金额
+     */
+    @Excel(name = "应用下载数据-付款成功金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功金额")
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * 落地页数据-落地页完件数
+     */
+    @Excel(name = "落地页数据-落地页完件数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页完件数")
+    private Long eventJinJianLandingPage;
+    /**
+     * 落地页数据-落地页授信数
+     */
+    @Excel(name = "落地页数据-落地页授信数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信数")
+    private Long eventCreditGrantLandingPage;
+    /**Save pv the next day
+     * 应用下载数据-次留数(仅支持分日查询)
+     */
+    @Excel(name = "应用下载数据-次留数(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留数(仅支持分日查询)")
+    private Long eventNextDayStay;
+    /**
+     * 落地页数据-表单提交数
+     */
+    @Excel(name = "落地页数据-表单提交数", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交数")
+    private Long formCount;
+    /**
+     * 3s播放数
+     */
+    @Excel(name = "3s播放数", width = 15)
+    @ApiModelProperty(value = "3s播放数")
+    private long play3sCount;
+    /**
+     * 创建时间
+     */
+    @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;
+
+    @TableField(exist = false)
+    private BigDecimal activationCost;//激活单价
+    @TableField(exist = false)
+    private BigDecimal impression1kCost;//平均千次素材曝光花费 = 花费/素材曝光数*1000
+    @TableField(exist = false)
+    private BigDecimal photoClickCost;//平均封面点击单价 = 花费/封面点击数
+    @TableField(exist = false)
+    private BigDecimal actionCost;//平均行为单价 = 总花费/行为数
+    @TableField(exist = false)
+    private BigDecimal play3sRatio;//3S播放率 = 广告视频播放3s数量/封面曝光数
+    @TableField(exist = false)
+    private BigDecimal downloadStartedCost;//安卓下载开始单价(元) =花费/安卓下载开始数
+    @TableField(exist = false)
+    private BigDecimal downloadCompletedCost;//安卓下载完成单价(元) =花费/安卓下载完成数
+    @TableField(exist = false)
+    private BigDecimal formCost;//表单提交单价 =当日消耗/当日回传表单数
+    @TableField(exist = false)
+    private BigDecimal eventPayFirstDayCost;//首日付费次数成本 =消耗/首日付费次数
+    @TableField(exist = false)
+    private BigDecimal eventPayCost;//付费次数成本 =消耗/付费次数
+    @TableField(exist = false)
+    private BigDecimal eventRegisterCost;//注册成本 =当日消耗/当日回传注册数
+    @TableField(exist = false)
+    private BigDecimal eventNextDayStayCost;//次日留存成本 =消耗/次日留存PV
+    @TableField(exist = false)
+    private BigDecimal eventJinJianAppCost;//完件成本 =消耗/完件数
+    @TableField(exist = false)
+    private BigDecimal eventCreditGrantAppCost;//授信成本 =消耗/授信数
+    @TableField(exist = false)
+    private BigDecimal eventJinJianLandingPageCost;//落地页完件成本 =当日消耗/当日回传完件数
+    @TableField(exist = false)
+    private BigDecimal eventCreditGrantLandingPageCost;//落地页授信成本 =当日消耗/当日回传授信数
+    @TableField(exist = false)
+    private BigDecimal submitCost;//按钮点击成本 =当日消耗 / 当日按钮点击数
+    @TableField(exist = false)
+    private BigDecimal eventPayFirstDayRoi;//首日ROI =首日付费金额/当日消耗
+    @TableField(exist = false)
+    private BigDecimal eventPayRoi;//ROI =付费金额/当日消耗
+    @TableField(exist = false)
+    private BigDecimal actionRatio;//行为率 =行为数占素材曝光数百分比
+    @TableField(exist = false)
+    private BigDecimal photoClickRatio;//封面点击率 =封面点击数占封面曝光数百分比
+    @TableField(exist = false)
+    private BigDecimal downloadStartedRatio;//安卓下载开始率 =安卓下载开始数/行为数
+    @TableField(exist = false)
+    private BigDecimal downloadCompletedRatio;//安卓下载完成率 =安卓下载完成数/安卓下载开始数
+    @TableField(exist = false)
+    private BigDecimal activationRatio;//下载完成激活率 =激活数/安卓下载完成数
+    @TableField(exist = false)
+    private BigDecimal clickOnActivationRatio;//下载完成激活率 =激活数/安卓下载完成数
+    @TableField(exist = false)
+    private BigDecimal eventRegisterRatio;//注册率 =当日回传注册数/当日激活数
+    @TableField(exist = false)
+    private BigDecimal eventNextDayStayRatio;//次日留存率 =次留数/前一日激活数
+    @TableField(exist = false)
+    private BigDecimal eventCreditGrantAppRatio;//授信率 =当日回传授信数/当日回传的完件数
+    @TableField(exist = false)
+    private BigDecimal formActionRatio;//表单提交点击率 =当日回传表单数/当日行为数
+    @TableField(exist = false)
+    private BigDecimal submitRatio;//按钮点击率 =当日按钮点击数 / 当日行为数
+    private BigDecimal grew=new BigDecimal(0);//同比 = (今日实时花费-昨日截止到此时的花费)/昨日截止到此时的花费*100%;
+}

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

@@ -21,6 +21,9 @@ public class KuaishouReportDailyAccount implements Serializable {
     @JsonProperty("charge")
     private BigDecimal charge;
 
+    @JsonProperty("ad_scene")
+    private String adScene;
+
     @JsonProperty("photo_show")
     private Long photoShow;
 

+ 24 - 18
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportHourlyAccount.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.report.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;
@@ -14,9 +15,8 @@ import java.util.Date;
 @TableName("ctop_kuaishou_report_hourly_account")
 public class KuaishouReportHourlyAccount implements Serializable {
     private static final long serialVersionUID = 1L;
-    @TableId
+    @TableId(type = IdType.UUID)
     private String id;
-
     private Long accountId;
     @JsonProperty("stat_date")
     private String statDate;
@@ -35,22 +35,7 @@ public class KuaishouReportHourlyAccount implements Serializable {
     private Long aclick;
     @JsonProperty
     private Long bclick;
-    @JsonProperty
-    private Long share;
-    @JsonProperty
-    private Long comment;
-    @JsonProperty
-    private Long photoLike;
-    @JsonProperty
-    private Long follow;
-    @JsonProperty("cancel_follow")
-    private Long cancelFollow;
-    @JsonProperty
-    private Long report;
-    @JsonProperty
-    private Long block;
-    @JsonProperty
-    private Long negative;
+
     @JsonProperty("download_started")
     private Long downloadStarted;
     @JsonProperty("download_completed")
@@ -119,6 +104,27 @@ public class KuaishouReportHourlyAccount implements Serializable {
     private BigDecimal eventCreditGrantLandingPageCost;
     @JsonProperty
     private BigDecimal eventNextDayStay;
+    @JsonProperty("play_3s_ratio")
+    @TableField("play_3s_ratio")
+    private BigDecimal play3sRatio;
+
+    @JsonProperty
+    private Long share;
+    @JsonProperty
+    private Long comment;
+    @JsonProperty
+    private Long photoLike;
+    @JsonProperty
+    private Long follow;
+    @JsonProperty("cancel_follow")
+    private Long cancelFollow;
+    @JsonProperty
+    private Long report;
+    @JsonProperty
+    private Long block;
+    @JsonProperty
+    private Long negative;
+
     @JsonProperty
     private Date createTime;
     @JsonProperty

+ 80 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/enums/CheckParametersEnum.java

@@ -0,0 +1,80 @@
+package cn.com.ctop.kuaishou.modules.report.enums;
+
+public enum CheckParametersEnum {
+    PARAMETER1("charge", "charge"),
+    PARAMETER2("photoShow", "photo_show"),
+    PARAMETER3("photoClick", "photo_click"),
+    PARAMETER4("aclick", "aclick"),
+    PARAMETER5("bclick", "bclick"),
+    PARAMETER6("photoShare", "photo_share"),
+    PARAMETER7("photoComment", "photo_comment"),
+    PARAMETER8("photoLike", "photo_like"),
+    PARAMETER9("follow", "follow"),
+    PARAMETER10("cancelFollow", "cancel_follow"),
+    PARAMETER11("report", "report"),
+    PARAMETER12("block", "block"),
+    PARAMETER13("negative", "negative"),
+    PARAMETER14("downloadStarted", "download_started"),
+    PARAMETER15("downloadCompleted", "download_completed"),
+    PARAMETER16("activation", "activation"),
+    PARAMETER17("submit", "submit"),
+    PARAMETER18("eventPayFirstDay", "event_pay_first_day"),
+    PARAMETER19("eventPayPurchaseAmountFirstDay", "event_pay_purchase_amount_first_day"),
+    PARAMETER20("eventPay", "event_pay"),
+    PARAMETER21("eventPayPurchaseAmount", "event_pay_purchase_amount"),
+    PARAMETER22("eventRegister", "event_register"),
+    PARAMETER23("eventJinJianApp", "event_jin_jian_app"),
+    PARAMETER24("eventCreditGrantApp", "event_credit_grant_app"),
+    PARAMETER25("eventOrderPaid", "event_order_paid"),
+    PARAMETER26("eventOrderPaidPurchaseAmount", "event_order_paid_purchase_amount"),
+    PARAMETER27("eventJinJianLandingPage", "event_jin_jian_landing_page"),
+    PARAMETER28("eventCreditGrantLandingPage", "event_credit_grant_landing_page"),
+    PARAMETER29("eventNextDayStay", "event_next_day_stay"),
+    PARAMETER31("play3sRatio", "play_3s_ratio"),
+    PARAMETER32("play3sCount", "play_3s_count"),
+    PARAMETER30("formCount", "form_count");
+
+    private String sqlName;
+    private String value;
+
+    CheckParametersEnum(String value, String sqlName) {
+        this.value = value;
+        this.sqlName = sqlName;
+    }
+
+    public static String getSqlName(String value) {
+        for (CheckParametersEnum campaignType : CheckParametersEnum.values()) {
+            if (campaignType.getValue().equals(value)) {
+                return campaignType.getSqlName();
+            }
+        }
+        return "";
+    }
+
+    public static boolean isInclude(String key) {
+        boolean include = false;
+        for (CheckParametersEnum e : CheckParametersEnum.values()) {
+            if (e.getValue().equals(key)) {
+                include = true;
+                break;
+            }
+        }
+        return include;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getSqlName() {
+        return sqlName;
+    }
+
+    public void setSqlName(String sqlName) {
+        this.sqlName = sqlName;
+    }
+}

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

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaiShouAccountMaterialOverview;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 清洗数据账户素材概览数据
+ *
+ * @author: jeecg-boot
+ * @date: 2021-03-10
+ * @cersion: V1.0
+ */
+public interface EtlKuaiShouAccountMaterialOverviewMapper extends BaseMapper<EtlKuaiShouAccountMaterialOverview> {
+
+    void replaceInsert(EtlKuaiShouAccountMaterialOverview etlKuaiShouAccountMaterialOverview);
+
+    JSONObject getMaterialOverview(Long accountId, String statDate);
+}

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

@@ -0,0 +1,26 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaiShouGroupDailyReport;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 快手组日报数据清洗
+ *
+ * @author: jeecg-boot
+ * @date: 2021-03-09
+ * @cersion: V1.0
+ */
+public interface EtlKuaiShouGroupDailyReportMapper extends BaseMapper<EtlKuaiShouGroupDailyReport> {
+
+    void replaceBatch(@Param("addList") List<EtlKuaiShouGroupDailyReport> addList);
+
+    Long getTotal(Long accountId);
+
+    List<JSONObject> queryPageList(@Param("accountId") Long accountId, @Param("sortCode") String sortCode, @Param("sortType") String sortType);
+
+    void updateStatus(@Param("accountId")  Long accountId,@Param("unitId")  Long unitId, @Param("putStatus") Integer putStatus);
+}

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

@@ -0,0 +1,22 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaiShouNewly;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+/**
+ * 快手 新上计划数据汇总
+ *
+ * @author: jeecg-boot
+ * @date: 2021-03-08
+ * @cersion: V1.0
+ */
+public interface EtlKuaiShouNewlyMapper extends BaseMapper<EtlKuaiShouNewly> {
+
+    void replaceBatch(@Param("addList") List<EtlKuaiShouNewly> addList);
+
+    List<Object> getNewlyCounts(@Param("accountId") Long accountId);
+}

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

@@ -0,0 +1,32 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouAudienceAccountDaily;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 人群分析报表——年龄、性别数据
+ *
+ * @author: jeecg-boot
+ * @date: 2021-03-09
+ * @cersion: V1.0
+ */
+public interface EtlKuaishouAudienceAccountDailyMapper extends BaseMapper<EtlKuaishouAudienceAccountDaily> {
+
+    void replaceBatch(@Param("list") List<EtlKuaishouAudienceAccountDaily> list);
+
+    List<JSONObject> queryAudienceTypeInfo(@Param("value") String value, @Param("type") String type, @Param("accountId") Long accountId, @Param("audienceType") String audienceType, @Param("parType") String parType);
+
+    List<JSONObject> queryEveryDayInfo(@Param("value") String value, @Param("type") String type, @Param("accountId") Long accountId, @Param("audienceType") String audienceType, @Param("parType") String parType,@Param("day") String day);
+
+    List<JSONObject> getSceneInfo(@Param("value") String value, @Param("accountId") Long accountId, @Param("parType") String parType);
+
+    List<JSONObject> getSceneEveryDayInfo(@Param("value") String value, @Param("accountId") Long accountId, @Param("parType") String parType,@Param("day") String day);
+
+    List<String> getTypeList(@Param("type") String type,@Param("audienceType") String audienceType);
+
+    List<String> getSceneTypeList();
+}

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

@@ -0,0 +1,29 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import java.util.List;
+
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountDaily;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 盯盘日数据
+ *
+ * @author: jeecg-boot
+ * @date: 2021-03-04
+ * @cersion: V1.0
+ */
+public interface EtlKuaishouReportAccountDailyMapper extends BaseMapper<EtlKuaishouReportAccountDaily> {
+
+    void replaceBatch(@Param("list") List<EtlKuaishouReportAccountDaily> list);
+
+    EtlKuaishouReportAccountHourly getOnedayAggregatebyDaily(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("accountId") Long accountId);
+
+    List<JSONObject> getOnedayEtlReportList(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("accountId") Long accountId, @Param("value") String value, @Param("type") String type);
+
+    JSONObject getMaxChargeAccountId(@Param("userId") String userId);
+
+    String getNewlyUpdateTime();
+}

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

@@ -0,0 +1,28 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+
+import java.util.List;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 账户维度-每小时盯盘数据
+ *
+ * @author: jeecg-boot
+ * @date: 2021-03-04
+ * @cersion: V1.0
+ */
+public interface EtlKuaishouReportAccountHourlyMapper extends BaseMapper<EtlKuaishouReportAccountHourly> {
+
+    void replaceBatch(@Param("list") List<EtlKuaishouReportAccountHourly> list);
+
+    EtlKuaishouReportAccountHourly getOnedayAggregateByHour(@Param("startTime") String startTime, @Param("accountId") Long accountId);
+
+    List<JSONObject> getOnedayEtlReportList(@Param("startTime") String startTime, @Param("accountId") Long accountId,@Param("value") String value,@Param("type") String type);
+
+    String getNewlyUpdateTime();
+}

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

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouAudienceAccountDaily;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouAudienceReportDailyAccount;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -22,4 +23,6 @@ public interface KuaishouAudienceReportDailyAccountMapper extends BaseMapper<Kua
     List<String> querybusinessTypeCount(KuaishouAudienceReportDailyAccount audienceReport);
 
     List<JSONObject> querybusinessTypeReportForm(KuaishouAudienceReportDailyAccount audienceReport);
+
+    List<EtlKuaishouAudienceAccountDaily> queryEveryDayAudienceInfo();
 }

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

@@ -1,14 +1,12 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
 import cn.com.ctop.common.module.vo.KuaishouReportAccountDailyDTOEntity;
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouVideoInfoDTO;
-import cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO;
+import cn.com.ctop.kuaishou.modules.report.entity.*;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 public interface KuaishouReportDailyAccountMapper extends BaseMapper<KuaishouReportDailyAccount> {
@@ -19,33 +17,41 @@ public interface KuaishouReportDailyAccountMapper extends BaseMapper<KuaishouRep
 
     List<JSONObject> selectCost(@Param("accountId") Long accountId, @Param("startDate") String startDate, @Param("endDate") String endDate);
 
-    List<ProjectAccountDTO> getKuaishouProjectInfo(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("projectList")List<Long> projectList, @Param("yn")Integer yn);
+    List<ProjectAccountDTO> getKuaishouProjectInfo(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectList") List<Long> projectList, @Param("yn") Integer yn);
 
-    List<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(@Param("projectId")Long projectId, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("projectList")List<Long> projectList, @Param("accountIds")List<Long> accountIds, @Param("yn")Integer yn);
+    List<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(@Param("projectId") Long projectId, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectList") List<Long> projectList, @Param("accountIds") List<Long> accountIds, @Param("yn") Integer yn);
 
-    List<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(@Param("projectList")List<Long> projectList, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("accountId")Long accountId, @Param("accountIds")List<Long> accountIds, @Param("yn")Integer yn);
+    List<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(@Param("projectList") List<Long> projectList, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("accountId") Long accountId, @Param("accountIds") List<Long> accountIds, @Param("yn") Integer yn);
 
-    List<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(@Param("projectList")List<Long> projectList, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("campaignId")Long campaignId, @Param("accountIds")List<Long> accountIds, @Param("yn")Integer yn);
+    List<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(@Param("projectList") List<Long> projectList, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("campaignId") Long campaignId, @Param("accountIds") List<Long> accountIds, @Param("yn") Integer yn);
 
-    List<Long> queryProjectMemberByUserId(@Param("userId")String userId, @Param("mediaIds")List<Long> mediaIds);
+    List<Long> queryProjectMemberByUserId(@Param("userId") String userId, @Param("mediaIds") List<Long> mediaIds);
 
-    List<Long> queryProjectInfoBySaleId(@Param("userId")String userId, @Param("mediaIds")List<Long> mediaIds);
+    List<Long> queryProjectInfoBySaleId(@Param("userId") String userId, @Param("mediaIds") List<Long> mediaIds);
 
-    List<ProjectAccountDTO> queryProjectMemberByIds(@Param("projectIds")List<Long> projectIds);
+    List<ProjectAccountDTO> queryProjectMemberByIds(@Param("projectIds") List<Long> projectIds);
 
-    String getRoleCodeByUserId(@Param("userId")String userId);
+    String getRoleCodeByUserId(@Param("userId") String userId);
 
-    List<Long> queryProjectMemberByAdmins(@Param("mediaIds")List<Long> mediaIds);
+    List<Long> queryProjectMemberByAdmins(@Param("mediaIds") List<Long> mediaIds);
 
-    List<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(@Param("projectList")List<Long> projectList, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("unitId")Long unitId, @Param("accountIds") List<Long> accoundIds, @Param("yn")Integer yn);
+    List<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(@Param("projectList") List<Long> projectList, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("unitId") Long unitId, @Param("accountIds") List<Long> accoundIds, @Param("yn") Integer yn);
 
-    KuaishouVideoInfoDTO getVideoUrl(@Param("photoId")Long photoId);
+    KuaishouVideoInfoDTO getVideoUrl(@Param("photoId") Long photoId);
 
-    List<Long> getUserProjectAccountIds(@Param("userId")String userId, @Param("yn")Integer yn);
+    List<Long> getUserProjectAccountIds(@Param("userId") String userId, @Param("yn") Integer yn);
 
-    List<Long> getUserProjectAccountIdsByAdmin(@Param("yn")Integer yn);
+    List<Long> getUserProjectAccountIdsByAdmin(@Param("yn") Integer yn);
 
-    List<Long> getSaleProjectAccountIds(@Param("userId")String userId, @Param("yn")Integer yn);
+    List<Long> getSaleProjectAccountIds(@Param("userId") String userId, @Param("yn") Integer yn);
 
-    List<KuaishouReportAccountDailyDTOEntity> getKuaishouProjectInfoEntity(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("projectList")List<Long> projectList, @Param("yn")Integer yn);
+    List<KuaishouReportAccountDailyDTOEntity> getKuaishouProjectInfoEntity(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectList") List<Long> projectList, @Param("yn") Integer yn);
+
+    void replaceBatch(@Param("addList") List<KuaishouReportDailyAccount> addList);
+
+    void replaceBatchAdScene(@Param("addList") List<KuaishouReportDailyAccount> addList);
+
+    List<EtlKuaishouReportAccountDaily> queryEveryDayDataForAccount();
+
+    BigDecimal getSumChargeByAccountIdAndStatDate(@Param("accountId") Long accountId, @Param("statDate") String statDate);
 }

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

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Update;
 
+import java.util.List;
+
 public interface KuaishouReportDailyGroupMapper extends BaseMapper<KuaishouReportDailyGroup> {
     void loadGroupDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);
 
@@ -14,4 +16,6 @@ public interface KuaishouReportDailyGroupMapper extends BaseMapper<KuaishouRepor
     void formatChannelCode(@Param("date") String date);
 
     int insertSelective(KuaishouReportDailyGroup record);
+
+    void replaceBatch(@Param("addList") List<KuaishouReportDailyGroup> addList);
 }

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

@@ -1,13 +1,19 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportHourlyAccount;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 public interface KuaishouReportHourlyAccountMapper extends BaseMapper<KuaishouReportHourlyAccount> {
     Integer selectMaxHour(@Param("accountId") Long accountId, @Param("statDate") String statDate);
 
     BigDecimal getCost(@Param("accountId") Long accountId, @Param("statHour") Integer statHour, @Param("statDate") String statDate);
+
+    void replaceBatch(@Param("addList") List<KuaishouReportHourlyAccount> addList);
+
+    List<EtlKuaishouReportAccountHourly> queryEveryhourlyDataForAccount();
 }

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

@@ -1,15 +1,24 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouVideoEtlInfo;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 快手视频信息清洗表(有效,爆款)
+ *
  * @author: jeecg-boot
- * @date:   2020-12-17
+ * @date: 2020-12-17
  * @cersion: V1.0
  */
 public interface KuaishouVideoEtlInfoMapper extends BaseMapper<KuaishouVideoEtlInfo> {
 
     String getCompanyNameByUserId(String planId);
+
+    Long getTotal(@Param("accountId") Long accountId, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    List<JSONObject> queryPageList(@Param("accountId") Long accountId, @Param("sortCode") String sortCode, @Param("sortType") String sortType, @Param("startTime") String startTime, @Param("endTime") String endTime);
 }

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

@@ -0,0 +1,74 @@
+<?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.EtlKuaiShouAccountMaterialOverviewMapper">
+
+    <insert id="replaceInsert"
+            parameterType="cn.com.ctop.kuaishou.modules.report.entity.EtlKuaiShouAccountMaterialOverview">
+        replace into ctop_etl_kuaishou_account_material_overview
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="accountId != null">
+                account_id,
+            </if>
+            <if test="newlyCount != null">
+                newly_count,
+            </if>
+            <if test="newlyUseCount != null">
+                newly_use_count,
+            </if>
+            <if test="totalCount != null">
+                total_count,
+            </if>
+            <if test="effectiveCount != null">
+                effective_count,
+            </if>
+            <if test="hotMoneyCount != null">
+                hot_money_count,
+            </if>
+            <if test="stateDate != null">
+                state_date
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id},
+            </if>
+            <if test="accountId != null">
+                #{accountId},
+            </if>
+            <if test="newlyCount != null">
+                #{newlyCount},
+            </if>
+            <if test="newlyUseCount != null">
+                #{newlyUseCount},
+            </if>
+            <if test="totalCount != null">
+                #{totalCount},
+            </if>
+            <if test="effectiveCount != null">
+                #{effectiveCount},
+            </if>
+            <if test="hotMoneyCount != null">
+                #{hotMoneyCount},
+            </if>
+            <if test="stateDate != null">
+                #{stateDate}
+            </if>
+        </trim>
+    </insert>
+    <select id="getMaterialOverview" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        newly_count as newlyCount,
+        newly_use_count as newlyUseCount,
+        total_count as totalCount,
+        effective_count as effectiveCount,
+        hot_money_count as hotMoneyCount,
+        update_time as updateTime
+        from  ctop_etl_kuaishou_account_material_overview
+        where account_id = #{accountId}
+        and state_date = #{statDate}
+
+    </select>
+</mapper>

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

@@ -0,0 +1,116 @@
+<?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.EtlKuaiShouGroupDailyReportMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_etl_kuaishou_group_daily_report(
+        account_id,
+        campaign_id,
+        campaign_name,
+        unit_id,
+        unit_name,
+        unit_status,
+        bid_type,
+        bid,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        download_started,
+        download_completed,
+        activation,
+        event_pay_first_day,
+        event_pay,
+        event_register,
+        event_jin_jian_app,
+        event_order_paid,
+        event_next_day_stay,
+        play_3s_count,
+        stat_date
+        )
+        values
+        <foreach collection="addList" item="addList" separator=",">
+            (
+            #{addList.accountId},
+            #{addList.campaignId},
+            #{addList.campaignName},
+            #{addList.unitId},
+            #{addList.unitName},
+            #{addList.unitStatus},
+            #{addList.bidType},
+            #{addList.bid},
+            #{addList.charge},
+            #{addList.photoShow},
+            #{addList.aclick},
+            #{addList.bclick},
+            #{addList.downloadStarted},
+            #{addList.downloadCompleted},
+            #{addList.activation},
+            #{addList.eventPayFirstDay},
+            #{addList.eventPay},
+            #{addList.eventRegister},
+            #{addList.eventJinJianApp},
+            #{addList.eventOrderPaid},
+            #{addList.eventNextDayStay},
+            #{addList.play3sCount},
+            #{addList.statDate}
+            )
+        </foreach>
+    </insert>
+
+    <select id="getTotal" resultType="java.lang.Long">
+        SELECT count(1)
+        FROM ctop_etl_kuaishou_group_daily_report t1
+        WHERE account_id = #{accountId}
+          AND t1.charge > 0
+          AND stat_date = DATE_FORMAT(now(), '%Y-%m-%d')
+    </select>
+
+    <select id="queryPageList" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        t1.unit_id as 'unitId',
+        account_id as 'accountId',
+        unit_name as 'unitName',
+        t1.charge,
+        IFNULL(ROUND(t1.charge/activation,2),0) as 'activationCost',
+        bid,
+        bid_type as 'bidType',
+        unit_status as 'unitStatus',
+        activation,
+        IFNULL(ROUND((t1.charge-t2.charge)/t2.charge*100,2),0)'grew',
+        t1.update_time as 'updateTime'
+        FROM ctop_etl_kuaishou_group_daily_report t1
+        LEFT JOIN (
+        SELECT charge,unit_id FROM ctop_etl_kuaishou_group_daily_report
+        WHERE account_id = #{accountId}
+        AND stat_date = DATE_FORMAT(date_sub(now(), interval 1 day), '%Y-%m-%d')
+        ) t2 ON t1.unit_id = t2.unit_id
+        WHERE account_id = #{accountId}
+        AND t1.charge > 0
+        AND stat_date = DATE_FORMAT(now(), '%Y-%m-%d')
+        <if test="sortCode == 'charge' ">
+            ORDER BY t1.charge
+        </if>
+        <if test="sortCode == 'activationCost' ">
+
+            ORDER BY t1.charge/activation
+        </if>
+        <if test="sortCode == 'bid' ">
+            ORDER BY bid
+        </if>
+        <if test="sortCode == 'activation' ">
+            ORDER BY activation
+        </if>
+        ${sortType}
+    </select>
+
+    <update id="updateStatus">
+        update
+            ctop_etl_kuaishou_group_daily_report
+        set unit_status = #{putStatus}
+        where account_id = #{accountId}
+          and unit_id = #{unitId}
+          and stat_date = DATE_FORMAT(now(), '%Y-%m-%d')
+    </update>
+
+</mapper>

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

@@ -0,0 +1,43 @@
+<?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.EtlKuaiShouNewlyMapper">
+
+    <insert id="replaceBatch">
+        replace into ctop_etl_kuaishou_newly(
+        project_id,
+        project_name,
+        account_id,
+        oauth_name,
+        user_id,
+        user_name,
+        new_count,
+        new_type,
+        stat_date
+        )
+        values
+        <foreach collection="addList" item="addList" separator=",">
+            (
+            #{addList.projectId},
+            #{addList.projectName},
+            #{addList.accountId},
+            #{addList.oauthName},
+            #{addList.userId},
+            #{addList.userName},
+            #{addList.newCount},
+            #{addList.newType},
+            #{addList.statDate}
+            )
+        </foreach>
+    </insert>
+
+    <select id="getNewlyCounts" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT stat_date as 'statDate', account_id as 'accountId', new_count as 'newCount', new_type as 'newType'
+        FROM ctop_etl_kuaishou_newly
+        WHERE stat_date &gt;= DATE_FORMAT(date_sub(now(), interval 7 day), '%Y-%m-%d')
+          AND stat_date &lt;= DATE_FORMAT(date_sub(now(), interval 1 day), '%Y-%m-%d')
+          AND account_id = #{accountId}
+        group by stat_date, new_type
+    </select>
+
+
+</mapper>

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

@@ -0,0 +1,174 @@
+<?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.EtlKuaishouAudienceAccountDailyMapper">
+    <insert id="replaceBatch">
+        replace into ctop_etl_kuaishou_audience_account_daily(
+        stat_date,
+        account_id,
+        audience_type,
+        charge,
+        activation,
+        event_pay,
+        event_pay_purchase_amount,
+        event_next_day_stay,
+        aclick,
+        bclick,
+        photo_click,
+        photo_show,
+        gender,
+        age_segment
+        )
+        values
+        <foreach collection="list" item="appInfo" separator=",">
+            (
+            #{appInfo.statDate},
+            #{appInfo.accountId},
+            #{appInfo.audienceType},
+            #{appInfo.charge},
+            #{appInfo.activation},
+            #{appInfo.eventPay},
+            #{appInfo.eventPayPurchaseAmount},
+            #{appInfo.eventNextDayStay},
+            #{appInfo.aclick},
+            #{appInfo.bclick},
+            #{appInfo.photoClick},
+            #{appInfo.photoShow},
+            #{appInfo.gender},
+            #{appInfo.ageSegment}
+            )
+        </foreach>
+    </insert>
+
+    <select id="queryAudienceTypeInfo" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        account_id as 'accountId',
+        <if test="parType == 'alone'">
+            SUM(${value}) as 'value',
+        </if>
+        <if test="parType == 'more'">
+            <if test="value == 'activationCost'">
+                IFNULL(ROUND( SUM(charge)/ SUM(activation),2),0) as 'value',
+            </if>
+            <if test="value == 'eventPayRoi'">
+                IFNULL(ROUND( SUM(event_pay_purchase_amount)/ SUM(charge)*100,2),0) as 'value',
+            </if>
+            <if test="value == 'eventPayCost'">
+                IFNULL(ROUND( SUM(charge)/ SUM(event_pay),2),0) as 'value',
+            </if>
+            <if test="value == 'eventNextDayStayCost'">
+                IFNULL(ROUND(SUM(charge)/SUM(event_next_day_stay),2),0) as 'value',
+            </if>
+        </if>
+        ${type} as 'type'
+        FROM ctop_etl_kuaishou_audience_account_daily
+        where stat_date &gt;= DATE_FORMAT(date_sub(now(), interval 8 day), '%Y-%m-%d')
+        AND stat_date &lt;= DATE_FORMAT(date_sub(now(), interval 2 day), '%Y-%m-%d')
+        AND audience_type = #{audienceType}
+        AND account_id = #{accountId}
+        group by ${type}
+        ORDER BY ${type}
+    </select>
+
+    <select id="queryEveryDayInfo" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        account_id as 'accountId',
+        stat_date as 'statDate',
+        <if test="parType == 'alone'">
+            ${value} as 'value',
+        </if>
+        <if test="parType == 'more'">
+            <if test="value == 'activationCost'">
+                IFNULL(ROUND( charge/ activation,2),0) as 'value',
+            </if>
+            <if test="value == 'eventPayRoi'">
+                IFNULL(ROUND(event_pay_purchase_amount/charge*100,2),0) as 'value',
+            </if>
+            <if test="value == 'eventPayCost'">
+                IFNULL(ROUND(charge / event_pay,2),0) as 'value',
+            </if>
+            <if test="value == 'eventNextDayStayCost'">
+                IFNULL(ROUND(charge/ event_next_day_stay,2),0) as 'value',
+            </if>
+        </if>
+        ${type} as 'type'
+        FROM ctop_etl_kuaishou_audience_account_daily
+        where stat_date = #{day}
+        AND audience_type = #{audienceType}
+        AND account_id = #{accountId}
+        group by stat_date,${type}
+        order by stat_date,${type}
+    </select>
+
+    <select id="getSceneEveryDayInfo" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        account_id as 'accountId',
+        stat_date as 'statDate',
+        <if test="parType == 'alone'">
+            ${value} as 'value',
+        </if>
+        <if test="parType == 'more'">
+            <if test="value == 'activationCost'">
+                IFNULL(ROUND( charge/ activation,2),0) as 'value',
+            </if>
+            <if test="value == 'eventPayRoi'">
+                IFNULL(ROUND(event_pay_purchase_amount/charge*100,2),0) as 'value',
+            </if>
+            <if test="value == 'eventPayCost'">
+                IFNULL(ROUND(charge / event_pay,2),0) as 'value',
+            </if>
+            <if test="value == 'eventNextDayStayCost'">
+                IFNULL(ROUND(charge/ event_next_day_stay,2),0) as 'value',
+            </if>
+        </if>
+        IFNULL(ad_scene,'全部') as 'type'
+        FROM ctop_kuaishou_report_daily_account_ad_scene
+        where stat_date = #{day}
+        AND account_id = #{accountId}
+        group by stat_date,ad_scene
+        order by stat_date,ad_scene
+    </select>
+
+    <select id="getSceneTypeList" resultType="java.lang.String">
+        SELECT DISTINCT IFNULL(ad_scene, '全部')
+        FROM ctop_kuaishou_report_daily_account_ad_scene
+        WHERE LENGTH(trim(ad_scene))>0
+        ORDER BY ad_scene
+    </select>
+
+    <select id="getTypeList" resultType="java.lang.String">
+        SELECT ${type} as 'type'
+        FROM ctop_etl_kuaishou_audience_account_daily
+        where audience_type = #{audienceType}
+        group by ${type}
+        order by ${type}
+    </select>
+
+    <select id="getSceneInfo" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        account_id as 'accountId',
+        <if test="parType == 'alone'">
+            SUM(${value}) as 'value',
+        </if>
+        <if test="parType == 'more'">
+            <if test="value == 'activationCost'">
+                IFNULL(ROUND( SUM(charge)/ SUM(activation),2),0) as 'value',
+            </if>
+            <if test="value == 'eventPayRoi'">
+                IFNULL(ROUND( SUM(event_pay_purchase_amount)/ SUM(charge)*100,2),0) as 'value',
+            </if>
+            <if test="value == 'eventPayCost'">
+                IFNULL(ROUND( SUM(charge)/ SUM(event_pay),2),0) as 'value',
+            </if>
+            <if test="value == 'eventNextDayStayCost'">
+                IFNULL(ROUND(SUM(charge)/SUM(event_next_day_stay),2),0) as 'value',
+            </if>
+        </if>
+        IFNULL(ad_scene,'全部')as 'type'
+        FROM ctop_kuaishou_report_daily_account_ad_scene
+        where stat_date &gt;= DATE_FORMAT(date_sub(now(), interval 8 day), '%Y-%m-%d')
+        AND stat_date &lt;= DATE_FORMAT(date_sub(now(), interval 2 day), '%Y-%m-%d')
+        AND account_id = #{accountId}
+        group by ad_scene
+        order by ad_scene
+    </select>
+</mapper>

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


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů