Quellcode durchsuchen

修改文件上传接口,url数据补全

syh vor 5 Jahren
Ursprung
Commit
c5d1d21e78
24 geänderte Dateien mit 1740 neuen und 148 gelöschten Zeilen
  1. 12 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouDailyReportLoadJob.java
  2. 11 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaishouHourlyReportLoadJob.java
  3. 37 134
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  4. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IFileInfoService.java
  5. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java
  6. 1 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java
  7. 7 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java
  8. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java
  9. 248 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaishouReportDailyCreativeStatisticController.java
  10. 248 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaishouReportHourlyCreativeStatisticController.java
  11. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouVideoGet.java
  12. 0 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouVideoGetService.java
  13. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouInterfaceService.java
  14. 154 11
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  15. 448 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportDailyCreativeStatistic.java
  16. 455 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaishouReportHourlyCreativeStatistic.java
  17. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyCreativeStatisticMapper.java
  18. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportHourlyCreativeStatisticMapper.java
  19. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyCreativeStatisticMapper.xml
  20. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportHourlyCreativeStatisticMapper.xml
  21. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyCreativeStatisticService.java
  22. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportHourlyCreativeStatisticService.java
  23. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyCreativeStatisticServiceImpl.java
  24. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportHourlyCreativeStatisticServiceImpl.java

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

@@ -33,6 +33,18 @@ public class KuaishouDailyReportLoadJob implements Job {
             log.info("定时获取头条数据异常:为获取到可用的token");
             return;
         }
