소스 검색

Merge branch 'dingpan' into V1.1.5

# Conflicts:
#	jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
#	jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
zhaoxian 4 년 전
부모
커밋
1dd0e1410a
100개의 변경된 파일5128개의 추가작업 그리고 377개의 파일을 삭제
  1. 3 0
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  2. 12 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouVideoEtlInfoController.java
  3. 8 40
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectController.java
  4. 12 48
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  5. 168 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  6. 4 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyGroupReportLoadJob.java
  7. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/AdvertiserMapper.java
  8. 4 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/TransferAccountMapper.java
  9. 7 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/AdvertiserMapper.xml
  10. 10 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml
  11. 13 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/TransferAccountMapper.xml
  12. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IAdvertiserService.java
  13. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java
  14. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/ITransferAccountService.java
  15. 7 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/AdvertiserServiceImpl.java
  16. 103 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  17. 103 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/TransferAccountServiceImpl.java
  18. 43 19
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  19. 15 17
      module-common/src/main/java/cn/com/ctop/common/module/entity/Project.java
  20. 6 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/ProductMapper.java
  21. 8 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/ProjectMapper.java
  22. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/SupplierListMapper.java
  23. 5 2
      module-common/src/main/java/cn/com/ctop/common/module/mapper/SysUserMapper.java
  24. 10 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/ProductMapper.xml
  25. 30 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/ProjectMapper.xml
  26. 6 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SupplierListMapper.xml
  27. 8 1
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserMapper.xml
  28. 6 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IProductService.java
  29. 8 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IProjectService.java
  30. 3 0
      module-common/src/main/java/cn/com/ctop/common/module/service/ISupplierListService.java
  31. 4 1
      module-common/src/main/java/cn/com/ctop/common/module/service/ISysUserService.java
  32. 9 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/ProductServiceImpl.java
  33. 25 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/ProjectServiceImpl.java
  34. 21 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/SupplierListServiceImpl.java
  35. 22 3
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/SysUserServiceImpl.java
  36. 7 1
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyMaterialReportJob.java
  37. 30 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouAccountAudienceReportEtlJob.java
  38. 29 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadEtlJob.java
  39. 5 4
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyGroupReportLoadJob.java
  40. 85 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDingPanCleanJob.java
  41. 5 1
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouGroupDailyReportJob.java
  42. 30 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouHourlyAccountReportLoadEtlJob.java
  43. 3 3
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouVideoRelateCreativesJob.java
  44. 16 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouMaterialControer.java
  45. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouBatchUpdateServiceImpl.java
  46. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  47. 228 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/DingPanController.java
  48. 0 36
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouController.java
  49. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaishouVideoRelateCreatives.java
  50. 4 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouCampaignMapper.java
  51. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouCreativeMapper.java
  52. 5 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouGroupMapper.java
  53. 8 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouVideoGetMapper.java
  54. 7 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCampaignMapper.xml
  55. 22 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCreativeMapper.xml
  56. 29 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml
  57. 57 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml
  58. 13 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouVideoRelateCreativesMapper.xml
  59. 3 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouCampaignService.java
  60. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouCreativeService.java
  61. 6 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouGroupService.java
  62. 7 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouVideoGetService.java
  63. 1 9
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java
  64. 2 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouVideoRelateCreativesService.java
  65. 6 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCampaignServiceImpl.java
  66. 25 8
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCreativeServiceImpl.java
  67. 25 11
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java
  68. 20 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java
  69. 0 83
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  70. 5 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouVideoRelateCreativesServiceImpl.java
  71. 259 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaiShouAccountMaterialOverviewController.java
  72. 266 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaiShouGroupDailyReportController.java
  73. 270 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaiShouNewlyController.java
  74. 334 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaishouAudienceAccountDailyController.java
  75. 266 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaishouReportAccountDailyController.java
  76. 332 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/EtlKuaishouReportAccountHourlyController.java
  77. 91 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaiShouAccountMaterialOverview.java
  78. 181 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaiShouGroupDailyReport.java
  79. 108 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaiShouNewly.java
  80. 139 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaishouAudienceAccountDaily.java
  81. 253 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaishouReportAccountDaily.java
  82. 320 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaishouReportAccountHourly.java
  83. 78 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/enums/CheckParametersEnum.java
  84. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaiShouAccountMaterialOverviewMapper.java
  85. 26 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaiShouGroupDailyReportMapper.java
  86. 22 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaiShouNewlyMapper.java
  87. 28 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaishouAudienceAccountDailyMapper.java
  88. 27 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaishouReportAccountDailyMapper.java
  89. 27 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaishouReportAccountHourlyMapper.java
  90. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouAudienceReportDailyAccountMapper.java
  91. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyAccountMapper.java
  92. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyGroupMapper.java
  93. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportHourlyAccountMapper.java
  94. 10 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouVideoEtlInfoMapper.java
  95. 74 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaiShouAccountMaterialOverviewMapper.xml
  96. 116 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaiShouGroupDailyReportMapper.xml
  97. 43 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaiShouNewlyMapper.xml
  98. 159 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouAudienceAccountDailyMapper.xml
  99. 263 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountDailyMapper.xml
  100. 0 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountHourlyMapper.xml

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

+ 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

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

@@ -2,7 +2,10 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
 import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
-import cn.com.ctop.common.module.entity.*;
+import cn.com.ctop.common.module.entity.Advertiser;
+import cn.com.ctop.common.module.entity.MaterialInfo;
+import cn.com.ctop.common.module.entity.Project;
+import cn.com.ctop.common.module.entity.SysUser;
 import cn.com.ctop.common.module.mapper.ProjectMapper;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.Check;
@@ -22,7 +25,6 @@ import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
 import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.ctop.service.ITransferAccountService;
-import org.jeecg.modules.system.service.ISysCategoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -197,28 +199,13 @@ public class ProjectController {
             pageList = projectService.page(page, queryWrapper);
         }
         List<Project> records = pageList.getRecords();
-        if (!Check.isNull(records)) {
-            if (!Check.isNull(records)) {
-                for (Project project2 : records) {
-                    QueryWrapper<TransferAccount> transferAccountQueryWrapper = new QueryWrapper<>();
-                    transferAccountQueryWrapper.eq("project_id", project2.getId());
-                    transferAccountQueryWrapper.eq("status", 0);
-                    List<TransferAccount> list = transferAccountService.list(transferAccountQueryWrapper);
-                    project2.setNeedExamine(list.size());
-                }
-
-            }
-        }
+        records = transferAccountService.getTransferInfoListByList(records);
+        pageList.setRecords(records);
         result.setResult(pageList);
         return result;
     }
 
 
