Procházet zdrojové kódy

修改头条图片素材报表

syh před 4 roky
rodič
revize
aa67d6ffff
44 změnil soubory, kde provedl 449 přidání a 285 odebrání
  1. 2 1
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java
  2. 9 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ImageCostController.java
  3. 34 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  4. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/ByteDanceCleanMaterialJob.java
  5. 11 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IImageReportDailyService.java
  6. 133 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ImageReportDailyServiceImpl.java
  7. 3 1
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  8. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/ByteDanceCleanMaterialReport.java
  9. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouCleanMaterialReport.java
  10. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/ByteDanceCleanMaterialReportMapper.java
  11. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaiShouCleanMaterialReportMapper.java
  12. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/MaterialInfoMapper.java
  13. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/ByteDanceCleanMaterialReportMapper.xml
  14. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaiShouCleanMaterialReportMapper.xml
  15. 28 0
      module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml
  16. 2 7
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IByteDanceCleanMaterialReportService.java
  17. 15 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IKuaiShouCleanMaterialReportService.java
  18. 2 2
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialImageInfoService.java
  19. 2 0
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java
  20. 26 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/ByteDanceCleanMaterialReportServiceImpl.java
  21. 18 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/KuaiShouCleanMaterialReportServiceImpl.java
  22. 8 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialImageInfoServiceImpl.java
  23. 70 0
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  24. 0 1
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceCleanMaterialJob.java
  25. 0 1
      module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouCleanMaterialJob.java
  26. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaiShouCleanMaterialReportController.java
  27. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyCreativeMapper.java
  28. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyCreativeMapper.xml
  29. 0 29
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaiShouCleanMaterialReportService.java
  30. 10 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/IKuaishouReportDailyCreativeService.java
  31. 0 41
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaiShouCleanMaterialReportServiceImpl.java
  32. 27 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaishouReportDailyCreativeServiceImpl.java
  33. 0 23
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceCleanMaterialService.java
  34. 0 46
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceCleanMaterialServiceImpl.java
  35. 2 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/ImageCostVO.java
  36. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/ByteDanceCleanMaterialReportController.java
  37. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceCreativeDailyReportMapper.java
  38. 1 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceCreativeDailyReportMapper.xml
  39. 2 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceReportMaterialDailyMapper.xml
  40. 3 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceCreativeDailyReportService.java
  41. 0 5
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceReportMaterialDailyService.java
  42. 0 54
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ByteDanceCleanMaterialReportServiceImpl.java
  43. 20 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceCreativeDailyReportServiceImpl.java
  44. 0 45
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportMaterialDailyServiceImpl.java

+ 2 - 1
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java

@@ -91,6 +91,7 @@ public class MD5Util {
 	}
 
 	public static void main(String[] args) throws Exception {
-		System.out.println(getFileMd5("D:\\3-1599203419045.jpg"));
+		System.out.println(getFileMd5("D:\\mnt\\0427有缘3-帆楠E打车-同城热恋-1587982341839.mp4"));
+		System.out.println(getFileMd5("D:\\mnt\\0427有缘4-帆楠E洗脚-同城热恋-1593661309704.mp4"));
 	}
 }

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

@@ -2,6 +2,7 @@ package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
 import com.alibaba.fastjson.JSONObject;
+import org.jeecg.modules.ctop.service.IImageReportDailyService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -12,8 +13,15 @@ import java.util.Map;
 public class ImageCostController {
     @Autowired
     private IBytedanceReportMaterialDailyService materialDailyService;
+    @Autowired
+    private IImageReportDailyService imageReportDailyService;
     @PostMapping("bytedance/cost")
     public Map<String,Object> bytedanceImageCost(@RequestBody JSONObject data){
-        return materialDailyService.bytedanceImageCost(data);
+        return imageReportDailyService.bytedanceImageCost(data);
+    }
+
+    @PostMapping("kuaishou/cost")
+    public Map<String,Object> kuaishouImageCost(@RequestBody JSONObject data){
+        return imageReportDailyService.kuaishouImageCost(data);
     }
 }

+ 34 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -8,10 +8,6 @@ import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.JsonUtil;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouCleanMaterialReportService;
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -303,12 +299,45 @@ public class MaterialInfoController {
                 }
 
             }
+        }
 
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
 
