浏览代码

代码合并

syh 4 年之前
父节点
当前提交
a9499d9bd4
共有 75 个文件被更改,包括 2159 次插入300 次删除
  1. 0 5
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java
  2. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  3. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/JhsBakendDataController.java
  4. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouChannelRegInfoController.java
  5. 4 18
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  6. 64 18
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  7. 25 16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/ProjectMemberMapper.xml
  8. 53 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  9. 7 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java
  10. 39 73
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  11. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java
  12. 29 10
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml
  13. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java
  14. 26 8
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java
  15. 0 4
      module-common/src/main/java/cn/com/ctop/common/module/utils/LoadFileUtil.java
  16. 0 3
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BaseReportVideoDailyLoadJob.java
  17. 9 0
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceEtlVideoJob.java
  18. 51 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouBatchCampaignTimeStartJob.java
  19. 9 0
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouEtlVideoJob.java
  20. 4 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaiShouAppInfoController.java
  21. 55 4
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouAdvertiserStrategyController.java
  22. 80 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouBatchUpdateController.java
  23. 65 8
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaiShouMaterialControer.java
  24. 2 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAdvertiserStrategy.java
  25. 8 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IKuaiShouBatchUpdateService.java
  26. 55 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouBatchUpdateServiceImpl.java
  27. 17 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouCreateServiceImpl.java
  28. 3 15
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  29. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaishouBatchCampaignPreview.java
  30. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouAppListMapper.java
  31. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouGroupMapper.java
  32. 3 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouVideoGetMapper.java
  33. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouBatchCampaignPreviewMapper.java
  34. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouPopulationMapper.java
  35. 29 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouAppListMapper.xml
  36. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml
  37. 6 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml
  38. 10 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouBatchCampaignPreviewMapper.xml
  39. 31 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouPopulationMapper.xml
  40. 45 30
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouVideoRelateCreativesMapper.xml
  41. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouGroupService.java
  42. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouVideoGetService.java
  43. 12 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouBatchCampaignPreviewService.java
  44. 2 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java
  45. 2 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouPopulationService.java
  46. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java
  47. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouBatchCampaignPreviewServiceImpl.java
  48. 55 58
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  49. 9 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouPopulationServiceImpl.java
  50. 103 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/entity/EtlKuaishouVideoInfo.java
  51. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/mapper/EtlKuaishouVideoInfoMapper.java
  52. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/mapper/xml/EtlKuaishouVideoInfoMapper.xml
  53. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/service/IEtlKuaishouVideoInfoService.java
  54. 22 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/EtlKuaishouVideoInfoServiceImpl.java
  55. 265 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/EtlKuaishouReportVideoDaily.java
  56. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaishouReportVideoDailyMapper.java
  57. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportVideoDailyMapper.xml
  58. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IEtlKuaishouReportVideoDailyService.java
  59. 18 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouReportVideoDailyServiceImpl.java
  60. 2 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/mapper/ETLReportBytedanceVideoMapper.java
  61. 201 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/mapper/xml/ETLReportBytedanceVideoMapper.xml
  62. 9 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/service/impl/ETLReportBytedanceVideoServiceImpl.java
  63. 103 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/EtlBytedanceVideoInfo.java
  64. 14 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/EtlBytedanceVideoInfoMapper.java
  65. 5 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/EtlBytedanceVideoInfoMapper.xml
  66. 14 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IEtlBytedanceVideoInfoService.java
  67. 18 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/EtlBytedanceVideoInfoServiceImpl.java
  68. 419 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/EtlBytedanceReportVideoDaily.java
  69. 14 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/EtlBytedanceReportVideoDailyMapper.java
  70. 5 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/EtlBytedanceReportVideoDailyMapper.xml
  71. 14 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IEtlBytedanceReportVideoDailyService.java
  72. 0 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportServiceImpl.java
  73. 2 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceVideoReportServiceImpl.java
  74. 18 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/EtlBytedanceReportVideoDailyServiceImpl.java
  75. 0 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java

+ 0 - 5
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java

@@ -89,9 +89,4 @@ public class MD5Util {
 	public static String getFileMd5(String path) throws Exception {
 		return DigestUtils.md5Hex(new FileInputStream(path));
 	}
-
-	public static void main(String[] args) throws Exception {
-		System.out.println(getFileMd5("D:\\mnt\\0427有缘3-帆楠E打车-同城热恋-1587982341839.mp4"));
-		System.out.println(getFileMd5("D:\\mnt\\0427有缘4-帆楠E洗脚-同城热恋-1593661309704.mp4"));
-	}
 }

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

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

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