-    @Autowired
-    private ISysCategoryService sysCategoryService;
-    @Autowired
-    private ISupplierListService supplierListService;
-
     /**
      * 分页列表查询
      *
@@ -236,11 +223,8 @@ public class ProjectController {
                                                 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                 HttpServletRequest req) {
         Result<IPage<Project>> result = new Result<>();
-
         String projectName = project.getProjectName();
         project.setProjectName(null);
-
-
         QueryWrapper<Project> queryWrapper = QueryGenerator.initQueryWrapper(project, req.getParameterMap());
         Page<Project> page = new Page<>(pageNo, pageSize);
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -251,30 +235,14 @@ public class ProjectController {
         } else if ("plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode) || "clip".equals(roleCode) || "designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode)) {
             queryWrapper.eq("design_responsible_id", sysUser.getId());
         }
-
         if (!Check.isNull(projectName)) {
             queryWrapper.like("project_name", projectName);
         }
         queryWrapper.orderByDesc("create_time");
-
         IPage<Project> pageList = projectService.page(page, queryWrapper);
         List<Project> records = pageList.getRecords();
-        if (!Check.isNull(records)) {
-            for (Project project1 : records) {
-                if (!Check.isNull(project1.getSupplierCode())) {
-                    QueryWrapper<SupplierList> supplierListQueryWrapper = new QueryWrapper<>();
-                    supplierListQueryWrapper.eq("supplier_code", project1.getSupplierCode());
-                    supplierListQueryWrapper.last("limit 1");
-                    SupplierList one = supplierListService.getOne(supplierListQueryWrapper);
-                    if (!Check.isNull(one)) {
-                        project1.setSupplierCode_dictText(one.getSupplierName());
-                    }
-                }
-
-
-            }
-
-        }
+        records = transferAccountService.getTransferInfoListByList(records);
+        pageList.setRecords(records);
         result.setSuccess(true);
         result.setResult(pageList);
         return result;

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

@@ -159,15 +159,14 @@ public class ProjectMemberController {
             }
             List<Integer> mediaIds = new ArrayList<>();
             String type = requestJson.getString("type");
-            if ("kuaishou".equals(type)) {
-                mediaIds.add(2);
-                mediaIds.add(4);
-            } else if ("bytedance".equals(type)) {
-                mediaIds.add(1);
-                mediaIds.add(3);
-            }
-            if (Check.isNull(mediaIds)) {
-                throw new Exception("请选择媒体类型");
+            if (!Check.isNull(type)) {
+                if ("kuaishou".equals(type)) {
+                    mediaIds.add(2);
+                    mediaIds.add(4);
+                } else if ("bytedance".equals(type)) {
+                    mediaIds.add(1);
+                    mediaIds.add(3);
+                }
             }
             String roleCode = sysRoleService.getRoleCodeByUserId(userId);
             if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
@@ -250,54 +249,19 @@ public class ProjectMemberController {
         }
         queryWrapper.groupBy("project_id");
         queryWrapper.orderByDesc("create_time");
-
-
         Page<ProjectMember> page = new Page<>(pageNo, pageSize);
         IPage<ProjectMember> pageList = projectMemberService.page(page, queryWrapper);
         List<ProjectMember> projectMembers = pageList.getRecords();
-        List<ProjectMember> projectMemberList = new ArrayList<>();
-        if (!Check.isNull(projectMembers)) {
-            for (ProjectMember member : projectMembers) {
-                if (Check.isNull(member)) {
-                    continue;
-                }
-                Project project = projectService.getById(member.getProjectId());
-                if (!Check.isNull(project)) {
-                    SysUser responsible = sysUserService.getById(project.getResponsibleId());
-                    if (!Check.isNull(responsible)) {
-                        member.setResponsibleName(responsible.getRealname());
-                    }
-                    SysUser designResponsible = sysUserService.getById(project.getDesignResponsibleId());
-                    if (!Check.isNull(designResponsible)) {
-                        member.setDesignResponsibleName(designResponsible.getRealname());
-                    }
-                    Advertiser advertiser = advertiserService.getById(project.getAdvertiserId());
-                    if (!Check.isNull(advertiser)) {
-                        member.setProjectName(project.getProjectName());
-                    }
-
-                    Product product = productService.getById(project.getProductId());
-                    if (!Check.isNull(product)) {
-                        member.setProductId(product.getId());
-                        member.setProductName(product.getProductName());
-                    }
-                    member.setAdvertiserName(advertiser.getName());
-                    member.setAdvertiserId(project.getAdvertiserId());
-                    member.setAdvertiserId(project.getAdvertiserId());
-                    member.setMediaId(project.getMediaId());
-                    member.setMaxBid(project.getMaxBid());
-                    projectMemberList.add(member);
-                }
-            }
-        }
-
-
+        projectMembers = projectMemberService.getMapsByProjectList(projectMembers);
+        pageList.setRecords(projectMembers);
         result.setSuccess(true);
         result.setResult(pageList);
         return result;
     }
 
 
+
+
     /**
      * 分页列表查询
      *

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

@@ -9,12 +9,13 @@ import cn.com.ctop.common.module.vo.ResFileDTO;
 import cn.com.ctop.crawler.modules.core.entity.CrawlerDouyinMusicTask;
 import cn.com.ctop.crawler.modules.core.service.CrawlerDouyinMusicTaskService;
 import cn.com.ctop.crawler.modules.douyin.service.DouyinMusicService;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouTemplate;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouAccessToken;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResultToken;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouDailyAgentService;
+import cn.com.ctop.kuaishou.modules.report.service.*;
 import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.material.service.IBytedanceEffectVideoInfoService;
@@ -91,6 +92,9 @@ public class TestController {
     private MusicInfoService musicInfoService;
     @Autowired
     private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
+    @Autowired
+    private IKuaishouReportDailyGroupService reportDailyGroupService;
+
 
     static ExecutorService executorService = Executors.newFixedThreadPool(15);
     static ExecutorService videoService = Executors.newFixedThreadPool(5);
@@ -115,8 +119,84 @@ public class TestController {
 
     @Autowired
     private IUserAllocationService allocationService;
+    @Autowired
+    private IEtlKuaiShouNewlyService kuaiShouNewlyService;
+    static ExecutorService materialExecutorService = Executors.newFixedThreadPool(8);
+
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IEtlKuaiShouGroupDailyReportService etlKuaiShouGroupDailyReportService;
+    @Autowired
+    private IEtlKuaiShouAccountMaterialOverviewService accountMaterialOverviewService;
+
+    @Autowired
+    private IEtlKuaiShouNewlyService newlyService;
+
+
+    @GetMapping("/cleanNewlyData")
+    public void cleanNewlyData() {
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        newlyService.cleanNewlyData(nowDate);
+        XxlJobHelper.log("快手清洗上新计划数据完成");
+    }
 
 
+    @GetMapping("/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);
+                }
+            });
+        }
+    }
+
+
+    @GetMapping("/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);
+                }
+            });
+        }
+
+
+    }
+
+
+    @GetMapping("/cleanDate")
+    public String cleanDate(String statDate) throws ParseException {
+        //  kuaiShouNewlyService.cleanNewlyData(statDate);
+        // CtopOauthToken
+        CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(9901975L);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse = simpleDateFormat.parse("2021-03-09");
+        reportDailyGroupService.getAdvertiserGroupReportDaily(tokenByAccountId, parse, parse);
+
+        return "success";
+    }
+
     @GetMapping("/getVideoByProjectId")
     public String getVideoByProjectId(Long projectId) {
         QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
@@ -416,26 +496,6 @@ public class TestController {
 
     }
 
-    @GetMapping(value = "/getGroupReport")
-    public void getGroupReport() throws ParseException {
-        List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date parse1 = simpleDateFormat.parse("2020-09-12");
-        Date parse2 = simpleDateFormat.parse("2020-09-17");
-        for (CtopOauthToken token : tokens) {
-
-            suzhaoService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    //1: 获取广告主信息数据
-                    kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, parse1, parse2);
-                }
-            });
-
-
-        }
-    }
-
 
     @GetMapping(value = "/syncDouyinMusicAsc")
     public String syncDouyinMusicAsc() {
@@ -687,7 +747,7 @@ public class TestController {
                             @Override
                             public void run() {
                                 //1: 获取广告主信息数据
-                                kuaishouInterfaceService.getAdvertiserReportDaily(token, start, end,"adScene");
+                                kuaishouInterfaceService.getAdvertiserReportDaily(token, start, end, "adScene");
                             }
                         });
                     });
@@ -742,7 +802,7 @@ public class TestController {
         SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
         Date date1 = sim.parse(startDate);
         Date date2 = sim.parse(endDate);
-        kuaishouInterfaceService.getAdvertiserReportDaily(token, date1, date2,"adScene");
+        kuaishouInterfaceService.getAdvertiserReportDaily(token, date1, date2, "adScene");
         return "Success";
     }
 
@@ -759,7 +819,7 @@ public class TestController {
             List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(tokenQueryWrapper);
             if (!Check.isNull(ctopOauthTokens)) {
                 for (CtopOauthToken token : ctopOauthTokens) {
-                    kuaishouInterfaceService.getAdvertiserReportDaily(token, date1, date2,"adScene");
+                    kuaishouInterfaceService.getAdvertiserReportDaily(token, date1, date2, "adScene");
                 }
             }
         } catch (Exception e) {
@@ -906,39 +966,6 @@ public class TestController {
         return "success";
     }
 
-    @GetMapping(value = "/getGroupData")
-    public String getGroupData() {
-
-
-        Date endDate = new Date();
-        QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
-        tokenQueryWrapper.eq("media_id", 2);
-        List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(tokenQueryWrapper);
-        for (CtopOauthToken token : ctopOauthTokens) {
-
-            for (int i = 0; i < 7; i++) {
-                Date getStartDate = DateUtils.addDay(endDate, -i);
-                //3:获取广告组信息数据
-                kuaishouInterfaceService.getAdvertiserGroupReportHourly(token, getStartDate, getStartDate);
-            }
-            for (int i = 0; i < 6; i++) {
-                Date getStartDate = new Date();
-                Date getEndDate = new Date();
-                if (i == 0) {
-                    getStartDate = DateUtils.addDay(endDate, -175 + i * 30);
-                    getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
-                } else {
-                    getStartDate = DateUtils.addDay(endDate, -180 + i * 30);
-                    getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
-                }
-                //3:获取广告组信息数据
-                kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getStartDate, getEndDate);
-            }
-        }
-        return "Success";
-    }
-
-
     @GetMapping(value = "/gerCreative")
     public void gerCreative() {
         QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
@@ -1029,10 +1056,7 @@ public class TestController {
     }
 
 
-    @Autowired
-    private IBytedancePlanDailyReportService planDailyReportService;
-    @Autowired
-    private ICtopOauthTokenService tokenService;
+
 
 
     @Autowired
@@ -1083,7 +1107,7 @@ public class TestController {
                     } catch (ParseException e) {
                         e.printStackTrace();
                     }
-                    kuaishouInterfaceService.getAdvertiserReportDaily(token, startDate, endDate,"adScene");
+                    kuaishouInterfaceService.getAdvertiserReportDaily(token, startDate, endDate, "adScene");
 
                     Thread.sleep(1 * 200);
                     //  kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
@@ -1169,7 +1193,7 @@ public class TestController {
                 @Override
                 public void run() {
                     //1: 获取广告主信息数据
-                    kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate,"adScene");
+                    kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate, "adScene");
                 }
             });
         });
@@ -1370,7 +1394,31 @@ public class TestController {
     IBytedanceVideoReportService bytedanceVideoReportService;
     @Autowired
     IETLReportBytedanceVideoService etlReportBytedanceVideoService;
+
     @GetMapping("execute")
+    public Map<String, Object> execute(String date) throws Exception {
+        Map<String, Object> result = new HashMap<>();
+//        List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
+//        countDownLatch = new CountDownLatch(tokens.size());
+//        tokens.forEach(token -> executor.submit(() -> {
+//            try {
+//                bytedanceVideoReportService.pullVideoReport(token,date,date,1);
+//            } catch (Exception e) {
+//                XxlJobHelper.log("头条视频报表基础数据拉取异常:{}",e.getMessage());
+//            } finally {
+//                countDownLatch.countDown();
+//            }
+//        }));
+//        try {
+//            countDownLatch.await();
+//        } catch (InterruptedException e) {
+//            e.printStackTrace();
+//        }
+        Map<String, Object> params = new HashMap<>();
+        params.put("stat_datetime", date);
+        etlReportBytedanceVideoService.removeByMap(params);
+        etlReportBytedanceVideoService.cleanETL(date);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
     public Map<String,Object> execute(Long accountId) throws Exception {
         Map<String,Object>result = new HashMap<>();
         CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
@@ -1379,4 +1427,61 @@ public class TestController {
         ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
         return result;
     }
+
+
+    @Autowired
+    private IKuaishouAudienceReportDailyService kuaishouAudienceReportDailyService;
+    @Autowired
+    private IKuaiShouGroupService kuaiShouGroupService;
+    @Autowired
+    private IKuaishouStrategyService kuaishouStrategyService;
+
+    @GetMapping("reportDaily")
+    public void ReportDaily() throws Exception {
+        CtopOauthToken token1 = tokenService.getTokenByAccountId(9743738L);
+        CtopOauthToken token2 = tokenService.getTokenByAccountId(9743727L);
+        CtopOauthToken token3 = tokenService.getTokenByAccountId(9556344L);
+        List<CtopOauthToken> tokens = new ArrayList<>();
+        tokens.add(token1);
+        tokens.add(token2);
+        tokens.add(token3);
+        //查询两天前数据  策略
+        List<String> dates = new ArrayList<>();
+        for (int i = 2; i < 33; i++) {
+            String dat = DateUtils.getLastDay(DateUtils.date2Str(), i);
+            dates.add(dat);
+        }
+
+        ExecutorService executorServic1e = Executors.newFixedThreadPool(30);
+        CtopOauthToken token = tokenService.getTokenByAccountId(9743738L);
+        dates.forEach(date -> executorServic1e.submit(() -> {
+            if (null == tokens || tokens.isEmpty()) {
+                XxlJobHelper.log("定时获取人群分析报表数据异常:未获取到可用的token");
+                XxlJobHelper.handleFail();
+                return;
+            }
+            int page = 1;
+            int pageSize = 2000;
+            getAudienceReportData(token, date, "ageSegment", page, pageSize);
+            getAudienceReportData(token, date, "gender", page, pageSize);
+            getAudienceReportData(token, date, "businessInterestTags", page, pageSize);
+            getAudienceReportData(token, date, "city", page, pageSize);
+            getAudienceReportData(token, date, "clientId", page, pageSize);
+            getAudienceReportData(token, date, "province", page, pageSize);
+        }));
+    }
+
+    private void getAudienceReportData(CtopOauthToken token, String date, String type, Integer page, Integer pageSize) {
+        System.out.println(date + "————:" + token.getAccountId());
+        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(410);
+            }
+        } catch (Exception e) {
+            XxlJobHelper.log("定时获取人群分析报表数据异常", e);
+        }
+    }
+
 }

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

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

@@ -2,6 +2,7 @@ package org.jeecg.modules.ctop.mapper;
 
 import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.UserAllocation;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.excelutil.entity.KuaishouXxlEntity;
@@ -9,6 +10,7 @@ import org.jeecg.modules.excelutil.entity.YdPlanAggregateEntity;
 import org.jeecg.modules.excelutil.entity.YdWeekAggregateEntity;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 广告主信息表
@@ -27,4 +29,6 @@ public interface AdvertiserMapper extends BaseMapper<Advertiser> {
     List<UserAllocation> getAllocationsBySaleId(@Param(value = "saleId") String saleId);
 
     List<UserAllocation> getAllocationsByAdvertiserId(@Param(value = "adId") String adId);
+
+    List<JSONObject> getAdvertiserByMap(@Param("ids") Map<String, String> advertiserIdMap);
 }

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

@@ -1,10 +1,12 @@
 package org.jeecg.modules.ctop.mapper;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import io.lettuce.core.dynamic.annotation.Param;
+import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.ctop.entity.TransferAccount;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 转户记录表
@@ -17,4 +19,5 @@ public interface TransferAccountMapper extends BaseMapper<TransferAccount> {
 
     List<TransferAccount> getAccountQuarterDetail(@Param(value = "accountId") Long accountId, @Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate);
 
+    List<JSONObject> getListByMap(@Param("ids") Map<Long, Long> projectIdMap);
 }

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

@@ -170,4 +170,11 @@
          left join ctop_project project on project.id = allocation.project_id
          where project.advertiser_id = #{adId}
     </select>
+    <select id="getAdvertiserByMap" resultType="com.alibaba.fastjson.JSONObject">
+        select id,name from ctop_advertiser
+        where id in
+        <foreach collection="ids" item="ids" separator="," open="(" close=")">
+            #{ids}
+        </foreach>
+    </select>
 </mapper>

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

@@ -180,11 +180,11 @@
 
     <select id="getProjectByAccountIds" resultType="java.lang.Long">
         SELECT
-            project_id
+        project_id
         FROM
-            ctop_user_allocation
+        ctop_user_allocation
         WHERE
-            account_id IN
+        account_id IN
         <foreach collection="accountIds" item="item" separator=","
                  open="(" close=")">
             #{item}
@@ -204,11 +204,13 @@
         <if test="userId !=null and userId!=''">
             and t1.user_id = #{userId}
         </if>
-        and t2.media_id in
-        <foreach collection="mediaIds" item="item" separator=","
-                 open="(" close=")">
-            #{item}
-        </foreach>
+        <if test="mediaIds != null and mediaIds.size() != 0 ">
+            and t2.media_id in
+            <foreach collection="mediaIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         group by t2.id
         order by t2.create_time desc
     </select>

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

@@ -17,5 +17,18 @@
             transferor_date &lt; #{endDate}
         order by transferor_date asc
     </select>
+    <select id="getListByMap" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        project_id as 'projectId',
+        count(1) as 'count'
+        from ctop_transfer_account
+        where status = 0
+        and project_id in
+        <foreach collection="ids" item="ids" separator="," open="(" close=")">
+            #{ids}
+        </foreach>
+        group by project_id
+
+    </select>
 
 </mapper>

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

@@ -3,10 +3,12 @@ package org.jeecg.modules.ctop.service;
 import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.vo.SheetInfoVo;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.text.ParseException;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 广告主信息表
@@ -27,4 +29,6 @@ public interface IAdvertiserService extends IService<Advertiser> {
     List<SheetInfoVo> getYdStatisticInfo(Long projectId, String startDate, String endDate) throws ParseException;
 
     List<UserAllocation> getAllocationsByAdvertiserId(String id);
+
+    List<JSONObject> getAdvertiserByMap(Map<String, String> advertiserIdMap);
 }

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

@@ -41,4 +41,6 @@ public interface IProjectMemberService extends IService<ProjectMember> {
     List<JSONObject> getProjectByUserIdAndMediaIds(String userId, List<Integer> mediaIds);
 
     List<Map<String, Object>> getAllProjectAccount(String mediaType);
+
+    List<ProjectMember> getMapsByProjectList(List<ProjectMember> projectMembers);
 }

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

@@ -1,5 +1,6 @@
 package org.jeecg.modules.ctop.service;
 
+import cn.com.ctop.common.module.entity.Project;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.ctop.entity.TransferAccount;
@@ -19,4 +20,5 @@ public interface ITransferAccountService extends IService<TransferAccount> {
 
     List<TransferAccount> getAccountQuarterDetail(Long accountId, String startDate, String endDate);
 
+    List<Project> getTransferInfoListByList(List<Project> records);
 }

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

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.entity.Advertiser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.vo.SheetInfoVo;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.common.util.DateUtils;
@@ -21,6 +22,7 @@ import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -114,6 +116,11 @@ public class AdvertiserServiceImpl extends ServiceImpl<AdvertiserMapper, Adverti
         return advertiserMapper.getAllocationsByAdvertiserId(adId);
     }
 
+    @Override
+    public List<JSONObject> getAdvertiserByMap(Map<String, String> advertiserIdMap) {
+        return advertiserMapper.getAdvertiserByMap(advertiserIdMap);
+    }
+
     private List<YdPlanAggregateEntity> getYdPlanStatisticInfo(Long projectId, String startDate, String endDate) {
         List<YdPlanAggregateEntity> result = new ArrayList<>();
         List<UserAllocation> allocations = userAllocationService.getByParams(projectId, null, null);

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

@@ -4,8 +4,7 @@ import cn.com.ctop.common.module.entity.Project;
 import cn.com.ctop.common.module.entity.SysUser;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
-import cn.com.ctop.common.module.service.ISysRoleExtService;
-import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import com.alibaba.fastjson.JSONArray;
@@ -17,6 +16,7 @@ import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.ctop.entity.ProjectMember;
 import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
+import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -42,6 +42,14 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
     private ISysRoleExtService sysRoleService;
     @Autowired
     private UserAllocationMapper userAllocationMapper;
+    @Autowired
+    private IProjectService projectService;
+    @Autowired
+    private ISysUserService userService;
+    @Autowired
+    private IAdvertiserService advertiserService;
+    @Autowired
+    private IProductService productService;
 
     private static final String[] PERMISSION_VIEW_PROJECT = {"admin", "saleDirector", "sale", "saleAssistant", "saleAm", "meidaManager"};
 
@@ -313,5 +321,98 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         return result;
     }
 
+    @Override
+    public List<ProjectMember> getMapsByProjectList(List<ProjectMember> projectMembers) {
+        if (Check.isNull(projectMembers)) {
+            return projectMembers;
+        }
+        JSONArray projectIdArray = new JSONArray();
+        if (!Check.isNull(projectMembers)) {
+            for (ProjectMember member : projectMembers) {
+                projectIdArray.add(member.getProjectId());
+            }
+        }
+        List<JSONObject> projectList = projectService.getProjectListByIds(projectIdArray);
+        if (Check.isNull(projectList)) {
+            return projectMembers;
+        }
+        Map<Long, JSONObject> projectMap = new HashMap<>();
+        for (int i = 0; i < projectList.size(); i++) {
+            JSONObject projectJson = projectList.get(i);
+            projectMap.put(projectJson.getLong("projectId"), projectJson);
+        }
+        Map<String, String> userIdMap = new HashMap<>();
+        Map<String, String> advertiserIdMap = new HashMap<>();
+        Map<Long, Long> productIdMap = new HashMap<>();
+        for (int i = 0; i < projectList.size(); i++) {
+            JSONObject projectJson = projectList.get(i);
+            if (!Check.isNull(projectJson.getString("responsibleId"))) {
+                userIdMap.put(projectJson.getString("responsibleId"), projectJson.getString("responsibleId"));
+            }
+            if (!Check.isNull(projectJson.getString("designResponsibleId"))) {
+                userIdMap.put(projectJson.getString("designResponsibleId"), projectJson.getString("designResponsibleId"));
+            }
+            if (!Check.isNull(projectJson.getString("advertiserId"))) {
+                advertiserIdMap.put(projectJson.getString("advertiserId"), projectJson.getString("advertiserId"));
+            }
+            if (!Check.isNull(projectJson.getLong("productId"))) {
+                productIdMap.put(projectJson.getLong("productId"), projectJson.getLong("productId"));
+            }
+        }
+        Map<String, String> userMap = new HashMap<>();
+        if (!Check.isNullMap(userIdMap)) {
+            userMap = userService.getUserMapByMap(userIdMap);
+        }
+
+        Map<String, String> advertiserMap = new HashMap<>();
+        if (!Check.isNullMap(advertiserIdMap)) {
+            List<JSONObject> advertiserList = advertiserService.getAdvertiserByMap(advertiserIdMap);
+            if (!Check.isNull(advertiserList)) {
+                for (int i = 0; i < advertiserList.size(); i++) {
+                    JSONObject advertiserJson = advertiserList.get(i);
+                    advertiserMap.put(advertiserJson.getString("id"), advertiserJson.getString("name"));
+                }
+            }
+        }
+        Map<Long, String> productMap = new HashMap<>();
+        if (!Check.isNullMap(productIdMap)) {
+            List<JSONObject> productList = productService.getProductByMap(productIdMap);
+            if (!Check.isNull(productList)) {
+                for (int i = 0; i < productList.size(); i++) {
+                    JSONObject productJson = productList.get(i);
+                    productMap.put(productJson.getLong("id"), productJson.getString("productName"));
+                }
+            }
+        }
+        for (ProjectMember member : projectMembers) {
+            Long projectId = member.getProjectId();
+            JSONObject projectJson = projectMap.get(projectId);
+            if (Check.isNull(projectJson)) {
+                continue;
+            }
+            member.setMediaId(projectJson.getString("mediaId"));
+            member.setMaxBid(projectJson.getLong("maxBid"));
+            String advertiserId = projectJson.getString("advertiserId");
+            member.setAdvertiserId(advertiserId);
+            if (!Check.isNullMap(advertiserMap)) {
+                member.setAdvertiserName(advertiserMap.get(advertiserId));
+            }
+            String responsibleId = projectJson.getString("responsibleId");
+            String designResponsibleId = projectJson.getString("designResponsibleId");
+            if (!Check.isNullMap(userMap)) {
+                member.setResponsibleName(userMap.get(responsibleId));
+                member.setDesignResponsibleName(userMap.get(designResponsibleId));
+            }
+            Long productId = projectJson.getLong("productId");
+            member.setProductId(productId);
+            if (!Check.isNullMap(productMap)) {
+                member.setProductName(productMap.get(productId));
+            }
+        }
+        return projectMembers;
+    }
 
 }
+
+
+

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

@@ -1,15 +1,23 @@
 package org.jeecg.modules.ctop.service.impl;
 
+import cn.com.ctop.common.module.entity.Project;
+import cn.com.ctop.common.module.service.IProductService;
+import cn.com.ctop.common.module.service.ISupplierListService;
+import cn.com.ctop.common.module.service.ISysUserService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.ctop.entity.TransferAccount;
 import org.jeecg.modules.ctop.mapper.TransferAccountMapper;
+import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.ctop.service.ITransferAccountService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 转户记录表
@@ -26,6 +34,15 @@ public class TransferAccountServiceImpl extends ServiceImpl<TransferAccountMappe
     @Autowired
     private TransferAccountMapper transferAccountMapper;
 
+    @Autowired
+    private ISysUserService userService;
+    @Autowired
+    private IAdvertiserService advertiserService;
+    @Autowired
+    private IProductService productService;
+    @Autowired
+    private ISupplierListService supplierListService;
+
     @Override
     public List<JSONObject> selectCost(Long accountId, String startDate, String endDate) {
         return dailyAccountMapper.selectCost(accountId, startDate, endDate);
@@ -37,4 +54,90 @@ public class TransferAccountServiceImpl extends ServiceImpl<TransferAccountMappe
         return transferAccountMapper.getAccountQuarterDetail(accountId, startDate, endDate);
     }
 
+    @Override
+    public List<Project> getTransferInfoListByList(List<Project> records) {
+        if (Check.isNull(records)) {
+            return records;
+        }
+        Map<String, String> supplierMap = supplierListService.getSupplierMap();
+        Map<Long, Long> projectIdMap = new HashMap<>();
+        Map<String, String> userIdMap = new HashMap<>();
+        Map<String, String> advertiserIdMap = new HashMap<>();
+        Map<Long, Long> productIdMap = new HashMap<>();
+        for (Project project : records) {
+            projectIdMap.put(project.getId(), project.getId());
+            if (!Check.isNull(project.getResponsibleId())) {
+                userIdMap.put(project.getResponsibleId(), project.getResponsibleId());
+            }
+            if (!Check.isNull(project.getDesignResponsibleId())) {
+                userIdMap.put(project.getDesignResponsibleId(), project.getDesignResponsibleId());
+            }
+            if (!Check.isNull(project.getSaleId())) {
+                userIdMap.put(project.getSaleId(), project.getSaleId());
+            }
+            if (!Check.isNull(project.getAdvertiserId())) {
+                advertiserIdMap.put(project.getAdvertiserId(), project.getAdvertiserId());
+            }
+            if (!Check.isNull(project.getProductId())) {
+                productIdMap.put(project.getProductId(), project.getProductId());
+            }
+        }
+        Map<String, String> userMap = new HashMap<>();
+        if (!Check.isNullMap(userIdMap)) {
+            userMap = userService.getUserMapByMap(userIdMap);
+        }
+
+        Map<String, String> advertiserMap = new HashMap<>();
+        if (!Check.isNullMap(advertiserIdMap)) {
+            List<JSONObject> advertiserList = advertiserService.getAdvertiserByMap(advertiserIdMap);
+            if (!Check.isNull(advertiserList)) {
+                for (int i = 0; i < advertiserList.size(); i++) {
+                    JSONObject advertiserJson = advertiserList.get(i);
+                    advertiserMap.put(advertiserJson.getString("id"), advertiserJson.getString("name"));
+                }
+            }
+        }
+        Map<Long, String> productMap = new HashMap<>();
+        if (!Check.isNullMap(productIdMap)) {
+            List<JSONObject> productList = productService.getProductByMap(productIdMap);
+            if (!Check.isNull(productList)) {
+                for (int i = 0; i < productList.size(); i++) {
+                    JSONObject productJson = productList.get(i);
+                    productMap.put(productJson.getLong("id"), productJson.getString("productName"));
+                }
+            }
+        }
+        Map<Long, Integer> transferMap = new HashMap<>();
+        if (!Check.isNullMap(projectIdMap)) {
+            List<JSONObject> transferList = transferAccountMapper.getListByMap(projectIdMap);
+            if (!Check.isNull(transferList)) {
+                for (int i = 0; i < transferList.size(); i++) {
+                    JSONObject transferJson = transferList.get(i);
+                    transferMap.put(transferJson.getLong("projectId"), transferJson.getInteger("count"));
+                }
+            }
+        }
+
+        for (Project project : records) {
+            if (!Check.isNullMap(advertiserMap)) {
+                project.setAdvertiserId_dictText(advertiserMap.get(project.getAdvertiserId()));
+            }
+            if (!Check.isNullMap(userMap)) {
+                project.setResponsibleId_dictText(userMap.get(project.getResponsibleId()));
+                project.setDesignResponsibleId_dictText(userMap.get(project.getDesignResponsibleId()));
+                project.setSaleId_dictText(userMap.get(project.getSaleId()));
+            }
+            if (!Check.isNullMap(productMap)) {
+                project.setProductId_dictText(productMap.get(project.getProductId()));
+            }
+            if (!Check.isNullMap(transferMap)) {
+                project.setNeedExamine(transferMap.get(project.getId()));
+            }
+            if (!Check.isNullMap(supplierMap)) {
+                project.setSupplierCode_dictText(supplierMap.get(project.getSupplierCode()));
+            }
+        }
+        return records;
+    }
+
 }

+ 43 - 19
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,31 @@ 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 {
+
+
+        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 +99,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 +495,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 +551,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 +575,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,20 +591,25 @@ 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(){
-        String startDate = "2021-01-01";
-        String endDate = "2021-01-31";
-        CtopOauthToken token = tokenService.getTokenByAccountId(9556227L);
-        kuaishouInterfaceService.getAdvertiserReportDaily(token, DateUtils.parseDate(startDate,"yyyy-MM-dd"), DateUtils.parseDate(endDate,"yyyy-MM-dd"));
+        Date startDate = DateUtils.parseDate("2020-09-11","yyyy-MM-dd");
+        for(int i=0;i<365;i++){
+//            dailyService.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate(DateUtils.addDay(startDate,i)));
+            videoEtlInfoService.etlKuaishouVideoInfo(DateUtils.formatDate(DateUtils.addDay(startDate,i)));
+        }
     }
+
 }

+ 15 - 17
module-common/src/main/java/cn/com/ctop/common/module/entity/Project.java

@@ -1,6 +1,5 @@
 package cn.com.ctop.common.module.entity;
 
-import cn.com.ctop.common.module.annotation.Dict;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -47,13 +46,11 @@ public class Project {
      */
     @Excel(name = "广告主id", width = 15)
     @ApiModelProperty(value = "广告主id")