+    @GetMapping(value = "/listV2")
+    public Result<IPage<MaterialInfo>> queryPageList(String type,Integer status,Long projectId,String materialName,String code,String colum,String order,
+                                                     String startDate,String endDate,Long tagId,
+                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+
+        Result<IPage<MaterialInfo>> result = new Result<>();
+        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String userId = user.getId();
+        String roleCode = roleService.getRoleCodeByUserId(userId);
+        if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale")){
+            //查询所有
+            materialInfoService.getListByParams(type,status,projectId,materialName,code,colum,order,startDate,endDate,userId,pageNo,pageSize);
+        }else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)){
+            //查询自己所在项目下的数据
+//            queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
+//            if (Check.isNull(materialInfo.getProjectId())) {
+//                List<Long> projects = memberService.selectProjectsByUserId(userId);
+//                if (!Check.isNull(projects)) {
+//                    queryWrapper.in("project_id", projects);
+//                } else {
+//                    result.setSuccess(true);
+//                    result.setResult(null);
+//                    return result;
+//                }
+//            }
+        }else{
+            //查询自己上传的视频
         }
 
         result.setSuccess(true);
-        result.setResult(pageList);
+//        result.setResult(pageList);
         return result;
     }
 

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

@@ -1,7 +1,7 @@
 package org.jeecg.modules.ctop.job;
 
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceCreativeDailyReportService;
 import lombok.extern.slf4j.Slf4j;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