+        tokens.forEach(token -> {
+            //1:获取全量广告计划数据
+            kuaishouInterfaceService.getCampaignList(token);
+            //1:获取全量广告组数据
+            kuaishouInterfaceService.getGroupList(token);
+            //1:获取全量创意数据
+            kuaishouInterfaceService.getCreativeList(token);
+            //2:获取全量视频素材数据
+            kuaishouInterfaceService.getVideoList(token);
+        });
+
+        log.info("快手物料数据同步完成");
 
         tokens.forEach(token -> {
             //1: 获取广告主信息数据

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

@@ -39,6 +39,17 @@ public class KuaishouHourlyReportLoadJob implements Job {
             log.info("定时获取头条数据异常:为获取到可用的token");
             return;
         }
+        tokens.forEach(token -> {
+            //1:获取全量广告计划数据
+            kuaishouInterfaceService.getCampaignList(token);
+            //1:获取全量广告组数据
+            kuaishouInterfaceService.getGroupList(token);
+            //1:获取全量创意数据
+            kuaishouInterfaceService.getCreativeList(token);
+            //2:获取全量视频素材数据
+            kuaishouInterfaceService.getVideoList(token);
+        });
+        log.info("物料数据同步完成");
 
         for (CtopOauthToken token : tokens) {
             kuaishouInterfaceService.getAdvertiserReportHourly(token, getDate, getDate);

+ 37 - 134
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -5,56 +5,31 @@ import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.service.IFileInfoService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.common.module.utils.OSSUtils;
-import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
-import org.jeecg.modules.demo.mock.MockController;
-import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
-import org.jeecg.modules.demo.test.service.IJeecgDemoService;
-import org.jeecg.modules.system.service.ISysDataLogService;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
-import javax.annotation.Resource;
-import java.io.File;
-import java.util.ArrayList;
+import java.io.IOException;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest
 @Slf4j
 public class SampleTest {
 
-    @Resource
-    private JeecgDemoMapper jeecgDemoMapper;
-    @Resource
-    private IJeecgDemoService jeecgDemoService;
-    @Resource
-    private ISysDataLogService sysDataLogService;
-    @Resource
-    private MockController mock;
-
     @Autowired
     private ICreateInternalService createInternalService;
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
 
-    @Test
-    public void testLogin() {
-        Map<String, Object> map = createInternalService.checkAccountPassword("dcd_ad@bytedance.com", "typdDCD@2018");
-    }
-
     @Autowired
     private IReportService reportService;
 
@@ -69,16 +44,6 @@ public class SampleTest {
             return;
         }
         tokens.forEach(token -> {
-            //1: 获取广告主信息数据
-//            kuaishouInterfaceService.getAdvertiserReportDaily(token,getDate);
-            //2:获取广告计划信息数据
-//            kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token,getDate);
-            //3:获取广告组信息数据
-//            kuaishouInterfaceService.getAdvertiserGroupReportDaily(token,getDate);
-            //4: 获取广告创意信息数据
-//            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token,getDate);
-//            //1: 获取广告主信息数据
-//            kuaishouInterfaceService.getAdvertiserReportHourly(token, getDate);
 //            //2:获取广告计划信息数据
             kuaishouInterfaceService.getAdvertiserCampaignReportHourly(token, getDate, getDate);
 //            //3:获取广告组信息数据
@@ -88,79 +53,14 @@ public class SampleTest {
         });
     }
 
+    @Autowired
+    IFileInfoService fileInfoService;
     @Test
-    public void testLoadDate180() {
-        Date endDate = new Date();
-        Date hourlyStartDate = DateUtils.addDay(endDate, -7);
-        Date startDate = DateUtils.addDay(endDate, -170);
-//        List<CtopOauthToken> bytedanceTokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-//        if (null != bytedanceTokens && bytedanceTokens.size() > 0) {
-//            bytedanceTokens.forEach(token -> {
-//                //1: 获取广告主信息数据
-//                reportService.getAdvertiserReport(token, startDate, endDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-//                //2:获取广告组信息数据
-//                reportService.getAdvertiserCampaignReport(token, startDate, endDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-//                //3:获取广告计划信息数据
-//                reportService.getAdvertiserPlanReport(token, startDate, endDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-//                //4: 获取广告创意信息数据
-//                reportService.getAdvertiserCreativeReport(token, startDate, endDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-//
-//                //1: 获取广告主信息数据
-//                reportService.getAdvertiserReport(token, hourlyStartDate, endDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-//                //2:获取广告组信息数据
-//                reportService.getAdvertiserCampaignReport(token, hourlyStartDate, endDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-//                //3:获取广告计划信息数据
-//                reportService.getAdvertiserPlanReport(token, hourlyStartDate, endDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-//                //4: 获取广告创意信息数据
-//                reportService.getAdvertiserCreativeReport(token, hourlyStartDate, endDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-//            });
-//        }
-        List<CtopOauthToken> kuaishouTokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
-        if (null != kuaishouTokens && kuaishouTokens.size() > 0) {
-            for (CtopOauthToken token : kuaishouTokens) {
-                for (int i = 0; i < 7; i++) {
-                    Date getStartDate = DateUtils.addDay(endDate, -i);
-                    //1: 获取广告主信息数据
-//                    kuaishouInterfaceService.getAdvertiserReportHourly(token, getStartDate, getStartDate);
-                    //2:获取广告计划信息数据
-//                    kuaishouInterfaceService.getAdvertiserCampaignReportHourly(token, getStartDate, getStartDate);
-                    //3:获取广告组信息数据
-                    kuaishouInterfaceService.getAdvertiserGroupReportHourly(token, getStartDate, getStartDate);
-                    //4: 获取广告创意信息数据
-//                    kuaishouInterfaceService.getAdvertiserCreativeReportHourly(token, getStartDate, getStartDate);
-                }
-//                for (int i = 0; i < 6; i++) {
-//                    Date getStartDate = new Date();
-//                    Date getEndDate = new Date();
-//                    if (i == 0) {
-//                        getStartDate = DateUtils.addDay(endDate, -175 + i * 30);
-//                        getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
-//                    } else {
-//                        getStartDate = DateUtils.addDay(endDate, -180 + i * 30);
-//                        getEndDate = DateUtils.addDay(endDate, -150 + i * 30);
-//                    }
-//                    //1: 获取广告主信息数据
-//                    kuaishouInterfaceService.getAdvertiserReportDaily(token, getStartDate, getEndDate);
-//                    //2:获取广告计划信息数据
-//                    kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getStartDate, getEndDate);
-//                    //3:获取广告组信息数据
-//                    kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getStartDate, getEndDate);
-//                    //4: 获取广告创意信息数据
-//                    kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getStartDate, getEndDate);
-//                }
-            }
-        }
-    }
-
-    @Test
-    public void testFileType() {
-        File file = new File("D:\\工作文件\\360借条\\快手后台数据-户1.csv");
+    public void testVideoList() throws IOException {
+        CtopOauthToken token = tokenService.getOauthTokenByAccountId("1232598");
+        kuaishouInterfaceService.getVideoList(token);
     }
 
-    @Test
-    public void testFileUpload() {
-        OSSUtils.uploadObject2Oss(new File("D:\\upload\\excel\\template.xlsx"));
-    }
 
     @Test
     public void testNg() {
@@ -168,36 +68,39 @@ public class SampleTest {
         createInternalService.createInternal(json);
     }
 
-
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-    @Autowired
-    private IFileInfoService fileInfoService;
-
     @Test
-    public void setJSONFile() {
-        CtopOauthToken token = tokenService.getOauthTokenByAccountId("93289889842");
-        JSONObject wordsObject = fileInfoService.getCreativeWord(token, token.getAccountId());
-        String getTitle = "哈哈{日期}{男人女人}";
-        JSONArray ids = getCreativeWordIds(getTitle, wordsObject);
-    }
+    public void loadAllMetiaralInfo() {
+        Date getDate = DateUtils.addDay(new Date(), -1);
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取头条数据异常:为获取到可用的token");
+            return;
+        }
+        tokens.forEach(token -> {
+            //1:获取全量广告计划数据
+            kuaishouInterfaceService.getCampaignList(token);
+            //1:获取全量广告组数据
+            kuaishouInterfaceService.getGroupList(token);
+            //1:获取全量创意数据
+            kuaishouInterfaceService.getCreativeList(token);
+            //2:获取全量视频素材数据
+            kuaishouInterfaceService.getVideoList(token);
+        });
 
-    public JSONArray getCreativeWordIds(String getTitle, JSONObject wordsObject) {
-        ArrayList<String> wordsString = StringUtils.stringCutFromBrace(getTitle);
-        JSONArray creativeWords = wordsObject.getJSONArray("creative_word");
-        JSONArray ids = new JSONArray();
-        wordsString.forEach(v -> {
-            creativeWords.forEach(word -> {
-                JSONObject wordObject = (JSONObject) word;
-                String name = wordObject.getString("name");
-                Integer id = wordObject.getInteger("creative_word_id");
-                if (v.equals(name)) {
-                    ids.add(id);
-                }
-            });
+        log.info("快手物料数据同步完成");
+
+        tokens.forEach(token -> {
+            //1: 获取广告主信息数据
+            kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate);
+            //2:获取广告计划信息数据
+            kuaishouInterfaceService.getAdvertiserCampaignReportDaily(token, getDate, getDate);
+            //3:获取广告组信息数据
+            kuaishouInterfaceService.getAdvertiserGroupReportDaily(token, getDate, getDate);
+            //4: 获取广告创意信息数据
+            kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, getDate, getDate);
         });
-        return ids;
     }
+
+    @Autowired
+    private ICtopOauthTokenService tokenService;
 }

+ 2 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IFileInfoService.java

@@ -33,4 +33,6 @@ public interface IFileInfoService extends IService<FileInfo> {
     JSONObject getCreativeWord(CtopOauthToken token, Long advertiserId);
 
     Map<String, Object> insertFile(String code, String url);
+
+    String downLoadByUrl(String fileUrl);
 }

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

@@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IUserAllocationService extends IService<UserAllocation> {
 
+    UserAllocation getByAccountId(Long accountId);
 }

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/FileInfoServiceImpl.java

@@ -299,6 +299,7 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
     }
 
 
+    @Override
     public String downLoadByUrl(String fileUrl) {
         //获取文件名,文件名实际上在URL中可以找到
         String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);

+ 7 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java

@@ -3,6 +3,7 @@ package cn.com.ctop.common.module.service.impl;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.mapper.UserAllocationMapper;
 import cn.com.ctop.common.module.service.IUserAllocationService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
@@ -15,4 +16,10 @@ import org.springframework.stereotype.Service;
 @Service
 public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper, UserAllocation> implements IUserAllocationService {
 
+    @Override
+    public UserAllocation getByAccountId(Long accountId) {
+        QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("account_id", accountId + "").orderByDesc("id").last("limit 1");
+        return this.getOne(queryWrapper);
+    }
 }

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

@@ -14,7 +14,7 @@ public class KuaishouInterfaceConstant {
     /**
      * 广告主报表数据
      */
-    public static final String VIDEO_LIST = "rest/openapi/v1/file/ad/video/list";
+    public static final String VIDEO_LIST = "/rest/openapi/v1/file/ad/video/list";
     /**
      * 广告计划报表数据
      */

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

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

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

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

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

@@ -61,7 +61,7 @@ public class KuaiShouVideoGet {
      */
     @Excel(name = "视频预览链接", width = 15)
     @ApiModelProperty(value = "视频预览链接")
-    private Object url;
+    private String url;
     /**
      * 视频首帧图片链接
      */

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

@@ -10,5 +10,4 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @Version: V1.0
  */
 public interface IKuaiShouVideoGetService extends IService<KuaiShouVideoGet> {
-
 }

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

@@ -92,6 +92,8 @@ public interface IKuaishouInterfaceService {
     void getGroup(String accessToken, Long advertiserId, Long unitId);
 
 
+    void getCreativeList(CtopOauthToken token);
+
     void getVideoInfo(String accessToken, Long advertiserId, String photoId);
 
     /**
@@ -250,4 +252,8 @@ public interface IKuaishouInterfaceService {
     void getAdvertiserGroupReportHourly(CtopOauthToken token, Date startDate, Date endDate);
 
     void getAdvertiserCreativeReportHourly(CtopOauthToken token, Date startDate, Date endDate);
+
+    void getCampaignList(CtopOauthToken token);
+
+    void getGroupList(CtopOauthToken token);
 }

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

@@ -1,12 +1,12 @@
 package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.*;
 import cn.com.ctop.kuaishou.modules.batch.entity.*;
 import cn.com.ctop.kuaishou.modules.batch.mapper.*;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCreativeService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResult;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResultToken;
 import cn.com.ctop.kuaishou.modules.report.entity.*;
@@ -226,7 +226,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             log.info("快手视频列表信息为空=》accountId:{}", token.getAccountId());
             return;
         }
-
+        System.out.println(details.toJSONString());
         for (int i = 0; i < details.size(); i++) {
             var detailJson = details.getJSONObject(i);
             var kuaiShouVideoGet = JSONObject.toJavaObject(detailJson, KuaiShouVideoGet.class);
@@ -691,11 +691,41 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             var creative = JSONObject.toJavaObject(detailJson, KuaishouReportDailyCreative.class);
             creative.setAccountId(token.getAccountId());
             creative.setId("" + creative.getAccountId() + creative.getCreativeId() + creative.getStatDate());
+            KuaishouReportDailyCreativeStatistic statistic = setDailyStatistic(creative, token);
+            dailyCreativeStatisticService.saveOrUpdate(statistic);
             dailyCreativeService.saveOrUpdate(creative);
         }
         getAdvertiserCreativeReportDailyByPage(token, startDate, endDate, page + 1);
     }
 
+    private KuaishouReportDailyCreativeStatistic setDailyStatistic(KuaishouReportDailyCreative creative, CtopOauthToken token) {
+        KuaishouReportDailyCreativeStatistic statistic = new KuaishouReportDailyCreativeStatistic(creative);
+        KuaiShouCreative getCreative = kuaiShouCreativeService.getById(creative.getId());
+        if (null != getCreative) {
+            statistic.setCreativeName(getCreative.getCreativeName());
+            KuaiShouCampaign getCampaign = kuaiShouCampaignService.getById(getCreative.getCampaignId());
+            if (null != getCampaign) {
+                statistic.setCampaignId(getCampaign.getCampaignId());
+                statistic.setCampaignName(getCampaign.getCampaignName());
+            }
+            KuaiShouGroup getGroup = kuaiShouGroupService.getById(getCreative.getUnitId());
+            if (null != getGroup) {
+                statistic.setUnitId(getGroup.getUnitId());
+                statistic.setUnitName(getGroup.getUnitName());
+            }
+            KuaiShouVideoGet getVideo = kuaiShouVideoGetService.getById("" + token.getAccountId() + getCreative.getPhotoId());
+            if (null != getVideo) {
+                statistic.setSignature(getVideo.getSignature());
+                statistic.setUrl(getVideo.getUrl());
+            }
+            UserAllocation allocation = userAllocationService.getByAccountId(token.getAccountId());
+            if (null != allocation) {
+                statistic.setAccountName(allocation.getAuthName());
+            }
+        }
+        return statistic;
+    }
+
     @Override
     public KuaishouResult<KuaishouReportDailyCreative> getCreativeDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_REPORT;
@@ -733,6 +763,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         getAdvertiserCreativeReportHourlyByPage(token, startDate, endDate, 1);
     }
 
+
     private void getAdvertiserCreativeReportHourlyByPage(CtopOauthToken token, Date startDate, Date endDate, int page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_REPORT;
         Map<String, String> headers = new HashMap<>();
@@ -768,11 +799,54 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             var creative = JSONObject.toJavaObject(detailJson, KuaishouReportHourlyCreative.class);
             creative.setAccountId(token.getAccountId());
             creative.setId("" + creative.getAccountId() + creative.getCreativeId() + creative.getStatDate() + creative.getStatHour());
+            KuaishouReportHourlyCreativeStatistic statistic = setHourlyStatistic(creative, token);
+            hourlyCreativeStatisticService.saveOrUpdate(statistic);
             hourlyCreativeService.saveOrUpdate(creative);
         }
         getAdvertiserCreativeReportHourlyByPage(token, startDate, endDate, page + 1);
     }
 
+    @Autowired
+    private IKuaiShouCreativeService kuaiShouCreativeService;
+    @Autowired
+    private IKuaiShouCampaignService kuaiShouCampaignService;
+    @Autowired
+    private IKuaiShouGroupService kuaiShouGroupService;
+    @Autowired
+    private IUserAllocationService userAllocationService;
+    @Autowired
+    private IKuaishouReportHourlyCreativeStatisticService hourlyCreativeStatisticService;
+    @Autowired
+    private IKuaishouReportDailyCreativeStatisticService dailyCreativeStatisticService;
+
+    private KuaishouReportHourlyCreativeStatistic setHourlyStatistic(KuaishouReportHourlyCreative creative, CtopOauthToken token) {
+        KuaishouReportHourlyCreativeStatistic statistic = new KuaishouReportHourlyCreativeStatistic(creative);
+        KuaiShouCreative getCreative = kuaiShouCreativeService.getById(creative.getId());
+        if (null != getCreative) {
+            statistic.setCreativeName(getCreative.getCreativeName());
+            KuaiShouCampaign getCampaign = kuaiShouCampaignService.getById(getCreative.getCampaignId());
+            if (null != getCampaign) {
+                statistic.setCampaignId(getCampaign.getCampaignId());
+                statistic.setCampaignName(getCampaign.getCampaignName());
+            }
+            KuaiShouGroup getGroup = kuaiShouGroupService.getById(getCreative.getUnitId());
+            if (null != getGroup) {
+                statistic.setUnitId(getGroup.getUnitId());
+                statistic.setUnitName(getGroup.getUnitName());
+            }
+            KuaiShouVideoGet getVideo = kuaiShouVideoGetService.getById("" + token.getAccountId() + getCreative.getPhotoId());
+            if (null != getVideo) {
+                statistic.setSignature(getVideo.getSignature());
+                statistic.setUrl(getVideo.getUrl());
+            }
+            UserAllocation allocation = userAllocationService.getByAccountId(token.getAccountId());
+            if (null != allocation) {
+                statistic.setAccountName(allocation.getAuthName());
+            }
+        }
+        return statistic;
+    }
+
     @Override
     public KuaishouResult<KuaishouReportHourlyCreative> getCreativeHourlyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_REPORT;
@@ -972,6 +1046,42 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return returnMap;
     }
 
+    @Override
+    public void getCampaignList(CtopOauthToken token) {
+        getCampaignListByPage(token.getAccessToken(), token.getAccountId(), 1);
+    }
+
+    private void getCampaignListByPage(String accessToken, Long accountId, int page) {
+        String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_LIST;
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Access-Token", accessToken);
+        headers.put("Content-Type", " application/json");
+        JSONObject param = new JSONObject();
+        param.put("advertiser_id", accountId);
+        param.put("page", page);
+        param.put("page_size", 200);
+
+        String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+        if (Check.isNull(resultJson)) {
+            log.error("获取广告计划信息返回结果异常,advertiserId:{}", accountId);
+            return;
+        }
+        Integer code = resultJson.getInteger("code");
+        if (null == code || code != 0) {
+            log.error("获取广告计划信息返回结果异常,advertiserId:{},异常信息:{}", accountId, resultJson);
+            return;
+        }
+        JSONObject dataJson = resultJson.getJSONObject("data");
+        JSONArray details = dataJson.getJSONArray("details");
+        if (Check.isNull(details)) {
+            log.info("获取广告计划信息返回结果为空,advertiserId:{}", accountId);
+            return;
+        }
+        addCampaign(accountId, details);
+        getCreativeListByPage(accessToken, accountId, page + 1);
+    }
+
     /**
      * 获取广告计划信息
      *
@@ -981,12 +1091,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
      */
     @Override
     public void getCampaignList(String accessToken, Long advertiserId, Integer page) {
-        // 第一次请求删除历史数据
-        if (page == 1) {
-            Map<String, Object> map = new HashMap<>();
-            map.put("account_id", advertiserId);
-            campaignMapper.deleteByMap(map);
-        }
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_LIST;
         Map<String, String> headers = new HashMap<>();
         headers.put("Access-Token", accessToken);
@@ -1072,6 +1176,40 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         }
     }
 
+    @Override
+    public void getGroupList(CtopOauthToken token) {
+        getGroupListByPage(token, 1);
+    }
+
+    private void getGroupListByPage(CtopOauthToken token, int page) {
+        String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GROUP_LIST;
+        JSONObject param = new JSONObject();
+        param.put("advertiser_id", token.getAccountId());
+        param.put("page_size", 200);
+        param.put("page", page);
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Access-Token", token.getAccessToken());
+        headers.put("Content-Type", " application/json");
+
+        String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
+        JSONObject resultJson = JSONObject.parseObject(result);
+        if (Check.isNull(resultJson)) {
+            log.error("获取广告组接口异常,advertiserId:{}", token.getAccountId());
+            return;
+        }
+        Integer code = resultJson.getInteger("code");
+        if (null == code || code != 0) {
+            log.error("获取广告组返回结果异常,advertiserId:{},异常信息:{}", token.getAccountId(), resultJson);
+            return;
+        }
+        JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
+        if (Check.isNull(details)) {
+            log.info("获取广告组返回结果为空,advertiserId:{}", token.getAccountId());
+            return;
+        }
+        addGroup(token.getAccountId(), details);
+        getGroupListByPage(token, page + 1);
+    }
 
     /**
      * 获取广告组信息 全量
@@ -1230,6 +1368,11 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         }
     }
 
+    @Override
+    public void getCreativeList(CtopOauthToken token) {
+        getCreativeListByPage(token.getAccessToken(), token.getAccountId(), 1);
+    }
+
     public void getCreativeListByPage(String accessToken, Long advertiserId, Integer page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_LIST;
         Map<String, String> headers = new HashMap<>();
@@ -1319,7 +1462,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                 videoGet.setAccountId(advertiserId);
                                 videoGet.setWidth(detailJson.getInteger("width"));
                                 videoGet.setHeight(detailJson.getInteger("height"));
-                                videoGet.setUrl(detailJson.getLong("unit_id"));
+                                videoGet.setUrl(detailJson.getString("url"));
                                 videoGet.setCoverUrl(detailJson.getString("creative_name"));
                                 videoGet.setPhotoId(detailJson.getString("photo_id"));
                                 //videoGet.setSignature(UUID.randomUUID().toString());

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

@@ -0,0 +1,448 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 时报清洗数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-01
+ */
+@Data
+@TableName("ctop_kuaishou_report_daily_creative_statistic")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_report_daily_creative_statistic对象", description = "时报清洗数据")
+public class KuaishouReportDailyCreativeStatistic {
+
+    /**
+     * id
+     */
+    @TableId
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * accountId
+     */
+    @Excel(name = "accountId", width = 15)
+    @ApiModelProperty(value = "accountId")
+    private Long accountId;
+    /**
+     * 用户名
+     */
+    @Excel(name = "用户名", width = 15)
+    @ApiModelProperty(value = "用户名")
+    private String accountName;
+    /**
+     * unitId
+     */
+    @Excel(name = "unitId", width = 15)
+    @ApiModelProperty(value = "unitId")
+    private Long unitId;
+    /**
+     * unitName
+     */
+    @Excel(name = "unitName", width = 15)
+    @ApiModelProperty(value = "unitName")
+    private String unitName;
+    /**
+     * campaignId
+     */
+    @Excel(name = "campaignId", width = 15)
+    @ApiModelProperty(value = "campaignId")
+    private Long campaignId;
+    /**
+     * campaignName
+     */
+    @Excel(name = "campaignName", width = 15)
+    @ApiModelProperty(value = "campaignName")
+    private String campaignName;
+    /**
+     * 广告创意ID
+     */
+    @Excel(name = "广告创意ID", width = 15)
+    @ApiModelProperty(value = "广告创意ID")
+    private Long creativeId;
+    /**
+     * creativeName
+     */
+    @Excel(name = "creativeName", width = 15)
+    @ApiModelProperty(value = "creativeName")
+    private String creativeName;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 花费(元)
+     */
+    @Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+    private BigDecimal charge;
+    /**
+     * 封面点击数
+     */
+    @Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+    private Long photoClick;
+    /**
+     * 曝光数
+     */
+    @Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+    private Long photoShow;
+    /**
+     * 点击数
+     */
+    @Excel(name = "点击数", width = 15)
+    @ApiModelProperty(value = "点击数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * photoClickRatio
+     */
+    @Excel(name = "photoClickRatio", width = 15)
+    @ApiModelProperty(value = "photoClickRatio")
+    private BigDecimal photoClickRatio;
+    /**
+     * 行为率
+     */
+    @Excel(name = "行为率", width = 15)
+    @ApiModelProperty(value = "行为率")
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光消耗
+     */
+    @Excel(name = "平均千次曝光消耗", width = 15)
+    @ApiModelProperty(value = "平均千次曝光消耗")
+    private BigDecimal impression1kCost;
+    /**
+     * eventCreditGrantLandingPageCost
+     */
+    @Excel(name = "eventCreditGrantLandingPageCost", width = 15)
+    @ApiModelProperty(value = "eventCreditGrantLandingPageCost")
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * eventCreditGrantLandingPage
+     */
+    @Excel(name = "eventCreditGrantLandingPage", width = 15)
+    @ApiModelProperty(value = "eventCreditGrantLandingPage")
+    private Long eventCreditGrantLandingPage;
+    /**
+     * eventJinJianLandingPageCost
+     */
+    @Excel(name = "eventJinJianLandingPageCost", width = 15)
+    @ApiModelProperty(value = "eventJinJianLandingPageCost")
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * eventJinJianLandingPage
+     */
+    @Excel(name = "eventJinJianLandingPage", width = 15)
+    @ApiModelProperty(value = "eventJinJianLandingPage")
+    private Long eventJinJianLandingPage;
+    /**
+     * formActionRatio
+     */
+    @Excel(name = "formActionRatio", width = 15)
+    @ApiModelProperty(value = "formActionRatio")
+    private BigDecimal formActionRatio;
+    /**
+     * formCost
+     */
+    @Excel(name = "formCost", width = 15)
+    @ApiModelProperty(value = "formCost")
+    private BigDecimal formCost;
+    /**
+     * formCount
+     */
+    @Excel(name = "formCount", width = 15)
+    @ApiModelProperty(value = "formCount")
+    private Long formCount;
+    /**
+     * eventOrderPaidCost
+     */
+    @Excel(name = "eventOrderPaidCost", width = 15)
+    @ApiModelProperty(value = "eventOrderPaidCost")
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * eventOrderPaidPurchaseAmount
+     */
+    @Excel(name = "eventOrderPaidPurchaseAmount", width = 15)
+    @ApiModelProperty(value = "eventOrderPaidPurchaseAmount")
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * eventOrderPaid
+     */
+    @Excel(name = "eventOrderPaid", width = 15)
+    @ApiModelProperty(value = "eventOrderPaid")
+    private BigDecimal eventOrderPaid;
+    /**
+     * eventCreditGrantAppRatio
+     */
+    @Excel(name = "eventCreditGrantAppRatio", width = 15)
+    @ApiModelProperty(value = "eventCreditGrantAppRatio")
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * eventCreditGrantAppCost
+     */
+    @Excel(name = "eventCreditGrantAppCost", width = 15)
+    @ApiModelProperty(value = "eventCreditGrantAppCost")
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * eventCreditGrantApp
+     */
+    @Excel(name = "eventCreditGrantApp", width = 15)
+    @ApiModelProperty(value = "eventCreditGrantApp")
+    private Long eventCreditGrantApp;
+    /**
+     * eventPayPurchaseAmountFirstDay
+     */
+    @Excel(name = "eventPayPurchaseAmountFirstDay", width = 15)
+    @ApiModelProperty(value = "eventPayPurchaseAmountFirstDay")
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * eventJinJianAppCost
+     */
+    @Excel(name = "eventJinJianAppCost", width = 15)
+    @ApiModelProperty(value = "eventJinJianAppCost")
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * eventJinJianApp
+     */
+    @Excel(name = "eventJinJianApp", width = 15)
+    @ApiModelProperty(value = "eventJinJianApp")
+    private Long eventJinJianApp;
+    /**
+     * eventRegisterCost
+     */
+    @Excel(name = "eventRegisterCost", width = 15)
+    @ApiModelProperty(value = "eventRegisterCost")
+    private BigDecimal eventRegisterCost;
+    /**
+     * eventRegister
+     */
+    @Excel(name = "eventRegister", width = 15)
+    @ApiModelProperty(value = "eventRegister")
+    private Long eventRegister;
+    /**
+     * eventPayRoi
+     */
+    @Excel(name = "eventPayRoi", width = 15)
+    @ApiModelProperty(value = "eventPayRoi")
+    private BigDecimal eventPayRoi;
+    /**
+     * eventPayPurchaseAmount
+     */
+    @Excel(name = "eventPayPurchaseAmount", width = 15)
+    @ApiModelProperty(value = "eventPayPurchaseAmount")
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * eventPay
+     */
+    @Excel(name = "eventPay", width = 15)
+    @ApiModelProperty(value = "eventPay")
+    private BigDecimal eventPay;
+    /**
+     * eventPayFirstDayRoi
+     */
+    @Excel(name = "eventPayFirstDayRoi", width = 15)
+    @ApiModelProperty(value = "eventPayFirstDayRoi")
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * eventPayFirstDay
+     */
+    @Excel(name = "eventPayFirstDay", width = 15)
+    @ApiModelProperty(value = "eventPayFirstDay")
+    private Long eventPayFirstDay;
+    /**
+     * photoClickCost
+     */
+    @Excel(name = "photoClickCost", width = 15)
+    @ApiModelProperty(value = "photoClickCost")
+    private BigDecimal photoClickCost;
+    /**
+     * actionCost
+     */
+    @Excel(name = "actionCost", width = 15)
+    @ApiModelProperty(value = "actionCost")
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    @Excel(name = "分享数", width = 15)
+    @ApiModelProperty(value = "分享数")
+    private Long share;
+    /**
+     * 评论数
+     */
+    @Excel(name = "评论数", width = 15)
+    @ApiModelProperty(value = "评论数")
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    @Excel(name = "点赞数", width = 15)
+    @ApiModelProperty(value = "点赞数")
+    private Long photoLike;
+    /**
+     * 新增关注数
+     */
+    @Excel(name = "新增关注数", width = 15)
+    @ApiModelProperty(value = "新增关注数")
+    private Long follow;
+    /**
+     * 举报数
+     */
+    @Excel(name = "举报数", width = 15)
+    @ApiModelProperty(value = "举报数")
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    @Excel(name = "拉黑数", width = 15)
+    @ApiModelProperty(value = "拉黑数")
+    private Long block;
+    /**
+     * negative
+     */
+    @Excel(name = "negative", width = 15)
+    @ApiModelProperty(value = "negative")
+    private Long negative;
+    /**
+     * 激活数
+     */
+    @Excel(name = "激活数", width = 15)
+    @ApiModelProperty(value = "激活数")
+    private Long activation;
+    /**
+     * submit
+     */
+    @Excel(name = "submit", width = 15)
+    @ApiModelProperty(value = "submit")
+    private Long submit;
+    /**
+     * cancelFollow
+     */
+    @Excel(name = "cancelFollow", width = 15)
+    @ApiModelProperty(value = "cancelFollow")
+    private Long cancelFollow;
+    /**
+     * 安卓下载开始数
+     */
+    @Excel(name = "安卓下载开始数", width = 15)
+    @ApiModelProperty(value = "安卓下载开始数")
+    private Long downloadStarted;
+    /**
+     * 安卓下载完成数
+     */
+    @Excel(name = "安卓下载完成数", width = 15)
+    @ApiModelProperty(value = "安卓下载完成数")
+    private Long downloadCompleted;
+    /**
+     * 创建时间
+     */
+    @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;
+    /**
+     * signature
+     */
+    @Excel(name = "signature", width = 15)
+    @ApiModelProperty(value = "signature")
+    private String signature;
+    /**
+     * url
+     */
+    @Excel(name = "url", width = 15)
+    @ApiModelProperty(value = "url")
+    private String url;
+
+    public KuaishouReportDailyCreativeStatistic(KuaishouReportDailyCreative creative) {
+        this.id = creative.getId();
+        this.accountId = creative.getAccountId();
+        this.creativeId = creative.getCreativeId();
+        this.statDate = creative.getStatDate();
+        this.charge = creative.getCharge();
+        this.photoClick = creative.getPhotoClick();
+        this.photoShow = creative.getPhotoShow();
+        this.aclick = creative.getAclick();
+        this.bclick = creative.getBclick();
+        this.photoClickRatio = creative.getPhotoClickRatio();
+        this.actionRatio = creative.getActionRatio();
+        this.impression1kCost = creative.getImpression1kCost();
+        this.eventCreditGrantLandingPageCost = creative.getEventCreditGrantLandingPageCost();
+        this.eventCreditGrantLandingPage = creative.getEventCreditGrantLandingPage();
+        this.eventJinJianLandingPageCost = creative.getEventJinJianLandingPageCost();
+        this.eventJinJianLandingPage = creative.getEventJinJianLandingPage();
+        this.formActionRatio = creative.getFormActionRatio();
+        this.formCost = creative.getFormCost();
+        this.formCount = creative.getFormCount();
+        this.eventOrderPaidCost = creative.getEventOrderPaidCost();
+        this.eventOrderPaidPurchaseAmount = creative.getEventOrderPaidPurchaseAmount();
+        this.eventOrderPaid = creative.getEventOrderPaid();
+        this.eventCreditGrantAppRatio = creative.getEventCreditGrantAppRatio();
+        this.eventCreditGrantAppCost = creative.getEventCreditGrantAppCost();
+        this.eventCreditGrantApp = creative.getEventCreditGrantApp();
+        this.eventPayPurchaseAmountFirstDay = creative.getEventPayPurchaseAmountFirstDay();
+        this.eventJinJianAppCost = creative.getEventJinJianAppCost();
+        this.eventJinJianApp = creative.getEventJinJianApp();
+        this.eventRegisterCost = creative.getEventRegisterCost();
+        this.eventRegister = creative.getEventRegister();
+        this.eventPayRoi = creative.getEventPayRoi();
+        this.eventPayPurchaseAmount = creative.getEventPayPurchaseAmount();
+        this.eventPay = creative.getEventPay();
+        this.eventPayFirstDayRoi = creative.getEventPayFirstDayRoi();
+        this.eventPayFirstDay = creative.getEventPayFirstDay();
+        this.photoClickCost = creative.getPhotoClickCost();
+        this.actionCost = creative.getActionCost();
+        this.share = creative.getShare();
+        this.comment = creative.getComment();
+        this.photoLike = creative.getPhotoLike();
+        this.follow = creative.getFollow();
+        this.report = creative.getReport();
+        this.block = creative.getBlock();
+        this.negative = creative.getNegative();
+        this.activation = creative.getActivation();
+        this.submit = creative.getSubmit();
+        this.cancelFollow = creative.getCancelFollow();
+        this.downloadStarted = creative.getDownloadStarted();
+        this.downloadCompleted = creative.getDownloadCompleted();
+        this.updateTime = new Date();
+        this.createTime = new Date();
+    }
+
+    public KuaishouReportDailyCreativeStatistic() {
+    }
+}

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

@@ -0,0 +1,455 @@
+package cn.com.ctop.kuaishou.modules.report.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 时报清洗数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-01
+ */
+@Data
+@TableName("ctop_kuaishou_report_hourly_creative_statistic")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_report_hourly_creative_statistic对象", description = "时报清洗数据")
+public class KuaishouReportHourlyCreativeStatistic {
+
+    /**
+     * id
+     */
+    @TableId
+    @ApiModelProperty(value = "id")
+    private String id;
+    /**
+     * accountId
+     */
+    @Excel(name = "accountId", width = 15)
+    @ApiModelProperty(value = "accountId")
+    private Long accountId;
+    /**
+     * 用户名
+     */
+    @Excel(name = "用户名", width = 15)
+    @ApiModelProperty(value = "用户名")
+    private String accountName;
+    /**
+     * unitId
+     */
+    @Excel(name = "unitId", width = 15)
+    @ApiModelProperty(value = "unitId")
+    private Long unitId;
+    /**
+     * unitName
+     */
+    @Excel(name = "unitName", width = 15)
+    @ApiModelProperty(value = "unitName")
+    private String unitName;
+    /**
+     * campaignId
+     */
+    @Excel(name = "campaignId", width = 15)
+    @ApiModelProperty(value = "campaignId")
+    private Long campaignId;
+    /**
+     * campaignName
+     */
+    @Excel(name = "campaignName", width = 15)
+    @ApiModelProperty(value = "campaignName")
+    private String campaignName;
+    /**
+     * 广告创意ID
+     */
+    @Excel(name = "广告创意ID", width = 15)
+    @ApiModelProperty(value = "广告创意ID")
+    private Long creativeId;
+    /**
+     * creativeName
+     */
+    @Excel(name = "creativeName", width = 15)
+    @ApiModelProperty(value = "creativeName")
+    private String creativeName;
+    /**
+     * 日期
+     */
+    @Excel(name = "日期", width = 15, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "日期")
+    private String statDate;
+    /**
+     * 时间
+     */
+    @Excel(name = "时间", width = 15)
+    @ApiModelProperty(value = "时间")
+    private Integer statHour;
+    /**
+     * 花费(元)
+     */
+    @Excel(name = "花费(元)", width = 15)
+    @ApiModelProperty(value = "花费(元)")
+    private java.math.BigDecimal charge;
+    /**
+     * 封面点击数
+     */
+    @Excel(name = "封面点击数", width = 15)
+    @ApiModelProperty(value = "封面点击数")
+    private Long photoClick;
+    /**
+     * 曝光数
+     */
+    @Excel(name = "曝光数", width = 15)
+    @ApiModelProperty(value = "曝光数")
+    private Long photoShow;
+    /**
+     * 点击数
+     */
+    @Excel(name = "点击数", width = 15)
+    @ApiModelProperty(value = "点击数")
+    private Long aclick;
+    /**
+     * 行为数
+     */
+    @Excel(name = "行为数", width = 15)
+    @ApiModelProperty(value = "行为数")
+    private Long bclick;
+    /**
+     * photoClickRatio
+     */
+    @Excel(name = "photoClickRatio", width = 15)
+    @ApiModelProperty(value = "photoClickRatio")
+    private BigDecimal photoClickRatio;
+    /**
+     * 行为率
+     */
+    @Excel(name = "行为率", width = 15)
+    @ApiModelProperty(value = "行为率")
+    private BigDecimal actionRatio;
+    /**
+     * 平均千次曝光消耗
+     */
+    @Excel(name = "平均千次曝光消耗", width = 15)
+    @ApiModelProperty(value = "平均千次曝光消耗")
+    private BigDecimal impression1kCost;
+    /**
+     * eventCreditGrantLandingPageCost
+     */
+    @Excel(name = "eventCreditGrantLandingPageCost", width = 15)
+    @ApiModelProperty(value = "eventCreditGrantLandingPageCost")
+    private BigDecimal eventCreditGrantLandingPageCost;
+    /**
+     * eventCreditGrantLandingPage
+     */
+    @Excel(name = "eventCreditGrantLandingPage", width = 15)
+    @ApiModelProperty(value = "eventCreditGrantLandingPage")
+    private Long eventCreditGrantLandingPage;
+    /**
+     * eventJinJianLandingPageCost
+     */
+    @Excel(name = "eventJinJianLandingPageCost", width = 15)
+    @ApiModelProperty(value = "eventJinJianLandingPageCost")
+    private BigDecimal eventJinJianLandingPageCost;
+    /**
+     * eventJinJianLandingPage
+     */
+    @Excel(name = "eventJinJianLandingPage", width = 15)
+    @ApiModelProperty(value = "eventJinJianLandingPage")
+    private Long eventJinJianLandingPage;
+    /**
+     * formActionRatio
+     */
+    @Excel(name = "formActionRatio", width = 15)
+    @ApiModelProperty(value = "formActionRatio")
+    private BigDecimal formActionRatio;
+    /**
+     * formCost
+     */
+    @Excel(name = "formCost", width = 15)
+    @ApiModelProperty(value = "formCost")
+    private BigDecimal formCost;
+    /**
+     * formCount
+     */
+    @Excel(name = "formCount", width = 15)
+    @ApiModelProperty(value = "formCount")
+    private Long formCount;
+    /**
+     * eventOrderPaidCost
+     */
+    @Excel(name = "eventOrderPaidCost", width = 15)
+    @ApiModelProperty(value = "eventOrderPaidCost")
+    private BigDecimal eventOrderPaidCost;
+    /**
+     * eventOrderPaidPurchaseAmount
+     */
+    @Excel(name = "eventOrderPaidPurchaseAmount", width = 15)
+    @ApiModelProperty(value = "eventOrderPaidPurchaseAmount")
+    private BigDecimal eventOrderPaidPurchaseAmount;
+    /**
+     * eventOrderPaid
+     */
+    @Excel(name = "eventOrderPaid", width = 15)
+    @ApiModelProperty(value = "eventOrderPaid")
+    private BigDecimal eventOrderPaid;
+    /**
+     * eventCreditGrantAppRatio
+     */
+    @Excel(name = "eventCreditGrantAppRatio", width = 15)
+    @ApiModelProperty(value = "eventCreditGrantAppRatio")
+    private BigDecimal eventCreditGrantAppRatio;
+    /**
+     * eventCreditGrantAppCost
+     */
+    @Excel(name = "eventCreditGrantAppCost", width = 15)
+    @ApiModelProperty(value = "eventCreditGrantAppCost")
+    private BigDecimal eventCreditGrantAppCost;
+    /**
+     * eventCreditGrantApp
+     */
+    @Excel(name = "eventCreditGrantApp", width = 15)
+    @ApiModelProperty(value = "eventCreditGrantApp")
+    private Long eventCreditGrantApp;
+    /**
+     * eventPayPurchaseAmountFirstDay
+     */
+    @Excel(name = "eventPayPurchaseAmountFirstDay", width = 15)
+    @ApiModelProperty(value = "eventPayPurchaseAmountFirstDay")
+    private BigDecimal eventPayPurchaseAmountFirstDay;
+    /**
+     * eventJinJianAppCost
+     */
+    @Excel(name = "eventJinJianAppCost", width = 15)
+    @ApiModelProperty(value = "eventJinJianAppCost")
+    private BigDecimal eventJinJianAppCost;
+    /**
+     * eventJinJianApp
+     */
+    @Excel(name = "eventJinJianApp", width = 15)
+    @ApiModelProperty(value = "eventJinJianApp")
+    private Long eventJinJianApp;
+    /**
+     * eventRegisterCost
+     */
+    @Excel(name = "eventRegisterCost", width = 15)
+    @ApiModelProperty(value = "eventRegisterCost")
+    private BigDecimal eventRegisterCost;
+    /**
+     * eventRegister
+     */
+    @Excel(name = "eventRegister", width = 15)
+    @ApiModelProperty(value = "eventRegister")
+    private Long eventRegister;
+    /**
+     * eventPayRoi
+     */
+    @Excel(name = "eventPayRoi", width = 15)
+    @ApiModelProperty(value = "eventPayRoi")
+    private BigDecimal eventPayRoi;
+    /**
+     * eventPayPurchaseAmount
+     */
+    @Excel(name = "eventPayPurchaseAmount", width = 15)
+    @ApiModelProperty(value = "eventPayPurchaseAmount")
+    private BigDecimal eventPayPurchaseAmount;
+    /**
+     * eventPay
+     */
+    @Excel(name = "eventPay", width = 15)
+    @ApiModelProperty(value = "eventPay")
+    private BigDecimal eventPay;
+    /**
+     * eventPayFirstDayRoi
+     */
+    @Excel(name = "eventPayFirstDayRoi", width = 15)
+    @ApiModelProperty(value = "eventPayFirstDayRoi")
+    private BigDecimal eventPayFirstDayRoi;
+    /**
+     * eventPayFirstDay
+     */
+    @Excel(name = "eventPayFirstDay", width = 15)
+    @ApiModelProperty(value = "eventPayFirstDay")
+    private Long eventPayFirstDay;
+    /**
+     * photoClickCost
+     */
+    @Excel(name = "photoClickCost", width = 15)
+    @ApiModelProperty(value = "photoClickCost")
+    private BigDecimal photoClickCost;
+    /**
+     * actionCost
+     */
+    @Excel(name = "actionCost", width = 15)
+    @ApiModelProperty(value = "actionCost")
+    private BigDecimal actionCost;
+    /**
+     * 分享数
+     */
+    @Excel(name = "分享数", width = 15)
+    @ApiModelProperty(value = "分享数")
+    private Long share;
+    /**
+     * 评论数
+     */
+    @Excel(name = "评论数", width = 15)
+    @ApiModelProperty(value = "评论数")
+    private Long comment;
+    /**
+     * 点赞数
+     */
+    @Excel(name = "点赞数", width = 15)
+    @ApiModelProperty(value = "点赞数")
+    private Long photoLike;
+    /**
+     * 新增关注数
+     */
+    @Excel(name = "新增关注数", width = 15)
+    @ApiModelProperty(value = "新增关注数")
+    private Long follow;
+    /**
+     * 举报数
+     */
+    @Excel(name = "举报数", width = 15)
+    @ApiModelProperty(value = "举报数")
+    private Long report;
+    /**
+     * 拉黑数
+     */
+    @Excel(name = "拉黑数", width = 15)
+    @ApiModelProperty(value = "拉黑数")
+    private Long block;
+    /**
+     * negative
+     */
+    @Excel(name = "negative", width = 15)
+    @ApiModelProperty(value = "negative")
+    private Long negative;
+    /**
+     * 激活数
+     */
+    @Excel(name = "激活数", width = 15)
+    @ApiModelProperty(value = "激活数")
+    private Long activation;
+    /**
+     * submit
+     */
+    @Excel(name = "submit", width = 15)
+    @ApiModelProperty(value = "submit")
+    private Long submit;
+    /**
+     * cancelFollow
+     */
+    @Excel(name = "cancelFollow", width = 15)
+    @ApiModelProperty(value = "cancelFollow")
+    private Long cancelFollow;
+    /**
+     * 安卓下载开始数
+     */
+    @Excel(name = "安卓下载开始数", width = 15)
+    @ApiModelProperty(value = "安卓下载开始数")
+    private Long downloadStarted;
+    /**
+     * 安卓下载完成数
+     */
+    @Excel(name = "安卓下载完成数", width = 15)
+    @ApiModelProperty(value = "安卓下载完成数")
+    private Long downloadCompleted;
+    /**
+     * 创建时间
+     */
+    @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;
+    /**
+     * signature
+     */
+    @Excel(name = "signature", width = 15)
+    @ApiModelProperty(value = "signature")
+    private String signature;
+    /**
+     * url
+     */
+    @Excel(name = "url", width = 15)
+    @ApiModelProperty(value = "url")
+    private String url;
+
+    public KuaishouReportHourlyCreativeStatistic(KuaishouReportHourlyCreative creative) {
+        this.id = creative.getId();
+        this.accountId = creative.getAccountId();
+        this.creativeId = creative.getCreativeId();
+        this.statDate = creative.getStatDate();
+        this.statHour = creative.getStatHour();
+        this.charge = creative.getCharge();
+        this.photoClick = creative.getPhotoClick();
+        this.photoShow = creative.getPhotoShow();
+        this.aclick = creative.getAclick();
+        this.bclick = creative.getBclick();
+        this.photoClickRatio = creative.getPhotoClickRatio();
+        this.actionRatio = creative.getActionRatio();
+        this.impression1kCost = creative.getImpression1kCost();
+        this.eventCreditGrantLandingPageCost = creative.getEventCreditGrantLandingPageCost();
+        this.eventCreditGrantLandingPage = creative.getEventCreditGrantLandingPage();
+        this.eventJinJianLandingPageCost = creative.getEventJinJianLandingPageCost();
+        this.eventJinJianLandingPage = creative.getEventJinJianLandingPage();
+        this.formActionRatio = creative.getFormActionRatio();
+        this.formCost = creative.getFormCost();
+        this.formCount = creative.getFormCount();
+        this.eventOrderPaidCost = creative.getEventOrderPaidCost();
+        this.eventOrderPaidPurchaseAmount = creative.getEventOrderPaidPurchaseAmount();
+        this.eventOrderPaid = creative.getEventOrderPaid();
+        this.eventCreditGrantAppRatio = creative.getEventCreditGrantAppRatio();
+        this.eventCreditGrantAppCost = creative.getEventCreditGrantAppCost();
+        this.eventCreditGrantApp = creative.getEventCreditGrantApp();
+        this.eventPayPurchaseAmountFirstDay = creative.getEventPayPurchaseAmountFirstDay();
+        this.eventJinJianAppCost = creative.getEventJinJianAppCost();
+        this.eventJinJianApp = creative.getEventJinJianApp();
+        this.eventRegisterCost = creative.getEventRegisterCost();
+        this.eventRegister = creative.getEventRegister();
+        this.eventPayRoi = creative.getEventPayRoi();
+        this.eventPayPurchaseAmount = creative.getEventPayPurchaseAmount();
+        this.eventPay = creative.getEventPay();
+        this.eventPayFirstDayRoi = creative.getEventPayFirstDayRoi();
+        this.eventPayFirstDay = creative.getEventPayFirstDay();
+        this.photoClickCost = creative.getPhotoClickCost();
+        this.actionCost = creative.getActionCost();
+        this.share = creative.getShare();
+        this.comment = creative.getComment();
+        this.photoLike = creative.getPhotoLike();
+        this.follow = creative.getFollow();
+        this.report = creative.getReport();
+        this.block = creative.getBlock();
+        this.negative = creative.getNegative();
+        this.activation = creative.getActivation();
+        this.submit = creative.getSubmit();
+        this.cancelFollow = creative.getCancelFollow();
+        this.downloadStarted = creative.getDownloadStarted();
+        this.downloadCompleted = creative.getDownloadCompleted();
+        this.updateTime = new Date();
+        this.createTime = new Date();
+    }
+
+    public KuaishouReportHourlyCreativeStatistic() {
+    }
+}

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

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreativeStatistic;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 时报清洗数据
+ *
+ * @author: jeecg-boot
+ * @date: 2019-11-01
+ * @cersion: V1.0
+ */
+public interface KuaishouReportDailyCreativeStatisticMapper extends BaseMapper<KuaishouReportDailyCreativeStatistic> {
+
+}

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

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.report.mapper;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportHourlyCreativeStatistic;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 时报清洗数据
+ *
+ * @author: jeecg-boot
+ * @date: 2019-11-01
+ * @cersion: V1.0
+ */
+public interface KuaishouReportHourlyCreativeStatisticMapper extends BaseMapper<KuaishouReportHourlyCreativeStatistic> {
+
+}

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

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

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

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.report.service;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreativeStatistic;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 时报清洗数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-01
+ */
+public interface IKuaishouReportDailyCreativeStatisticService extends IService<KuaishouReportDailyCreativeStatistic> {
+
+}

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

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.report.service;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportHourlyCreativeStatistic;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 时报清洗数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-01
+ */
+public interface IKuaishouReportHourlyCreativeStatisticService extends IService<KuaishouReportHourlyCreativeStatistic> {
+
+}

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

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.report.service.impl;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreativeStatistic;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeStatisticMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyCreativeStatisticService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 时报清洗数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-01
+ */
+@Service
+public class KuaishouReportDailyCreativeStatisticServiceImpl extends ServiceImpl<KuaishouReportDailyCreativeStatisticMapper, KuaishouReportDailyCreativeStatistic> implements IKuaishouReportDailyCreativeStatisticService {
+
+}

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

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.report.service.impl;
+
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportHourlyCreativeStatistic;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportHourlyCreativeStatisticMapper;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportHourlyCreativeStatisticService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 时报清洗数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2019-11-01
+ */
+@Service
+public class KuaishouReportHourlyCreativeStatisticServiceImpl extends ServiceImpl<KuaishouReportHourlyCreativeStatisticMapper, KuaishouReportHourlyCreativeStatistic> implements IKuaishouReportHourlyCreativeStatisticService {
+
+}