-    @Dict(dicCode = "id", dictTable = "ctop_advertiser", dicText = "name")
     private String advertiserId;
 
 
     @Excel(name = "产品id", width = 15)
     @ApiModelProperty(value = "广告主id")
-    @Dict(dicCode = "id", dictTable = "ctop_product", dicText = "product_name")
     private Long productId;
 
     /**
@@ -67,13 +64,11 @@ public class Project {
      */
     @Excel(name = "负责人id", width = 15)
     @ApiModelProperty(value = "负责人id")
-    @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
     private String responsibleId;
 
 
     @Excel(name = "设计负责人", width = 15)
     @ApiModelProperty(value = "设计负责人")
-    @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
     private String designResponsibleId;
 
 
@@ -94,14 +89,8 @@ public class Project {
 
     private String supplierCode;
 
-    /**
-     * 销售
-     */
-    @TableField(exist = false)
-    private String supplierCode_dictText;
 
     // 销售
-    @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
     private String saleId;
     /**
      * 最高深度转化出价
@@ -125,15 +114,24 @@ public class Project {
     @ApiModelProperty(value = "修改时间")
     private Date updateTime;
 
-    @TableField(exist = false)
-    private Integer needExamine;
+
     private String bidType;
     private String ocpxActionType;
 
-   /* @TableField(exist = false)
-    private String responsibleName; // 运营负责人
+    @TableField(exist = false)
+    private String responsibleId_dictText; // 运营负责人
 
+    @TableField(exist = false)
+    private String saleId_dictText; // 销售
 
-    private String designResponsibleName; // 产品负责人
-*/
+    @TableField(exist = false)
+    private String designResponsibleId_dictText; // 设计负责人
+    @TableField(exist = false)
+    private String advertiserId_dictText; // 广告主名称
+    @TableField(exist = false)
+    private String productId_dictText; // 产品名称
+    @TableField(exist = false)
+    private Integer needExamine;
+    @TableField(exist = false)
+    private String supplierCode_dictText;
 }