@@ -18,7 +18,7 @@ import java.util.concurrent.Executors;
 @Slf4j
 public class ByteDanceCleanMaterialJob implements Job {
     @Autowired
-    private IByteDanceCleanMaterialReportService byteDanceCleanMaterialReportService;
+    private IBytedanceCreativeDailyReportService bytedanceCreativeDailyReportService;
     static ExecutorService executorService = null;
 
     @Override
@@ -26,7 +26,7 @@ public class ByteDanceCleanMaterialJob implements Job {
         Thread thread = new Thread() {
             @Override
             public void run() {
-                List<String> signatureList = byteDanceCleanMaterialReportService.getSignature();
+                List<String> signatureList = bytedanceCreativeDailyReportService.getSignatureList();
                 if (Check.isNull(signatureList)) {
                     log.error("头条素材数据获取为空");
                     return;
@@ -37,7 +37,7 @@ public class ByteDanceCleanMaterialJob implements Job {
                     executorService.submit(new Runnable() {
                         @Override
                         public void run() {
-                            byteDanceCleanMaterialReportService.calculationMaterialReport(signature);
+                            bytedanceCreativeDailyReportService.calculationMaterialReport(signature);
                         }
                     });
                 }

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

@@ -0,0 +1,11 @@
+package org.jeecg.modules.ctop.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.Map;
+
+public interface IImageReportDailyService {
+    Map<String,Object> bytedanceImageCost(JSONObject data);
+
+    Map<String, Object> kuaishouImageCost(JSONObject data);
+}

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

@@ -0,0 +1,133 @@
+package org.jeecg.modules.ctop.service.impl;
+
+import cn.com.ctop.common.module.entity.MaterialImageInfo;
+import cn.com.ctop.common.module.entity.SysUser;
+import cn.com.ctop.common.module.service.IMaterialImageInfoService;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.toutiao.modules.report.DTO.ImageCostVO;
+import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.jeecg.modules.ctop.service.IImageReportDailyService;
+import org.jeecg.modules.system.service.ISysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class ImageReportDailyServiceImpl implements IImageReportDailyService {
+
+    @Override
+    public Map<String,Object> bytedanceImageCost(JSONObject data) {
+        Map<String,Object>result = new HashMap<>();
+        String startDate = data.getString("startDate");
+        if(null == startDate||startDate.trim().equals("")){
+            startDate = null;
+        }
+        String endDate = data.getString("endDate");
+        if(null == endDate||endDate.trim().equals("")){
+            endDate = null;
+        }
+        JSONArray accountList = data.getJSONArray("accountList");
+        if(null==accountList||accountList.isEmpty()){
+            accountList = null;
+        }
+        String code = data.getString("code");
+        if(null == code||code.trim().equals("")){
+            code = null;
+        }
+        Integer pageSize = data.getInteger("pageSize");
+        Integer pageNumber = data.getInteger("pageNumber");
+        if(null == pageNumber||pageNumber ==0){
+            pageNumber = 1;
+        }
+        if(null == pageSize||pageSize ==0){
+            pageSize = 10;
+        }
+        PageHelper.startPage(pageNumber,pageSize);
+        List<ImageCostVO> vos = bytedanceReportMaterialDailyMapper.bytedanceImageCost(startDate,endDate,accountList,code,(pageNumber-1)*pageSize,pageSize);
+        PageInfo<ImageCostVO> pageInfo = new PageInfo<>(vos);
+        if(null!=vos&&!vos.isEmpty()){
+            List<ImageCostVO>setVos = new ArrayList<>();
+            for(ImageCostVO vo:vos){
+                MaterialImageInfo imageInfo = imageInfoService.getByCode(vo.getSignature());
+                if(null!=imageInfo){
+                    vo.setUserId(imageInfo.getUserId());
+                    SysUser user = sysUserService.getById(imageInfo.getUserId());
+                    vo.setUserName(user.getUsername());
+                }else{
+                    vo.setUserName("-");
+                }
+                setVos.add(vo);
+            }
+            pageInfo.setList(setVos);
+        }
+        result.put("data",pageInfo);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Override
+    public Map<String, Object> kuaishouImageCost(JSONObject data) {
+        Map<String,Object>result = new HashMap<>();
+        String startDate = data.getString("startDate");
+        if(null == startDate||startDate.trim().equals("")){
+            startDate = null;
+        }
+        String endDate = data.getString("endDate");
+        if(null == endDate||endDate.trim().equals("")){
+            endDate = null;
+        }
+        JSONArray accountList = data.getJSONArray("accountList");
+        if(null==accountList||accountList.isEmpty()){
+            accountList = null;
+        }
+        String code = data.getString("code");
+        if(null == code||code.trim().equals("")){
+            code = null;
+        }
+        Integer pageSize = data.getInteger("pageSize");
+        Integer pageNumber = data.getInteger("pageNumber");
+        if(null == pageNumber||pageNumber ==0){
+            pageNumber = 1;
+        }
+        if(null == pageSize||pageSize ==0){
+            pageSize = 10;
+        }
+        PageHelper.startPage(pageNumber,pageSize);
+        List<ImageCostVO> vos = bytedanceReportMaterialDailyMapper.bytedanceImageCost(startDate,endDate,accountList,code,(pageNumber-1)*pageSize,pageSize);
+        PageInfo<ImageCostVO> pageInfo = new PageInfo<>(vos);
+        if(null!=vos&&!vos.isEmpty()){
+            List<ImageCostVO>setVos = new ArrayList<>();
+            for(ImageCostVO vo:vos){
+                MaterialImageInfo imageInfo = imageInfoService.getByCode(vo.getSignature());
+                if(null!=imageInfo){
+                    vo.setUserId(imageInfo.getUserId());
+                    SysUser user = sysUserService.getById(imageInfo.getUserId());
+                    vo.setUserName(user.getUsername());
+                }else{
+                    vo.setUserName("-");
+                }
+                setVos.add(vo);
+            }
+            pageInfo.setList(setVos);
+        }
+        result.put("data",pageInfo);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Autowired
+    private IMaterialImageInfoService imageInfoService;
+    @Autowired
+    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
+    @Autowired
+    private ISysUserService sysUserService;
+}

+ 3 - 1
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -59,7 +59,9 @@ public class SampleTest {
 
     @Test
     public void initImageCode(){
-        List<MaterialImageInfo> imageInfos = imageInfoService.list();
+        QueryWrapper<MaterialImageInfo>queryWrapper = new QueryWrapper<>();
+        queryWrapper.le("update_time","2020-09-23 18:35:00");
+        List<MaterialImageInfo> imageInfos = imageInfoService.list(queryWrapper);
         for (MaterialImageInfo image:imageInfos) {
             imageInfoService.initImageCode(image);
         }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/ByteDanceCleanMaterialReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.modules.report.entity;
+package cn.com.ctop.common.module.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/entity/KuaiShouCleanMaterialReport.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.kuaishou.modules.report.entity;
+package cn.com.ctop.common.module.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/ByteDanceCleanMaterialReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.toutiao.modules.report.mapper;
+package cn.com.ctop.common.module.mapper;
 
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaiShouCleanMaterialReportMapper.java

@@ -1,6 +1,6 @@
-package cn.com.ctop.kuaishou.modules.report.mapper;
+package cn.com.ctop.common.module.mapper;
 
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

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

@@ -34,4 +34,6 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
     Long getProjectIdByAccountId(@Param("accountId") Long accountId);
 
     List<MaterialInfo> getListByDate(@Param("startDate") String startDate,@Param("endDate") String endDate);
+
+    List<MaterialInfo> getListByParams(@Param("type")String type, @Param("status")Integer status, @Param("projectId")Long projectId, @Param("materialName")String materialName, @Param("code")String code, @Param("colum")String colum, @Param("order")String order, @Param("startDate")String startDate, @Param("endDate")String endDate, @Param("userId")String userId);
 }

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/ByteDanceCleanMaterialReportMapper.xml

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

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

@@ -1,5 +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.KuaiShouCleanMaterialReportMapper">
+<mapper namespace="cn.com.ctop.common.module.mapper.KuaiShouCleanMaterialReportMapper">
 
 </mapper>

+ 28 - 0
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/MaterialInfoMapper.xml

@@ -113,6 +113,34 @@
         limit 1
     </select>
 
+    <select id="getListByParams" resultType="cn.com.ctop.common.module.entity.MaterialInfo">
+        select
+        distinct matInfo.code,
+        matInfo.project_id,
+        matInfo.id
+        from ctop_material_info matInfo
+        left join ctop_material_tag_info tagInfo on tagInfo.code = matInfo.code
+        where 1=1
+        <if test="status!=null">
+            and matInfo.status = #{status}
+        </if>
+        <if test="userId!=null">
+            and matInfo.user_id = #{userId}
+        </if>
+        <if test="materialName!=null">
+            and matInfo.material_name like concat('%',#{materialName},'%')
+        </if>
+        <if test="projectId!=null">
+            and matInfo.project_id = #{projectId}
+        </if>
+        <if test="startDate!=null">
+            and matInfo.create_time &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            and matInfo.create_time &lt;= #{endDate}
+        </if>
+
+    </select>
     <select id="getListByDate" resultType="cn.com.ctop.common.module.entity.MaterialInfo">
         select  *  from
         ctop_material_info

+ 2 - 7
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IByteDanceCleanMaterialReportService.java

@@ -1,10 +1,8 @@
-package cn.com.ctop.toutiao.modules.report.service;
+package cn.com.ctop.common.module.service;
 
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
 import com.baomidou.mybatisplus.extension.service.IService;
 
-import java.util.List;
-
 /**
  * 头条-数据清洗
  *
@@ -14,8 +12,5 @@ import java.util.List;
  */
 public interface IByteDanceCleanMaterialReportService extends IService<ByteDanceCleanMaterialReport> {
 
-    List<String> getSignature();
-
-
     void calculationMaterialReport(String signature);
 }

+ 15 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/IKuaiShouCleanMaterialReportService.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.common.module.service;
+
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 快手素材清洗数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-02-24
+ */
+public interface IKuaiShouCleanMaterialReportService extends IService<KuaiShouCleanMaterialReport> {
+
+}

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

@@ -15,7 +15,6 @@ import java.util.Map;
  * @date 2020-03-16
  */
 public interface IMaterialImageInfoService extends IService<MaterialImageInfo> {
-
     /**
      * 根据视频id  关联封面
      */
@@ -23,10 +22,11 @@ public interface IMaterialImageInfoService extends IService<MaterialImageInfo> {
 
     Map<String, Object> checkMaterialInfo(String code, String videoId);
 
-
     List<String> getCodeList();
 
     List<JSONObject> getUrlList(String videoId);
 
     void initImageCode(MaterialImageInfo image);
+
+    MaterialImageInfo getByCode(String signature);
 }

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

@@ -73,4 +73,6 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
     List<String> getEffiCode();
 
     List<MaterialInfo> getListByDate(String startDate, String endDate);
+
+    Map<String,Object> getListByParams(String type, Integer status, Long projectId, String materialName, String code, String colum, String order, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize);
 }

+ 26 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/ByteDanceCleanMaterialReportServiceImpl.java

@@ -0,0 +1,26 @@
+package cn.com.ctop.common.module.service.impl;
+
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.common.module.mapper.ByteDanceCleanMaterialReportMapper;
+import cn.com.ctop.common.module.service.IByteDanceCleanMaterialReportService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Service;
+
+/**
+ * 头条-数据清洗
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-02-25
+ */
+@Service
+@Primary
+
+public class ByteDanceCleanMaterialReportServiceImpl extends ServiceImpl<ByteDanceCleanMaterialReportMapper, ByteDanceCleanMaterialReport> implements IByteDanceCleanMaterialReportService {
+
+    @Override
+    public void calculationMaterialReport(String signature) {
+
+    }
+}

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

@@ -0,0 +1,18 @@
+package cn.com.ctop.common.module.service.impl;
+
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.common.module.mapper.KuaiShouCleanMaterialReportMapper;
+import cn.com.ctop.common.module.service.IKuaiShouCleanMaterialReportService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 快手素材清洗数据
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-02-24
+ */
+@Service
+public class KuaiShouCleanMaterialReportServiceImpl extends ServiceImpl<KuaiShouCleanMaterialReportMapper, KuaiShouCleanMaterialReport> implements IKuaiShouCleanMaterialReportService {
+}

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

@@ -143,4 +143,12 @@ public class MaterialImageInfoServiceImpl extends ServiceImpl<MaterialImageInfoM
         }
     }
 
+    @Override
+    public MaterialImageInfo getByCode(String signature) {
+        QueryWrapper<MaterialImageInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("code",signature);
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+
 }

+ 70 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -13,6 +13,8 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.tencentcloudapi.mps.v20190612.models.DescribeTaskDetailResponse;
 import it.sauronsoftware.jave.Encoder;
 import it.sauronsoftware.jave.EncoderException;
@@ -672,6 +674,74 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     public List<MaterialInfo> getListByDate(String startDate, String endDate) {
         return materialInfoMapper.getListByDate(startDate, endDate);
     }
+
+    @Autowired
+    private IByteDanceCleanMaterialReportService byteDanceCleanMaterialReportService;
+    @Override
+    public Map<String,Object> getListByParams(String type, Integer status, Long projectId, String materialName, String code, String colum, String order, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize) {
+        Map<String,Object> result = new HashMap<>();
+        PageHelper.startPage(pageNo,pageSize);
+        List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(type,status,projectId,materialName,code, colum, order,startDate,endDate, userId);
+        List<MaterialInfo> setList = new ArrayList<>();
+        PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
+        if(null!=dailyList&&!dailyList.isEmpty()){
+            for(MaterialInfo info:dailyList){
+                //判断是否已经同步到快手平台
+                Integer kuaishouMaterialUpCount = this.getKuaishouUpVideoCount(info.getCode());
+                if (kuaishouMaterialUpCount > 0) {
+                    info.setKuaishouVideoIsUp(1);
+                } else {
+                    info.setKuaishouVideoIsUp(0);
+                }
+                //判断是否已经同步到抖音平台
+                Integer toutiaoMaterialUpCount = this.getToutiaoUpVideoCount(info.getCode());
+                if (toutiaoMaterialUpCount > 0) {
+                    info.setToutiaoVideoIsUp(1);
+                } else {
+                    info.setToutiaoVideoIsUp(0);
+                }
+
+
+                ByteDanceCleanMaterialReport byteDance = byteDanceCleanMaterialReportService.getById(info.getCode());
+                if (!Check.isNull(byteDance)) {
+                    String byteDanceString = JsonUtil.objectToJson(byteDance);
+                    info.setByteDance(JSONObject.parseObject(byteDanceString));
+                }
+
+                KuaiShouCleanMaterialReport kuaiShou = kuaiShouCleanMaterialReportService.getById(info.getCode());
+                if (!Check.isNull(kuaiShou)) {
+                    String kuaiShouString = JsonUtil.objectToJson(kuaiShou);
+                    info.setKuaiShou(JSONObject.parseObject(kuaiShouString));
+                }
+
+
+                Project project = projectService.getById(info.getProjectId());
+                if (!Check.isNull(project)) {
+                    info.setMediaId(project.getMediaId());
+                    info.setProjectName(project.getProjectName());
+                }
+
+                QueryWrapper<MaterialImageInfo> imageInfoQueryWrapper = new QueryWrapper<>();
+                imageInfoQueryWrapper.eq("video_id", info.getCode());
+                imageInfoQueryWrapper.eq("status", 0);
+                List<MaterialImageInfo> imageInfoList = materialImageInfoService.list(imageInfoQueryWrapper);
+                if (Check.isNull(imageInfoList)) {
+                    info.setWhetherUnaudited(false);
+                } else {
+                    info.setWhetherUnaudited(true);
+                }
+
+                setList.add(info);
+            }
+        }
+        pageInfo.setList(setList);
+        result.put("data",pageInfo);
+        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Autowired
+    private IKuaiShouCleanMaterialReportService kuaiShouCleanMaterialReportService;
 }
 
 

+ 0 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/ByteDanceCleanMaterialJob.java

@@ -1,7 +1,6 @@
 package cn.com.ctop.job.bytedance.handler;
 
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.log.XxlJobLogger;

+ 0 - 1
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaiShouCleanMaterialJob.java

@@ -1,7 +1,6 @@
 package cn.com.ctop.job.kuaishou.handler;
 
 import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouCleanMaterialReportService;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xxl.job.core.log.XxlJobLogger;

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaiShouCleanMaterialReportController.java

@@ -1,8 +1,8 @@
 package cn.com.ctop.kuaishou.modules.report.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouCleanMaterialReportService;
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.common.module.service.IKuaiShouCleanMaterialReportService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

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

@@ -1,6 +1,6 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;

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

@@ -266,7 +266,7 @@
     </select>
 
     <select id="calculationMaterialReport"
-            resultType="cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport">
+            resultType="cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport">
         select
         signature id,
         sum(charge) charge,

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

@@ -1,29 +0,0 @@
-package cn.com.ctop.kuaishou.modules.report.service;
-
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-import java.util.List;
-
-/**
- * 快手素材清洗数据
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-02-24
- */
-public interface IKuaiShouCleanMaterialReportService extends IService<KuaiShouCleanMaterialReport> {
-    /**
-     * 快手 唯一素材MD5标识
-     *
-     * @return
-     */
-    List<String> getSignature();
-
-    /**
-     * 计算快手素材报表
-     *
-     * @param signature
-     */
-    void calculationReport(String signature);
-}

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

@@ -3,5 +3,15 @@ package cn.com.ctop.kuaishou.modules.report.service;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 public interface IKuaishouReportDailyCreativeService extends IService<KuaishouReportDailyCreative> {
+    List<String> getSignature();
+
+    /**
+     * 计算快手素材报表
+     *
+     * @param signature
+     */
+    void calculationReport(String signature);
 }

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

@@ -1,41 +0,0 @@
-package cn.com.ctop.kuaishou.modules.report.service.impl;
-
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaiShouCleanMaterialReportMapper;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
-import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouCleanMaterialReportService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * 快手素材清洗数据
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-02-24
- */
-@Service
-public class KuaiShouCleanMaterialReportServiceImpl extends ServiceImpl<KuaiShouCleanMaterialReportMapper, KuaiShouCleanMaterialReport> implements IKuaiShouCleanMaterialReportService {
-    @Autowired
-    private KuaishouReportDailyCreativeMapper kuaishouReportDailyCreativeMapper;
-
-    @Override
-    public List<String> getSignature() {
-        return kuaishouReportDailyCreativeMapper.getSignatureList();
-    }
-
-    @Override
-    public void calculationReport(String signature) {
-        if (Check.isNull(signature)) {
-            return;
-        }
-        KuaiShouCleanMaterialReport calculationMaterialReport = kuaishouReportDailyCreativeMapper.calculationMaterialReport(signature);
-        if (!Check.isNull(calculationMaterialReport)) {
-            this.saveOrUpdate(calculationMaterialReport);
-        }
-    }
-}

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

@@ -1,11 +1,38 @@
 package cn.com.ctop.kuaishou.modules.report.service.impl;
 
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
+import cn.com.ctop.common.module.service.IKuaiShouCleanMaterialReportService;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyCreative;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyCreativeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class KuaishouReportDailyCreativeServiceImpl extends ServiceImpl<KuaishouReportDailyCreativeMapper, KuaishouReportDailyCreative> implements IKuaishouReportDailyCreativeService {
+    @Autowired
+    private KuaishouReportDailyCreativeMapper kuaishouReportDailyCreativeMapper;
+    @Autowired
+    private IKuaiShouCleanMaterialReportService cleanMaterialReportService;
+
+    @Override
+    public List<String> getSignature() {
+        return kuaishouReportDailyCreativeMapper.getSignatureList();
+    }
+
+    @Override
+    public void calculationReport(String signature) {
+        if (Check.isNull(signature)) {
+            return;
+        }
+        KuaiShouCleanMaterialReport calculationMaterialReport = kuaishouReportDailyCreativeMapper.calculationMaterialReport(signature);
+        if (!Check.isNull(calculationMaterialReport)) {
+            cleanMaterialReportService.saveOrUpdate(calculationMaterialReport);
+        }
+    }
+
 }

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

@@ -1,23 +0,0 @@
-package cn.com.ctop.toutiao.modules.material.service;
-
-import java.util.List;
-
-/**
- * @author 宋英豪
- * @date 2020年5月9日09:52:48
- */
-public interface IBytedanceCleanMaterialService {
-    /**
-     * 头条 唯一素材MD5标识
-     *
-     * @return
-     */
-    List<String> getSignature();
-
-    /**
-     * 计算头条素材报表
-     *
-     * @param signature
-     */
-    void calculationMaterialReport(String signature);
-}

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

@@ -1,46 +0,0 @@
-package cn.com.ctop.toutiao.modules.material.service.impl;
-
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.toutiao.modules.material.service.IBytedanceCleanMaterialService;
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
-import cn.com.ctop.toutiao.modules.report.mapper.BytedanceCreativeDailyReportMapper;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class BytedanceCleanMaterialServiceImpl implements IBytedanceCleanMaterialService {
-    @Autowired
-    private BytedanceCreativeDailyReportMapper bytedanceCreativeDailyReportMapper;
-    @Autowired
-    private IByteDanceCleanMaterialReportService byteDanceCleanMaterialReportService;
-
-    /**
-     * MD5 集合
-     *
-     * @return
-     */
-    @Override
-    public List<String> getSignature() {
-        return bytedanceCreativeDailyReportMapper.getSignatureList();
-    }
-
-    /**
-     * 头条素材报表
-     *
-     * @param signature
-     */
-    @Override
-    public void calculationMaterialReport(String signature) {
-        if (Check.isNull(signature)) {
-            return;
-        }
-        ByteDanceCleanMaterialReport calculationMaterialReport = bytedanceCreativeDailyReportMapper.calculationMaterialReport(signature);
-        if (!Check.isNull(calculationMaterialReport)) {
-            byteDanceCleanMaterialReportService.saveOrUpdate(calculationMaterialReport);
-        }
-    }
-}

+ 2 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/ImageCostVO.java

@@ -15,4 +15,6 @@ public class ImageCostVO implements Serializable {
     private Long click;
     private Long showNum;
     private Long convert;
+    private String userId;
+    private String userName;
 }

+ 2 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/ByteDanceCleanMaterialReportController.java

@@ -1,9 +1,9 @@
 package cn.com.ctop.toutiao.modules.report.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.common.module.service.IByteDanceCleanMaterialReportService;
 import cn.com.ctop.common.module.utils.StringUtils;
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceCreativeDailyReportMapper.java

@@ -1,6 +1,6 @@
 package cn.com.ctop.toutiao.modules.report.mapper;
 
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceCreativeDailyReport;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceCreativeDailyReportMapper.xml

@@ -233,7 +233,7 @@
       WHERE signature !=''
     </select>
     <select id="calculationMaterialReport"
-            resultType="cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport">
+            resultType="cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport">
         select
         signature id,
         sum(cost) cost,

+ 2 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceReportMaterialDailyMapper.xml

@@ -245,10 +245,9 @@
         sum(report.convert_material)                                  as 'convert',
         imageInfo.image_url                                           as 'imageUrl',
         imageInfo.signature                                           as 'signature',
-        group_concat(distinct allocation.project_name)                as 'projectName',
+        group_concat(distinct report.project_name)                as 'projectName',
         report.stat_datetime                                          as 'statDate'
-            from ctop_bytedance_report_material_daily report
-            left join ctop_user_allocation allocation on allocation.account_id = report.account_id
+            from ctop_bytedance_report_image_daily report
             left join ctop_bytedance_image_info imageInfo on imageInfo.material_id = report.material_id
         where
         1=1

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

@@ -18,6 +18,9 @@ public interface IBytedanceCreativeDailyReportService extends IService<Bytedance
 
     List<BytedanceCreativeDailyReport> bytedanceCreativeAccountReportList(JSONObject json);
 
+    List<String> getSignatureList();
 
     void replaceBatch(List<BytedanceCreativeDailyReport> dailyReports);
+
+    void calculationMaterialReport(String signature);
 }

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

@@ -2,11 +2,9 @@ package cn.com.ctop.toutiao.modules.report.service;
 
 import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 素材报表
@@ -15,9 +13,6 @@ import java.util.Map;
  * @version V1.0
  */
 public interface IBytedanceReportMaterialDailyService extends IService<BytedanceReportMaterialDaily> {
-
     List<BytedanceReportMaterialDaily> getListByParams(String date);
     List<BytedanceVideoVo> getVideoVoByDate(String date);
-
-    Map<String,Object> bytedanceImageCost(JSONObject data);
 }

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

@@ -1,54 +0,0 @@
-package cn.com.ctop.toutiao.modules.report.service.impl;
-
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.toutiao.modules.report.entity.ByteDanceCleanMaterialReport;
-import cn.com.ctop.toutiao.modules.report.mapper.ByteDanceCleanMaterialReportMapper;
-import cn.com.ctop.toutiao.modules.report.mapper.BytedanceCreativeDailyReportMapper;
-import cn.com.ctop.toutiao.modules.report.service.IByteDanceCleanMaterialReportService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * 头条-数据清洗
- *
- * @author jeecg-boot
- * @version V1.0
- * @date 2020-02-25
- */
-@Service
-@Primary
-
-public class ByteDanceCleanMaterialReportServiceImpl extends ServiceImpl<ByteDanceCleanMaterialReportMapper, ByteDanceCleanMaterialReport> implements IByteDanceCleanMaterialReportService {
-    @Autowired
-    private BytedanceCreativeDailyReportMapper bytedanceCreativeDailyReportMapper;
-
-    /**
-     * 头条MD5 集合
-     *
-     * @return
-     */
-    @Override
-    public List<String> getSignature() {
-        return bytedanceCreativeDailyReportMapper.getSignatureList();
-    }
-
-    /**
-     * 头条素材报表
-     *
-     * @param signature
-     */
-    @Override
-    public void calculationMaterialReport(String signature) {
-        if (Check.isNull(signature)) {
-            return;
-        }
-        ByteDanceCleanMaterialReport calculationMaterialReport = bytedanceCreativeDailyReportMapper.calculationMaterialReport(signature);
-        if (!Check.isNull(calculationMaterialReport)) {
-            this.saveOrUpdate(calculationMaterialReport);
-        }
-    }
-}

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

@@ -1,6 +1,8 @@
 package cn.com.ctop.toutiao.modules.report.service.impl;
 
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
 import cn.com.ctop.common.module.mapper.SysRoleExtMapper;
+import cn.com.ctop.common.module.service.IByteDanceCleanMaterialReportService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceCreativeDailyReport;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceCreativeDailyReportMapper;
@@ -64,8 +66,26 @@ public class BytedanceCreativeDailyReportServiceImpl extends ServiceImpl<Bytedan
     }
 
     @Override
+    public List<String> getSignatureList() {
+        return bytedanceCreativeDailyReportMapper.getSignatureList();
+    }
+
+    @Override
     public void replaceBatch(List<BytedanceCreativeDailyReport> dailyReports) {
         bytedanceCreativeDailyReportMapper.replaceBatch(dailyReports);
     }
 
+    @Override
+    public void calculationMaterialReport(String signature) {
+        if (Check.isNull(signature)) {
+            return;
+        }
+        ByteDanceCleanMaterialReport calculationMaterialReport = bytedanceCreativeDailyReportMapper.calculationMaterialReport(signature);
+        if (!Check.isNull(calculationMaterialReport)) {
+            byteDanceCleanMaterialReportService.saveOrUpdate(calculationMaterialReport);
+        }
+    }
+    @Autowired
+    private IByteDanceCleanMaterialReportService byteDanceCleanMaterialReportService;
+
 }

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

@@ -1,25 +1,16 @@
 package cn.com.ctop.toutiao.modules.report.service.impl;
 
-import cn.com.ctop.common.module.utils.ResultMapUtils;
-import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
-import cn.com.ctop.toutiao.modules.report.DTO.ImageCostVO;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 素材报表
@@ -48,41 +39,5 @@ public class BytedanceReportMaterialDailyServiceImpl extends ServiceImpl<Bytedan
         return bytedanceReportMaterialDailyMapper.getVideoVoByDate(date);
     }
 
-    @Override
-    public Map<String,Object> bytedanceImageCost(JSONObject data) {
-        Map<String,Object>result = new HashMap<>();
-        String startDate = data.getString("startDate");
-        if(null == startDate||startDate.trim().equals("")){
-            startDate = null;
-        }
-        String endDate = data.getString("endDate");
-        if(null == endDate||endDate.trim().equals("")){
-            endDate = null;
-        }
-        JSONArray accountList = data.getJSONArray("accountList");
-        if(null==accountList||accountList.isEmpty()){
-            accountList = null;
-        }
-        String code = data.getString("code");
-        if(null == code||code.trim().equals("")){
-            code = null;
-        }
-        Integer pageSize = data.getInteger("pageSize");
-        Integer pageNumber = data.getInteger("pageNumber");
-        if(null == pageNumber||pageNumber ==0){
-            pageNumber = 1;
-        }
-        if(null == pageSize||pageSize ==0){
-            pageSize = 10;
-        }
-        PageHelper.startPage(pageNumber,pageSize);
-        List<ImageCostVO>vos = bytedanceReportMaterialDailyMapper.bytedanceImageCost(startDate,endDate,accountList,code,(pageNumber-1)*pageSize,pageSize);
-        PageInfo<ImageCostVO> pageInfo = new PageInfo<>(vos);
-        result.put("data",pageInfo);
-        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
-        return result;
-
-    }
-
 
 }