@@ -217,7 +217,6 @@ public class JhsBakendDataController {
 			  fis = (FileInputStream) file.getInputStream();
 			  AnalysisEventListener listener = new JhsBakendDataExcelListener();
 			  Boolean flag = ExcelUtils.readExcel(fis, JhsBakendDataEntity.class, listener);
-			  System.out.println("导入是否成功:" + flag);
 		  } catch (Exception e) {
 			  e.printStackTrace();
 		  } finally {

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

@@ -191,7 +191,6 @@ public class KuaishouChannelRegInfoController {
                 fis = (FileInputStream) file.getInputStream();
                 AnalysisEventListener listener = new KuaishouChannelRegInfoExcelListener();
                 Boolean flag = ExcelUtils.readExcel(fis, KuaishouChannelRegInfoEntity.class, listener);
-                System.out.println("导入是否成功:" + flag);
             } catch (Exception e) {
                 e.printStackTrace();
             } finally {

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

@@ -28,21 +28,10 @@ import org.jeecg.modules.ctop.service.IAdvertiserService;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.system.service.ISysUserService;
 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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 项目成员
@@ -191,9 +180,10 @@ public class ProjectMemberController {
             List<JSONObject> projectList = projectMemberService.getProjectByUserIdAndMediaIds(userId, mediaIds);
             List<JSONObject> haveList = new ArrayList<>();
             if (!Check.isNull(projectList)) {
+                Map<Long, List<JSONObject>> accountMap = userAllocationService.getAccountListByProjectList(projectList);
                 for (int i = 0; i < projectList.size(); i++) {
                     JSONObject project = projectList.get(i);
-                    List<JSONObject> accountList = userAllocationService.getAccountListByProject(project.getLong("projectId"));
+                    List<JSONObject> accountList = accountMap.get(project.getLong("projectId"));
                     if (!Check.isNull(accountList)) {
                         project.put("accountList", accountList);
                         haveList.add(project);
@@ -596,9 +586,5 @@ public class ProjectMemberController {
 
     }
 
-    public static void main(String[] args) {
-
-    }
-
 
 }

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

@@ -15,6 +15,7 @@ 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.toutiao.modules.link.service.IETLReportBytedanceVideoService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.material.service.IBytedanceEffectVideoInfoService;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
@@ -22,6 +23,7 @@ import cn.com.ctop.toutiao.modules.report.service.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
@@ -54,7 +56,7 @@ import static org.jeecg.common.util.DateUtils.getAnotherDay;
 @RequestMapping("/test")
 @Slf4j
 public class TestController {
-    @Autowired
+    @Resource
     private CtopOauthTokenMapper tokenMapper;
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
@@ -107,11 +109,28 @@ public class TestController {
 
     @Autowired
     private IBindAccountAuthService bindAccountAuthService;
-    @Autowired
+    @Resource
     private UserAllocationMapper allocationMapper;
     @Autowired
     private IBytedanceReportService bytedanceReportService;
 
+    @Autowired
+    private IUserAllocationService allocationService;
+
+
+    @GetMapping("/getVideoByProjectId")
+    public String getVideoByProjectId(Long projectId) {
+        QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("project_id", projectId);
+        List<UserAllocation> list = allocationService.list(queryWrapper);
+        for (UserAllocation allocation : list) {
+            CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
+            kuaishouInterfaceService.getVideoList(token, null, null);
+        }
+        return "success";
+    }
+
+
     @GetMapping("/testKuaishou")
     public String kuaishouCallback(@RequestParam("auth_code") String authCode, @RequestParam("state") String state) {
         try {
@@ -242,7 +261,6 @@ public class TestController {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
-        System.out.println("数据获取完成");
 //        bytedanceReportMaterialDailyMapper.updateImageReportCode();
 //        bytedanceReportMaterialDailyMapper.updateImageReportProjectId();
 //        bytedanceReportMaterialDailyMapper.updateImageReportProjectName();
@@ -686,11 +704,6 @@ public class TestController {
     }
 
 
-
-
-
-
-
     @GetMapping(value = "/createCutTask")
     public String createCutTask(String startDate, String endDate) throws IOException {
         List<MaterialInfo> materialInfos = materialInfoService.getListByDate(startDate, endDate);
@@ -1332,24 +1345,57 @@ public class TestController {
     }
 
     @GetMapping("loadMatData")
-    public Map<String,Object>getData(String startDate,String endDate,Long accountId){
-        Map<String,Object>result = new HashMap<>();
+    public Map<String, Object> getData(String startDate, String endDate, Long accountId) {
+        Map<String, Object> result = new HashMap<>();
         CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
-        Date start = DateUtils.parseDate(startDate,"yyyy-MM-dd");
-        int days = DateUtils.getdaysOfTwoDate(startDate,endDate)+1;
-        for (int i=0;i<days;i++){
-            String getDate = DateUtils.formatDate(DateUtils.addDay(start,i));
+        Date start = DateUtils.parseDate(startDate, "yyyy-MM-dd");
+        int days = DateUtils.getdaysOfTwoDate(startDate, endDate) + 1;
+        for (int i = 0; i < days; i++) {
+            String getDate = DateUtils.formatDate(DateUtils.addDay(start, i));
             bytedanceReportService.bytedanceMaterialReport(token, getDate, getDate);
         }
-        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 
     @GetMapping("loadAccountData")
-    public Map<String,Object>getData(Long accountId){
-        Map<String,Object>result = new HashMap<>();
+    public Map<String, Object> getData(Long accountId) {
+        Map<String, Object> result = new HashMap<>();
         CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
-        reportService.getAdvertiserReport(token, DateUtils.parseDate("2021-01-01","yyyy-MM-dd"), DateUtils.parseDate("2021-01-31","yyyy-MM-dd"),CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        reportService.getAdvertiserReport(token, DateUtils.parseDate("2021-01-01", "yyyy-MM-dd"), DateUtils.parseDate("2021-01-31", "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    private ExecutorService executor = Executors.newFixedThreadPool(10);
+    private CountDownLatch countDownLatch;
+    @Autowired
+    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);
         return result;
     }

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

@@ -110,28 +110,37 @@
     </select>
 
     <select id="queryProjectMemberByUserId" resultType="org.jeecg.modules.ctop.entity.ProjectMember">
-        select
-        distinct b.project_id as projectId,
-         (
-         select project_name  from ctop_project
-         where id = b.project_id
-        )as projectName,
-        a.advertiser_id as advertiserId,
+        SELECT
+        t1.id AS 'projectId',
+        project_name AS 'projectName',
+        t1.advertiser_id AS 'advertiserId',
         (
-        select name from ctop_advertiser where id = a.advertiser_id
+        SELECT
+        NAME
+        FROM
+        ctop_advertiser
+        WHERE
+        id = t1.advertiser_id
+        ) AS 'advertiserName',
+        t1.media_id as 'mediaId'
+        FROM
+        ctop_project t1
+        WHERE
+        t1.id IN (
+        SELECT
+        project_id
+        FROM
+        ctop_project_member
+        where user_id = #{userId}
+        GROUP BY
+        project_id
         )
-        as advertiserName,
-        (SELECT media_id from ctop_project c where c.id=a.project_id limit 1) as mediaId
-        from
-        ctop_user_allocation a
-        left join ctop_project_member b on a.project_id = b.project_id
-        where b.user_id = #{userId}
-        and a.media_id in
+        AND t1.media_id IN
         <foreach collection="mediaIds" item="item" separator=","
                  open="(" close=")">
             #{item}
         </foreach>
-        order by b.create_time desc
+        order by t1.create_time desc
     </select>
 
     <select id="getSaleProjects" resultType="org.jeecg.modules.ctop.entity.ProjectMember">

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

@@ -5,6 +5,7 @@ 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.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import com.alibaba.fastjson.JSONArray;
@@ -104,6 +105,9 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         return projectMemberList;
     }
 
+    @Autowired
+    private IUserAllocationService userAllocationService;
+
     @Override
     public List<Map<String, Object>> getProjectAccountByUserId(String userId, String mediaType) {
         List<Map<String, Object>> result = new ArrayList<>();
@@ -121,15 +125,63 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         if (projectMemberList.isEmpty()) {
             return result;
         }
+
+        // Map<Long, List<JSONObject>> accountMap = userAllocationService.getAccountListByProjectMemberList(projectMemberList);
+        Map<Long, List<JSONObject>> accountMap = this.getAccountListByProjectMemberList(projectMemberList);
+
+
+      /*  temp.put("project", projectMember);
+        QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("project_id", projectMember.getProjectId());
+        queryWrapper.isNotNull("account_id");
+        List<UserAllocation> userAllocations = userAllocationMapper.selectList(queryWrapper);
+        if (userAllocations.isEmpty()) {
+            temp = null;
+        } else {
+            temp.put("account", userAllocations);*/
+
+/*
         projectMemberList.forEach(ProjectMember -> {
             Map<String, Object> temp = this.queryAccountByProjectId(ProjectMember);
             if (temp != null) {
                 result.add(temp);
             }
-        });
+        });*/
+
+        for (ProjectMember member : projectMemberList) {
+            Map<String, Object> temp = new HashMap<>();
+            temp.put("project", member);
+            List<JSONObject> jsonObjects = accountMap.get(member.getProjectId());
+            if (Check.isNull(jsonObjects)) {
+                continue;
+            }
+            temp.put("account", jsonObjects);
+            result.add(temp);
+        }
+
         return result;
     }
 
+    private Map<Long, List<JSONObject>> getAccountListByProjectMemberList(List<ProjectMember> projectMemberList) {
+        Map<Long, List<JSONObject>> map = new HashMap<>();
+        List list = new ArrayList();
+        for (ProjectMember member : projectMemberList) {
+            list.add(member.getProjectId());
+            map.put(member.getProjectId(), new ArrayList<>());
+        }
+
+        List<JSONObject> jsonList = userAllocationMapper.getAccountListByProjectList(list);
+        for (int i = 0; i < jsonList.size(); i++) {
+            JSONObject jsonObject = jsonList.get(i);
+            Long projectId = jsonObject.getLong("projectId");
+            List<JSONObject> jsonObjects = map.get(projectId);
+            jsonObjects.add(jsonObject);
+        }
+        return map;
+
+
+    }
+
     @Override
     public ProjectMember getProjectByParams(Long targetProject, String userId) {
         QueryWrapper<ProjectMember> queryWrapper = new QueryWrapper<>();

+ 7 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysDepartServiceImpl.java

@@ -19,6 +19,7 @@ import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import java.util.*;
 
 /**
@@ -32,17 +33,17 @@ import java.util.*;
 @Service
 public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart> implements ISysDepartService {
 
-    @Autowired
+    @Resource
     private SysUserDepartMapper userDepartMapper;
-    @Autowired
+    @Resource
     private SysDepartRoleMapper sysDepartRoleMapper;
-    @Autowired
+    @Resource
     private SysDepartPermissionMapper departPermissionMapper;
-    @Autowired
+    @Resource
     private SysDepartRolePermissionMapper departRolePermissionMapper;
-    @Autowired
+    @Resource
     private SysDepartRoleUserMapper departRoleUserMapper;
-    @Autowired
+    @Resource
     private SysDepartMapper sysDepartMapper;
 
     @Override

+ 39 - 73
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.IProjectService;
 import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountTargetTemplate;
@@ -23,6 +24,8 @@ 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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -46,7 +49,7 @@ import static org.jeecg.common.util.DateUtils.getAnotherDay;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ActiveProfiles("dev")
+@ActiveProfiles("wps")
 @Slf4j
 public class SampleTest {
     @Autowired
@@ -65,6 +68,10 @@ public class SampleTest {
     private IBindAccountLoginService bindAccountLoginService;
     @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
+    @Autowired
+    private IProjectService projectService;
+    @Autowired
+    private IUserAllocationService allocationService;
  /*   @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
 
@@ -80,16 +87,27 @@ public class SampleTest {
 
 
 
+
+
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
         Date parse = simpleDateFormat.parse("2021-02-02");
         kuaishouInterfaceService.getAdvertiserReportDaily(token, parse, parse);*/
 
-        CtopOauthToken token = new CtopOauthToken();
+        QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("project_id", 900886);
+        List<UserAllocation> list = allocationService.list(queryWrapper);
+        for (UserAllocation allocation : list) {
+            CtopOauthToken token = tokenService.getTokenByAccountId(allocation.getAccountId());
+            kuaishouInterfaceService.getVideoList(token, null, null);
+        }
+
+
+      /*  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);*/
@@ -161,8 +179,7 @@ public class SampleTest {
         }
     }
 
-    @Autowired
-    private IUserAllocationService allocationService;
+
 
     @Test
     public void testLoadBytedanceData() {
@@ -175,7 +192,6 @@ public class SampleTest {
                 reportService.getAdvertiserReport(token, DateUtils.parseDate(startDate, "yyyy-MM-dd"), DateUtils.parseDate(endDate, "yyyy-MM-dd"), CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
             }
         }
-        System.out.println("任务结束");
     }
 
     @Test
@@ -449,12 +465,14 @@ public class SampleTest {
 
     @Test
     public void etlKuaishouData() {
-        String dateString = "2021-01-05";
+        String dateString = "2020-07-18";
         Date startDate = DateUtils.parseDate(dateString, "yyyy-MM-dd");
-        for (int i = 0; i <= 10; i++) {
+        for (int i = 0; i <= 450; i++) {
             Date getDate = DateUtils.addDay(startDate, i);
-            kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
-            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
+            kuaishouVideoEtlInfoService.etlKuaishouVideoInfoGroupByProjectId(getDate);
+//            bytedanceVideoEtlInfoService.etlBytedanceVideoInfoByProjectId(getDate);
+//            kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
+//            bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
         }
     }
 
@@ -538,76 +556,24 @@ public class SampleTest {
     }
 
     @Test
-    public void testLoadBytedanceDataV2(){
-        String accountIds=
-                "1675440464386062," +
-                        "1688606248211533," +
-                        "1669181787105294," +
-                        "1687571097467912," +
-                        "1650079154438157," +
-                        "1680697900744711," +
-                        "1678156679964680," +
-                        "1670727177043982," +
-                        "1676160388944910," +
-                        "1687559760306190," +
-                        "1687382871519240," +
-                        "1680312075164686," +
-                        "1675440465991688," +
-                        "1664657972166663," +
-                        "1688193173408782," +
-                        "1675616147056647," +
-                        "1687308848716814," +
-                        "1686394621234247," +
-                        "1683594409340935," +
-                        "1683676478859341," +
-                        "1686384860112904," +
-                        "1668290872519693," +
-                        "1674063202781191," +
-                        "1685024266033160," +
-                        "1669714891201544," +
-                        "1687758256277512," +
-                        "1675434231118856," +
-                        "1686394621807687," +
-                        "1678411706704903," +
-                        "1686223489547271," +
-                        "1660120711467022," +
-                        "1686833795211278," +
-                        "1680697899143175," +
-                        "1661313994984462," +
-                        "1661313995480077," +
-                        "1636295780727820," +
-                        "1676540490482759," +
-                        "1675342904713223," +
-                        "1686771461984327," +
-                        "1685841129360391," +
-                        "1683676477736973," +
-                        "1661313994470413," +
-                        "1663465141771272," +
-                        "1687758256732174," +
-                        "1686223482927117," +
-                        "1686835166313479," +
-                        "1642648003678215," +
-                        "1639753233213454," +
-                        "1675239584963662," +
-                        "1674634579279885," +
-                        "1650263841162253," +
-                        "1672178052130888";
-        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);
+    public void testLoadBytedanceDataV2() {
+        List<CtopOauthToken> tokens = oauthTokenService.selectToutiaoToken();
+        countDownLatch = new CountDownLatch(tokens.size());
+        for(int i=2;i<20;i++){
+            String statDate= DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
+            tokens.forEach(token -> bytedanceVideoReportService.pullVideoReport(token, statDate, statDate, 1));
         }
     }
 
 
     @Test
-    public void checkBytedanceReport(){
+    public void checkBytedanceReport() {
         CtopOauthToken token = tokenService.getTokenByAccountId(1678959391271949L);
         String startDate = "2021-01-01 00:00:00";
         String endDate = "2021-01-31 00:00:00";
-        bytedanceReportService.checkoutData(token,startDate,endDate);
+        bytedanceReportService.checkoutData(token, startDate, endDate);
     }
+
     @Test
     public void etlKuaishouProjectData() {
         CtopOauthToken token = tokenService.getTokenByAccountId(1660666858777607L);
@@ -653,8 +619,8 @@ public class SampleTest {
     @Test
     public void etlBytedanceVideoReportClean() {
         //for (int i = 1; i <= 1; i++) {
-          //  String statDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
-            ietlReportBytedanceVideoService.cleanETL("2020-12-31");
+        //  String statDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
+        ietlReportBytedanceVideoService.cleanETL("2020-12-31");
         //}
     }
 

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

@@ -42,4 +42,6 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
     String getCompanyNameByUserId(@Param("planId") String planId);
 
     List<UserAllocation> listByMediaId(@Param("mediaId")String mediaId, @Param("accountStatus")Integer accountStatus);
+
+    List<JSONObject> getAccountListByProjectList(@Param("list") List list);
 }

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

@@ -31,14 +31,33 @@
 
     <select id="getAccountListByProject" resultType="com.alibaba.fastjson.JSONObject">
        select
-       account_id as 'accountId',
-       user_name as 'userName',
-       auth_name as 'authName'
-       from ctop_user_allocation
-       where project_id = #{projectId}
-       order by create_time desc
+       t1.account_id as 'accountId',
+       (select  realname  from sys_user where  id = t1.user_id ) as 'userName',
+       t1.auth_name as 'authName'
+       from ctop_user_allocation t1
+       where t1.project_id = #{projectId}
+       order by t1.create_time desc
     </select>
 
+    <select id="getAccountListByProjectList" resultType="com.alibaba.fastjson.JSONObject">
+        select
+        t1.project_id as 'projectId',
+        t1.account_id as 'accountId',
+        (select realname from sys_user where id = t1.user_id ) as 'userName',
+        t1.auth_name as 'authName',
+        t1.account_status as 'accountStatus'
+        from ctop_user_allocation t1
+        where t1.project_id in
+        <foreach collection="list" item="item" separator=","
+                 open="(" close=")">
+            #{item}
+        </foreach>
+
+
+        order by t1.create_time desc
+    </select>
+
+
     <select id="getUserIdListByProjectId" resultType="com.alibaba.fastjson.JSONObject">
    SELECT t1.user_id as 'userId',
     t1.account_id as 'accountId',
@@ -128,10 +147,10 @@
         select a.* from ctop_user_allocation a
         left join ctop_project p on p.id = a.project_id
         where
-            1=1
-            <if test="null!=accountStatus">
-                and a.account_status = #{accountStatus}
-            </if>
+        1=1
+        <if test="null!=accountStatus">
+            and a.account_status = #{accountStatus}
+        </if>
         <if test="null!=mediaId">
             and p.media_id = #{mediaId}
         </if>

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

@@ -43,4 +43,8 @@ public interface IUserAllocationService extends IService<UserAllocation> {
     JSONObject getSwitchStatusByAccount(Long accountId);
 
     List<Long> getAccountsByDeleteComment();
+
+    Map<Long, List<JSONObject>> getAccountListByProjectList(List<JSONObject> projectList);
+
+
 }

+ 26 - 8
module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java

@@ -6,7 +6,6 @@ import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
-import 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;
@@ -96,8 +95,8 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     }
 
     @Override
-    public List<UserAllocation> listByMediaId(String mediaId,int accountStatus) {
-        return userAllocationMapper.listByMediaId(mediaId,accountStatus);
+    public List<UserAllocation> listByMediaId(String mediaId, int accountStatus) {
+        return userAllocationMapper.listByMediaId(mediaId, accountStatus);
     }
 
     @Override
@@ -128,11 +127,11 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
 
     @Override
     public List<JSONObject> getAccountIdsByUserId(String userId) {
-        List<JSONObject> result= new ArrayList<>();
-        if(userId.equals("e9ca23d68d884d4ebb19d07889727dae")){
-            result=userAllocationMapper.getAllAccountIdsByMediaId("2");
-        }else {
-            result=userAllocationMapper.getAccountIdsByUserId(userId);
+        List<JSONObject> result = new ArrayList<>();
+        if (userId.equals("e9ca23d68d884d4ebb19d07889727dae")) {
+            result = userAllocationMapper.getAllAccountIdsByMediaId("2");
+        } else {
+            result = userAllocationMapper.getAccountIdsByUserId(userId);
 
         }
         return result;
@@ -157,4 +156,23 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     public List<Long> getAccountsByDeleteComment() {
         return userAllocationMapper.queryAccountsByDeleteComment();
     }
+
+    @Override
+    public Map<Long, List<JSONObject>> getAccountListByProjectList(List<JSONObject> projectList) {
+        Map<Long, List<JSONObject>> map = new HashMap<>();
+        List list = new ArrayList();
+        for (int i = 0; i < projectList.size(); i++) {
+            JSONObject jsonObject = projectList.get(i);
+            list.add(jsonObject.getLong("projectId"));
+            map.put(jsonObject.getLong("projectId"), new ArrayList<>());
+        }
+        List<JSONObject> jsonList = userAllocationMapper.getAccountListByProjectList(list);
+        for (int i = 0; i < jsonList.size(); i++) {
+            JSONObject jsonObject = jsonList.get(i);
+            Long projectId = jsonObject.getLong("projectId");
+            List<JSONObject> jsonObjects = map.get(projectId);
+            jsonObjects.add(jsonObject);
+        }
+        return map;
+    }
 }

+ 0 - 4
module-common/src/main/java/cn/com/ctop/common/module/utils/LoadFileUtil.java

@@ -91,10 +91,6 @@ public class LoadFileUtil {
         return flag;
     }
 
-    public static void main(String[] args) throws IOException {
-        System.out.println(getMD5("D:\\data\\6ybjAGrL.mp4"));
-    }
-
     /**
      * 获取文件md5
      *

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

@@ -43,8 +43,5 @@ public class BaseReportVideoDailyLoadJob {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
-        if(!executorService.isShutdown()){
-            executorService.shutdown();
-        }
     }
 }

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

@@ -21,4 +21,13 @@ public class BytedanceEtlVideoJob {
             bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
         }
     }
+
+    @XxlJob("bytedanceEtlVideoProjectJob")
+    public void bytedanceEtlVideoProjectJob() throws Exception {
+        Date startDate = DateUtils.addDay(new Date(),-2);
+        for(int i=0;i<=2;i++){
+            Date getDate = DateUtils.addDay(startDate,i);
+            bytedanceVideoEtlInfoService.etlBytedanceVideoInfoByProjectId(getDate);
+        }
+    }
 }

+ 51 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouBatchCampaignTimeStartJob.java

@@ -0,0 +1,51 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchCampaignPreview;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouUpdateService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouBatchCampaignPreviewService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class KuaishouBatchCampaignTimeStartJob {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouBatchCampaignPreviewService campaignPreviewService;
+    @Autowired
+    private IKuaiShouUpdateService kuaiShouUpdateService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+
+    @XxlJob("kuaishouBatchCampaignTimeStartJob")
+    public void execute() throws Exception {
+        List<KuaishouBatchCampaignPreview> campaignPreviewList = campaignPreviewService.queryListByTime();
+        if (!Check.isNull(campaignPreviewList)) {
+            campaignPreviewList.forEach(campaignPreview -> executorService.submit(() -> {
+                CtopOauthToken token = tokenService.getTokenByAccountId(campaignPreview.getAccountId());
+                if (!Check.isNull(token)) {
+                    Map<String, Object> map = kuaiShouUpdateService.updateCampaignStatus(token.getAccessToken(), campaignPreview.getAccountId(), campaignPreview.getCampaignId(), 1, "timingStart");
+                    if ((boolean) map.get("success")) {
+                        QueryWrapper<KuaishouBatchCampaignPreview> queryWrapper = new QueryWrapper<>();
+                        queryWrapper.eq("id", campaignPreview.getId());
+                        KuaishouBatchCampaignPreview campaign = new KuaishouBatchCampaignPreview();
+                        campaign.setMessage("定时启动成功!");
+                        campaignPreviewService.update(campaign, queryWrapper);
+                    }
+                }
+            }));
+            XxlJobHelper.log("计划定时启动完成");
+        }
+    }
+
+}

+ 9 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouEtlVideoJob.java

@@ -21,4 +21,13 @@ public class KuaishouEtlVideoJob {
             kuaishouVideoEtlInfoService.etlKuaishouVideoInfo(getDate);
         }
     }
+
+    @XxlJob("kuaishouEtlProjectVideoJob")
+    public void kuaishouEtlProjectVideoJob() throws Exception {
+        Date startDate = DateUtils.addDay(new Date(),-2);
+        for(int i=0;i<=2;i++){
+            Date getDate = DateUtils.addDay(startDate,i);
+            kuaishouVideoEtlInfoService.etlKuaishouVideoInfoGroupByProjectId(getDate);
+        }
+    }
 }

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

@@ -88,10 +88,13 @@ public class AiKuaiShouAppInfoController {
 
 
     @PostMapping(value = "/importAppExcel")
-    public JSONObject importExcel(@RequestParam("file") MultipartFile file,
+    @ResponseBody
+    public JSONObject importExcel(HttpServletResponse response,
+                                  @RequestParam("file") MultipartFile file,
                                   @RequestParam("accountId") Long accountId,
                                   @RequestParam("platform") Integer platform,
                                   @RequestParam("imageToken") String imageToken) {
+        response.setHeader("Access-Control-Allow-Origin", "*");
         FileInputStream fis = null;
         JSONObject returnJson = new JSONObject();
         try {

+ 55 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouAdvertiserStrategyController.java

@@ -2,6 +2,8 @@ package cn.com.ctop.kuaishou.modules.ai.controller;
 
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
 import com.alibaba.fastjson.JSONArray;
@@ -17,9 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
 
 /**
  * 快手账户策略设置信息表
@@ -51,6 +51,7 @@ public class AiKuaishouAdvertiserStrategyController {
 		Result<IPage<AiKuaishouAdvertiserStrategy>> result = new Result<>();
 		QueryWrapper<AiKuaishouAdvertiserStrategy> queryWrapper = QueryGenerator.initQueryWrapper(aiKuaishouAdvertiserStrategy, req.getParameterMap());
 		Page<AiKuaishouAdvertiserStrategy> page = new Page<>(pageNo, pageSize);
+		queryWrapper.orderByDesc("id");
 		IPage<AiKuaishouAdvertiserStrategy> pageList = aiKuaishouAdvertiserStrategyService.page(page, queryWrapper);
 		List<AiKuaishouAdvertiserStrategy> records = pageList.getRecords();
 		List<AiKuaishouAdvertiserStrategy> setData = new ArrayList<>();
@@ -119,7 +120,57 @@ public class AiKuaishouAdvertiserStrategyController {
 	}
 
 	/**
-	  *   通过id删除
+	 *  开启
+	 * @return
+	 */
+	@GetMapping(value = "/oprateStatus")
+	public Map<String,Object> oprateStatus(Long id, Integer status) {
+		Map<String,Object>result = new HashMap<>();
+		if(null == id||status == null){
+			ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+			return result;
+		}
+		AiKuaishouAdvertiserStrategy aiKuaishouAdvertiserStrategyEntity = aiKuaishouAdvertiserStrategyService.getById(id);
+		if(aiKuaishouAdvertiserStrategyEntity==null) {
+			ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+			return result;
+		}
+		if(status!=0){
+			status = 1;
+		}
+		aiKuaishouAdvertiserStrategyEntity.setStatus(status);
+		aiKuaishouAdvertiserStrategyService.updateById(aiKuaishouAdvertiserStrategyEntity);
+		ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+		return result;
+	}
+
+	/**
+	 *  开启
+	 * @return
+	 */
+	@GetMapping(value = "/oprateCreativeStatus")
+	public Map<String,Object> oprateCreativeStatus(Long id, Integer status) {
+		Map<String,Object>result = new HashMap<>();
+		if(null == id||status == null){
+			ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+			return result;
+		}
+		AiKuaishouAdvertiserStrategy aiKuaishouAdvertiserStrategyEntity = aiKuaishouAdvertiserStrategyService.getById(id);
+		if(aiKuaishouAdvertiserStrategyEntity==null) {
+			ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+			return result;
+		}
+		if(status!=0){
+			status = 1;
+		}
+		aiKuaishouAdvertiserStrategyEntity.setOpenProgramCreate(status);
+		aiKuaishouAdvertiserStrategyService.updateById(aiKuaishouAdvertiserStrategyEntity);
+		ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+		return result;
+	}
+
+	/**
+	 * 通过id删除
 	 * @param id
 	 * @return
 	 */

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

@@ -0,0 +1,80 @@
+package cn.com.ctop.kuaishou.modules.ai.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.ai.service.IKuaiShouBatchUpdateService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Slf4j
+@RestController
+@RequestMapping("/ai/batchUpdate/")
+public class KuaiShouBatchUpdateController {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private IKuaiShouBatchUpdateService batchUpdateService;
+    @Autowired
+    private IKuaiShouGroupService groupService;
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+
+    @PostMapping(value = "/updateGroupBid")
+    public JSONObject getAppDetail(@RequestBody JSONObject requestJson) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            Long accountId = requestJson.getLong("accountId");
+            if (Check.isNull(accountId)) {
+                throw new Exception("请输入账户");
+            }
+            CtopOauthToken oauthToken = tokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(oauthToken)) {
+                throw new Exception("未获取到账户信息");
+            }
+            Long bid = requestJson.getLong("bid");
+            if (Check.isNull(bid) || bid == 0) {
+                throw new Exception("请传入需要修改的出价,或出价不能改为0");
+            }
+            executorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        log.info("开始异步执行修改出价,accountId:{}", accountId);
+                        groupService.deleteByAccountId(accountId);
+                        log.info("历史数据清除完成,accountId:{}", accountId);
+                        kuaishouInterfaceService.getGroupList(oauthToken, null, null);
+                        log.info("最新数据获取完成,accountId:{}", accountId);
+                        Thread.sleep(1000);
+                        batchUpdateService.updateBid(oauthToken, bid);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    } finally {
+                    }
+                }
+            });
+
+
+            returnJson.put("code", 0);
+            returnJson.put("message", "success");
+
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+}

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

@@ -40,6 +40,37 @@ public class KuaiShouMaterialControer {
     @Autowired
     private IKuaishouVideoRelateCreativesService relateCreativesService;
 
+
+    @PostMapping(value = "/getKuaiShouVideoList")
+    public JSONObject getKuaiShouVideoList(@RequestBody JSONObject requestJson) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(requestJson)) {
+                throw new Exception("入参不能为空");
+            }
+            Long accountId = requestJson.getLong("accountId");
+            if (Check.isNull(accountId)) {
+                throw new Exception("账户id不能为空");
+            }
+            CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
+            if (Check.isNull(token)) {
+                throw new Exception("未获取账号授权信息");
+            }
+
+            String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+            iKuaishouInterfaceService.getVideoList(token, nowDate, nowDate);
+            returnJson.put("code", 0);
+            returnJson.put("message", "素材更新成功");
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+
     /**
      * 查询上新素材
      *
@@ -48,6 +79,7 @@ public class KuaiShouMaterialControer {
      */
     @PostMapping(value = "/getNewVideoList")
     public JSONObject getNewVideo(@RequestBody JSONObject requestJson) {
+        // log.info("获取上新素材入参:{}", requestJson);
         JSONObject returnJson = new JSONObject();
         try {
             if (Check.isNull(requestJson)) {
@@ -61,9 +93,9 @@ public class KuaiShouMaterialControer {
             if (Check.isNull(token)) {
                 throw new Exception("未获取账号授权信息");
             }
-            String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-            iKuaishouInterfaceService.getVideoList(token, nowDate, nowDate);
-          //  iKuaishouInterfaceService.getSuZaoList(token.getAccessToken(), accountId, 1, nowDate, nowDate);
+            String appVersion = requestJson.getString("appVersion");
+            // String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+            //  iKuaishouInterfaceService.getVideoList(token, nowDate, nowDate);
             KuaiShouVideoLastTime videoLastTime = lastTimeService.getById(accountId);
             Date startTime;
             Date endDate = new Date();
@@ -76,6 +108,9 @@ public class KuaiShouMaterialControer {
             requestMap.put("startTime", DateUtils.formatDate(startTime, "yyyy-MM-dd HH:mm:ss"));
             requestMap.put("endTime", DateUtils.formatDate(endDate, "yyyy-MM-dd HH:mm:ss"));
             requestMap.put("accountId", accountId);
+            if (!Check.isNull(appVersion)) {
+                requestMap.put("appVersion", appVersion);
+            }
             List<JSONObject> materialList = videoGetService.getVideoListByMap(requestMap);
             if (!Check.isNull(materialList)) {
                 for (int i = 0; i < materialList.size(); i++) {
@@ -112,6 +147,7 @@ public class KuaiShouMaterialControer {
      */
     @PostMapping(value = "/getHistoryVideoList")
     public JSONObject getHistoryVideoList(@RequestBody JSONObject requestJson) {
+        // log.info("获取历史素材入参:{}", requestJson);
         JSONObject returnJson = new JSONObject();
         try {
             if (Check.isNull(requestJson)) {
@@ -138,12 +174,16 @@ public class KuaiShouMaterialControer {
             if (Check.isNull(num) || num == 0) {
                 throw new Exception("请输入查询条数");
             }
+            String appVersion = requestJson.getString("appVersion");
             Map<String, Object> requestMap = new HashMap<>();
             requestMap.put("startTime", startDate);
             requestMap.put("endTime", endDate);
             requestMap.put("accountId", accountId);
             requestMap.put("num", num);
             requestMap.put("createCount", createCount);
+            if (!Check.isNull(appVersion)) {
+                requestMap.put("appVersion", appVersion);
+            }
             List<JSONObject> materialList = relateCreativesService.getVideoListByMap(requestMap);
             if (!Check.isNull(materialList)) {
                 for (int i = 0; i < materialList.size(); i++) {
@@ -155,6 +195,7 @@ public class KuaiShouMaterialControer {
                         materialJson.put("video_url", videoGet.getUrl());
                         materialJson.put("material_type", videoGet.getMaterialType());
                         materialJson.put("channel_type", videoGet.getChannelType());
+                        materialJson.put("photo_name", videoGet.getPhotoName());
                         List<String> imageList = lastTimeService.getImageListByMd5(signature);
                         materialJson.put("imageList", imageList);
                     }
@@ -183,6 +224,7 @@ public class KuaiShouMaterialControer {
      */
     @PostMapping(value = "/getHistoryTopVideoList")
     public JSONObject getHistoryTopVideoList(@RequestBody JSONObject requestJson) {
+      //   log.info("获取历史Top素材入参:{}", requestJson);
         JSONObject returnJson = new JSONObject();
         try {
             if (Check.isNull(requestJson)) {
@@ -204,19 +246,29 @@ public class KuaiShouMaterialControer {
             if (Check.isNull(num) || num == 0) {
                 throw new Exception("请输入查询条数");
             }
+            String appVersion = requestJson.getString("appVersion");
             Map<String, Object> requestMap = new HashMap<>();
             requestMap.put("startDate", startDate);
             requestMap.put("endDate", endDate);
             requestMap.put("accountId", accountId);
             requestMap.put("num", num);
+            if (!Check.isNull(appVersion)) {
+                requestMap.put("appVersion", appVersion);
+            }
             List<JSONObject> materialList = relateCreativesService.getHistoryTopVideoList(requestMap);
             if (!Check.isNull(materialList)) {
                 for (int i = 0; i < materialList.size(); i++) {
                     JSONObject materialJson = materialList.get(i);
-                    String signature = materialJson.getString("signature");
-                    List<String> imageList = lastTimeService.getImageListByMd5(signature);
-                    materialJson.put("imageList", imageList);
-
+                    KuaiShouVideoGet videoGet = videoGetService.getVideoByPhotoId(materialJson.getLong("photo_id"));
+                    if (!Check.isNull(videoGet)) {
+                        String signature = videoGet.getSignature();
+                        materialJson.put("video_url", videoGet.getUrl());
+                        materialJson.put("material_type", videoGet.getMaterialType());
+                        materialJson.put("channel_type", videoGet.getChannelType());
+                        materialJson.put("photo_name", videoGet.getPhotoName());
+                        List<String> imageList = lastTimeService.getImageListByMd5(signature);
+                        materialJson.put("imageList", imageList);
+                    }
                 }
                 returnJson.put("code", 0);
                 returnJson.put("message", "SUCCESS");
@@ -242,6 +294,7 @@ public class KuaiShouMaterialControer {
      */
     @PostMapping(value = "/getCreateZeroVideoList")
     public JSONObject getHistoryCreateVideoList(@RequestBody JSONObject requestJson) {
+      //  log.info("获取关联创意数为0素材入参:{}", requestJson);
         JSONObject returnJson = new JSONObject();
         try {
             if (Check.isNull(requestJson)) {
@@ -264,12 +317,15 @@ public class KuaiShouMaterialControer {
             if (Check.isNull(endTime)) {
                 throw new Exception("请输入查询结束时间");
             }
+            String appVersion = requestJson.getString("appVersion");
             Map<String, Object> requestMap = new HashMap<>();
             requestMap.put("startTime", startTime);
             requestMap.put("endTime", endTime);
             requestMap.put("accountId", accountId);
-            requestMap.put("creativeCount", 0);
             requestMap.put("videoCnt", videoCnt);
+            if (!Check.isNull(appVersion)) {
+                requestMap.put("appVersion", appVersion);
+            }
             List<JSONObject> materialList = relateCreativesService.getVideoZeroListByMap(requestMap);
             if (!Check.isNull(materialList)) {
                 for (int i = 0; i < materialList.size(); i++) {
@@ -281,6 +337,7 @@ public class KuaiShouMaterialControer {
                         materialJson.put("video_url", videoGet.getUrl());
                         materialJson.put("channel_type", videoGet.getChannelType());
                         materialJson.put("material_type", videoGet.getMaterialType());
+                        materialJson.put("photo_name", videoGet.getPhotoName());
                         List<String> imageList = lastTimeService.getImageListByMd5(signature);
                         materialJson.put("imageList", imageList);
                     }

+ 2 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAdvertiserStrategy.java

@@ -46,6 +46,7 @@ public class AiKuaishouAdvertiserStrategy {
 	private Integer bid;
 	/**深度出价*/
 	private Long cpaBid;
+	private Long deepConversionBid;
 	/**优先低成本出价*/
 	private Integer smartBid;
 	/**优化目标*/
@@ -201,7 +202,7 @@ public class AiKuaishouAdvertiserStrategy {
 	 * 投放中的appId数组
 	 */
 	private String appIdArray;
-
+	private Integer openProgramCreate;
 	@TableField(exist = false)
 	private String authName;
 }

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

@@ -0,0 +1,8 @@
+package cn.com.ctop.kuaishou.modules.ai.service;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+
+public interface IKuaiShouBatchUpdateService {
+
+    void updateBid(CtopOauthToken oauthToken, Long bid);
+}

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

@@ -0,0 +1,55 @@
+package cn.com.ctop.kuaishou.modules.ai.service.impl;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.ai.service.IKuaiShouBatchUpdateService;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
+import cn.com.ctop.kuaishou.modules.batch.service.IBatchService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouUpdateService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Service
+public class KuaiShouBatchUpdateServiceImpl implements IKuaiShouBatchUpdateService {
+    @Autowired
+    private IKuaiShouGroupService groupService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(40);
+    @Autowired
+    private IBatchService batchService;
+    @Autowired
+    private IKuaiShouUpdateService updateService;
+
+    @Override
+    public void updateBid(CtopOauthToken oauthToken, Long bid) {
+        QueryWrapper<KuaiShouGroup> groupQueryWrapper = new QueryWrapper<>();
+        groupQueryWrapper.eq("account_id", oauthToken.getAccountId());
+        List<KuaiShouGroup> groupList = groupService.list(groupQueryWrapper);
+        if (Check.isNull(groupList)) {
+            return;
+        }
+        for (KuaiShouGroup group : groupList) {
+            executorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        JSONObject unitJson = new JSONObject();
+                        unitJson.put("advertiser_id", oauthToken.getAccountId());
+                        unitJson.put("unit_id", group.getUnitId());
+                        unitJson.put("cpa_bid", bid);
+                        updateService.updateUnit(oauthToken.getAccessToken(), unitJson);
+                        Thread.sleep(1500);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            });
+        }
+    }
+}

+ 17 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaiShouCreateServiceImpl.java

@@ -35,6 +35,8 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
     private IKuaiShouMaterialUploadService uploadService;
     @Autowired
     private IKuaiShouVideoGetService videoGetService;
+    @Autowired
+    private IKuaiShouGroupTemplateService groupTemplateService;
 
     @Value("${ai.callback.callback-unit-url}")
     private String unitUrl;
@@ -90,7 +92,10 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                 if (!Check.isNull(groupCreateJson.getLong("deep_conversion_bid"))) {
                     createJson.put("deep_conversion_bid", groupCreateJson.getLong("deep_conversion_bid")); //深度转化目标出价
                 }
+
+                Integer sceneId = null;
                 if (!Check.isNull(groupCreateJson.getJSONArray("scene_id"))) {
+                    sceneId = groupCreateJson.getJSONArray("scene_id").getInteger(0);
                     createJson.put("scene_id", groupCreateJson.getJSONArray("scene_id")); //资源位置
                 }
                 Integer unit_type = groupCreateJson.getInteger("unit_type");
@@ -174,9 +179,19 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                         createJson.put("asset_mining", groupCreateJson.getBoolean("asset_mining")); //程序化创意2.0素材挖掘
                     }
                 }
-
                 if (!Check.isNull(groupCreateJson.getLong("template_id"))) {
-                    createJson.put("template_id", groupCreateJson.getLong("template_id")); //定向模板id
+                    if (sceneId != 5) {
+                        createJson.put("template_id", groupCreateJson.getLong("template_id")); //定向模板id
+                    } else { // 联盟广告位 需要根据模板id 获取定向数据
+                        JSONObject unionJson = groupTemplateService.getUnionJson(groupCreateJson.getLong("template_id"));
+                        Integer code = unionJson.getInteger("code");
+                        if (code == 0) {
+                            JSONObject target = unionJson.getJSONObject("target");
+                            createJson.put("target", target);
+                        }else{
+                            throw new Exception("联盟广告位定向模板错误");
+                        }
+                    }
                 } else {
                     JSONObject target = getTarget(groupCreateJson);
                     if (!Check.isNull(target)) {

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

@@ -139,7 +139,7 @@ public class BatchController {
             Thread thread1 = new Thread() {
                 @Override
                 public void run() {
-                    iKuaishouInterfaceService.getPopulationList(accountId, oauthToken.getAccessToken());
+                    iKuaishouInterfaceService.getPopulationList(accountId, oauthToken.getAccessToken(), 1);
                 }
             };
             thread1.start();
@@ -1121,12 +1121,7 @@ public class BatchController {
                 throw new Exception("账户id不能为空");
             }
             QueryWrapper<KuaiShouVideoGet> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouVideoGet, req.getParameterMap());
-            KuaiShouAdvertiserBaseInfo baseInfo = KuaiShouAdvertiserBaseInfoService.getBaseInfo(accountId);
-            if (!Check.isNull(baseInfo)) {
-                queryWrapper.eq("user_id", baseInfo.getUserId());
-            } else {
-                queryWrapper.eq("account_id", accountId);
-            }
+            queryWrapper.eq("account_id", accountId);
             if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
                 queryWrapper.between("stat_date", startDate, endDate);
             }
@@ -1969,14 +1964,7 @@ public class BatchController {
             if (Check.isNull(oauthToken)) {
                 throw new Exception("未获取到账户信息");
             }
-            Thread thread = new Thread() {
-                @Override
-                public void run() {
-                    iKuaishouInterfaceService.getPopulationList(accountId, oauthToken.getAccessToken());
-                }
-            };
-            thread.start();
-
+            iKuaishouInterfaceService.getPopulationList(accountId, oauthToken.getAccessToken(), 1);
             result.setSuccess(true);
         } catch (Exception e) {
             e.printStackTrace();

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaishouBatchCampaignPreview.java

@@ -103,7 +103,7 @@ public class KuaishouBatchCampaignPreview {
     /**
      * 是否创建成功 0 失败,1成功
      */
-    private int isSuccess;
+    private Integer isSuccess;
 
     /**
      * 操作说明

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

@@ -2,6 +2,9 @@ package cn.com.ctop.kuaishou.modules.batch.mapper;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @Description: 快手-应用列表
@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface KuaiShouAppListMapper extends BaseMapper<KuaiShouAppList> {
 
+    void replaceBatch(@Param("addList") List<KuaiShouAppList> addList);
 }

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

@@ -31,4 +31,6 @@ public interface KuaiShouGroupMapper extends BaseMapper<KuaiShouGroup> {
     List<KuaiShouGroup> queryUnitInfoByCampaignId(@Param("accountId") Long accountId, @Param("campaignId") Long campaignId);
 
     Integer queryToDayBuiltCount(@Param("accountId") Long accountId, @Param("date") String date);
+
+    void deleteByAccountId(@Param("accountId") Long accountId);
 }

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

@@ -21,8 +21,10 @@ public interface KuaiShouVideoGetMapper extends BaseMapper<KuaiShouVideoGet> {
 
     List<KuaiShouVideoGetVo> getVideoList(Map<String, Object> requestMap);
 
-    List<KuaiShouVideoGet> getHighQualityVideo(long accountId,int days,int num);
+    List<KuaiShouVideoGet> getHighQualityVideo(long accountId, int days, int num);
+
     List<KuaiShouVideoGet> selectPhotoIdsByAccountId(Long accountId);
+
     List<JSONObject> getVideoListByMap(Map<String, Object> requestMap);
 
     List<KuaiShouVideoGet> getPhotoIdsByParams(Long accountId, String signature);

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

@@ -3,6 +3,8 @@ package cn.com.ctop.kuaishou.modules.batch.mapper;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchCampaignPreview;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * 快手-广告计划预览信息
  *
@@ -12,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface KuaishouBatchCampaignPreviewMapper extends BaseMapper<KuaishouBatchCampaignPreview> {
 
+    List<KuaishouBatchCampaignPreview> queryListByTime();
 }

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

@@ -2,6 +2,9 @@ package cn.com.ctop.kuaishou.modules.batch.mapper;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouPopulation;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 人群包列表
@@ -12,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface KuaishouPopulationMapper extends BaseMapper<KuaishouPopulation> {
 
+    void replaceBatch(@Param("addList") List<KuaishouPopulation> addList);
 }

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

@@ -1,5 +1,34 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouAppListMapper">
+    <insert id="replaceBatch">
+        replace into ctop_kuaishou_app_list(
+        account_id,
+        app_id,
+        url,
+        app_version,
+        app_name,
+        app_icon_url,
+        image_token,
+        package_name,
+        platform,
+        return_time
+        )
+        values
+        <foreach collection="addList" item="appInfo" separator=",">
+            (
+            #{appInfo.accountId},
+            #{appInfo.appId},
+            #{appInfo.url},
+            #{appInfo.appVersion},
+            #{appInfo.appName},
+            #{appInfo.appIconUrl},
+            #{appInfo.imageToken},
+            #{appInfo.packageName},
+            #{appInfo.platform},
+            #{appInfo.returnTime}
+            )
+        </foreach>
+    </insert>
 
 </mapper>

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

@@ -137,4 +137,9 @@
           AND create_channel =1
           AND LOCATE(#{date}, group_create_time)
     </select>
+    <delete id="deleteByAccountId">
+        delete from ctop_kuaishou_group
+        where  account_id = #{accountId}
+    </delete>
+
 </mapper>

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

@@ -99,7 +99,8 @@
         stat_date as 'stat_date',
         material_type as 'material_type',
         channel_type as 'channel_type',
-        url as 'video_url'
+        url as 'video_url',
+        photo_name as 'photo_name'
         from ctop_kuaishou_video_get
         where 1 = 1
         <if test="accountId != null and accountId != '' ">
@@ -111,6 +112,10 @@
         <if test="endTime != null and endTime != '' ">
             and stat_date &lt;= #{endTime}
         </if>
+        <if test="appVersion != null and appVersion != '' ">
+            and photo_name like concat(#{appVersion},'%')
+        </if>
+        and status = 0
         group by signature
         order by stat_date desc
     </select>

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

@@ -2,4 +2,14 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouBatchCampaignPreviewMapper">
 
+    <select id="queryListByTime" resultType="cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchCampaignPreview">
+        SELECT id, campaign_id, account_id
+        FROM ctop_kuaishou_batch_campaign_preview
+        WHERE is_time = 1
+          AND is_success = 1
+          AND time_start &gt;= date_sub(now(), interval 5 minute)
+          AND time_start &lt;= now()
+          AND campaign_id is not null
+    </select>
+
 </mapper>

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

@@ -1,5 +1,35 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouPopulationMapper">
-
+    <insert id="replaceBatch">
+        replace into ctop_kuaishou_population(
+        account_id,
+        orientation_id,
+        orientation_name,
+        type,
+        population_type,
+        record_size,
+        match_size,
+        cover_num,
+        status,
+        put_time,
+        third_platform_code
+        )
+        values
+        <foreach collection="addList" item="population" separator=",">
+            (
+            #{population.accountId},
+            #{population.orientationId},
+            #{population.orientationName},
+            #{population.type},
+            #{population.populationType},
+            #{population.recordSize},
+            #{population.matchSize},
+            #{population.coverNum},
+            #{population.status},
+            #{population.putTime},
+            #{population.thirdPlatformCode}
+            )
+        </foreach>
+    </insert>
 </mapper>

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

@@ -23,31 +23,32 @@
 
     <select id="getVideoListByMap" resultType="com.alibaba.fastjson.JSONObject">
         select
-        photo_id as 'photo_id',
-        stat_date as 'stat_date',
-        creative_count as 'creative_count'
+        t1.photo_id as 'photo_id',
+        t1.stat_date as 'stat_date',
+        t1.creative_count as 'creative_count'
         FROM ctop_kuaishou_video_relate_creatives AS t1
-        JOIN (SELECT ROUND(RAND() * (SELECT MAX(id) FROM
-        ctop_kuaishou_video_relate_creatives
-        where 1 = 1
+        WHERE 1 = 1
         <if test="accountId != null and accountId != '' ">
-            and account_id = #{accountId}
+            and t1.account_id = #{accountId}
+        </if>
+        <if test="createCount != null and createCount != '' ">
+            AND t1.creative_count &lt;= #{createCount}
         </if>
         <if test="startTime != null and startTime != '' ">
-            and DATE_FORMAT(stat_date,'%Y-%m-%d') &gt;= #{startTime}
+            and t1.stat_date &gt;= #{startTime}
         </if>
         <if test="endTime != null and endTime != '' ">
-            and DATE_FORMAT(stat_date,'%Y-%m-%d') &lt;= #{endTime}
+            and t1.stat_date &lt;= #{endTime}
         </if>
-        )) AS id) AS t2
-        WHERE t1.id >= t2.id
-        <if test="accountId != null and accountId != '' ">
-            and account_id = #{accountId}
-        </if>
-        <if test="createCount != null and createCount != '' ">
-            AND creative_count &lt;= #{createCount}
+        <if test="appVersion != null and appVersion != '' ">
+            and t1.photo_id in (
+            select photo_id from ctop_kuaishou_video_get
+            where account_id = #{accountId}
+            and photo_name like CONCAT(#{appVersion},'%')
+            and status = 0
+            )
         </if>
-        ORDER BY t1.id ASC LIMIT #{num}
+        LIMIT #{num}
     </select>
 
     <select id="getVideoZeroListByMap" resultType="com.alibaba.fastjson.JSONObject">
@@ -60,31 +61,35 @@
         <if test="accountId != null and accountId != '' ">
             and account_id = #{accountId}
         </if>
-        <if test="creativeCount != null and creativeCount != '' ">
-            AND creative_count = #{creativeCount}
-        </if>
+        AND creative_count = 0
         <if test="startTime != null and startTime != '' ">
             AND stat_date &gt;= #{startTime}
         </if>
         <if test="endTime != null and endTime != '' ">
             AND stat_date &lt;= #{endTime}
         </if>
+        <if test="appVersion != null and appVersion != '' ">
+            and photo_id in (
+            select photo_id from ctop_kuaishou_video_get
+            where account_id = #{accountId}
+            and photo_name like concat(#{appVersion},'%')
+            and status = 0
+            )
+        </if>
         ORDER BY stat_date ASC
         LIMIT #{videoCnt}
     </select>
 
     <select id="getHistoryTopVideoList" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT
+        select
         t2.photo_id,
-        t2.signature,
-        t1.charge,
-        t2.channel_type,
-        t2.material_type as 'material_type',
-        t2.url as 'video_url'
+        t1.signature,
+        t1.charge
         FROM
         (
         SELECT
         sum(charge) as 'charge',
+        photo_id as 'photo_id',
         signature
         FROM
         ctop_kuaishou_report_daily_material
@@ -98,7 +103,11 @@
         account_id = #{accountId}
         and stat_date &gt;= #{startDate}
         and stat_date &lt;= #{endDate}
-        and signature is  not  null
+        <if test="appVersion != null and appVersion != '' ">
+            and photo_name like concat(#{appVersion},'%')
+        </if>
+        and status = 0
+        and signature is not null
         )
         GROUP BY
         signature
@@ -106,9 +115,15 @@
         sum(charge) DESC
         LIMIT #{num}
         ) t1
-        LEFT   JOIN ctop_kuaishou_video_get t2 ON t1.signature = t2.signature
-        AND t2.account_id = #{accountId}
-        GROUP BY t2.signature
+        LEFT JOIN (
+        SELECT
+        photo_id,
+        signature
+        FROM
+        ctop_kuaishou_video_get
+        WHERE
+        account_id = #{accountId}
+        ) t2 ON t1.signature = t2.signature
         ORDER BY t1.charge DESC
     </select>
 </mapper>

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

@@ -39,4 +39,6 @@ public interface IKuaiShouGroupService extends IService<KuaiShouGroup> {
     KuaiShouGroup selectGroupByUnitId(Long accountId, Long unitId);
 
     Integer queryToDayBuiltCount(Long accountId);
+
+    void deleteByAccountId(Long accountId);
 }

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

@@ -31,6 +31,7 @@ public interface IKuaiShouVideoGetService extends IService<KuaiShouVideoGet> {
     List<KuaiShouVideoGet> getNewVideoBetweenTime(Long accountId,String startTime, String endTime);
 
     List<JSONObject> getVideoListByMap(Map<String, Object> requestMap);
+
     List<KuaiShouVideoGet> selectPhotoIdsByAccountId(Long accountId);
 
     KuaiShouVideoGet getVideoByPhotoId(Long photo_id);

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

@@ -4,6 +4,8 @@ import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchCampaignPreview;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * @Description: 快手-广告计划预览信息
  * @Author: jeecg-boot
@@ -15,4 +17,14 @@ public interface IKuaishouBatchCampaignPreviewService extends IService<KuaishouB
     void addPreviewData(JSONObject data) throws Exception;
 
     JSONObject queryByBatchId(String batchId, String accountId);
+
+    /**
+     * 查询定时启动的计划集
+     *
+     * @param
+     * @return java.util.List<cn.com.ctop.kuaishou.modules.batch.entity.KuaishouBatchCampaignPreview>
+     * @throws
+     * @author ZHAOXA
+     */
+    List<KuaishouBatchCampaignPreview> queryListByTime();
 }

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

@@ -422,7 +422,7 @@ public interface IKuaishouInterfaceService {
      * @param accessToken
      * @return
      */
-    void getPopulationList(Long accountId, String accessToken);
+    void getPopulationList(Long accountId, String accessToken, Integer page);
 
 
     /**
@@ -445,8 +445,7 @@ public interface IKuaishouInterfaceService {
     JSONArray getAppSearch(Long accountId, String accessToken, String appName);
 
 
-
-   // void getSuZaoList(String token, Long accountId, int page, String startDate, String endDate);
+    // void getSuZaoList(String token, Long accountId, int page, String startDate, String endDate);
 
     /**
      * 异步获取创意信息

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

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.io.File;
+import java.util.List;
 
 /**
  * 人群包列表
@@ -101,4 +102,5 @@ public interface IKuaishouPopulationService extends IService<KuaishouPopulation>
      */
     Long predictionPopulation(Long accountId, JSONObject obj, String accessToken);
 
+    void replaceBatch(List<KuaishouPopulation> addList);
 }

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

@@ -144,6 +144,11 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
         return groupMapper.queryToDayBuiltCount(accountId, date);
     }
 
+    @Override
+    public void deleteByAccountId(Long accountId) {
+        groupMapper.deleteByAccountId(accountId);
+    }
+
 
     @Override
     public void getGroupByUnitId(String accessToken, Long accountId, Long unitId) {

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

@@ -121,6 +121,10 @@ public class KuaishouBatchCampaignPreviewServiceImpl extends ServiceImpl<Kuaisho
         }
         return campaigns;
     }
+    @Override
+    public List<KuaishouBatchCampaignPreview> queryListByTime() {
+        return campaignPreviewMapper.queryListByTime();
+    }
 
     /**
      * 添加预览数据

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

@@ -183,7 +183,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     private void getVideoListByPage(CtopOauthToken token, String startDate, String endDate, int page) {
         try {
-            log.info("获取视频数据,accountId:{}", token.getAccountId());
+          //  log.info("获取视频数据,accountId:{}", token.getAccountId());
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.VIDEO_LIST;
             Map<String, String> headers = new HashMap<>();
             headers.put("Content-Type", "application/json");
@@ -2771,7 +2771,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
 
     @Override
-    public void getPopulationList(Long accountId, String accessToken) {
+    public void getPopulationList(Long accountId, String accessToken, Integer page) {
         try {
             log.info("获取人群包列表,accountId:{}", accountId);
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.POPULATION_LIST;
@@ -2781,7 +2781,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             JSONObject requestJson = new JSONObject();
             requestJson.put("advertiser_id", accountId);
             requestJson.put("status", 4);
-            requestJson.put("page", 1);
+            requestJson.put("page", page);
             requestJson.put("page_size", 500);
             String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
             JSONObject resultJson = JSONObject.parseObject(result);
@@ -2789,37 +2789,37 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                 Integer code = resultJson.getInteger("code");
                 if (code == 0) {
                     JSONObject dataDetailJson = resultJson.getJSONObject("data");
-                    if (!Check.isNull(dataDetailJson)) {
-                        Map<String, Object> deleteMap = new HashMap<>();
+                    if (Check.isNull(dataDetailJson)) {
+                        return;
+                    }
+                    JSONArray details = dataDetailJson.getJSONArray("details");
+                    if (Check.isNull(details)) {
+                        return;
+                    }
 
-                        JSONArray details = dataDetailJson.getJSONArray("details");
-                        if (Check.isNull(details)) {
-                            return;
-                        }
-                        deleteMap.put("account_id", accountId);
-                        populationService.removeByMap(deleteMap);
-                        for (int i = 0; i < details.size(); i++) {
-                            JSONObject dataJson = details.getJSONObject(i);
-                            if (!Check.isNull(dataJson)) {
-                                KuaishouPopulation population = new KuaishouPopulation();
-                                population.setOrientationId(dataJson.getLong("orientation_id"));
-                                population.setOrientationName(dataJson.getString("orientation_name"));
-                                population.setType(dataJson.getInteger("type"));
-                                population.setPopulationType(dataJson.getInteger("population_type"));
-                                population.setRecordSize(dataJson.getLong("record_size"));
-                                population.setMatchSize(dataJson.getLong("match_size"));
-                                population.setCoverNum(dataJson.getLong("cover_num"));
-                                population.setStatus(dataJson.getInteger("status"));
-                                population.setPutTime(dataJson.getDate("create_time"));
-                                population.setThirdPlatformCode(dataJson.getLong("third_platform_code"));
-                                population.setAccountId(accountId);
-                                populationService.save(population);
+                    List<KuaishouPopulation> addList = new ArrayList<>();
+                    for (int i = 0; i < details.size(); i++) {
+                        JSONObject dataJson = details.getJSONObject(i);
+                        if (!Check.isNull(dataJson)) {
+                            KuaishouPopulation population = new KuaishouPopulation();
+                            population.setOrientationId(dataJson.getLong("orientation_id"));
+                            population.setOrientationName(dataJson.getString("orientation_name"));
+                            population.setType(dataJson.getInteger("type"));
+                            population.setPopulationType(dataJson.getInteger("population_type"));
+                            population.setRecordSize(dataJson.getLong("record_size"));
+                            population.setMatchSize(dataJson.getLong("match_size"));
+                            population.setCoverNum(dataJson.getLong("cover_num"));
+                            population.setStatus(dataJson.getInteger("status"));
+                            population.setPutTime(dataJson.getDate("create_time"));
+                            population.setThirdPlatformCode(dataJson.getLong("third_platform_code"));
+                            population.setAccountId(accountId);
+                            addList.add(population);
+                            // populationService.save(population);
 
-                            }
                         }
-
                     }
-
+                    populationService.replaceBatch(addList);
+                    getPopulationList(accountId, accessToken, page + 1);
                 } else {
                     log.error("获取人群包管理返回数据为空,accountId:{}", accountId);
 
@@ -3340,37 +3340,34 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             if (!Check.isNull(resultJson)) {
                 Integer code = resultJson.getInteger("code");
                 if (code == 0) {
-                    if (page == 1) { //分页保存数据,如果页数为1,删除之前的数据重新入库
-                        Map<String, Object> deleteMap = new HashMap<>();
-                        deleteMap.put("account_id", advertiserId);
-                        appListMapper.deleteByMap(deleteMap);
-                    }
                     JSONObject data = resultJson.getJSONObject("data");
-                    if (!Check.isNull(data)) {
-                        Integer totalCount = data.getInteger("total_count");
-                        JSONArray dataArr = data.getJSONArray("details");
-                        for (int i = 0; i < dataArr.size(); i++) {
-                            JSONObject dataJson = JSONObject.parseObject(dataArr.get(i).toString());
-                            if (!Check.isNull(dataJson)) {
-                                KuaiShouAppList appList = new KuaiShouAppList();
-                                appList.setAccountId(advertiserId);
-                                appList.setPlatform(dataJson.getInteger("platform"));
-                                appList.setUrl(dataJson.getString("url"));
-                                appList.setAppId(dataJson.getLong("app_id"));
-                                appList.setAppVersion(dataJson.getString("app_version"));
-                                appList.setAppName(dataJson.getString("app_name"));
-                                appList.setAppIconUrl(dataJson.getString("app_icon_url"));
-                                appList.setImageToken(dataJson.getString("image_token"));
-                                appList.setPackageName(dataJson.getString("package_name"));
-                                appList.setReturnTime(DateUtils.timeStamp2Date(dataJson.getTimestamp("update_time")));
-                                appListMapper.insert(appList);
-                            }
-                        }
-                        Integer totalPage = (totalCount - 1) / pageSize + 1;
-                        if (page < totalPage) {
-                            getAppList2ByPage(advertiserId, accessToken, page + 1, pageSize);
+                    if (Check.isNull(data)) {
+                        return;
+                    }
+                    JSONArray dataArr = data.getJSONArray("details");
+                    if (Check.isNull(dataArr)) {
+                        return;
+                    }
+                    List<KuaiShouAppList> addList = new ArrayList<>();
+                    for (int i = 0; i < dataArr.size(); i++) {
+                        JSONObject dataJson = JSONObject.parseObject(dataArr.get(i).toString());
+                        if (!Check.isNull(dataJson)) {
+                            KuaiShouAppList appList = new KuaiShouAppList();
+                            appList.setAccountId(advertiserId);
+                            appList.setPlatform(dataJson.getInteger("platform"));
+                            appList.setUrl(dataJson.getString("url"));
+                            appList.setAppId(dataJson.getLong("app_id"));
+                            appList.setAppVersion(dataJson.getString("app_version"));
+                            appList.setAppName(dataJson.getString("app_name"));
+                            appList.setAppIconUrl(dataJson.getString("app_icon_url"));
+                            appList.setImageToken(dataJson.getString("image_token"));
+                            appList.setPackageName(dataJson.getString("package_name"));
+                            appList.setReturnTime(DateUtils.timeStamp2Date(dataJson.getTimestamp("update_time")));
+                            addList.add(appList);
                         }
                     }
+                    appListMapper.replaceBatch(addList);
+                    getAppList2ByPage(advertiserId, accessToken, page + 1, pageSize);
                 } else {
                     log.error("获取应用列表失败,返回信息:{}", resultJson);
                 }

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

@@ -10,10 +10,12 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouPopulationService;
 import com.alibaba.fastjson.JSONObject;
 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 java.io.File;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -27,7 +29,8 @@ import java.util.Map;
 @Service
 public class KuaishouPopulationServiceImpl extends ServiceImpl<KuaishouPopulationMapper, KuaishouPopulation> implements IKuaishouPopulationService {
 
-
+    @Autowired
+    private KuaishouPopulationMapper populationMapper;
     private String urlPath = PropertiesUtils.getConfig("kuaishou_api_url");
 
     /**
@@ -327,4 +330,9 @@ public class KuaishouPopulationServiceImpl extends ServiceImpl<KuaishouPopulatio
         }
         return null;
     }
+
+    @Override
+    public void replaceBatch(List<KuaishouPopulation> addList) {
+        populationMapper.replaceBatch(addList);
+    }
 }

+ 103 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/entity/EtlKuaishouVideoInfo.java

@@ -0,0 +1,103 @@
+package cn.com.ctop.kuaishou.modules.material.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
+ * @date   2021-02-20
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_etl_kuaishou_video_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_etl_kuaishou_video_info对象", description="快手视频报表信息")
+public class EtlKuaishouVideoInfo {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**视频唯一标识*/
+	@Excel(name = "视频唯一标识", width = 15)
+    @ApiModelProperty(value = "视频唯一标识")
+	private String videoCode;
+	/**初次产生消耗时间*/
+	@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;
+	/**url*/
+	@Excel(name = "url", width = 15)
+    @ApiModelProperty(value = "url")
+	private String url;
+	/**coverUrl*/
+	@Excel(name = "coverUrl", width = 15)
+    @ApiModelProperty(value = "coverUrl")
+	private String coverUrl;
+	/**渠道类型*/
+	@Excel(name = "渠道类型", width = 15)
+    @ApiModelProperty(value = "渠道类型")
+	private String channelType;
+	/**渠道名称*/
+	@Excel(name = "渠道名称", width = 15)
+    @ApiModelProperty(value = "渠道名称")
+	private String channelName;
+	/**companyName*/
+	@Excel(name = "companyName", width = 15)
+    @ApiModelProperty(value = "companyName")
+	private String companyName;
+	/**planId*/
+	@Excel(name = "planId", width = 15)
+    @ApiModelProperty(value = "planId")
+	private String planId;
+	/**planName*/
+	@Excel(name = "planName", width = 15)
+    @ApiModelProperty(value = "planName")
+	private String planName;
+	/**clipId*/
+	@Excel(name = "clipId", width = 15)
+    @ApiModelProperty(value = "clipId")
+	private String clipId;
+	/**clipName*/
+	@Excel(name = "clipName", width = 15)
+    @ApiModelProperty(value = "clipName")
+	private String clipName;
+	/**shotId*/
+	@Excel(name = "shotId", width = 15)
+    @ApiModelProperty(value = "shotId")
+	private String shotId;
+	/**shotName*/
+	@Excel(name = "shotName", width = 15)
+    @ApiModelProperty(value = "shotName")
+	private String shotName;
+	/**designTeamLeaderId*/
+	@Excel(name = "designTeamLeaderId", width = 15)
+    @ApiModelProperty(value = "designTeamLeaderId")
+	private String designTeamLeaderId;
+	/**designTeamLeaderName*/
+	@Excel(name = "designTeamLeaderName", width = 15)
+    @ApiModelProperty(value = "designTeamLeaderName")
+	private String designTeamLeaderName;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.material.mapper;
+
+import cn.com.ctop.kuaishou.modules.material.entity.EtlKuaishouVideoInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 快手视频报表信息
+ * @author: jeecg-boot
+ * @date:   2021-02-20
+ * @cersion: V1.0
+ */
+public interface EtlKuaishouVideoInfoMapper extends BaseMapper<EtlKuaishouVideoInfo> {
+
+}

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

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

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.material.service;
+
+import cn.com.ctop.kuaishou.modules.material.entity.EtlKuaishouVideoInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 快手视频报表信息
+ * @Author: jeecg-boot
+ * @Date:   2021-02-20
+ * @Version: V1.0
+ */
+public interface IEtlKuaishouVideoInfoService extends IService<EtlKuaishouVideoInfo> {
+    void  etlKuaishouVideoInfo(String date);
+}

+ 22 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/material/service/impl/EtlKuaishouVideoInfoServiceImpl.java

@@ -0,0 +1,22 @@
+package cn.com.ctop.kuaishou.modules.material.service.impl;
+
+import cn.com.ctop.kuaishou.modules.material.entity.EtlKuaishouVideoInfo;
+import cn.com.ctop.kuaishou.modules.material.mapper.EtlKuaishouVideoInfoMapper;
+import cn.com.ctop.kuaishou.modules.material.service.IEtlKuaishouVideoInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 快手视频报表信息
+ * @author jeecg-boot
+ * @date   2021-02-20
+ * @version V1.0
+ */
+@Service
+public class EtlKuaishouVideoInfoServiceImpl extends ServiceImpl<EtlKuaishouVideoInfoMapper, EtlKuaishouVideoInfo> implements IEtlKuaishouVideoInfoService {
+
+    @Override
+    public void etlKuaishouVideoInfo(String date) {
+        //1:查询
+    }
+}

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

@@ -0,0 +1,265 @@
+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
+ * @date   2021-02-20
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_etl_kuaishou_report_video_daily")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_etl_kuaishou_report_video_daily对象", description="快手视频分日报表信息")
+public class EtlKuaishouReportVideoDaily {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+	private Long id;
+	/**数据日期*/
+	@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 statDate;
+	/**videoCode*/
+	@Excel(name = "videoCode", width = 15)
+    @ApiModelProperty(value = "videoCode")
+	private String videoCode;
+	/**花费(元)*/
+	@Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+	private java.math.BigDecimal charge;
+	/**曝光数*/
+	@Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+	private Integer photoShow;
+	/**素材曝光数*/
+	@Excel(name = "素材曝光数", width = 15)
+    @ApiModelProperty(value = "素材曝光数")
+	private Integer aclick;
+	/**行为数*/
+	@Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+	private Integer bclick;
+	/**分享数*/
+	@Excel(name = "分享数", width = 15)
+    @ApiModelProperty(value = "分享数")
+	private Integer photoShare;
+	/**评论数*/
+	@Excel(name = "评论数", width = 15)
+    @ApiModelProperty(value = "评论数")
+	private Integer photoComment;
+	/**点赞数*/
+	@Excel(name = "点赞数", width = 15)
+    @ApiModelProperty(value = "点赞数")
+	private Integer photoLike;
+	/**新增关注数*/
+	@Excel(name = "新增关注数", width = 15)
+    @ApiModelProperty(value = "新增关注数")
+	private Integer follow;
+	/**取消关注数*/
+	@Excel(name = "取消关注数", width = 15)
+    @ApiModelProperty(value = "取消关注数")
+	private Integer cancelFollow;
+	/**举报数*/
+	@Excel(name = "举报数", width = 15)
+    @ApiModelProperty(value = "举报数")
+	private Integer report;
+	/**拉黑数*/
+	@Excel(name = "拉黑数", width = 15)
+    @ApiModelProperty(value = "拉黑数")
+	private Integer block;
+	/**减少此类作品数*/
+	@Excel(name = "减少此类作品数", width = 15)
+    @ApiModelProperty(value = "减少此类作品数")
+	private Integer negative;
+	/**应用下载数据-安卓下载开始数*/
+	@Excel(name = "应用下载数据-安卓下载开始数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载开始数")
+	private Integer downloadStarted;
+	/**应用下载数据-安卓下载完成数*/
+	@Excel(name = "应用下载数据-安卓下载完成数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-安卓下载完成数")
+	private Integer downloadCompleted;
+	/**应用下载数据-激活数*/
+	@Excel(name = "应用下载数据-激活数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-激活数")
+	private Integer activation;
+	/**提交按钮点击数*/
+	@Excel(name = "提交按钮点击数", width = 15)
+    @ApiModelProperty(value = "提交按钮点击数")
+	private Integer submit;
+	/**封面点击数*/
+	@Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+	private Integer photoClick;
+	/**封面点击率*/
+	@Excel(name = "封面点击率", width = 15)
+    @ApiModelProperty(value = "封面点击率")
+	private Double photoClickRatio;
+	/**行为率*/
+	@Excel(name = "行为率", width = 15)
+    @ApiModelProperty(value = "行为率")
+	private Double actionRatio;
+	/**平均千次曝光花费(元)*/
+	@Excel(name = "平均千次曝光花费(元)", width = 15)
+    @ApiModelProperty(value = "平均千次曝光花费(元)")
+	private java.math.BigDecimal impression1kCost;
+	/**平均点击单价(元)*/
+	@Excel(name = "平均点击单价(元)", width = 15)
+    @ApiModelProperty(value = "平均点击单价(元)")
+	private java.math.BigDecimal photoClickCost;
+	/**平均行为单价(元)*/
+	@Excel(name = "平均行为单价(元)", width = 15)
+    @ApiModelProperty(value = "平均行为单价(元)")
+	private java.math.BigDecimal actionCost;
+	/**应用下载数据-首日付费次数*/
+	@Excel(name = "应用下载数据-首日付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费次数")
+	private Integer eventPayFirstDay;
+	/**应用下载数据-首日付费金额*/
+	@Excel(name = "应用下载数据-首日付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日付费金额")
+	private java.math.BigDecimal eventPayPurchaseAmountFirstDay;
+	/**应用下载数据-首日ROI*/
+	@Excel(name = "应用下载数据-首日ROI", width = 15)
+    @ApiModelProperty(value = "应用下载数据-首日ROI")
+	private Double eventPayFirstDayRoi;
+	/**应用下载数据-付费次数*/
+	@Excel(name = "应用下载数据-付费次数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费次数")
+	private Integer eventPay;
+	/**应用下载数据-付费金额*/
+	@Excel(name = "应用下载数据-付费金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付费金额")
+	private java.math.BigDecimal eventPayPurchaseAmount;
+	/**应用下载数据-ROI*/
+	@Excel(name = "应用下载数据-ROI", width = 15)
+    @ApiModelProperty(value = "应用下载数据-ROI")
+	private Double eventPayRoi;
+	/**应用下载数据-注册数*/
+	@Excel(name = "应用下载数据-注册数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册数")
+	private Integer eventRegister;
+	/**应用下载数据-注册成本*/
+	@Excel(name = "应用下载数据-注册成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册成本")
+	private java.math.BigDecimal eventRegisterCost;
+	/**应用下载数据-注册率*/
+	@Excel(name = "应用下载数据-注册率", width = 15)
+    @ApiModelProperty(value = "应用下载数据-注册率")
+	private Double eventRegisterRatio;
+	/**应用下载数据-完件数*/
+	@Excel(name = "应用下载数据-完件数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-完件数")
+	private Integer eventJinJianApp;
+	/**应用下载数据-完件成本*/
+	@Excel(name = "应用下载数据-完件成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-完件成本")
+	private java.math.BigDecimal eventJinJianAppCost;
+	/**应用下载数据-授信数*/
+	@Excel(name = "应用下载数据-授信数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信数")
+	private Integer eventCreditGrantApp;
+	/**应用下载数据-授信成本*/
+	@Excel(name = "应用下载数据-授信成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信成本")
+	private java.math.BigDecimal eventCreditGrantAppCost;
+	/**应用下载数据-授信率*/
+	@Excel(name = "应用下载数据-授信率", width = 15)
+    @ApiModelProperty(value = "应用下载数据-授信率")
+	private Double eventCreditGrantAppRatio;
+	/**应用下载数据-付款成功数*/
+	@Excel(name = "应用下载数据-付款成功数", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功数")
+	private Integer eventOrderPaid;
+	/**应用下载数据-付款成功金额*/
+	@Excel(name = "应用下载数据-付款成功金额", width = 15)
+    @ApiModelProperty(value = "应用下载数据-付款成功金额")
+	private java.math.BigDecimal eventOrderPaidPurchaseAmount;
+	/**落地页数据-落地页完件数*/
+	@Excel(name = "落地页数据-落地页完件数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页完件数")
+	private Integer eventJinJianLandingPage;
+	/**落地页数据-落地页完件成本*/
+	@Excel(name = "落地页数据-落地页完件成本", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页完件成本")
+	private java.math.BigDecimal eventJinJianLandingPageCost;
+	/**落地页数据-落地页授信数*/
+	@Excel(name = "落地页数据-落地页授信数", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信数")
+	private Integer eventCreditGrantLandingPage;
+	/**落地页数据-落地页授信成本*/
+	@Excel(name = "落地页数据-落地页授信成本", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信成本")
+	private java.math.BigDecimal eventCreditGrantLandingPageCost;
+	/**落地页数据-落地页授信率*/
+	@Excel(name = "落地页数据-落地页授信率", width = 15)
+    @ApiModelProperty(value = "落地页数据-落地页授信率")
+	private Double eventCreditGrantLandingRatio;
+	/**应用下载数据-次留成本(仅支持分日查询)*/
+	@Excel(name = "应用下载数据-次留成本(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留成本(仅支持分日查询)")
+	private java.math.BigDecimal eventNextDayStayCost;
+	/**应用下载数据-次留率(仅支持分日查询)*/
+	@Excel(name = "应用下载数据-次留率(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留率(仅支持分日查询)")
+	private Integer eventNextDayStayRatio;
+	/**落地页数据-表单提交点击率*/
+	@Excel(name = "落地页数据-表单提交点击率", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交点击率")
+	private Double formActionRatio;
+	/**应用下载数据-单次付款成本*/
+	@Excel(name = "应用下载数据-单次付款成本", width = 15)
+    @ApiModelProperty(value = "应用下载数据-单次付款成本")
+	private java.math.BigDecimal eventOrderPaidCost;
+	/**应用下载数据-次留数(仅支持分日查询)*/
+	@Excel(name = "应用下载数据-次留数(仅支持分日查询)", width = 15)
+    @ApiModelProperty(value = "应用下载数据-次留数(仅支持分日查询)")
+	private Integer eventNextDayStay;
+	/**落地页数据-表单提交单价*/
+	@Excel(name = "落地页数据-表单提交单价", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交单价")
+	private java.math.BigDecimal formCost;
+	/**落地页数据-表单提交数*/
+	@Excel(name = "落地页数据-表单提交数", width = 15)
+    @ApiModelProperty(value = "落地页数据-表单提交数")
+	private Integer formCount;
+	/**3s播放率*/
+	@Excel(name = "3s播放率", width = 15)
+    @ApiModelProperty(value = "3s播放率")
+	private Double play3sRatio;
+	/**3s播放数*/
+	@Excel(name = "3s播放数", width = 15)
+    @ApiModelProperty(value = "3s播放数")
+	private Integer 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;
+}

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportVideoDaily;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 快手视频分日报表信息
+ * @author: jeecg-boot
+ * @date:   2021-02-20
+ * @cersion: V1.0
+ */
+public interface EtlKuaishouReportVideoDailyMapper extends BaseMapper<EtlKuaishouReportVideoDaily> {
+
+}

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

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

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.report.service;
+
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportVideoDaily;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 快手视频分日报表信息
+ * @Author: jeecg-boot
+ * @Date:   2021-02-20
+ * @Version: V1.0
+ */
+public interface IEtlKuaishouReportVideoDailyService extends IService<EtlKuaishouReportVideoDaily> {
+
+}

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

@@ -0,0 +1,18 @@
+package cn.com.ctop.kuaishou.modules.report.service.impl;
+
+import cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportVideoDaily;
+import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouReportVideoDailyMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IEtlKuaishouReportVideoDailyService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 快手视频分日报表信息
+ * @author jeecg-boot
+ * @date   2021-02-20
+ * @version V1.0
+ */
+@Service
+public class EtlKuaishouReportVideoDailyServiceImpl extends ServiceImpl<EtlKuaishouReportVideoDailyMapper, EtlKuaishouReportVideoDaily> implements IEtlKuaishouReportVideoDailyService {
+
+}

+ 2 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/mapper/ETLReportBytedanceVideoMapper.java

@@ -28,4 +28,6 @@ public interface ETLReportBytedanceVideoMapper extends BaseMapper<ETLReportByted
     JSONObject queryAccountDetailByAccountId(@Param("accountId") Long accountId);
 
     List<ETLReportBytedanceVideo> queryETLData(@Param("statDate") String statDate);
+
+    void insertBatch(@Param("records") List<ETLReportBytedanceVideo>records);
 }

+ 201 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/mapper/xml/ETLReportBytedanceVideoMapper.xml

@@ -1,6 +1,206 @@
 <?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.toutiao.modules.link.mapper.ETLReportBytedanceVideoMapper">
+    <insert id="insertBatch">
+        insert into etl_report_bytedance_video(
+        material_id,
+        material_name,
+        md5,
+        url,
+        toutiao_url,
+        cover_url,
+        account_id,
+        account_name,
+        project_id,
+        project_name,
+        product_id,
+        product_name,
+        advertiser_id,
+        advertiser_name,
+        clip_id,
+        clip_name,
+        shot_id,
+        shot_name,
+        plan_id,
+        plan_name,
+        material_create_time,
+        stat_datetime,
+        click,
+        cost,
+        in_app_cart,
+        in_app_order,
+        in_app_pay,
+        phone,
+        form,
+        map_search,
+        view_material,
+        qq,
+        lottery,
+        vote,
+        redirect,
+        shopping,
+        consult,
+        wechat,
+        phone_confirm,
+        phone_connect,
+        consult_effective,
+        total_play,
+        valid_play,
+        wifi_play,
+        play25_feed_break_rate,
+        play25_feed_break,
+        play50_feed_break,
+        play75_feed_break,
+        play100_feed_break,
+        advanced_creative_phone_click,
+        advanced_creative_counsel_click,
+        advanced_creative_form_click,
+        share_material,
+        comment_material,
+        follow,
+        home_visited,
+        ies_challenge_click,
+        ies_music_click,
+        next_day_open,
+        next_day_open_rate,
+        next_day_open_cost,
+        active_pay_amount,
+        valid_play_cost,
+        advanced_creative_coupon_addition,
+        convert_material,
+        active_pay_cost,
+        download,
+        cpc,
+        location_click,
+        play_over_rate,
+        ctr,
+        cpm,
+        wifi_play_rate,
+        like_material,
+        active_cost,
+        game_addiction_cost,
+        game_addiction,
+        active_rate,
+        game_addiction_rate,
+        active_register_rate,
+        download_finish_cost,
+        active_register_cost,
+        convert_rate,
+        download_finish_rate,
+        install_finish_rate,
+        coupon,
+        coupon_single_page,
+        play_over,
+        download_start_cost,
+        message,
+        valid_play_rate,
+        average_play_time_per_play,
+        convert_cost,
+        install_finish_cost,
+        download_start_rate,
+        show_material
+        )
+        values
+        <foreach collection="mlist" item="image" separator=",">
+            (#{image.accountId},
+            #{image.projectId},
+            #{image.projectName},
+            #{image.advertiserId},
+            #{image.advertiserName},
+            #{image.signature},
+            #{image.videoUrl},
+            #{image.url},
+            #{image.huanbi},
+            #{image.materialName},
+            #{image.appType},
+            #{image.companyId},
+            #{image.materialId},
+            #{image.statDatetime},
+            #{image.click},
+            #{image.cost},
+            #{image.active},
+            #{image.downloadFinish},
+            #{image.downloadStart},
+            #{image.installFinish},
+            #{image.register},
+            #{image.payCount},
+            #{image.inAppUv},
+            #{image.inAppDetailUv},
+            #{image.inAppCart},
+            #{image.inAppOrder},
+            #{image.inAppPay},
+            #{image.phone},
+            #{image.form},
+            #{image.mapSearch},
+            #{image.viewMaterial},
+            #{image.qq},
+            #{image.lottery},
+            #{image.vote},
+            #{image.redirect},
+            #{image.shopping},
+            #{image.consult},
+            #{image.wechat},
+            #{image.phoneConfirm},
+            #{image.phoneConnect},
+            #{image.consultEffective},
+            #{image.totalPlay},
+            #{image.validPlay},
+            #{image.wifiPlay},
+            #{image.play25FeedBreakRate},
+            #{image.play25FeedBreak},
+            #{image.play50FeedBreak},
+            #{image.play75FeedBreak},
+            #{image.play100FeedBreak},
+            #{image.advancedCreativePhoneClick},
+            #{image.advancedCreativeCounselClick},
+            #{image.advancedCreativeFormClick},
+            #{image.shareMaterial},
+            #{image.commentMaterial},
+            #{image.follow},
+            #{image.homeVisited},
+            #{image.iesChallengeClick},
+            #{image.iesMusicClick},
+            #{image.nextDayOpen},
+            #{image.nextDayOpenRate},
+            #{image.nextDayOpenCost},
+            #{image.activePayAmount},
+            #{image.validPlayCost},
+            #{image.advancedCreativeCouponAddition},
+            #{image.convertMaterial},
+            #{image.activePayCost},
+            #{image.download},
+            #{image.cpc},
+            #{image.locationClick},
+            #{image.playOverRate},
+            #{image.ctr},
+            #{image.cpm},
+            #{image.wifiPlayRate},
+            #{image.likeMaterial},
+            #{image.activeCost},
+            #{image.gameAddictionCost},
+            #{image.gameAddiction},
+            #{image.activeRate},
+            #{image.gameAddictionRate},
+            #{image.activeRegisterRate},
+            #{image.downloadFinishCost},
+            #{image.activeRegisterCost},
+            #{image.convertRate},
+            #{image.downloadFinishRate},
+            #{image.installFinishRate},
+            #{image.coupon},
+            #{image.couponSinglePage},
+            #{image.playOver},
+            #{image.downloadStartCost},
+            #{image.message},
+            #{image.validPlayRate},
+            #{image.averagePlayTimePerPlay},
+            #{image.convertCost},
+            #{image.installFinishCost},
+            #{image.downloadStartRate},
+            #{image.showMaterial}
+            )
+        </foreach>
+    </insert>
     <select id="queryVideoInfoByMaterialId"  resultType="com.alibaba.fastjson.JSONObject">
         SELECT
             signature AS md5,
@@ -106,4 +306,4 @@
                 LEFT JOIN (SELECT account_id, advertiser_id,project_id,auth_name from ctop_user_allocation where account_id in (SELECT DISTINCT account_id from base_report_bytedance_video_daily where stat_datetime=#{statDate})) t5 on t1.account_id=t5.account_id
         GROUP BY t1.id
     </select>
-</mapper>
+</mapper>

+ 9 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/service/impl/ETLReportBytedanceVideoServiceImpl.java

@@ -14,8 +14,12 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import javax.naming.ldap.HasControls;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 头条视频报表ETL
@@ -27,7 +31,7 @@ public class ETLReportBytedanceVideoServiceImpl extends ServiceImpl<ETLReportByt
     @Autowired
     IBaseReportBytedanceVideoDailyService baseReportBytedanceVideoDailyService;
 
-    @Autowired
+    @Resource
     ETLReportBytedanceVideoMapper etlReportBytedanceVideoMapper;
 
     @Override
@@ -91,15 +95,17 @@ public class ETLReportBytedanceVideoServiceImpl extends ServiceImpl<ETLReportByt
     @Override
     public void cleanETL(String statDate) {
         List<ETLReportBytedanceVideo> etlReportBytedanceVideos = etlReportBytedanceVideoMapper.queryETLData(statDate);
+        System.out.println(statDate+":"+etlReportBytedanceVideos.size());
         if(etlReportBytedanceVideos.isEmpty()){
             log.warn("{},头条etl报表清洗异常,base数据源为空",statDate);
             return;
         }
         boolean result = this.saveBatch(etlReportBytedanceVideos);
-        if(result)
+        if(result){
             log.info("{},头条etl报表清洗完成,数量:{}",statDate,etlReportBytedanceVideos.size());
-        else
+        } else{
             log.error("{},头条etl报表清洗失败,请重试",statDate);
+        }
     }
 
 }

+ 103 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/EtlBytedanceVideoInfo.java

@@ -0,0 +1,103 @@
+package cn.com.ctop.toutiao.modules.material.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
+ * @date   2021-02-20
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_etl_bytedance_video_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_etl_bytedance_video_info对象", description="头条视频报表信息")
+public class EtlBytedanceVideoInfo {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**视频唯一标识*/
+	@Excel(name = "视频唯一标识", width = 15)
+    @ApiModelProperty(value = "视频唯一标识")
+	private String videoCode;
+	/**初次产生消耗时间*/
+	@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;
+	/**url*/
+	@Excel(name = "url", width = 15)
+    @ApiModelProperty(value = "url")
+	private String url;
+	/**coverUrl*/
+	@Excel(name = "coverUrl", width = 15)
+    @ApiModelProperty(value = "coverUrl")
+	private String coverUrl;
+	/**渠道类型*/
+	@Excel(name = "渠道类型", width = 15)
+    @ApiModelProperty(value = "渠道类型")
+	private String channelType;
+	/**渠道名称*/
+	@Excel(name = "渠道名称", width = 15)
+    @ApiModelProperty(value = "渠道名称")
+	private String channelName;
+	/**companyName*/
+	@Excel(name = "companyName", width = 15)
+    @ApiModelProperty(value = "companyName")
+	private String companyName;
+	/**planId*/
+	@Excel(name = "planId", width = 15)
+    @ApiModelProperty(value = "planId")
+	private String planId;
+	/**planName*/
+	@Excel(name = "planName", width = 15)
+    @ApiModelProperty(value = "planName")
+	private String planName;
+	/**clipId*/
+	@Excel(name = "clipId", width = 15)
+    @ApiModelProperty(value = "clipId")
+	private String clipId;
+	/**clipName*/
+	@Excel(name = "clipName", width = 15)
+    @ApiModelProperty(value = "clipName")
+	private String clipName;
+	/**shotId*/
+	@Excel(name = "shotId", width = 15)
+    @ApiModelProperty(value = "shotId")
+	private String shotId;
+	/**shotName*/
+	@Excel(name = "shotName", width = 15)
+    @ApiModelProperty(value = "shotName")
+	private String shotName;
+	/**designTeamLeaderId*/
+	@Excel(name = "designTeamLeaderId", width = 15)
+    @ApiModelProperty(value = "designTeamLeaderId")
+	private String designTeamLeaderId;
+	/**designTeamLeaderName*/
+	@Excel(name = "designTeamLeaderName", width = 15)
+    @ApiModelProperty(value = "designTeamLeaderName")
+	private String designTeamLeaderName;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

+ 14 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/EtlBytedanceVideoInfoMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.toutiao.modules.material.mapper;
+
+import cn.com.ctop.toutiao.modules.material.entity.EtlBytedanceVideoInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 头条视频报表信息
+ * @author: jeecg-boot
+ * @date:   2021-02-20
+ * @cersion: V1.0
+ */
+public interface EtlBytedanceVideoInfoMapper extends BaseMapper<EtlBytedanceVideoInfo> {
+
+}

+ 5 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/EtlBytedanceVideoInfoMapper.xml

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

+ 14 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IEtlBytedanceVideoInfoService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.toutiao.modules.material.service;
+
+import cn.com.ctop.toutiao.modules.material.entity.EtlBytedanceVideoInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 头条视频报表信息
+ * @Author: jeecg-boot
+ * @Date:   2021-02-20
+ * @Version: V1.0
+ */
+public interface IEtlBytedanceVideoInfoService extends IService<EtlBytedanceVideoInfo> {
+
+}

+ 18 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/EtlBytedanceVideoInfoServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.toutiao.modules.material.service.impl;
+
+import cn.com.ctop.toutiao.modules.material.entity.EtlBytedanceVideoInfo;
+import cn.com.ctop.toutiao.modules.material.mapper.EtlBytedanceVideoInfoMapper;
+import cn.com.ctop.toutiao.modules.material.service.IEtlBytedanceVideoInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 头条视频报表信息
+ * @author jeecg-boot
+ * @date   2021-02-20
+ * @version V1.0
+ */
+@Service
+public class EtlBytedanceVideoInfoServiceImpl extends ServiceImpl<EtlBytedanceVideoInfoMapper, EtlBytedanceVideoInfo> implements IEtlBytedanceVideoInfoService {
+
+}

+ 419 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/EtlBytedanceReportVideoDaily.java

@@ -0,0 +1,419 @@
+package cn.com.ctop.toutiao.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
+ * @date   2021-02-20
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_etl_bytedance_report_video_daily")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_etl_bytedance_report_video_daily对象", description="头条视频分日报表信息")
+public class EtlBytedanceReportVideoDaily {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**素材标识*/
+	@Excel(name = "素材标识", width = 15)
+    @ApiModelProperty(value = "素材标识")
+	private String videoCode;
+	/**数据日期*/
+	@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 statDate;
+	/**素材类型*/
+	@Excel(name = "素材类型", width = 15)
+    @ApiModelProperty(value = "素材类型")
+	private String imageMode;
+	/**点击量*/
+	@Excel(name = "点击量", width = 15)
+    @ApiModelProperty(value = "点击量")
+	private Integer click;
+	/**总花费*/
+	@Excel(name = "总花费", width = 15)
+    @ApiModelProperty(value = "总花费")
+	private java.math.BigDecimal cost;
+	/**应用下载广告数据-激活数*/
+	@Excel(name = "应用下载广告数据-激活数", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-激活数")
+	private Integer active;
+	/**应用下载-安卓下载完成*/
+	@Excel(name = "应用下载-安卓下载完成", width = 15)
+    @ApiModelProperty(value = "应用下载-安卓下载完成")
+	private Integer downloadFinish;
+	/**应用下载-安卓下载开始*/
+	@Excel(name = "应用下载-安卓下载开始", width = 15)
+    @ApiModelProperty(value = "应用下载-安卓下载开始")
+	private Integer downloadStart;
+	/**应用下载-安卓安装完成*/
+	@Excel(name = "应用下载-安卓安装完成", width = 15)
+    @ApiModelProperty(value = "应用下载-安卓安装完成")
+	private Integer installFinish;
+	/**应用下载-注册*/
+	@Excel(name = "应用下载-注册", width = 15)
+    @ApiModelProperty(value = "应用下载-注册")
+	private Integer register;
+	/**应用下载-付费数*/
+	@Excel(name = "应用下载-付费数", width = 15)
+    @ApiModelProperty(value = "应用下载-付费数")
+	private Integer payCount;
+	/**应用下载广告数据-APP内访问*/
+	@Excel(name = "应用下载广告数据-APP内访问", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-APP内访问")
+	private Integer inAppUv;
+	/**应用下载广告数据-APP内访问详情页*/
+	@Excel(name = "应用下载广告数据-APP内访问详情页", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-APP内访问详情页")
+	private Integer inAppDetailUv;
+	/**	应用下载广告数据-APP内加入购物车*/
+	@Excel(name = "	应用下载广告数据-APP内加入购物车", width = 15)
+    @ApiModelProperty(value = "	应用下载广告数据-APP内加入购物车")
+	private Integer inAppCart;
+	/**	应用下载广告数据-APP内下单*/
+	@Excel(name = "	应用下载广告数据-APP内下单", width = 15)
+    @ApiModelProperty(value = "	应用下载广告数据-APP内下单")
+	private Integer inAppOrder;
+	/**应用下载广告数据-APP内付费*/
+	@Excel(name = "应用下载广告数据-APP内付费", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-APP内付费")
+	private Integer inAppPay;
+	/**落地页转化数据-点击电话按钮*/
+	@Excel(name = "落地页转化数据-点击电话按钮", width = 15)
+    @ApiModelProperty(value = "落地页转化数据-点击电话按钮")
+	private Integer phone;
+	/**落地页转化数据-表单提交*/
+	@Excel(name = "落地页转化数据-表单提交", width = 15)
+    @ApiModelProperty(value = "落地页转化数据-表单提交")
+	private Integer form;
+	/**落地页-地图搜索*/
+	@Excel(name = "落地页-地图搜索", width = 15)
+    @ApiModelProperty(value = "落地页-地图搜索")
+	private Integer mapSearch;
+	/**落地页-按钮button*/
+	@Excel(name = "落地页-按钮button", width = 15)
+    @ApiModelProperty(value = "落地页-按钮button")
+	private Integer button;
+	/**落地页-关键页面浏览*/
+	@Excel(name = "落地页-关键页面浏览", width = 15)
+    @ApiModelProperty(value = "落地页-关键页面浏览")
+	private Integer viewMaterial;
+	/**落地页-QQ咨询数*/
+	@Excel(name = "落地页-QQ咨询数", width = 15)
+    @ApiModelProperty(value = "落地页-QQ咨询数")
+	private Integer qq;
+	/**落地页-抽奖数*/
+	@Excel(name = "落地页-抽奖数", width = 15)
+    @ApiModelProperty(value = "落地页-抽奖数")
+	private Integer lottery;
+	/**落地页-投票*/
+	@Excel(name = "落地页-投票", width = 15)
+    @ApiModelProperty(value = "落地页-投票")
+	private Integer vote;
+	/**落地页-页面跳转*/
+	@Excel(name = "落地页-页面跳转", width = 15)
+    @ApiModelProperty(value = "落地页-页面跳转")
+	private Integer redirect;
+	/**落地页-商品购买*/
+	@Excel(name = "落地页-商品购买", width = 15)
+    @ApiModelProperty(value = "落地页-商品购买")
+	private Integer shopping;
+	/**落地页-在线咨询*/
+	@Excel(name = "落地页-在线咨询", width = 15)
+    @ApiModelProperty(value = "落地页-在线咨询")
+	private Integer consult;
+	/**落地页-微信*/
+	@Excel(name = "落地页-微信", width = 15)
+    @ApiModelProperty(value = "落地页-微信")
+	private Integer wechat;
+	/**落地页-智能电话确认拨打*/
+	@Excel(name = "落地页-智能电话确认拨打", width = 15)
+    @ApiModelProperty(value = "落地页-智能电话确认拨打")
+	private Integer phoneConfirm;
+	/**落地页-智能电话确认接通*/
+	@Excel(name = "落地页-智能电话确认接通", width = 15)
+    @ApiModelProperty(value = "落地页-智能电话确认接通")
+	private Integer phoneConnect;
+	/**落地页-智能电话有效咨询*/
+	@Excel(name = "落地页-智能电话有效咨询", width = 15)
+    @ApiModelProperty(value = "落地页-智能电话有效咨询")
+	private Integer consultEffective;
+	/**视频-总播放*/
+	@Excel(name = "视频-总播放", width = 15)
+    @ApiModelProperty(value = "视频-总播放")
+	private Integer totalPlay;
+	/**视频-有效播放*/
+	@Excel(name = "视频-有效播放", width = 15)
+    @ApiModelProperty(value = "视频-有效播放")
+	private Integer validPlay;
+	/**视频-wifi播放*/
+	@Excel(name = "视频-wifi播放", width = 15)
+    @ApiModelProperty(value = "视频-wifi播放")
+	private Integer wifiPlay;
+	/**视频-播放时长,单位ms*/
+	@Excel(name = "视频-播放时长,单位ms", width = 15)
+    @ApiModelProperty(value = "视频-播放时长,单位ms")
+	private Integer playDurationSum;
+	/**视频-播放25%进度总数*/
+	@Excel(name = "视频-播放25%进度总数", width = 15)
+    @ApiModelProperty(value = "视频-播放25%进度总数")
+	private Integer play25FeedBreak;
+	/**视频-播放50%进度总数*/
+	@Excel(name = "视频-播放50%进度总数", width = 15)
+    @ApiModelProperty(value = "视频-播放50%进度总数")
+	private Integer play50FeedBreak;
+	/**视频-播放75%进度总数*/
+	@Excel(name = "视频-播放75%进度总数", width = 15)
+    @ApiModelProperty(value = "视频-播放75%进度总数")
+	private Integer play75FeedBreak;
+	/**视频数据-99%进度播放数*/
+	@Excel(name = "视频数据-99%进度播放数", width = 15)
+    @ApiModelProperty(value = "视频数据-99%进度播放数")
+	private Integer play100FeedBreak;
+	/**附加创意-电话按钮*/
+	@Excel(name = "附加创意-电话按钮", width = 15)
+    @ApiModelProperty(value = "附加创意-电话按钮")
+	private Integer advancedCreativePhoneClick;
+	/**附加创意-在线咨询*/
+	@Excel(name = "附加创意-在线咨询", width = 15)
+    @ApiModelProperty(value = "附加创意-在线咨询")
+	private Integer advancedCreativeCounselClick;
+	/**附加创意-表单提交*/
+	@Excel(name = "附加创意-表单提交", width = 15)
+    @ApiModelProperty(value = "附加创意-表单提交")
+	private Integer advancedCreativeFormClick;
+	/**互动数据-分享数*/
+	@Excel(name = "互动数据-分享数", width = 15)
+    @ApiModelProperty(value = "互动数据-分享数")
+	private Integer shareMaterial;
+	/**互动数据-评论数*/
+	@Excel(name = "互动数据-评论数", width = 15)
+    @ApiModelProperty(value = "互动数据-评论数")
+	private Integer commentMaterial;
+	/**互动数据-新增关注数*/
+	@Excel(name = "互动数据-新增关注数", width = 15)
+    @ApiModelProperty(value = "互动数据-新增关注数")
+	private Integer follow;
+	/**互动数据-主页访问量*/
+	@Excel(name = "互动数据-主页访问量", width = 15)
+    @ApiModelProperty(value = "互动数据-主页访问量")
+	private Integer homeVisited;
+	/**互动数据-挑战赛查看数*/
+	@Excel(name = "互动数据-挑战赛查看数", width = 15)
+    @ApiModelProperty(value = "互动数据-挑战赛查看数")
+	private Integer iesChallengeClick;
+	/**互动数据-音乐查看数*/
+	@Excel(name = "互动数据-音乐查看数", width = 15)
+    @ApiModelProperty(value = "互动数据-音乐查看数")
+	private Integer iesMusicClick;
+	/**次留数*/
+	@Excel(name = "次留数", width = 15)
+    @ApiModelProperty(value = "次留数")
+	private Integer nextDayOpen;
+	/**次留率*/
+	@Excel(name = "次留率", width = 15)
+    @ApiModelProperty(value = "次留率")
+	private java.math.BigDecimal nextDayOpenRate;
+	/**次留成本*/
+	@Excel(name = "次留成本", width = 15)
+    @ApiModelProperty(value = "次留成本")
+	private java.math.BigDecimal nextDayOpenCost;
+	/**付费价值*/
+	@Excel(name = "付费价值", width = 15)
+    @ApiModelProperty(value = "付费价值")
+	private Integer activePayAmount;
+	/**视频数据-有效播放成本*/
+	@Excel(name = "视频数据-有效播放成本", width = 15)
+    @ApiModelProperty(value = "视频数据-有效播放成本")
+	private java.math.BigDecimal validPlayCost;
+	/**附加创意-附加创意卡券领取*/
+	@Excel(name = "附加创意-附加创意卡券领取", width = 15)
+    @ApiModelProperty(value = "附加创意-附加创意卡券领取")
+	private Integer advancedCreativeCouponAddition;
+	/**convertMaterial*/
+	@Excel(name = "convertMaterial", width = 15)
+    @ApiModelProperty(value = "convertMaterial")
+	private Integer convertMaterial;
+	/**应用下载广告数据-付费成本*/
+	@Excel(name = "应用下载广告数据-付费成本", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-付费成本")
+	private java.math.BigDecimal activePayCost;
+	/**落地页转化数据-下载开始*/
+	@Excel(name = "落地页转化数据-下载开始", width = 15)
+    @ApiModelProperty(value = "落地页转化数据-下载开始")
+	private Integer download;
+	/**cpa*/
+	@Excel(name = "cpa", width = 15)
+    @ApiModelProperty(value = "cpa")
+	private java.math.BigDecimal cpa;
+	/**cpc*/
+	@Excel(name = "cpc", width = 15)
+    @ApiModelProperty(value = "cpc")
+	private java.math.BigDecimal cpc;
+	/**互动数据-POI点击数*/
+	@Excel(name = "互动数据-POI点击数", width = 15)
+    @ApiModelProperty(value = "互动数据-POI点击数")
+	private Integer locationClick;
+	/**视频数据-播完率*/
+	@Excel(name = "视频数据-播完率", width = 15)
+    @ApiModelProperty(value = "视频数据-播完率")
+	private java.math.BigDecimal playOverRate;
+	/**展现数据-点击率*/
+	@Excel(name = "展现数据-点击率", width = 15)
+    @ApiModelProperty(value = "展现数据-点击率")
+	private java.math.BigDecimal ctr;
+	/**cpm*/
+	@Excel(name = "cpm", width = 15)
+    @ApiModelProperty(value = "cpm")
+	private java.math.BigDecimal cpm;
+	/**视频数据-WiFi播放占比*/
+	@Excel(name = "视频数据-WiFi播放占比", width = 15)
+    @ApiModelProperty(value = "视频数据-WiFi播放占比")
+	private java.math.BigDecimal wifiPlayRate;
+	/**互动数据-点赞数*/
+	@Excel(name = "互动数据-点赞数", width = 15)
+    @ApiModelProperty(value = "互动数据-点赞数")
+	private Integer likeMaterial;
+	/**应用下载广告数据-付费率*/
+	@Excel(name = "应用下载广告数据-付费率", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-付费率")
+	private java.math.BigDecimal activePayRate;
+	/**应用下载广告数据-激活成本*/
+	@Excel(name = "应用下载广告数据-激活成本", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-激活成本")
+	private java.math.BigDecimal activeCost;
+	/**应用下载广告数据-关键行为成本*/
+	@Excel(name = "应用下载广告数据-关键行为成本", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-关键行为成本")
+	private java.math.BigDecimal gameAddictionCost;
+	/**应用下载广告数据-关键行为数*/
+	@Excel(name = "应用下载广告数据-关键行为数", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-关键行为数")
+	private Integer gameAddiction;
+	/**应用下载广告数据-激活率*/
+	@Excel(name = "应用下载广告数据-激活率", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-激活率")
+	private java.math.BigDecimal activeRate;
+	/**播放超过10秒的总数*/
+	@Excel(name = "播放超过10秒的总数", width = 15)
+    @ApiModelProperty(value = "播放超过10秒的总数")
+	private Integer playDuration10s;
+	/**有效电话数*/
+	@Excel(name = "有效电话数", width = 15)
+    @ApiModelProperty(value = "有效电话数")
+	private Integer phoneEffective;
+	/**应用下载广告数据-关键行为率*/
+	@Excel(name = "应用下载广告数据-关键行为率", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-关键行为率")
+	private java.math.BigDecimal gameAddictionRate;
+	/**应用下载广告数据-注册率*/
+	@Excel(name = "应用下载广告数据-注册率", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-注册率")
+	private java.math.BigDecimal activeRegisterRate;
+	/**视频平均播放时长*/
+	@Excel(name = "视频平均播放时长", width = 15)
+    @ApiModelProperty(value = "视频平均播放时长")
+	private java.math.BigDecimal averageVideoPlay;
+	/**应用下载广告数据-安卓下载完成成本*/
+	@Excel(name = "应用下载广告数据-安卓下载完成成本", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-安卓下载完成成本")
+	private java.math.BigDecimal downloadFinishCost;
+	/**播放超过3秒的总数*/
+	@Excel(name = "播放超过3秒的总数", width = 15)
+    @ApiModelProperty(value = "播放超过3秒的总数")
+	private Integer playDuration3s;
+	/**应用下载广告数据-注册成本*/
+	@Excel(name = "应用下载广告数据-注册成本", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-注册成本")
+	private java.math.BigDecimal activeRegisterCost;
+	/**showMaterial*/
+	@Excel(name = "showMaterial", width = 15)
+    @ApiModelProperty(value = "showMaterial")
+	private Integer showMaterial;
+	/**转化数据-转化率*/
+	@Excel(name = "转化数据-转化率", width = 15)
+    @ApiModelProperty(value = "转化数据-转化率")
+	private java.math.BigDecimal convertRate;
+	/**应用下载广告数据-安卓下载完成率*/
+	@Excel(name = "应用下载广告数据-安卓下载完成率", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-安卓下载完成率")
+	private java.math.BigDecimal downloadFinishRate;
+	/**应用下载广告数据-安卓安装完成率*/
+	@Excel(name = "应用下载广告数据-安卓安装完成率", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-安卓安装完成率")
+	private java.math.BigDecimal installFinishRate;
+	/**落地页转化数据-建站卡券领取*/
+	@Excel(name = "落地页转化数据-建站卡券领取", width = 15)
+    @ApiModelProperty(value = "落地页转化数据-建站卡券领取")
+	private Integer coupon;
+	/**落地页转化数据-卡券页领取*/
+	@Excel(name = "落地页转化数据-卡券页领取", width = 15)
+    @ApiModelProperty(value = "落地页转化数据-卡券页领取")
+	private Integer couponSinglePage;
+	/**播放完成总数(已下线)*/
+	@Excel(name = "播放完成总数(已下线)", width = 15)
+    @ApiModelProperty(value = "播放完成总数(已下线)")
+	private Integer playOver;
+	/**应用下载广告数据-安卓下载开始成本*/
+	@Excel(name = "应用下载广告数据-安卓下载开始成本", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-安卓下载开始成本")
+	private java.math.BigDecimal downloadStartCost;
+	/**落地页转化数据-短信咨询*/
+	@Excel(name = "落地页转化数据-短信咨询", width = 15)
+    @ApiModelProperty(value = "落地页转化数据-短信咨询")
+	private Integer message;
+	/**playDuration*/
+	@Excel(name = "playDuration", width = 15)
+    @ApiModelProperty(value = "playDuration")
+	private Integer playDuration;
+	/**视频数据-有效播放率*/
+	@Excel(name = "视频数据-有效播放率", width = 15)
+    @ApiModelProperty(value = "视频数据-有效播放率")
+	private java.math.BigDecimal validPlayRate;
+	/**视频数据-平均单次播放时长*/
+	@Excel(name = "视频数据-平均单次播放时长", width = 15)
+    @ApiModelProperty(value = "视频数据-平均单次播放时长")
+	private java.math.BigDecimal averagePlayTimePerPlay;
+	/**转化数据-转化成本*/
+	@Excel(name = "转化数据-转化成本", width = 15)
+    @ApiModelProperty(value = "转化数据-转化成本")
+	private java.math.BigDecimal convertCost;
+	/**转化展示率*/
+	@Excel(name = "转化展示率", width = 15)
+    @ApiModelProperty(value = "转化展示率")
+	private java.math.BigDecimal convertShowRate;
+	/**应用下载广告数据-安卓安装完成成本*/
+	@Excel(name = "应用下载广告数据-安卓安装完成成本", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-安卓安装完成成本")
+	private java.math.BigDecimal installFinishCost;
+	/**应用下载广告数据-安卓下载开始率*/
+	@Excel(name = "应用下载广告数据-安卓下载开始率", width = 15)
+    @ApiModelProperty(value = "应用下载广告数据-安卓下载开始率")
+	private java.math.BigDecimal downloadStartRate;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

+ 14 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/EtlBytedanceReportVideoDailyMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.toutiao.modules.report.mapper;
+
+import cn.com.ctop.toutiao.modules.report.entity.EtlBytedanceReportVideoDaily;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 头条视频分日报表信息
+ * @author: jeecg-boot
+ * @date:   2021-02-20
+ * @cersion: V1.0
+ */
+public interface EtlBytedanceReportVideoDailyMapper extends BaseMapper<EtlBytedanceReportVideoDaily> {
+
+}

+ 5 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/EtlBytedanceReportVideoDailyMapper.xml

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

+ 14 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IEtlBytedanceReportVideoDailyService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.toutiao.modules.report.service;
+
+import cn.com.ctop.toutiao.modules.report.entity.EtlBytedanceReportVideoDaily;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 头条视频分日报表信息
+ * @Author: jeecg-boot
+ * @Date:   2021-02-20
+ * @Version: V1.0
+ */
+public interface IEtlBytedanceReportVideoDailyService extends IService<EtlBytedanceReportVideoDaily> {
+
+}

+ 0 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportServiceImpl.java

@@ -569,7 +569,6 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             }
         };
         JSONObject json = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, JSONObject.parseObject(JSONObject.toJSONString(data)));
-        System.out.println(json);
         if (json == null) {
             log.error("返回为空,请求有误:" + JSONObject.toJSONString(data));
             return -2;
@@ -782,7 +781,6 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             log.error("返回为空,请求有误:" + JSONObject.toJSONString(data));
             return -2;
         }
-        System.out.println(json.toJSONString());
         try {
             Integer code = json.getInteger("code");
             if (code != 0) {

+ 2 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceVideoReportServiceImpl.java

@@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -24,7 +25,7 @@ import java.util.Map;
 @Service
 public class BytedanceVideoReportServiceImpl implements IBytedanceVideoReportService {
 
-    @Autowired
+    @Resource
     BytedanceVideoReportMapper bytedanceVideoReportMapper;
 
     @Autowired

+ 18 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/EtlBytedanceReportVideoDailyServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.toutiao.modules.report.service.impl;
+
+import cn.com.ctop.toutiao.modules.report.entity.EtlBytedanceReportVideoDaily;
+import cn.com.ctop.toutiao.modules.report.mapper.EtlBytedanceReportVideoDailyMapper;
+import cn.com.ctop.toutiao.modules.report.service.IEtlBytedanceReportVideoDailyService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 头条视频分日报表信息
+ * @author jeecg-boot
+ * @date   2021-02-20
+ * @version V1.0
+ */
+@Service
+public class EtlBytedanceReportVideoDailyServiceImpl extends ServiceImpl<EtlBytedanceReportVideoDailyMapper, EtlBytedanceReportVideoDaily> implements IEtlBytedanceReportVideoDailyService {
+
+}

+ 0 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java

@@ -86,7 +86,6 @@ public class ReportServiceImpl implements IReportService {
         config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
         JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(conditions, config));
         JSONObject getObject = getAdvertiserStat(token, jsonObject);
-        System.out.println(getObject);
         if(null == getObject){
             XxlJobHelper.log("头条广告主数据获取异常");
             return;
@@ -494,7 +493,6 @@ public class ReportServiceImpl implements IReportService {
         config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
         JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(conditions, config));
         JSONObject getObject = getAdvertiserStat(token, jsonObject);
-        System.out.println(getObject);
         if(null == getObject){
             XxlJobHelper.log("头条广告主数据获取异常");
             return;