+ 6 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/ProductMapper.java

@@ -1,9 +1,13 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.Product;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 产品表
  *
@@ -14,4 +18,6 @@ import org.apache.ibatis.annotations.Param;
 public interface ProductMapper extends BaseMapper<Product> {
 
     String getUserNameByUserId(@Param("userId") String userId);
+
+    List<JSONObject> getProductByMap(@Param("ids") Map<Long, Long> productIdMap);
 }

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

@@ -1,10 +1,14 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.Project;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 项目
  *
@@ -19,4 +23,8 @@ public interface ProjectMapper extends BaseMapper<Project> {
     JSONObject getWarningInfoByProjectId(@Param("projectId") Long projectId);
 
     String querySupplierCodeById(@Param("projectId") Long projectId);
+
+    List<JSONObject> getProjectListByIds(@Param("ids") JSONArray projectIdArray);
+
+    List<JSONObject> getListByMap(@Param("ids") Map<Long, Long> projectIdMap);
 }

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

@@ -1,8 +1,11 @@
 package cn.com.ctop.common.module.mapper;
 
 import cn.com.ctop.common.module.entity.SupplierList;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * 供应商列表
  *
@@ -12,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface SupplierListMapper extends BaseMapper<SupplierList> {
 
+    List<JSONObject> getSupplierMap();
 }

