Browse Source

素材报表

yumeng 4 years ago
parent
commit
cee8c00ec4
14 changed files with 751 additions and 23 deletions
  1. 7 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  2. 2 2
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  3. 2 2
      jeecg-boot-module-system/src/main/resources/jeecg/jeecg_database.properties
  4. 25 9
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  5. 0 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java
  6. 24 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouReportDailyMaterialMapper.java
  7. 132 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml
  8. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouReportDailyMaterialService.java
  9. 27 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouDailyReportTaskServiceImpl.java
  10. 33 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouHistoryReportTaskServiceImpl.java
  11. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouReportDailyMaterialServiceImpl.java
  12. 419 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouReportDailyMaterial.java
  13. 34 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouReportDailyMaterialVo.java
  14. 13 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/VideoGetvo.java

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

@@ -266,6 +266,7 @@ public class UserAllocationController {
             result.error500("未找到对应实体");
             result.error500("未找到对应实体");
         } else {
         } else {
             boolean ok = userAllocationService.updateById(userAllocation);
             boolean ok = userAllocationService.updateById(userAllocation);
+            UserAllocation update = userAllocationService.getById(userAllocation.getId());
             QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
             QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
             memberQueryWrapper.eq("user_id", userAllocation.getUserId());
             memberQueryWrapper.eq("user_id", userAllocation.getUserId());
             memberQueryWrapper.eq("project_id", userAllocation.getProjectId());
             memberQueryWrapper.eq("project_id", userAllocation.getProjectId());
@@ -273,18 +274,17 @@ public class UserAllocationController {
             ProjectMember member = memberMapper.selectOne(memberQueryWrapper);
             ProjectMember member = memberMapper.selectOne(memberQueryWrapper);
             if (Check.isNull(member)) {
             if (Check.isNull(member)) {
                 ProjectMember addMember = new ProjectMember();
                 ProjectMember addMember = new ProjectMember();
-                addMember.setProjectId(userAllocation.getProjectId());
-                addMember.setProjectName(userAllocation.getProjectName());
-                addMember.setUserId(userAllocation.getUserId());
-                addMember.setUserName(userAllocation.getUserName());
-                String roleCode = sysRoleService.getRoleCodeByUserId(userAllocation.getUserId());
+                addMember.setProjectId(update.getProjectId());
+                addMember.setProjectName(update.getProjectName());
+                addMember.setUserId(update.getUserId());
+                addMember.setUserName(update.getUserName());
+                String roleCode = sysRoleService.getRoleCodeByUserId(update.getUserId());
                 if (!Check.isNull(roleCode)) {
                 if (!Check.isNull(roleCode)) {
                     addMember.setRoleCode(roleCode);
                     addMember.setRoleCode(roleCode);
                 }
                 }
                 projectMemberService.save(addMember);
                 projectMemberService.save(addMember);
             }
             }
 
 
-
             if (ok) {
             if (ok) {
                 result.success("修改成功!");
                 result.success("修改成功!");
             }
             }
@@ -362,7 +362,7 @@ public class UserAllocationController {
     public Result<List<UserAllocation>> selectAccountListByProjectId(Long projectId) {
     public Result<List<UserAllocation>> selectAccountListByProjectId(Long projectId) {
         Result<List<UserAllocation>> result = new Result<>();
         Result<List<UserAllocation>> result = new Result<>();
         try {
         try {
-            List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId,null,null);
+            List<UserAllocation> userAllocations = userAllocationService.getByParams(projectId, null, null);
             result.setSuccess(true);
             result.setSuccess(true);
             result.setResult(userAllocations);
             result.setResult(userAllocations);
         } catch (Exception e) {
         } catch (Exception e) {

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

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

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

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

+ 25 - 9
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -10,10 +10,13 @@ import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.message.handle.impl.EmailSendMsgHandle;
 import cn.com.ctop.common.module.message.handle.impl.EmailSendMsgHandle;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
 import org.junit.Test;
@@ -46,17 +49,30 @@ public class SampleTest {
     private IUserAllocationService userAllocationService;
     private IUserAllocationService userAllocationService;
     @Autowired
     @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
     private IByteDanceAdvertiserDataService advertiserDataService;
+    @Autowired
+    private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
+    @Autowired
+    private IKuaiShouDailyReportTaskService dailyReportTaskService;
+
+
     @Test
     @Test
     public void loadBytedanceCreativeData() {
     public void loadBytedanceCreativeData() {
-        List<UserAllocation>allocations = userAllocationService.getByParams(633L,null,0);
-        if(null!=allocations&&!allocations.isEmpty()){
-            for (UserAllocation allocation:allocations) {
-                CtopOauthToken token = oauthTokenService.getTokenByAccountId(allocation.getAccountId());
-                advertiserDataService.getAdvertiserPlan(token, "", null, null);
-            }
+        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("media_id", 2);
+        List<CtopOauthToken> list = oauthTokenService.list(queryWrapper);
+        for (CtopOauthToken token:list) {
+            kuaiShouHistoryReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), "2020-03-09", "2020-09-08", "history");
+
         }
         }
+
+    }
+
+    @Test
+    public void getTaskList() {
+        kuaiShouHistoryReportTaskService.getTaskList();
     }
     }
 
 
+
     @Autowired
     @Autowired
     private IBindAccountLoginService bindAccountLoginService;
     private IBindAccountLoginService bindAccountLoginService;
     @Autowired
     @Autowired
@@ -127,9 +143,9 @@ public class SampleTest {
     @Test
     @Test
     public void loadKuaishouAgentData() {
     public void loadKuaishouAgentData() {
         kuaishouReportDailyAgentService.loginAgent();
         kuaishouReportDailyAgentService.loginAgent();
-        for(int i=0;i<20;i++){
-            String currentDate = DateUtils.formatDate(DateUtils.addDay(new Date(),-i));
-            kuaishouReportDailyAgentService.getReport(currentDate,DateUtils.getNowDate("yyyy-MM-dd"));
+        for (int i = 0; i < 20; i++) {
+            String currentDate = DateUtils.formatDate(DateUtils.addDay(new Date(), -i));
+            kuaishouReportDailyAgentService.getReport(currentDate, DateUtils.getNowDate("yyyy-MM-dd"));
         }
         }
 //
 //
 //        try {
 //        try {

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

@@ -1131,7 +1131,6 @@ public class BatchController {
                 queryWrapper.between("stat_date", startDate, endDate);
                 queryWrapper.between("stat_date", startDate, endDate);
             }
             }
             queryWrapper.orderByDesc("stat_date");
             queryWrapper.orderByDesc("stat_date");
-            queryWrapper.orderByDesc("photo_id");
             queryWrapper.groupBy("signature");
             queryWrapper.groupBy("signature");
             Page<KuaiShouVideoGet> page = new Page<>(pageNo, pageSize);
             Page<KuaiShouVideoGet> page = new Page<>(pageNo, pageSize);
             IPage<KuaiShouVideoGet> pageList = kuaiShouVideoGetService.page(page, queryWrapper);
             IPage<KuaiShouVideoGet> pageList = kuaiShouVideoGetService.page(page, queryWrapper);

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

@@ -0,0 +1,24 @@
+package cn.com.ctop.kuaishou.modules.batch.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo;
+import cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 素材
+ *
+ * @author: jeecg-boot
+ * @date: 2020-09-09
+ * @cersion: V1.0
+ */
+public interface KuaiShouReportDailyMaterialMapper extends BaseMapper<KuaiShouReportDailyMaterial> {
+    void loadMaterialDailyReport(@Param("accountId") Long accountId, @Param("localPath") String localPath);
+
+    List<KuaiShouReportDailyMaterialVo> getPhotoList(@Param("accountId") Long accountId, @Param("statDate") String statDate);
+
+    VideoGetvo getVideoGetByPhotoId(Long photoId);
+}

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

@@ -0,0 +1,132 @@
+<?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.KuaiShouReportDailyMaterialMapper">
+
+    <insert id="loadMaterialDailyReport">
+		LOAD DATA local INFILE  #{localPath}
+	    REPLACE INTO TABLE ctop_kuaishou_report_daily_material CHARACTER SET utf8mb4
+		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
+		IGNORE 1 LINES
+		(photo_id,
+		image_token,
+		cover_url,
+		photo_url,
+		@photo_caption,
+		creative_material_type_string,
+        ad_scene,
+        charge,
+        photo_show,
+        aclick,
+        bclick,
+        photo_share,
+        photo_comment,
+        photo_like,
+        follow,
+        cancel_follow,
+        report,
+        block,
+        negative,
+        download_started,
+        download_completed,
+        activation,
+        submit,
+        stat_date,
+        @stat_hour,
+        photo_click,
+        photo_click_ratio,
+        action_ratio,
+        impression_1k_cost,
+        photo_click_cost,
+        @click_1k_cost,
+        action_cost,
+        event_pay_first_day,
+        event_pay_purchase_amount_first_day,
+        event_pay_first_day_roi,
+        event_pay,
+        event_pay_purchase_amount,
+        event_pay_roi,
+        event_register,
+        event_register_cost,
+        event_register_ratio,
+        event_jin_jian_app,
+        event_jin_jian_app_cost,
+        event_credit_grant_app,
+        event_credit_grant_app_cost,
+        event_credit_grant_app_ratio,
+        event_order_paid,
+        event_order_paid_purchase_amount,
+        event_order_paid_cost,
+        form_count,
+        form_cost,
+        form_action_ratio,
+        event_jin_jian_landing_page,
+        event_jin_jian_landing_page_cost,
+        event_credit_grant_landing_page,
+        event_credit_grant_landing_page_cost,
+        event_credit_grant_landing_ratio,
+        event_next_day_stay_cost,
+        event_next_day_stay_ratio,
+        event_next_day_stay,
+        play_3s_ratio,
+        @event_valid_clues,
+        @event_valid_clues_cost,
+        @ad_product_cnt,
+        @event_goods_view,
+        @merchant_reco_fans,
+        @event_order_amount_roi,
+        @event_goods_view_cost,
+        @merchant_reco_fans_cost,
+        @event_new_user_pay,
+        @event_new_user_pay_cost,
+        @event_new_user_pay_ratio,
+        @event_button_click,
+        @event_button_click_cost,
+        @event_button_click_ratio,
+        @play_5s_ratio,
+        @play_end_ratio,
+        @event_order_paid_roi,
+        @event_new_user_jinjian_app,
+        @event_new_user_jinjian_app_cost,
+        @event_new_user_jinjian_app_roi,
+        @event_new_user_credit_grant_app,
+        @event_new_user_credit_grant_app_cost,
+        @event_new_user_credit_grant_app_roi,
+        @event_new_user_jinjian_page,
+        @event_new_user_jinjian_page_cost,
+        @event_new_user_jinjian_page_roi,
+        @event_new_user_credit_grant_page,
+        @event_new_user_credit_grant_page_cost,
+        @event_new_user_credit_grant_page_roi,
+        @event_appoint_form,
+        @event_appoint_form_cost,
+        @event_appoint_form_ratio,
+        @event_appoint_jump_click,
+        @event_appoint_jump_click_cost,
+        @event_appoint_jump_click_ratio
+        )
+          set account_id = #{accountId}
+    </insert>
+
+    <select id="getPhotoList" resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo">
+        select
+        id as id,
+        photo_id as photoId
+        from
+        ctop_kuaishou_report_daily_material
+        where account_id = #{accountId}
+        <if test="statDate != null and statDate != '' ">
+            and stat_date = #{statDate}
+        </if>
+    </select>
+
+    <select id="getVideoGetByPhotoId" resultType="cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo">
+      select
+      signature as 'signature',
+      channel_type as 'channelType'
+      from ctop_kuaishou_video_get
+      where photo_id = #{photoId}
+      limit 1
+    </select>
+
+
+</mapper>

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.batch.service;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 素材
+ * @Author: jeecg-boot
+ * @Date: 2020-09-09
+ * @Version: V1.0
+ */
+public interface IKuaiShouReportDailyMaterialService extends IService<KuaiShouReportDailyMaterial> {
+
+}

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

@@ -3,7 +3,11 @@ package cn.com.ctop.kuaishou.modules.batch.service.impl;
 import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouDailyReportTask;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouDailyReportTask;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouDailyReportTaskMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouDailyReportTaskMapper;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouReportDailyMaterialMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo;
+import cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
@@ -44,6 +48,8 @@ public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDail
 
 
     @Autowired
     @Autowired
     private KuaishouReportDailyCreativeMapper reportDailyCreativeMapper;
     private KuaishouReportDailyCreativeMapper reportDailyCreativeMapper;
+    @Autowired
+    private KuaiShouReportDailyMaterialMapper kuaishouReportDailyMaterialMapper;
 
 
     @Override
     @Override
     public void formatCreativeDailyReportData(Long accountId, String statDate) {
     public void formatCreativeDailyReportData(Long accountId, String statDate) {
@@ -132,6 +138,27 @@ public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDail
                     XxlJobLogger.log("下载文件,accountId:{}", task.getAccountId());
                     XxlJobLogger.log("下载文件,accountId:{}", task.getAccountId());
                     reportDailyCreativeMapper.loadProgramCreativeDailyReport(task.getAccountId(), localPath);
                     reportDailyCreativeMapper.loadProgramCreativeDailyReport(task.getAccountId(), localPath);
                     XxlJobLogger.log("下载结束,accountId:{}", task.getAccountId());
                     XxlJobLogger.log("下载结束,accountId:{}", task.getAccountId());
+                } else if (task.getViewType() == 5) {
+                    kuaishouReportDailyMaterialMapper.loadMaterialDailyReport(task.getAccountId(), localPath);
+
+                    List<KuaiShouReportDailyMaterialVo> list = kuaishouReportDailyMaterialMapper.getPhotoList(task.getAccountId(), task.getStatDate());
+                    if (!Check.isNull(list)) {
+                        for (KuaiShouReportDailyMaterialVo materialVo : list) {
+                            Long id = materialVo.getId();
+                            Long photoId = materialVo.getPhotoId();
+                            VideoGetvo videoGetvo = kuaishouReportDailyMaterialMapper.getVideoGetByPhotoId(photoId);
+                            if (!Check.isNull(videoGetvo)) {
+                                KuaiShouReportDailyMaterial material = new KuaiShouReportDailyMaterial();
+                                material.setId(id);
+                                material.setSignature(videoGetvo.getSignature());
+                                material.setChannelType(videoGetvo.getChannelType());
+                                kuaishouReportDailyMaterialMapper.updateById(material);
+                            }
+                        }
+
+                    }
+
+
                 }
                 }
             }
             }
 
 

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

@@ -6,8 +6,12 @@ import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouDailyReportTask;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouDailyReportTask;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouHistoryReportTask;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouHistoryReportTask;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouHistoryReportTaskMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouHistoryReportTaskMapper;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouReportDailyMaterialMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo;
+import cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
@@ -58,6 +62,9 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
     @Autowired
     @Autowired
     private IKuaiShouDailyReportTaskService dailyReportTaskService;
     private IKuaiShouDailyReportTaskService dailyReportTaskService;
 
 
+    @Autowired
+    private KuaiShouReportDailyMaterialMapper kuaishouReportDailyMaterialMapper;
+
     @Override
     @Override
     public void createTask(Long accountId, String token, String startDate, String endDate, String taskType) {
     public void createTask(Long accountId, String token, String startDate, String endDate, String taskType) {
         if (Check.isNull(accountId) || Check.isNull(token)) {
         if (Check.isNull(accountId) || Check.isNull(token)) {
@@ -223,7 +230,28 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
                     reportDailyCreativeMapper.loadProgramCreativeDailyReport(task.getAccountId(), localPath);
                     reportDailyCreativeMapper.loadProgramCreativeDailyReport(task.getAccountId(), localPath);
                     XxlJobLogger.log("下载结束,accountId:{}", task.getAccountId());
                     XxlJobLogger.log("下载结束,accountId:{}", task.getAccountId());
                     // 程序化报表
                     // 程序化报表
+                } else if (task.getViewType() == 5) {
+                    kuaishouReportDailyMaterialMapper.loadMaterialDailyReport(task.getAccountId(), localPath);
+
+                    List<KuaiShouReportDailyMaterialVo> list = kuaishouReportDailyMaterialMapper.getPhotoList(task.getAccountId(), null);
+                    if (!Check.isNull(list)) {
+                        for (KuaiShouReportDailyMaterialVo materialVo : list) {
+                            Long id = materialVo.getId();
+                            Long photoId = materialVo.getPhotoId();
+                            VideoGetvo videoGetvo = kuaishouReportDailyMaterialMapper.getVideoGetByPhotoId(photoId);
+                            if (!Check.isNull(videoGetvo)) {
+                                KuaiShouReportDailyMaterial material = new KuaiShouReportDailyMaterial();
+                                material.setId(id);
+                                material.setSignature(videoGetvo.getSignature());
+                                material.setChannelType(videoGetvo.getChannelType());
+                                kuaishouReportDailyMaterialMapper.updateById(material);
+                            }
+                        }
+
+                    }
                 }
                 }
+
+
             }
             }
             task.setTaskStatus(4);
             task.setTaskStatus(4);
 
 
@@ -238,11 +266,13 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
 
 
     private void getHistoryTypeList() {
     private void getHistoryTypeList() {
         historyTypeList = new ArrayList<>();
         historyTypeList = new ArrayList<>();
-        historyTypeList.add(1);
+        historyTypeList.add(5);
+       /* historyTypeList.add(1);
         historyTypeList.add(2);
         historyTypeList.add(2);
         historyTypeList.add(3);
         historyTypeList.add(3);
         historyTypeList.add(4);
         historyTypeList.add(4);
-        historyTypeList.add(10);
+        historyTypeList.add(5);
+        historyTypeList.add(10);*/
     }
     }
 
 
     private void getDailyTypeList() {
     private void getDailyTypeList() {
@@ -250,6 +280,7 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
         dailyTypeList.add(2);
         dailyTypeList.add(2);
         dailyTypeList.add(3);
         dailyTypeList.add(3);
         dailyTypeList.add(4);
         dailyTypeList.add(4);
+        dailyTypeList.add(5);
         dailyTypeList.add(10);
         dailyTypeList.add(10);
     }
     }
 
 

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

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.batch.service.impl;
+
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouReportDailyMaterialMapper;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 素材
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-09
+ */
+@Service
+public class KuaiShouReportDailyMaterialServiceImpl extends ServiceImpl<KuaiShouReportDailyMaterialMapper, KuaiShouReportDailyMaterial> implements IKuaiShouReportDailyMaterialService {
+
+}

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

@@ -0,0 +1,419 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 素材
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-09
+ */
+@Data
+@TableName("ctop_kuaishou_report_daily_material")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_report_daily_material对象", description = "素材")
+public class KuaiShouReportDailyMaterial {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 计划ID
+     */
+    @Excel(name = "计划ID", width = 15)
+    @ApiModelProperty(value = "计划ID")
+    private Long photoId;
+    /**
+     * channelType
+     */
+    @Excel(name = "channelType", width = 15)
+    @ApiModelProperty(value = "channelType")
+    private Integer channelType;
+    /**
+     * signature
+     */
+    @Excel(name = "signature", width = 15)
+    @ApiModelProperty(value = "signature")
+    private String signature;
+    /**
+     * 封面token
+     */
+    @Excel(name = "封面token", width = 15)
+    @ApiModelProperty(value = "封面token")
+    private String imageToken;
+    /**
+     * 封面url
+     */
+    @Excel(name = "封面url", width = 15)
+    @ApiModelProperty(value = "封面url")
+    private String coverUrl;
+    /**
+     * 视频uel
+     */
+    @Excel(name = "视频uel", width = 15)
+    @ApiModelProperty(value = "视频uel")
+    private String photoUrl;
+    /**
+     * 素材类型
+     */
+    @Excel(name = "素材类型", width = 15)
+    @ApiModelProperty(value = "素材类型")
+    private String creativeMaterialTypeString;
+    /**
+     * 场景
+     */
+    @Excel(name = "场景", width = 15)
+    @ApiModelProperty(value = "场景")
+    private String adScene;
+    /**
+     * 花费(元)
+     */
+    @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 String statDate;
+    /**
+     * 封面点击数
+     */
+    @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;
+    /**
+     * 创建时间
+     */
+    @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;
+}

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

@@ -0,0 +1,34 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * 素材
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-09-09
+ */
+@Data
+
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class KuaiShouReportDailyMaterialVo {
+
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    @Excel(name = "计划ID", width = 15)
+    @ApiModelProperty(value = "计划ID")
+    private Long photoId;
+}

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

@@ -0,0 +1,13 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+@Data
+public class VideoGetvo implements Serializable {
+    private String signature;
+    private Integer channelType;
+
+}