+ 5 - 2
module-common/src/main/java/cn/com/ctop/common/module/mapper/SysUserMapper.java

@@ -25,6 +25,7 @@ import java.util.Map;
  */
 public interface SysUserMapper extends BaseMapper<SysUser> {
     List<SysUser> selectAllUser();
+
     List<SysUser> selectAllDesigner();
 
     /**
@@ -161,7 +162,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
 
     Map<String, Object> queryRoleCode(@Param("userId") String userId);
 
-    List<SysUserVo> getAllUser(@Param("userName") String userName,@Param("status") String status);
+    List<SysUserVo> getAllUser(@Param("userName") String userName, @Param("status") String status);
 
     List<SysUserVo> getUserListByCompany(@Param("companyId") String companyId, @Param("userName") String userName);
 
@@ -171,7 +172,9 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
 
     JSONObject selectUserByAccount(@Param("accountId") Long accountId);
 
-    SysUser getDesignerTeamLeaderBy(@Param("orgCode")String orgCode);
+    SysUser getDesignerTeamLeaderBy(@Param("orgCode") String orgCode);
 
     List<SysUser> queryPageList(SysUser user);
+
+    List<JSONObject> getUserMapByMap(@Param("ids") Map<String, String> userIdMap);
 }

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

@@ -6,5 +6,15 @@
      select  realname  from sys_user
      where  id = #{userId}
     </select>
+    <select id="getProductByMap" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        id as 'id',
+        product_name as 'productName'
+        from ctop_product
+        where id in
+        <foreach collection="ids" item="ids" separator="," open="(" close=")">
+            #{ids}
+        </foreach>
+    </select>
 
 </mapper>

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

@@ -24,5 +24,35 @@
     <select id="querySupplierCodeById" resultType="java.lang.String">
         select supplier_code from ctop_project where id=#{projectId}
     </select>
+    <select id="getProjectListByIds" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        id as 'projectId',
+        advertiser_id as 'advertiserId',
+        product_id as 'productId',
+        responsible_id as 'responsibleId',
+        design_responsible_id as 'designResponsibleId',
+        media_id as 'mediaId',
+        max_bid as 'maxBid'
+        from ctop_project
+        where id in
+        <foreach collection="ids" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+        group by id
+
+
+    </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>

+ 6 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SupplierListMapper.xml

@@ -2,4 +2,10 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.common.module.mapper.SupplierListMapper">
 
+    <select id="getSupplierMap" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        supplier_code as 'code',
+        supplier_name as 'name'
+        from ctop_supplier_list
+    </select>
 </mapper>

+ 8 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/SysUserMapper.xml

@@ -100,7 +100,7 @@ SELECT
         <if test="userName != null and userName != ''">
             and t1.realname like concat(concat('%',#{userName}),'%')
         </if>
-          <if test="status != null and status != ''">
+        <if test="status != null and status != ''">
             and t1.status =#{status}
             AND t1.del_flag = 0
         </if>
@@ -312,5 +312,12 @@ SELECT
             AND t1.sex =#{sex}
         </if>
     </select>
+    <select id="getUserMapByMap" resultType="com.alibaba.fastjson.JSONObject">
+        select id,realname from sys_user
+        where id in
+        <foreach collection="ids" item="ids" separator="," open="(" close=")">
+            #{ids}
+        </foreach>
+    </select>
 
 </mapper>

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

@@ -1,8 +1,12 @@
 package cn.com.ctop.common.module.service;
 
 import cn.com.ctop.common.module.entity.Product;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * @Description: 产品表
  * @Author: jeecg-boot
@@ -12,4 +16,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
 public interface IProductService extends IService<Product> {
 
     String getUserNameByUserId(String userId);
+
+    List<JSONObject> getProductByMap(Map<Long, Long> productIdMap);
 }

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

@@ -1,9 +1,12 @@
 package cn.com.ctop.common.module.service;
 
 import cn.com.ctop.common.module.entity.Project;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 项目
@@ -19,4 +22,9 @@ public interface IProjectService extends IService<Project> {
     String getNameByAccountId(Long accountId);
 
     String getSupplierCodeById(Long projectId);
+
+    List<JSONObject> getProjectListByIds(JSONArray projectIdArray);
+
+
+    Map<Long, String> getProjectMap(Map<Long, Long> projectIdMap);
 }

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

@@ -3,6 +3,8 @@ package cn.com.ctop.common.module.service;
 import cn.com.ctop.common.module.entity.SupplierList;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.Map;
+
 /**
  * 供应商列表
  *
@@ -12,4 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ISupplierListService extends IService<SupplierList> {
 
+    Map<String, String> getSupplierMap();
 }

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

@@ -71,6 +71,7 @@ public interface ISysUserService extends IService<SysUser> {
     public SysUser getUserByName(String username);
 
     SysUser getUserByRealName(String realname);
+
     /**
      * 添加用户和用户角色关系
      *
@@ -259,11 +260,13 @@ public interface ISysUserService extends IService<SysUser> {
      */
     List<SysUser> queryByDepIds(List<String> departIds, String username);
 
-    List<SysUserVo> getAllUser(String userName,String status);
+    List<SysUserVo> getAllUser(String userName, String status);
 
     List<SysUser> getAllDesigner();
 
     SysUser getDesignerTeamLeaderBy(String orgCode);
 
     List<SysUser> queryPageList(SysUser user);
+
+    Map<String, String> getUserMapByMap(Map<String, String> userIdMap);
 }

+ 9 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/ProductServiceImpl.java

@@ -3,10 +3,14 @@ package cn.com.ctop.common.module.service.impl;
 import cn.com.ctop.common.module.entity.Product;
 import cn.com.ctop.common.module.mapper.ProductMapper;
 import cn.com.ctop.common.module.service.IProductService;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 产品表
  *
@@ -23,4 +27,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
     public String getUserNameByUserId(String userId) {
         return productMapper.getUserNameByUserId(userId);
     }
+
+    @Override
+    public List<JSONObject> getProductByMap(Map<Long, Long> productIdMap) {
+        return productMapper.getProductByMap(productIdMap);
+    }
 }

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

@@ -3,12 +3,17 @@ 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;
 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;
 
 /**
  * 项目
@@ -40,4 +45,24 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     public String getSupplierCodeById(Long projectId) {
         return projectMapper.querySupplierCodeById(projectId);
     }
+
+    @Override
+    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;
+    }
 }

+ 21 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/SupplierListServiceImpl.java

@@ -3,9 +3,16 @@ package cn.com.ctop.common.module.service.impl;
 import cn.com.ctop.common.module.entity.SupplierList;
 import cn.com.ctop.common.module.mapper.SupplierListMapper;
 import cn.com.ctop.common.module.service.ISupplierListService;
+import cn.com.ctop.common.module.utils.Check;
+import com.alibaba.fastjson.JSONObject;
 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;
+
 /**
  * 供应商列表
  *
@@ -15,5 +22,19 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class SupplierListServiceImpl extends ServiceImpl<SupplierListMapper, SupplierList> implements ISupplierListService {
+    @Autowired
+    private SupplierListMapper supplierListMapper;
 
+    @Override
+    public Map<String, String> getSupplierMap() {
+        Map<String, String> map = new HashMap<>();
+        List<JSONObject> list = supplierListMapper.getSupplierMap();
+        if (!Check.isNull(list)) {
+            for (int i = 0; i < list.size(); i++) {
+                JSONObject json = list.get(i);
+                map.put(json.getString("code"), json.getString("name"));
+            }
+        }
+        return map;
+    }
 }

+ 22 - 3
module-common/src/main/java/cn/com/ctop/common/module/service/impl/SysUserServiceImpl.java

@@ -3,9 +3,12 @@ package cn.com.ctop.common.module.service.impl;
 import cn.com.ctop.common.module.entity.*;
 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;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -15,7 +18,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CacheConstant;
 import org.jeecg.common.constant.CommonConstant;
-import cn.com.ctop.common.module.service.ISysBaseApi;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.system.vo.SysUserCacheInfo;
 import org.jeecg.common.util.PasswordUtil;
@@ -268,8 +270,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     }
 
     @Override
-    public List<SysUserVo> getAllUser(String userName,String status) {
-        return userMapper.getAllUser(userName,status);
+    public List<SysUserVo> getAllUser(String userName, String status) {
+        return userMapper.getAllUser(userName, status);
     }
 
     @Override
@@ -288,6 +290,23 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     }
 
     @Override
+    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
     public Map<String, String> getDepNamesByUserIds(List<String> userIds) {
         List<SysUserDepVo> list = this.baseMapper.getDepNamesByUserIds(userIds);
         Map<String, String> res = new HashMap<String, String>();

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

@@ -2,6 +2,7 @@ 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.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import com.xxl.job.core.context.XxlJobHelper;
@@ -10,6 +11,7 @@ import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
 import java.util.Date;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
@@ -24,7 +26,8 @@ public class BytedanceDailyMaterialReportJob {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IBytedanceReportService bytedanceReportService;
-
+    @Resource
+    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
     @XxlJob("bytedanceDailyMaterialReportJob")
     public void execute() throws Exception {
         Date getDate2 = DateUtils.addDay(new Date(), -2);
@@ -54,6 +57,9 @@ public class BytedanceDailyMaterialReportJob {
                         bytedanceReportService.bytedanceVideoMaterialReport(token, date2, date2);
                         bytedanceReportService.bytedanceVideoMaterialReport(token, date, date);
                         XxlJobHelper.log("账户"+token.getAccountId() + "素材报表数据任务完成,任务时间:" + date + "~" + date2);
+                        bytedanceReportMaterialDailyMapper.updateImageReportCode(token.getAccountId());
+                        bytedanceReportMaterialDailyMapper.updateImageReportProjectId(token.getAccountId());
+                        bytedanceReportMaterialDailyMapper.updateImageReportProjectName(token.getAccountId());
                     } catch (Exception e) {
                         e.printStackTrace();
                     } finally {

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

+ 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("快手物料数据同步完成");
     }

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

+ 3 - 3
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouVideoRelateCreativesJob.java

@@ -82,16 +82,16 @@ public class KuaishouVideoRelateCreativesJob {
         if (!Check.isNull(KuaiShouVideoGets)) {
             JSONArray dateList = new JSONArray();
             JSONArray photoIds = new JSONArray();
-            Map<String, Object> statdateMap = new HashMap<>();
+            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.getStatDate());
+                    statdateMap.put(video.getPhotoId(), video);
                 } else {
                     photoIds.add(video.getPhotoId());
-                    statdateMap.put(video.getPhotoId(), video.getStatDate());
+                    statdateMap.put(video.getPhotoId(), video);
                     dateList.add(photoIds);
                     photoIds = new JSONArray();
                     count = 0;

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

@@ -93,6 +93,7 @@ public class KuaiShouMaterialControer {
                 throw new Exception("未获取账号授权信息");
             }
             String appVersion = requestJson.getString("appVersion");
+            Integer channelType = requestJson.getInteger("channelType");
             KuaiShouVideoLastTime videoLastTime = lastTimeService.getById(accountId);
             Date startTime;
             Date endDate = new Date();
@@ -108,6 +109,9 @@ public class KuaiShouMaterialControer {
             if (!Check.isNull(appVersion)) {
                 requestMap.put("appVersion", appVersion);
             }
+            if (!Check.isNull(channelType)) {
+                requestMap.put("channelType", channelType);
+            }
             List<JSONObject> materialList = videoGetService.getVideoListByMap(requestMap);
             if (!Check.isNull(materialList)) {
                 for (int i = 0; i < materialList.size(); i++) {
@@ -171,6 +175,7 @@ public class KuaiShouMaterialControer {
                 throw new Exception("请输入查询条数");
             }
             String appVersion = requestJson.getString("appVersion");
+            Integer channelType = requestJson.getInteger("channelType");
             Map<String, Object> requestMap = new HashMap<>();
             requestMap.put("startTime", startDate);
             requestMap.put("endTime", endDate);
@@ -180,6 +185,9 @@ public class KuaiShouMaterialControer {
             if (!Check.isNull(appVersion)) {
                 requestMap.put("appVersion", appVersion);
             }
+            if (!Check.isNull(channelType)) {
+                requestMap.put("channelType", channelType);
+            }
             List<JSONObject> materialList = relateCreativesService.getVideoListByMap(requestMap);
             if (!Check.isNull(materialList)) {
                 materialList = videoGetService.getVideoInfoAndImageList(materialList);
@@ -234,10 +242,14 @@ public class KuaiShouMaterialControer {
             requestMap.put("startDate", startDate);
             requestMap.put("endDate", endDate);
             requestMap.put("accountId", accountId);
+            Integer channelType = requestJson.getInteger("channelType");
             requestMap.put("num", num);
             if (!Check.isNull(appVersion)) {
                 requestMap.put("appVersion", appVersion);
             }
+            if (!Check.isNull(channelType)) {
+                requestMap.put("channelType", channelType);
+            }
             List<JSONObject> materialList = relateCreativesService.getHistoryTopVideoList(requestMap);
             if (!Check.isNull(materialList)) {
                 materialList = videoGetService.getVideoInfoAndImageList(materialList);
@@ -289,6 +301,7 @@ public class KuaiShouMaterialControer {
                 throw new Exception("请输入查询结束时间");
             }
             String appVersion = requestJson.getString("appVersion");
+            Integer channelType = requestJson.getInteger("channelType");
             Map<String, Object> requestMap = new HashMap<>();
             requestMap.put("startTime", startTime);
             requestMap.put("endTime", endTime);
@@ -297,6 +310,9 @@ public class KuaiShouMaterialControer {
             if (!Check.isNull(appVersion)) {
                 requestMap.put("appVersion", appVersion);
             }
+            if (!Check.isNull(channelType)) {
+                requestMap.put("channelType", channelType);
+            }
             List<JSONObject> materialList = relateCreativesService.getVideoZeroListByMap(requestMap);
             if (!Check.isNull(materialList)) {
                 materialList = videoGetService.getVideoInfoAndImageList(materialList);

+ 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

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

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

@@ -0,0 +1,228 @@
+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 com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+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;
+
+    /**
+     * 获取创意监测链接
+     *
+     * @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) {
+                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) {

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

@@ -46,6 +46,9 @@ public class KuaishouVideoRelateCreatives {
     @Excel(name = "视频id", width = 15)
     @ApiModelProperty(value = "视频id")
     private Long photoId;
+
+    private Integer channelType;
+
     private Date statDate;
     /**
      * 与此视频id关联的创意总数

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

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

@@ -115,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>
@@ -139,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>

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

@@ -112,6 +112,9 @@
         <if test="endTime != null and endTime != '' ">
             and stat_date &lt;= #{endTime}
         </if>
+        <if test="channelType != null and channelType != '' ">
+            and channel_type = #{channelType}
+        </if>
         <if test="appVersion != null and appVersion != '' ">
             and photo_name like concat(#{appVersion},'%')
         </if>
@@ -163,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>

+ 13 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouVideoRelateCreativesMapper.xml

@@ -7,7 +7,8 @@
         account_id,
         photo_id,
         creative_count,
-        stat_date
+        stat_date,
+        channel_type
         )
         values
         <foreach collection="videolist" item="video" separator=",">
@@ -15,7 +16,8 @@
             #{video.accountId},
             #{video.photoId},
             #{video.creativeCount},
-            #{video.statDate}
+            #{video.statDate},
+            #{video.channelType}
             )
         </foreach>
     </insert>
@@ -40,6 +42,9 @@
         <if test="endTime != null and endTime != '' ">
             and t1.stat_date &lt;= #{endTime}
         </if>
+        <if test="channelType != null and channelType != '' ">
+            and t1.channel_type = #{channelType}
+        </if>
         <if test="appVersion != null and appVersion != '' ">
             and t1.photo_id in (
             select photo_id from ctop_kuaishou_video_get
@@ -68,6 +73,9 @@
         <if test="endTime != null and endTime != '' ">
             AND stat_date &lt;= #{endTime}
         </if>
+        <if test="channelType != null and channelType != '' ">
+            and channel_type = #{channelType}
+        </if>
         <if test="appVersion != null and appVersion != '' ">
             and photo_id in (
             select photo_id from ctop_kuaishou_video_get
@@ -104,6 +112,9 @@
         <if test="appVersion != null and appVersion != '' ">
             and photo_name like concat(#{appVersion},'%')
         </if>
+        <if test="channelType != null and channelType != '' ">
+            and channel_type = #{channelType}
+        </if>
         and status = 0
         and signature is not null
         )

+ 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 - 9
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);
 
     /**
      * 组时报
@@ -284,14 +283,7 @@ 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 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouVideoRelateCreativesService.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.batch.service;
 
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouVideoRelateCreatives;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -19,7 +20,7 @@ public interface IKuaishouVideoRelateCreativesService extends IService<KuaishouV
 
     Result pushVideo(JSONObject data);
 
-    void videoRelateCreatives(Long accountId, JSONArray photoIds, Map<String, Object> statdateMap);
+    void videoRelateCreatives(Long accountId, JSONArray photoIds, Map<String, KuaiShouVideoGet> statdateMap);
 
     List<JSONObject> getVideoListByMap(Map<String, Object> requestMap);
 

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

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

@@ -505,90 +505,7 @@ 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) {

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

@@ -6,6 +6,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.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.IKuaishouVideoRelateCreativesService;
@@ -102,7 +103,7 @@ public class KuaishouVideoRelateCreativesServiceImpl extends ServiceImpl<Kuaisho
      * @author ZHAOXA
      */
     @Override
-    public void videoRelateCreatives(Long accountId, JSONArray photoIds, Map<String, Object> statdateMap) {
+    public void videoRelateCreatives(Long accountId, JSONArray photoIds, Map<String, KuaiShouVideoGet> statdateMap) {
         try {
             CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
             for (int i = 0; i < photoIds.size(); i++) {
@@ -128,7 +129,9 @@ public class KuaishouVideoRelateCreativesServiceImpl extends ServiceImpl<Kuaisho
                                 k.setAccountId(accountId);
                                 k.setPhotoId(object.getLong("photo_id"));
                                 k.setCreativeCount(object.getInteger("creative_count"));
-                                k.setStatDate((Date) statdateMap.get(object.getString("photo_id")));
+                                KuaiShouVideoGet shouVideoGet = statdateMap.get(object.getString("photo_id"));
+                                k.setStatDate(shouVideoGet.getStatDate());
+                                k.setChannelType(shouVideoGet.getChannelType());
                                 videolist.add(k);
                             }
                             kuaishouVideoRelateCreativesMapper.insertBatch(videolist);

+ 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("文件导入失败!");
+    }
+
+}

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

@@ -0,0 +1,332 @@
+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 = "/getMaxChargeAccountId")
+    public Result<Object> getMaxChargeAccountId(Long accountId,String userId) {
+        try {
+            return etlKuaishouReportAccountHourlyService.getMaxChargeAccountId(accountId,userId);
+        } 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("文件导入失败!");
+    }
+
+}

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

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

@@ -0,0 +1,320 @@
+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 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%;
+}

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

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

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

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

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

@@ -0,0 +1,27 @@
+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);
+
+    Long getMaxChargeAccountId(@Param("userId") String userId);
+}

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

@@ -0,0 +1,27 @@
+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, @Param("hour") Integer hour);
+
+    List<JSONObject> getOnedayEtlReportList(@Param("startTime") String startTime, @Param("accountId") Long accountId,@Param("value") String value,@Param("type") String type);
+
+}

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

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

@@ -1,6 +1,7 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
 import cn.com.ctop.common.module.vo.KuaishouReportAccountDailyDTOEntity;
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountDaily;
 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;
@@ -50,4 +51,6 @@ public interface KuaishouReportDailyAccountMapper extends BaseMapper<KuaishouRep
     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);
+
+    List<EtlKuaishouReportAccountDaily> queryEveryDayDataForAccount();
 }

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

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

@@ -1,5 +1,6 @@
 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;
@@ -13,4 +14,6 @@ public interface KuaishouReportHourlyAccountMapper extends BaseMapper<KuaishouRe
     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,
+        ROUND(t1.charge/activation,2) as 'activationCost',
+        bid,
+        bid_type as 'bidType',
+        unit_status as 'unitStatus',
+        activation,
+        ROUND((t1.charge-t2.charge)/t2.charge*100,2) '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 = 1
+        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>

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

@@ -0,0 +1,159 @@
+<?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}
+    </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 &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 stat_date,${type}
+        order by stat_date
+    </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
+        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 stat_date,ad_scene
+        order by stat_date
+    </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
+        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
+    </select>
+</mapper>

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

@@ -0,0 +1,263 @@
+<?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.EtlKuaishouReportAccountDailyMapper">
+    <insert id="replaceBatch">
+        replace into ctop_etl_kuaishou_report_account_daily(
+        stat_date,
+        account_id,
+        charge,
+        photo_show,
+        photo_click,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay,
+        event_pay_purchase_amount,
+        event_register,
+        event_jin_jian_app,
+        event_credit_grant_app,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_jin_jian_landing_page,
+        event_credit_grant_landing_page,
+        event_next_day_stay,
+        form_count,
+        play_3s_count
+        )
+        values
+        <foreach collection="list" item="appInfo" separator=",">
+            (
+            #{appInfo.statDate},
+            #{appInfo.accountId},
+            #{appInfo.charge},
+            #{appInfo.photoShow},
+            #{appInfo.photoClick},
+            #{appInfo.aclick},
+            #{appInfo.bclick},
+            #{appInfo.photoShare},
+            #{appInfo.photoComment},
+            #{appInfo.photoLike},
+            #{appInfo.follow},
+            #{appInfo.cancelFollow},
+            #{appInfo.report},
+            #{appInfo.block},
+            #{appInfo.negative},
+            #{appInfo.downloadStarted},
+            #{appInfo.downloadCompleted},
+            #{appInfo.activation},
+            #{appInfo.submit},
+            #{appInfo.eventPayFirstDay},
+            #{appInfo.eventPayPurchaseAmountFirstDay},
+            #{appInfo.eventPay},
+            #{appInfo.eventPayPurchaseAmount},
+            #{appInfo.eventRegister},
+            #{appInfo.eventJinJianApp},
+            #{appInfo.eventCreditGrantApp},
+            #{appInfo.eventOrderPaid},
+            #{appInfo.eventOrderPaidPurchaseAmount},
+            #{appInfo.eventJinJianLandingPage},
+            #{appInfo.eventCreditGrantLandingPage},
+            #{appInfo.eventNextDayStay},
+            #{appInfo.formCount},
+            #{appInfo.play3sCount}
+            )
+        </foreach>
+    </insert>
+
+
+    <select id="getOnedayAggregatebyDaily"
+            resultType="cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly">
+        SELECT stat_date,
+               IFNULL(SUM(charge), 0) as 'charge',
+               SUM(photo_show) as 'photoShow',
+               SUM(photo_click) as 'photoClick',
+               SUM(aclick) as 'aclick',
+               SUM(bclick) as 'bclick',
+               SUM(photo_share) as 'photoShare',
+               SUM(photo_comment) as 'photoComment',
+               SUM(photo_like) as 'photoLike',
+               SUM(follow) as 'follow',
+               SUM(cancel_follow) as 'cancelFollow',
+               SUM(report) as 'report',
+               SUM(block) as 'block',
+               SUM(negative) as 'negative',
+               SUM(download_started) as 'downloadStarted',
+               SUM(download_completed) as 'downloadCompleted',
+               SUM(activation) as 'activation',
+               SUM(submit) as 'submit',
+               SUM(event_pay_first_day) as 'eventPayFirstDay',
+               SUM(event_pay_purchase_amount_first_day) as 'eventPayPurchaseAmountFirstDay',
+               SUM(event_pay) as 'eventPay',
+               SUM(event_pay_purchase_amount) as 'eventPayPurchaseAmount',
+               SUM(event_register) as 'eventRegister',
+               SUM(event_jin_jian_app) as 'eventJinJianApp',
+               SUM(event_credit_grant_app) as 'eventCreditGrantApp',
+               SUM(event_order_paid) as 'eventOrderPaid',
+               SUM(event_order_paid_purchase_amount) as 'eventOrderPaidPurchaseAmount',
+               SUM(event_jin_jian_landing_page) as 'eventJinJianLandingPage',
+               SUM(event_credit_grant_landing_page) as 'eventCreditGrantLandingPage',
+               SUM(event_next_day_stay) as 'eventNextDayStay',
+               SUM(form_count) as 'formCount',
+               IFNULL(ROUND(SUM(charge) / SUM(activation), 2), 0) as 'activationCost',
+               IFNULL(ROUND(SUM(charge) / SUM(activation) * 1000, 2), 0) as 'impression1kCost',
+               IFNULL(ROUND(SUM(charge) / SUM(photo_click), 2), 0) as 'photoClickCost',
+               IFNULL(ROUND(SUM(charge) / SUM(bclick), 2), 0) as 'actionCost',
+               IFNULL(ROUND(SUM(charge) / SUM(download_started), 2), 0) as 'downloadStartedCost',
+               IFNULL(ROUND(SUM(charge) / SUM(download_completed), 2), 0) as 'downloadCompletedCost',
+               IFNULL(ROUND(SUM(charge) / SUM(form_count), 2), 0) as 'formCost',
+               IFNULL(ROUND(SUM(charge) / SUM(event_pay_first_day), 2), 0) as 'eventPayFirstDayCost',
+               IFNULL(ROUND(SUM(charge) / SUM(event_pay), 2), 0) as 'eventPayCost',
+               IFNULL(ROUND(SUM(charge) / SUM(event_register), 2), 0) as 'eventRegisterCost',
+               IFNULL(ROUND(SUM(charge) / SUM(event_next_day_stay), 2), 0) as 'eventNextDayStayCost',
+               IFNULL(ROUND(SUM(charge) / SUM(event_jin_jian_app), 2), 0) as 'eventJinJianAppCost',
+               IFNULL(ROUND(SUM(charge) / SUM(event_credit_grant_app), 2), 0) as 'eventCreditGrantAppCost',
+               IFNULL(ROUND(SUM(charge) / SUM(event_jin_jian_landing_page), 2), 0) as 'eventJinJianLandingPageCost',
+               IFNULL(ROUND(SUM(charge) / SUM(event_credit_grant_landing_page), 2),
+                      0) as 'eventCreditGrantLandingPageCost',
+               IFNULL(ROUND(SUM(charge) / SUM(submit), 2), 0) as 'submitCost',
+               IFNULL(ROUND(SUM(event_pay_purchase_amount_first_day) / SUM(charge) * 100, 2),
+                      0) as 'eventPayFirstDayRoi',
+               IFNULL(ROUND(SUM(event_pay_purchase_amount) / SUM(charge) * 100, 2), 0) as 'eventPayRoi',
+               IFNULL(ROUND(SUM(bclick) / SUM(activation) * 100, 2), 0) as 'actionRatio',
+               IFNULL(ROUND(SUM(photo_click) / SUM(photo_show) * 100, 2), 0) as 'photoClickRatio',
+               IFNULL(ROUND(SUM(download_started) / SUM(bclick) * 100, 2), 0) as 'downloadStartedRatio',
+               IFNULL(ROUND(SUM(download_completed) / SUM(download_started) * 100, 2), 0) as 'downloadCompletedRatio',
+               IFNULL(ROUND(SUM(activation) / SUM(download_completed) * 100, 2), 0) as 'activationRatio',
+               IFNULL(ROUND(SUM(event_register) / SUM(activation) * 100, 2), 0) as 'eventRegisterRatio',
+               IFNULL(ROUND(SUM(event_next_day_stay) / SUM(activation) * 100, 2), 0) as 'eventNextDayStayRatio',
+               IFNULL(ROUND(SUM(event_credit_grant_app) / SUM(event_jin_jian_app) * 100, 2),
+                      0) as 'eventCreditGrantAppRatio',
+               IFNULL(ROUND(SUM(form_count) / SUM(bclick) * 100, 2), 0) as 'formActionRatio',
+               IFNULL(ROUND(SUM(submit) / SUM(bclick) * 100, 2), 0) as 'submitRatio'
+        FROM ctop_etl_kuaishou_report_account_daily
+        WHERE account_id = #{accountId}
+          AND stat_date &gt;= #{startTime}
+          AND stat_date &lt;= #{endTime}
+    </select>
+
+
+    <select id="getOnedayEtlReportList" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT
+        <if test="type == 'alone'">
+            ${value} as 'value',
+        </if>
+        <if test="type == 'more'">
+            <if test="value == 'activationCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(activation), 2), 0) as 'value',
+            </if>
+            <if test="value == 'impression1kCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(aclick) * 1000, 2), 0) as 'value',
+            </if>
+            <if test="value == 'photoClickCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(photo_click), 2), 0) as 'value',
+            </if>
+            <if test="value == 'actionCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(bclick), 2), 0) as 'value',
+            </if>
+            <if test="value == 'play3sRatio'">
+                IFNULL(ROUND(SUM(play_3s_count) / SUM(photo_show) * 100, 2), 0) as 'value',
+            </if>
+            <if test="value == 'downloadStartedCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(download_started), 2), 0) as 'value',
+            </if>
+            <if test="value == 'downloadCompletedCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(download_completed), 2), 0) as 'value',
+            </if>
+            <if test="value == 'formCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(form_count), 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventPayFirstDayCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(event_pay_first_day), 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventPayCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(event_pay), 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventRegisterCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(event_register), 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventNextDayStayCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(event_next_day_stay), 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventJinJianAppCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(event_jin_jian_app), 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventCreditGrantAppCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(event_credit_grant_app), 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventJinJianLandingPageCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(event_jin_jian_landing_page), 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventCreditGrantLandingPageCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(event_credit_grant_landing_page), 2), 0) as 'value',
+            </if>
+            <if test="value == 'submitCost'">
+                IFNULL(ROUND(SUM(charge) / SUM(submit), 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventPayFirstDayRoi'">
+                IFNULL(ROUND(SUM(event_pay_purchase_amount_first_day) / SUM(charge) * 100, 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 == 'actionRatio'">
+                IFNULL(ROUND(SUM(bclick) / SUM(aclick) * 100, 2), 0) as 'value',
+            </if>
+            <if test="value == 'photoClickRatio'">
+                IFNULL(ROUND(SUM(photo_click) / SUM(photo_show) * 100, 2), 0) as 'value',
+            </if>
+            <if test="value == 'downloadStartedRatio'">
+                IFNULL(ROUND(SUM(download_started) / SUM(bclick) * 100, 2), 0) as 'value',
+            </if>
+            <if test="value == 'downloadCompletedRatio'">
+                IFNULL(ROUND(SUM(download_completed) / SUM(download_started) * 100, 2), 0) as 'value',
+            </if>
+            <if test="value == 'activationRatio'">
+                IFNULL(ROUND(SUM(activation) / SUM(download_completed) * 100, 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventRegisterRatio'">
+                IFNULL(ROUND(SUM(event_register) / SUM(activation) * 100, 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventNextDayStayRatio'">
+                IFNULL(ROUND(SUM(event_next_day_stay) / SUM(activation) * 100, 2), 0) as 'value',
+            </if>
+            <if test="value == 'eventCreditGrantAppRatio'">
+                IFNULL(ROUND(SUM(event_credit_grant_app) / SUM(event_jin_jian_app) * 100, 2), 0) as 'value',
+            </if>
+            <if test="value == 'formActionRatio'">
+                IFNULL(ROUND(SUM(form_count) / SUM(bclick) * 100, 2), 0) as 'value',
+            </if>
+            <if test="value == 'submitRatio'">
+                IFNULL(ROUND(SUM(submit) / SUM(bclick) * 100, 2), 0) as 'value',
+            </if>
+        </if>
+        stat_date as 'statDate'
+        FROM ctop_etl_kuaishou_report_account_daily
+        WHERE account_id = #{accountId}
+        AND stat_date &gt;= #{startTime}
+        AND stat_date &lt;= #{endTime}
+        group by stat_date
+    </select>
+
+
+    <select id="getMaxChargeAccountId" resultType="java.lang.Long">
+        SELECT t1.account_id
+        FROM ctop_user_allocation t1
+                 INNER JOIN ctop_kuaishou_report_hourly_account t2 ON t1.account_id = t2.account_id
+        where t2.stat_date = DATE_FORMAT(now(), '%Y-%m-%d')
+          AND t1.user_id = #{userId}
+        order by charge desc limit 1
+    </select>
+</mapper>

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


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.