Browse Source

Merge branch 'master' into jiaoyang

# Conflicts:
#	jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
yumeng 5 years ago
parent
commit
4b26c0b29c
86 changed files with 3398 additions and 350 deletions
  1. 7 0
      jeecg-boot-module-system/pom.xml
  2. 4 3
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  3. 0 16
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/AdvertiserController.java
  4. 150 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BytedanceMusicInfoController.java
  5. 140 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/BytedanceMusicTypeController.java
  6. 156 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/DictMusicTypeController.java
  7. 50 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ImageCostController.java
  8. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialTagInfoController.java
  9. 19 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectMemberController.java
  10. 175 166
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectTransferRecordController.java
  11. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IImageReportDailyService.java
  12. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/IProjectMemberService.java
  13. 61 45
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ImageReportDailyServiceImpl.java
  14. 27 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectMemberServiceImpl.java
  15. 20 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectTransferRecordServiceImpl.java
  16. 3 0
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  17. 4 0
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  18. 4 0
      jeecg-boot-module-system/src/main/resources/application-prod2.yml
  19. 6 2
      jeecg-boot-module-system/src/main/resources/application-test.yml
  20. 3 0
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  21. 0 1
      jeecg-boot-module-system/src/main/resources/application.yml
  22. 0 3
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MusicTypeServiceImpl.java
  23. 4 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/LoadFileUtil.java
  24. 2 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/DTO/ImageCostVO.java
  25. 123 0
      module-common/src/main/java/cn/com/ctop/common/module/vo/BytedanceImageCostVOEntity.java
  26. 23 0
      module-common/src/main/java/cn/com/ctop/common/module/vo/KuaishouImageCostVO.java
  27. 152 0
      module-common/src/main/java/cn/com/ctop/common/module/vo/KuaishouImageCostVOEntity.java
  28. 3 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/DouyinMusicService.java
  29. 3 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/impl/DouyinMusicServiceImpl.java
  30. 74 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/BytedanceMusicInfo.java
  31. 66 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/BytedanceMusicType.java
  32. 41 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/DictMusicType.java
  33. 14 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/BytedanceMusicInfoMapper.java
  34. 14 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/BytedanceMusicTypeMapper.java
  35. 18 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/DictMusicTypeMapper.java
  36. 5 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/xml/BytedanceMusicInfoMapper.xml
  37. 5 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/xml/BytedanceMusicTypeMapper.xml
  38. 13 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/xml/DictMusicTypeMapper.xml
  39. 14 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IBytedanceMusicInfoService.java
  40. 14 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IBytedanceMusicTypeService.java
  41. 16 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IDictMusicTypeService.java
  42. 18 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/impl/BytedanceMusicInfoServiceImpl.java
  43. 18 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/impl/BytedanceMusicTypeServiceImpl.java
  44. 28 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/impl/DictMusicTypeServiceImpl.java
  45. 25 15
      module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyMaterialReportJob.java
  46. 93 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouVideoGetController.java
  47. 116 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/vo/KuaiShouVideoGetVo.java
  48. 3 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouReportDailyMaterialMapper.java
  49. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouVideoGetMapper.java
  50. 42 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml
  51. 27 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml
  52. 3 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouReportDailyMaterialService.java
  53. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouVideoGetService.java
  54. 10 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouDailyReportTaskServiceImpl.java
  55. 8 8
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouHistoryReportTaskServiceImpl.java
  56. 11 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouReportDailyMaterialServiceImpl.java
  57. 7 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouUpdateServiceImpl.java
  58. 6 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouVideoGetServiceImpl.java
  59. 4 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  60. 9 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KuaiShouAccountReportCtrl.java
  61. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/KuaishouReportDailyImageMapper.java
  62. 10 11
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KsVideoReportMapper.xml
  63. 1 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaiShouYiCheReportMapper.xml
  64. 18 8
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml
  65. 100 6
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyImageMapper.xml
  66. 0 1
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatDepartmentServiceImpl.java
  67. 0 5
      module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatNoListServiceImpl.java
  68. 64 0
      module-shiwan/pom.xml
  69. 235 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/FileUtil.java
  70. 309 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/controller/ShiwanFileUploadController.java
  71. 111 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/entity/ShiwanFileUpload.java
  72. 23 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/mapper/ShiwanFileUploadMapper.java
  73. 44 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/mapper/xml/ShiwanFileUploadMapper.xml
  74. 419 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/service/ShiwanFileUploadServiceImpl.java
  75. 40 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/service/impl/IShiwanFileUploadService.java
  76. 3 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAdvertisePlan.java
  77. 9 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceAccountReportCtrl.java
  78. 0 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceAccountReportMapper.java
  79. 16 7
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceReportMaterialDailyMapper.java
  80. 11 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceAccountReportMapper.xml
  81. 73 8
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceReportMaterialDailyMapper.xml
  82. 11 11
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceVideoReportMapper.xml
  83. 3 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceFundDailyServiceImpl.java
  84. 5 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportServiceImpl.java
  85. 1 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/ReportServiceImpl.java
  86. 1 0
      pom.xml

+ 7 - 0
jeecg-boot-module-system/pom.xml

@@ -106,6 +106,13 @@
         </dependency>
 
         <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-shiwan</artifactId>
+            <version>2.0.2</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
             <groupId>com.aliyun.oss</groupId>
             <artifactId>aliyun-sdk-oss</artifactId>
             <version>3.5.0</version>

+ 4 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -155,9 +155,9 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/test/getGroupData/**", "anon");
         filterChainDefinitionMap.put("/test/getVideoAndImage/**", "anon");
         filterChainDefinitionMap.put("/test/gerCreative/**", "anon");
-        filterChainDefinitionMap.put("/test/testdouyinmusic","anon");
-        filterChainDefinitionMap.put("/test/syncDouyinMusic","anon");
-        filterChainDefinitionMap.put("/test/parseDouyinMusic","anon");
+        filterChainDefinitionMap.put("/test/testdouyinmusic", "anon");
+        filterChainDefinitionMap.put("/test/syncDouyinMusic", "anon");
+        filterChainDefinitionMap.put("/test/parseDouyinMusic", "anon");
         filterChainDefinitionMap.put("/report/kuaishouReportDailyAgent/get", "anon");
 
         filterChainDefinitionMap.put("/appium/appiumTask/run/login", "anon");
@@ -174,6 +174,7 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/rest/script/*", "anon");
         filterChainDefinitionMap.put("/ctop/checkTaskList/*", "anon");
         filterChainDefinitionMap.put("/ctop/report/bytedance/*", "anon");
+        filterChainDefinitionMap.put("/shiwan/shiwanFileUpload/*", "anon");
 
         // 添加自己的过滤器并且取名为jwt
         Map<String, Filter> filterMap = new HashMap<>(1);

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

@@ -116,25 +116,9 @@ public class AdvertiserController {
                                                    @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize,
                                                    HttpServletRequest req) {
         Result<IPage<Advertiser>> result = new Result<>();
-        // String roleCode = sysRoleService.getRoleCodeByUserId(advertiser.getUserId());
-      /*  String userId = advertiser.getUserId();
-        if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
-            advertiser.setUserId(null);
-        }*/
-
         String name = advertiser.getName();
         advertiser.setName(null);
         QueryWrapper<Advertiser> queryWrapper = QueryGenerator.initQueryWrapper(advertiser, req.getParameterMap());
-       /* if ("kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
-            QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
-            userCompanyQueryWrapper.eq("user_id", userId);
-            userCompanyQueryWrapper.orderByDesc("create_time");
-            userCompanyQueryWrapper.last("limit 1");
-            UserCompany userCompany = userCompanyMapper.selectOne(userCompanyQueryWrapper);
-            if (!Check.isNull(userCompany)) {
-                queryWrapper.eq("company_id", userCompany.getCompanyId());
-            }
-        }*/
         if (!Check.isNull(name)) {
             queryWrapper.like("name", name);
         }

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

@@ -0,0 +1,150 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicInfo;
+import cn.com.ctop.crawler.modules.music.service.IBytedanceMusicInfoService;
+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.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 音乐信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="音乐信息")
+@RestController
+@RequestMapping("/ctop/bytedanceMusicInfo")
+public class BytedanceMusicInfoController {
+	@Autowired
+	private IBytedanceMusicInfoService bytedanceMusicInfoService;
+
+	/**
+	  * 分页列表查询
+	 * @param bytedanceMusicInfo
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-分页列表查询", notes="音乐信息-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BytedanceMusicInfo>> queryPageList(BytedanceMusicInfo bytedanceMusicInfo,
+														   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+														   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+														   HttpServletRequest req) {
+		Result<IPage<BytedanceMusicInfo>> result = new Result<>();
+		QueryWrapper<BytedanceMusicInfo> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceMusicInfo, req.getParameterMap());
+		Page<BytedanceMusicInfo> page = new Page<>(pageNo, pageSize);
+		IPage<BytedanceMusicInfo> pageList = bytedanceMusicInfoService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param bytedanceMusicInfo
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-添加", notes="音乐信息-添加")
+	@PostMapping(value = "/add")
+	public Result<BytedanceMusicInfo> add(@RequestBody BytedanceMusicInfo bytedanceMusicInfo) {
+		Result<BytedanceMusicInfo> result = new Result<>();
+		try {
+			bytedanceMusicInfoService.save(bytedanceMusicInfo);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param bytedanceMusicInfo
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-编辑", notes="音乐信息-编辑")
+	@PutMapping(value = "/edit")
+	public Result<BytedanceMusicInfo> edit(@RequestBody BytedanceMusicInfo bytedanceMusicInfo) {
+		Result<BytedanceMusicInfo> result = new Result<BytedanceMusicInfo>();
+		BytedanceMusicInfo bytedanceMusicInfoEntity = bytedanceMusicInfoService.getById(bytedanceMusicInfo.getId());
+		if(bytedanceMusicInfoEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = bytedanceMusicInfoService.updateById(bytedanceMusicInfo);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-通过id删除", notes="音乐信息-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			bytedanceMusicInfoService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-批量删除", notes="音乐信息-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BytedanceMusicInfo> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BytedanceMusicInfo> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.bytedanceMusicInfoService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="音乐信息-通过id查询", notes="音乐信息-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BytedanceMusicInfo> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BytedanceMusicInfo> result = new Result<>();
+		BytedanceMusicInfo bytedanceMusicInfo = bytedanceMusicInfoService.getById(id);
+		if(bytedanceMusicInfo==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(bytedanceMusicInfo);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -0,0 +1,140 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicType;
+import cn.com.ctop.crawler.modules.music.service.IBytedanceMusicTypeService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 音乐类型信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Slf4j
+@RestController
+@RequestMapping("/ctop/bytedanceMusicType")
+public class BytedanceMusicTypeController {
+	@Autowired
+	private IBytedanceMusicTypeService bytedanceMusicTypeService;
+
+	/**
+	  * 分页列表查询
+	 * @param bytedanceMusicType
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<BytedanceMusicType>> queryPageList(BytedanceMusicType bytedanceMusicType,
+														   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+														   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+														   HttpServletRequest req) {
+		Result<IPage<BytedanceMusicType>> result = new Result<>();
+		QueryWrapper<BytedanceMusicType> queryWrapper = QueryGenerator.initQueryWrapper(bytedanceMusicType, req.getParameterMap());
+		Page<BytedanceMusicType> page = new Page<>(pageNo, pageSize);
+		IPage<BytedanceMusicType> pageList = bytedanceMusicTypeService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	  *   添加
+	 * @param bytedanceMusicType
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<BytedanceMusicType> add(@RequestBody BytedanceMusicType bytedanceMusicType) {
+		Result<BytedanceMusicType> result = new Result<>();
+		try {
+			bytedanceMusicTypeService.save(bytedanceMusicType);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param bytedanceMusicType
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<BytedanceMusicType> edit(@RequestBody BytedanceMusicType bytedanceMusicType) {
+		Result<BytedanceMusicType> result = new Result<BytedanceMusicType>();
+		BytedanceMusicType bytedanceMusicTypeEntity = bytedanceMusicTypeService.getById(bytedanceMusicType.getId());
+		if(bytedanceMusicTypeEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = bytedanceMusicTypeService.updateById(bytedanceMusicType);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		return result;
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			bytedanceMusicTypeService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BytedanceMusicType> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BytedanceMusicType> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.bytedanceMusicTypeService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<BytedanceMusicType> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BytedanceMusicType> result = new Result<>();
+		BytedanceMusicType bytedanceMusicType = bytedanceMusicTypeService.getById(id);
+		if(bytedanceMusicType==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(bytedanceMusicType);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -0,0 +1,156 @@
+package org.jeecg.modules.ctop.controller;
+
+import cn.com.ctop.crawler.modules.music.entity.DictMusicType;
+import cn.com.ctop.crawler.modules.music.service.IDictMusicTypeService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Arrays;
+
+ /**
+ * 抖音音乐类型
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="抖音音乐类型")
+@RestController
+@RequestMapping("/ctop/dictMusicType")
+public class DictMusicTypeController {
+	@Autowired
+	private IDictMusicTypeService dictMusicTypeService;
+
+	/**
+	  * 分页列表查询
+	 * @param dictMusicType
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<DictMusicType>> queryPageList(DictMusicType dictMusicType,
+													  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+													  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+													  HttpServletRequest req) {
+		Result<IPage<DictMusicType>> result = new Result<>();
+		QueryWrapper<DictMusicType> queryWrapper = QueryGenerator.initQueryWrapper(dictMusicType, req.getParameterMap());
+		Page<DictMusicType> page = new Page<>(pageNo, pageSize);
+		IPage<DictMusicType> pageList = dictMusicTypeService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+
+
+	/**
+	  *   添加
+	 * @param dict_music_type
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<DictMusicType> add(@RequestBody DictMusicType dictMusicType) {
+		Result<DictMusicType> result = new Result<>();
+		try {
+			dictMusicTypeService.save(dictMusicType);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(),e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	  *  编辑
+	 * @param dictMusicType
+	 * @return
+	 */
+	@ApiOperation(value="抖音音乐类型-编辑", notes="抖音音乐类型-编辑")
+	@PutMapping(value = "/edit")
+	public Result<DictMusicType> edit(@RequestBody DictMusicType dictMusicType) {
+		Result<DictMusicType> result = new Result<>();
+		DictMusicType dictMusicTypeEntity = dictMusicTypeService.getById(dictMusicType.getId());
+		if(dictMusicTypeEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = dictMusicTypeService.updateById(dictMusicType);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	@PostMapping("listAll")
+	public JSONObject listAllType(){
+		return dictMusicTypeService.listAll();
+	}
+
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="抖音音乐类型-通过id删除", notes="抖音音乐类型-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		try {
+			dictMusicTypeService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败",e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@ApiOperation(value="抖音音乐类型-批量删除", notes="抖音音乐类型-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<DictMusicType> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<DictMusicType> result = new Result<>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.dictMusicTypeService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@ApiOperation(value="抖音音乐类型-通过id查询", notes="抖音音乐类型-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<DictMusicType> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<DictMusicType> result = new Result<>();
+		DictMusicType dictMusicType = dictMusicTypeService.getById(id);
+		if(dictMusicType==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(dictMusicType);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

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

@@ -1,11 +1,26 @@
 package org.jeecg.modules.ctop.controller;
 
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.vo.BytedanceImageCostVOEntity;
+import cn.com.ctop.common.module.vo.KuaishouImageCostVOEntity;
+import cn.com.ctop.common.module.vo.SheetInfoVo;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
+import com.alibaba.excel.EasyExcelFactory;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.metadata.Sheet;
 import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.IImageReportDailyService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Date;
 import java.util.Map;
 
 @RestController
@@ -20,8 +35,42 @@ public class ImageCostController {
         return imageReportDailyService.bytedanceImageCost(data);
     }
 
+    @PostMapping("bytedance/cost/export")
+    public void bytedanceImageCostExport(@RequestBody JSONObject data, HttpServletResponse response) throws IOException {
+
+        SheetInfoVo vo = imageReportDailyService.getbytedanceImageCostVo(data);
+        OutputStream outputStream = response.getOutputStream();
+        String date = DateUtils.formatDate(new Date());
+        HttpUtils.setResponseHeader(response, "头条图片消耗报表" + date + ".xlsx");
+        ExcelWriter excelWriter = EasyExcelFactory.getWriter(outputStream);
+        Sheet sheet = new Sheet(1, 0, BytedanceImageCostVOEntity.class);
+        sheet.setSheetName(vo.getSheetName());
+        excelWriter.write(vo.getDetails(), sheet);
+
+        excelWriter.finish();
+        outputStream.flush();
+        outputStream.close();
+    }
+
     @PostMapping("kuaishou/cost")
     public Map<String,Object> kuaishouImageCost(@RequestBody JSONObject data){
         return imageReportDailyService.kuaishouImageCost(data);
     }
+
+    @PostMapping("kuaishou/cost/export")
+    public void kuaishouImageCostExport(@RequestBody JSONObject data, HttpServletResponse response) throws IOException {
+        SheetInfoVo vo = imageReportDailyService.getkuaishouImageCostVo(data);
+        OutputStream outputStream = response.getOutputStream();
+        String date = DateUtils.formatDate(new Date());
+        HttpUtils.setResponseHeader(response, "快手图片消耗报表" + date + ".xlsx");
+        ExcelWriter excelWriter = EasyExcelFactory.getWriter(outputStream);
+        Sheet sheet = new Sheet(1, 0, KuaishouImageCostVOEntity.class);
+        sheet.setSheetName(vo.getSheetName());
+        excelWriter.write(vo.getDetails(), sheet);
+        excelWriter.finish();
+        outputStream.flush();
+        outputStream.close();
+    }
+
+
 }

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

@@ -50,7 +50,6 @@ public class MaterialTagInfoController {
 		Result<IPage<MaterialTagInfo>> result = new Result<>();
 		QueryWrapper<MaterialTagInfo> queryWrapper = QueryGenerator.initQueryWrapper(materialTagInfo, req.getParameterMap());
 		Page<MaterialTagInfo> page = new Page<>(pageNo, pageSize);
-		queryWrapper.eq("status",1);
 		IPage<MaterialTagInfo> pageList = materialTagInfoService.page(page, queryWrapper);
 		result.setSuccess(true);
 		result.setResult(pageList);

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

@@ -511,6 +511,25 @@ public class ProjectMemberController {
         return resultBody;
     }
 
+    /**
+     * 查询当前账户下的快手头条传不同的mediaType
+     *
+     * @return
+     */
+    @GetMapping("/getAllProjectAccount")
+    public Result<List<Map<String, Object>>> getAllProjectAccount(String mediaType) {
+        Result<List<Map<String, Object>>> resultBody = new Result<>();
+        try {
+            List<Map<String, Object>> result = projectMemberService.getAllProjectAccount(mediaType);
+            resultBody.setSuccess(true);
+            resultBody.setResult(result);
+        } catch (Exception e) {
+            resultBody.setSuccess(false);
+            resultBody.success("查询失败");
+        }
+        return resultBody;
+    }
+
 
     /**
      * 销售的项目

+ 175 - 166
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectTransferRecordController.java

@@ -26,185 +26,194 @@ import java.util.Map;
 
 /**
  * 账户转项目记录
+ *
  * @author jeecg-boot
- * @date   2020-07-22
  * @version V1.0
+ * @date 2020-07-22
  */
 @Slf4j
-@Api(tags="账户转项目记录")
+@Api(tags = "账户转项目记录")
 @RestController
 @RequestMapping("/ctop/projectTransferRecord")
 public class ProjectTransferRecordController {
-	@Autowired
-	private IProjectTransferRecordService projectTransferRecordService;
-	@Autowired
-	private ISysRoleService sysRoleService;
-	/**
-	  * 我发起的
-	 * @param projectTransferRecord
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-分页列表查询")
-	@ApiOperation(value="账户转项目记录-分页列表查询", notes="账户转项目记录-分页列表查询")
-	@GetMapping(value = "/initiatedList")
-	public Result<IPage<ProjectTransferRecord>> initiatedList(ProjectTransferRecord projectTransferRecord,
-									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-									  HttpServletRequest req) {
-		Integer status = projectTransferRecord.getStatus();
-		if(null == status||status.equals(0)){
-			projectTransferRecord.setStatus(null);
-		}
-		Result<IPage<ProjectTransferRecord>> result = new Result<>();
-		QueryWrapper<ProjectTransferRecord> queryWrapper = QueryGenerator.initQueryWrapper(projectTransferRecord, req.getParameterMap());
-		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		String rodeCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
-		if(null!=rodeCode&&rodeCode.trim().equals("admin")){
-			queryWrapper.eq("user_id",sysUser.getId());
-		}
-		queryWrapper.ne("status",0);
-		Page<ProjectTransferRecord> page = new Page<>(pageNo, pageSize);
-		IPage<ProjectTransferRecord> pageList = projectTransferRecordService.page(page, queryWrapper);
-		result.setSuccess(true);
-		result.setResult(pageList);
-		return result;
-	}
+    @Autowired
+    private IProjectTransferRecordService projectTransferRecordService;
+    @Autowired
+    private ISysRoleService sysRoleService;
 
-	 /**
-	  * 待审核的
-	  * @param projectTransferRecord
-	  * @param pageNo
-	  * @param pageSize
-	  * @param req
-	  * @return
-	  */
-	 @AutoLog(value = "账户转项目记录-分页列表查询")
-	 @ApiOperation(value="账户转项目记录-分页列表查询", notes="账户转项目记录-分页列表查询")
-	 @GetMapping(value = "/auditList")
-	 public Result<IPage<ProjectTransferRecord>> auditList(ProjectTransferRecord projectTransferRecord,
-															   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-															   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-															   HttpServletRequest req) {
-		 Integer status = projectTransferRecord.getStatus();
-		 if(null == status||status.equals(0)){
-			 projectTransferRecord.setStatus(null);
-		 }
-		 Result<IPage<ProjectTransferRecord>> result = new Result<>();
-		 QueryWrapper<ProjectTransferRecord> queryWrapper = QueryGenerator.initQueryWrapper(projectTransferRecord, req.getParameterMap());
-		 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		 String rodeCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
-		 if(null!=rodeCode&&rodeCode.trim().equals("admin")){
-			 queryWrapper.eq("reviewer_id",sysUser.getId());
-		 }
-		 queryWrapper.ne("status",0);
-		 Page<ProjectTransferRecord> page = new Page<>(pageNo, pageSize);
-		 IPage<ProjectTransferRecord> pageList = projectTransferRecordService.page(page, queryWrapper);
-		 result.setSuccess(true);
-		 result.setResult(pageList);
-		 return result;
-	 }
+    /**
+     * 我发起的
+     *
+     * @param projectTransferRecord
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-分页列表查询")
+    @ApiOperation(value = "账户转项目记录-分页列表查询", notes = "账户转项目记录-分页列表查询")
+    @GetMapping(value = "/initiatedList")
+    public Result<IPage<ProjectTransferRecord>> initiatedList(ProjectTransferRecord projectTransferRecord,
+                                                              @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                              @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                              HttpServletRequest req) {
+        Integer status = projectTransferRecord.getStatus();
+        if (null == status || status.equals(0)) {
+            projectTransferRecord.setStatus(null);
+        }
+        Result<IPage<ProjectTransferRecord>> result = new Result<>();
+        QueryWrapper<ProjectTransferRecord> queryWrapper = QueryGenerator.initQueryWrapper(projectTransferRecord, req.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String rodeCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
+        if (null != rodeCode && rodeCode.trim().equals("admin")) {
+            queryWrapper.eq("user_id", sysUser.getId());
+        }
+        queryWrapper.ne("status", 0);
+        Page<ProjectTransferRecord> page = new Page<>(pageNo, pageSize);
+        IPage<ProjectTransferRecord> pageList = projectTransferRecordService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
 
-	 @PostMapping("editStatus")
-	 public Map<String,Object> editStatus(Long id, Integer status){
-	 	Map<String, Object>result = new HashMap<>();
-	 	if(id == null||id == 0||status == null){
-			ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
-			return result;
-		}
-		return projectTransferRecordService.updateStatus(id,status);
-	 }
+    /**
+     * 待审核的
+     *
+     * @param projectTransferRecord
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-分页列表查询")
+    @ApiOperation(value = "账户转项目记录-分页列表查询", notes = "账户转项目记录-分页列表查询")
+    @GetMapping(value = "/auditList")
+    public Result<IPage<ProjectTransferRecord>> auditList(ProjectTransferRecord projectTransferRecord,
+                                                          @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                          HttpServletRequest req) {
+        Integer status = projectTransferRecord.getStatus();
+        if (null == status || status.equals(0)) {
+            projectTransferRecord.setStatus(null);
+        }
+        Result<IPage<ProjectTransferRecord>> result = new Result<>();
+        QueryWrapper<ProjectTransferRecord> queryWrapper = QueryGenerator.initQueryWrapper(projectTransferRecord, req.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String rodeCode = sysRoleService.getRoleCodeByUserId(sysUser.getId());
+        if (null != rodeCode && !rodeCode.trim().equals("admin")) {
+            queryWrapper.eq("reviewer_id", sysUser.getId());
+        }
+        queryWrapper.ne("status", 0);
+        Page<ProjectTransferRecord> page = new Page<>(pageNo, pageSize);
+        IPage<ProjectTransferRecord> pageList = projectTransferRecordService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
 
-	/**
-	  *  添加
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-添加")
-	@ApiOperation(value="账户转项目记录-添加", notes="账户转项目记录-添加")
-	@PostMapping(value = "/add")
-	public Map<String,Object> add(Long accountId, Long projectId) {
-		return projectTransferRecordService.addRecord(accountId,projectId);
-	}
+    @PostMapping("editStatus")
+    public Map<String, Object> editStatus(Long id, Integer status) {
+        Map<String, Object> result = new HashMap<>();
+        if (id == null || id == 0 || status == null) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
+            return result;
+        }
+        return projectTransferRecordService.updateStatus(id, status);
+    }
 
-	/**
-	  *  编辑
-	 * @param projectTransferRecord
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-编辑")
-	@ApiOperation(value="账户转项目记录-编辑", notes="账户转项目记录-编辑")
-	@PutMapping(value = "/edit")
-	public Result<ProjectTransferRecord> edit(@RequestBody ProjectTransferRecord projectTransferRecord) {
-		Result<ProjectTransferRecord> result = new Result<>();
-		ProjectTransferRecord projectTransferRecordEntity = projectTransferRecordService.getById(projectTransferRecord.getId());
-		if(projectTransferRecordEntity==null) {
-			result.error500("未找到对应实体");
-		}else {
-			boolean ok = projectTransferRecordService.updateById(projectTransferRecord);
-			if(ok) {
-				result.success("修改成功!");
-			}
-		}
+    /**
+     * 添加
+     *
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-添加")
+    @ApiOperation(value = "账户转项目记录-添加", notes = "账户转项目记录-添加")
+    @PostMapping(value = "/add")
+    public Map<String, Object> add(Long accountId, Long projectId) {
+        return projectTransferRecordService.addRecord(accountId, projectId);
+    }
 
-		return result;
-	}
+    /**
+     * 编辑
+     *
+     * @param projectTransferRecord
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-编辑")
+    @ApiOperation(value = "账户转项目记录-编辑", notes = "账户转项目记录-编辑")
+    @PutMapping(value = "/edit")
+    public Result<ProjectTransferRecord> edit(@RequestBody ProjectTransferRecord projectTransferRecord) {
+        Result<ProjectTransferRecord> result = new Result<>();
+        ProjectTransferRecord projectTransferRecordEntity = projectTransferRecordService.getById(projectTransferRecord.getId());
+        if (projectTransferRecordEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = projectTransferRecordService.updateById(projectTransferRecord);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
 
-	/**
-	 * 通过id删除
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-通过id删除")
-	@ApiOperation(value="账户转项目记录-通过id删除", notes="账户转项目记录-通过id删除")
-	@DeleteMapping(value = "/delete")
-	public Result<Object> delete(@RequestParam(name="id",required=true) Long id,@RequestParam(name = "status",defaultValue = "0") Integer status) {
-		try {
-			projectTransferRecordService.updateStatus(id,status);
-		} catch (Exception e) {
-			log.error("删除失败",e.getMessage());
-			return Result.error("删除失败!");
-		}
-		return Result.ok("删除成功!");
-	}
+        return result;
+    }
 
-	/**
-	 *  批量删除
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-批量删除")
-	@ApiOperation(value="账户转项目记录-批量删除", notes="账户转项目记录-批量删除")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<ProjectTransferRecord> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		Result<ProjectTransferRecord> result = new Result<>();
-		if(ids==null || "".equals(ids.trim())) {
-			result.error500("参数不识别!");
-		}else {
-			this.projectTransferRecordService.removeByIds(Arrays.asList(ids.split(",")));
-			result.success("删除成功!");
-		}
-		return result;
-	}
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-通过id删除")
+    @ApiOperation(value = "账户转项目记录-通过id删除", notes = "账户转项目记录-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<Object> delete(@RequestParam(name = "id", required = true) Long id, @RequestParam(name = "status", defaultValue = "0") Integer status) {
+        try {
+            projectTransferRecordService.updateStatus(id, status);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
 
-	/**
-	 * 通过id查询
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "账户转项目记录-通过id查询")
-	@ApiOperation(value="账户转项目记录-通过id查询", notes="账户转项目记录-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<ProjectTransferRecord> queryById(@RequestParam(name="id",required=true) String id) {
-		Result<ProjectTransferRecord> result = new Result<>();
-		ProjectTransferRecord projectTransferRecord = projectTransferRecordService.getById(id);
-		if(projectTransferRecord==null) {
-			result.error500("未找到对应实体");
-		}else {
-			result.setResult(projectTransferRecord);
-			result.setSuccess(true);
-		}
-		return result;
-	}
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "账户转项目记录-批量删除")
+    @ApiOperation(value = "账户转项目记录-批量删除", notes = "账户转项目记录-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<ProjectTransferRecord> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<ProjectTransferRecord> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.projectTransferRecordService.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<ProjectTransferRecord> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<ProjectTransferRecord> result = new Result<>();
+        ProjectTransferRecord projectTransferRecord = projectTransferRecordService.getById(id);
+        if (projectTransferRecord == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(projectTransferRecord);
+            result.setSuccess(true);
+        }
+        return result;
+    }
 }

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

@@ -1,5 +1,6 @@
 package org.jeecg.modules.ctop.service;
 
+import cn.com.ctop.common.module.vo.SheetInfoVo;
 import com.alibaba.fastjson.JSONObject;
 
 import java.util.Map;
@@ -8,4 +9,8 @@ public interface IImageReportDailyService {
     Map<String,Object> bytedanceImageCost(JSONObject data);
 
     Map<String, Object> kuaishouImageCost(JSONObject data);
+
+    SheetInfoVo getkuaishouImageCostVo(JSONObject data);
+
+    SheetInfoVo getbytedanceImageCostVo(JSONObject data);
 }

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

@@ -39,4 +39,6 @@ public interface IProjectMemberService extends IService<ProjectMember> {
     List<Long> getProjectByAccountIds(JSONArray accountIds);
 
     List<JSONObject> getProjectByUserIdAndMediaIds(String userId, List<Integer> mediaIds);
+
+    List<Map<String, Object>> getAllProjectAccount(String mediaType);
 }

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

@@ -1,11 +1,9 @@
 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.common.module.vo.*;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyImageMapper;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -16,13 +14,19 @@ 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 {
+    @Autowired
+    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
+    @Autowired
+    private KuaishouReportDailyImageMapper kuaishouReportDailyImageMapper;
+    @Autowired
+    private ISysUserService sysUserService;
+
 
     @Override
     public Map<String,Object> bytedanceImageCost(JSONObject data) {
@@ -52,29 +56,38 @@ public class ImageReportDailyServiceImpl implements IImageReportDailyService {
             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);
-        }
+        List<BytedanceImageCostVO> vos = bytedanceReportMaterialDailyMapper.bytedanceImageCost(startDate,endDate,accountList,code);
+        PageInfo<BytedanceImageCostVO> pageInfo = new PageInfo<>(vos);
         result.put("data",pageInfo);
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 
     @Override
+    public SheetInfoVo getbytedanceImageCostVo(JSONObject data) {
+        SheetInfoVo sheetInfoVo = new SheetInfoVo<BytedanceImageCostVOEntity>();
+        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;
+        }
+        List<BytedanceImageCostVOEntity>details = bytedanceReportMaterialDailyMapper.bytedanceImageCostEntity(startDate,endDate,accountList,code);
+        sheetInfoVo.setDetails(details);
+        return sheetInfoVo;
+    }
+
+    @Override
     public Map<String, Object> kuaishouImageCost(JSONObject data) {
         Map<String,Object>result = new HashMap<>();
         String startDate = data.getString("startDate");
@@ -102,32 +115,35 @@ public class ImageReportDailyServiceImpl implements IImageReportDailyService {
             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);
-        }
+        List<KuaishouImageCostVO> vos = kuaishouReportDailyImageMapper.imageCost(startDate,endDate,accountList,code);
+        PageInfo<KuaishouImageCostVO> pageInfo = new PageInfo<>(vos);
         result.put("data",pageInfo);
         ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 
-    @Autowired
-    private IMaterialImageInfoService imageInfoService;
-    @Autowired
-    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
-    @Autowired
-    private ISysUserService sysUserService;
+    @Override
+    public SheetInfoVo getkuaishouImageCostVo(JSONObject data) {
+        SheetInfoVo sheetInfoVo = new SheetInfoVo<KuaishouImageCostVOEntity>();
+        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;
+        }
+        sheetInfoVo.setSheetName("快手图片消耗统计");
+        List<KuaishouImageCostVOEntity> details = kuaishouReportDailyImageMapper.imageCostEntity(startDate,endDate,accountList,code);
+        sheetInfoVo.setDetails(details);
+        return sheetInfoVo;
+    }
 }

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

@@ -201,6 +201,7 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         return memberMapper.getProjectByUserId(userId);
     }
 
+    @Override
     public List<Long> getProjectByAccountIds(JSONArray accountIds) {
         return memberMapper.getProjectByAccountIds(accountIds);
     }
@@ -234,5 +235,31 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
         return memberMapper.getProjectByUserIdAndMediaIds(userId, mediaIds);
     }
 
+    @Override
+    public List<Map<String, Object>> getAllProjectAccount(String mediaType) {
+        List<Map<String, Object>> result = new ArrayList<>();
+        List<Integer> mediaList = new ArrayList<>();
+        if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INSIDE_INT);
+        } else if (mediaType.equals(CtopAdConstant.PLATFORM_TYPE_KUAISHOU)) {
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INT);
+            mediaList.add(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_INSIDE_INT);
+        }
+
+        //查询登录账号下的项目
+        List<ProjectMember> projectMemberList = this.memberMapper.adminProjects(mediaList);
+        if (projectMemberList.isEmpty()) {
+            return result;
+        }
+        projectMemberList.forEach(ProjectMember -> {
+            Map<String, Object> temp = this.queryAccountByProjectId(ProjectMember);
+            if (temp != null) {
+                result.add(temp);
+            }
+        });
+        return result;
+    }
+
 
 }

+ 20 - 17
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectTransferRecordServiceImpl.java

@@ -25,9 +25,10 @@ import java.util.Map;
 
 /**
  * 账户转项目记录
+ *
  * @author jeecg-boot
- * @date   2020-07-22
  * @version V1.0
+ * @date 2020-07-22
  */
 @Service
 public class ProjectTransferRecordServiceImpl extends ServiceImpl<ProjectTransferRecordMapper, ProjectTransferRecord> implements IProjectTransferRecordService {
@@ -39,46 +40,48 @@ public class ProjectTransferRecordServiceImpl extends ServiceImpl<ProjectTransfe
     private IProjectService projectService;
     @Autowired
     private IUserAllocationService userAllocationService;
+
     @Override
-    public Map<String,Object> updateStatus(Long id, Integer status) {
-        Map<String,Object>result = new HashMap<>();
+    public Map<String, Object> updateStatus(Long id, Integer status) {
+        Map<String, Object> result = new HashMap<>();
         ProjectTransferRecord record = this.getById(id);
-        if(null == record||record.getStatus()==0){
+        if (null == record || record.getStatus() == 0) {
             ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
             return result;
         }
         record.setStatus(status);
         record.setUpdateTime(new Date());
         this.updateById(record);
-        if(status == 2){
+        if (status == 2) {
             //需要转转项目
             UserAllocation userAllocation = userAllocationService.getByAccountId(record.getAccountId());
             SysUser user = sysUserService.getById(record.getUserId());
             Project project = projectService.getById(record.getTargetProject());
             userAllocation.setProjectId(project.getId());
-       //     userAllocation.setProjectName(project.getProjectName());
+            userAllocation.setAdvertiserId(project.getAdvertiserId());
+            //     userAllocation.setProjectName(project.getProjectName());
             userAllocationService.updateById(userAllocation);
-            ProjectMember member = projectMemberService.getProjectByParams(record.getTargetProject(),record.getUserId());
-            if(null == member){
-                projectMemberService.addMember(user,project);
+            ProjectMember member = projectMemberService.getProjectByParams(record.getTargetProject(), record.getUserId());
+            if (null == member) {
+                projectMemberService.addMember(user, project);
             }
         }
-        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 
     @Override
     public Map<String, Object> addRecord(Long accountId, Long projectId) {
-        Map<String,Object>result = new HashMap<>();
+        Map<String, Object> result = new HashMap<>();
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        if(accountId == null||projectId==null){
-            ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
+        if (accountId == null || projectId == null) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
             return result;
         }
         UserAllocation allocation = userAllocationService.getByAccountId(accountId);
         Project project = projectService.getById(projectId);
-        if(null == allocation||null == project){
-            ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
+        if (null == allocation || null == project) {
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
             return result;
         }
         ProjectTransferRecord record = new ProjectTransferRecord();
@@ -87,11 +90,11 @@ public class ProjectTransferRecordServiceImpl extends ServiceImpl<ProjectTransfe
         record.setSoucreProject(allocation.getProjectId());
         record.setTargetProject(projectId);
         record.setUserId(user.getId());
-        record.setReviewerId(project.getUserId());
+        record.setReviewerId(project.getResponsibleId());
         record.setCreateTime(new Date());
         record.setUpdateTime(new Date());
         this.save(record);
-        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
         return result;
     }
 }

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

@@ -226,3 +226,6 @@ oss:
     replace-old-value: oss-cn-beijing
     download: D:\mnt\file\video
 
+zip:
+  local:
+    download-path: /data/unzip/

+ 4 - 0
jeecg-boot-module-system/src/main/resources/application-prod.yml

@@ -196,3 +196,7 @@ oss:
     replace-value: oss-cn-beijing
     replace-old-value: oss-cn-beijing
     download: /data/file/video/
+
+zip:
+  local:
+    download-path: /data/unzip/

+ 4 - 0
jeecg-boot-module-system/src/main/resources/application-prod2.yml

@@ -188,3 +188,7 @@ oss:
     replace-value: oss-cn-beijing
     replace-old-value: oss-cn-beijing
     download: /data/file/video/
+
+zip:
+  local:
+    download-path: /data/unzip/

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

@@ -125,8 +125,8 @@ mybatis-plus:
       id-type: 4
       # 默认数据库表下划线命名
       table-underline: true
-#  configuration:
-#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  #  configuration:
+  #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
   #  map-underscore-to-camel-case: false
   #分页pageHelper
 pagehelper:
@@ -187,3 +187,7 @@ oss:
     replace-value: oss-cn-beijing
     replace-old-value: oss-cn-beijing
     download: /mnt/file/video/
+
+zip:
+  local:
+    download-path: /data/unzip/

+ 3 - 0
jeecg-boot-module-system/src/main/resources/application-wps.yml

@@ -182,3 +182,6 @@ oss:
     replace-value: oss-cn-beijing-internal
     replace-old-value: oss-cn-beijing
     download: D://mnt//image//
+zip:
+  local:
+    download-path: D://mnt//data//

+ 0 - 1
jeecg-boot-module-system/src/main/resources/application.yml

@@ -2,7 +2,6 @@ spring:
   profiles:
     # active: wps
     active: @activatedProperties@
-
 swagger:
   production: false
   basic:

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

@@ -1,10 +1,7 @@
 package cn.com.ctop.common.module.service.impl;
 
-import cn.com.ctop.common.module.entity.MusicInfo;
 import cn.com.ctop.common.module.entity.MusicType;
-import cn.com.ctop.common.module.mapper.MusicInfoMapper;
 import cn.com.ctop.common.module.mapper.MusicTypeMapper;
-import cn.com.ctop.common.module.service.MusicInfoService;
 import cn.com.ctop.common.module.service.MusicTypeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;

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

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

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

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.modules.report.DTO;
+package cn.com.ctop.common.module.vo;
 
 import lombok.Data;
 
@@ -6,7 +6,7 @@ import java.io.Serializable;
 import java.math.BigDecimal;
 
 @Data
-public class ImageCostVO implements Serializable {
+public class BytedanceImageCostVO implements Serializable {
     private String statDate;
     private String signature;
     private String projectName;

+ 123 - 0
module-common/src/main/java/cn/com/ctop/common/module/vo/BytedanceImageCostVOEntity.java

@@ -0,0 +1,123 @@
+package cn.com.ctop.common.module.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.math.BigDecimal;
+
+public class BytedanceImageCostVOEntity extends BaseRowModel {
+    @ExcelProperty(index = 1, value = "图片链接")
+    private String imageUrl;
+    @ExcelProperty(index = 1, value = "上传时间")
+    private String statDate;
+    @ExcelProperty(index = 1, value = "图片标识")
+    private String signature;
+    @ExcelProperty(index = 1, value = "项目名称")
+    private String projectName;
+    @ExcelProperty(index = 1, value = "消耗")
+    private BigDecimal cost;
+    @ExcelProperty(index = 1, value = "点击数")
+    private Long click;
+    @ExcelProperty(index = 1, value = "展示数")
+    private Long showNum;
+    @ExcelProperty(index = 1, value = "转化数")
+    private Long convert;
+    @ExcelProperty(index = 1, value = "平面id")
+    private String userId;
+    @ExcelProperty(index = 1, value = "平面名称")
+    private String userName;
+
+    public BytedanceImageCostVOEntity() {
+    }
+
+    public BytedanceImageCostVOEntity(BytedanceImageCostVO vo) {
+        this.imageUrl = vo.getImageUrl();
+        this.statDate = vo.getStatDate();
+        this.signature = vo.getSignature();
+        this.projectName = vo.getProjectName();
+        this.cost = vo.getCost();
+        this.click = vo.getClick();
+        this.showNum = vo.getShowNum();
+        this.convert = vo.getConvert();
+    }
+
+    public String getImageUrl() {
+        return imageUrl;
+    }
+
+    public void setImageUrl(String imageUrl) {
+        this.imageUrl = imageUrl;
+    }
+
+    public String getStatDate() {
+        return statDate;
+    }
+
+    public void setStatDate(String statDate) {
+        this.statDate = statDate;
+    }
+
+    public String getSignature() {
+        return signature;
+    }
+
+    public void setSignature(String signature) {
+        this.signature = signature;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public BigDecimal getCost() {
+        return cost;
+    }
+
+    public void setCost(BigDecimal cost) {
+        this.cost = cost;
+    }
+
+    public Long getClick() {
+        return click;
+    }
+
+    public void setClick(Long click) {
+        this.click = click;
+    }
+
+    public Long getShowNum() {
+        return showNum;
+    }
+
+    public void setShowNum(Long showNum) {
+        this.showNum = showNum;
+    }
+
+    public Long getConvert() {
+        return convert;
+    }
+
+    public void setConvert(Long convert) {
+        this.convert = convert;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+}

+ 23 - 0
module-common/src/main/java/cn/com/ctop/common/module/vo/KuaishouImageCostVO.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.common.module.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class KuaishouImageCostVO implements Serializable {
+    String imageUrl;
+    String signature;
+    String projectName;
+    BigDecimal charge;
+    Long photoClick;
+    Long photoShow;
+    Long activation;
+    Long eventRegister;
+    Long eventPay;
+    Long formCount;
+    Long eventJinJianApp;
+    Long eventCreditGrantApp;
+    String userName;
+}

+ 152 - 0
module-common/src/main/java/cn/com/ctop/common/module/vo/KuaishouImageCostVOEntity.java

@@ -0,0 +1,152 @@
+package cn.com.ctop.common.module.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.metadata.BaseRowModel;
+
+import java.math.BigDecimal;
+
+public class KuaishouImageCostVOEntity extends BaseRowModel {
+    @ExcelProperty(index = 1, value = "图片url")
+    String imageUrl;
+    @ExcelProperty(index = 2, value = "图片标识")
+    String signature;
+    @ExcelProperty(index = 3, value = "所属项目")
+    String projectName;
+    @ExcelProperty(index = 4, value = "消耗")
+    BigDecimal charge;
+    @ExcelProperty(index = 5, value = "封面点击数")
+    Long photoClick;
+    @ExcelProperty(index = 6, value = "封面曝光数")
+    Long photoShow;
+    @ExcelProperty(index = 7, value = "激活数")
+    Long activation;
+    @ExcelProperty(index = 8, value = "注册数")
+    Long eventRegister;
+    @ExcelProperty(index = 9, value = "付费数")
+    Long eventPay;
+    @ExcelProperty(index = 10, value = "表单提交数")
+    Long formCount;
+    @ExcelProperty(index = 11, value = "完件数")
+    Long eventJinJianApp;
+    @ExcelProperty(index = 12, value = "授信数")
+    Long eventCreditGrantApp;
+    @ExcelProperty(index = 13, value = "所属平面id")
+    String userId;
+    @ExcelProperty(index = 14, value = "所属平面")
+    String userName;
+
+    public KuaishouImageCostVOEntity() {
+    }
+
+    public String getImageUrl() {
+        return imageUrl;
+    }
+
+    public void setImageUrl(String imageUrl) {
+        this.imageUrl = imageUrl;
+    }
+
+    public String getSignature() {
+        return signature;
+    }
+
+    public void setSignature(String signature) {
+        this.signature = signature;
+    }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public BigDecimal getCharge() {
+        return charge;
+    }
+
+    public void setCharge(BigDecimal charge) {
+        this.charge = charge;
+    }
+
+    public Long getPhotoClick() {
+        return photoClick;
+    }
+
+    public void setPhotoClick(Long photoClick) {
+        this.photoClick = photoClick;
+    }
+
+    public Long getPhotoShow() {
+        return photoShow;
+    }
+
+    public void setPhotoShow(Long photoShow) {
+        this.photoShow = photoShow;
+    }
+
+    public Long getActivation() {
+        return activation;
+    }
+
+    public void setActivation(Long activation) {
+        this.activation = activation;
+    }
+
+    public Long getEventRegister() {
+        return eventRegister;
+    }
+
+    public void setEventRegister(Long eventRegister) {
+        this.eventRegister = eventRegister;
+    }
+
+    public Long getEventPay() {
+        return eventPay;
+    }
+
+    public void setEventPay(Long eventPay) {
+        this.eventPay = eventPay;
+    }
+
+    public Long getFormCount() {
+        return formCount;
+    }
+
+    public void setFormCount(Long formCount) {
+        this.formCount = formCount;
+    }
+
+    public Long getEventJinJianApp() {
+        return eventJinJianApp;
+    }
+
+    public void setEventJinJianApp(Long eventJinJianApp) {
+        this.eventJinJianApp = eventJinJianApp;
+    }
+
+    public Long getEventCreditGrantApp() {
+        return eventCreditGrantApp;
+    }
+
+    public void setEventCreditGrantApp(Long eventCreditGrantApp) {
+        this.eventCreditGrantApp = eventCreditGrantApp;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+}

+ 3 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/DouyinMusicService.java

@@ -3,7 +3,7 @@ package cn.com.ctop.crawler.modules.douyin.service;
 import cn.com.ctop.common.module.entity.MusicInfo;
 
 public interface DouyinMusicService {
-    public void getHotMusicList();
-    public MusicInfo getMusicInfo(MusicInfo musicInfo);
-    public void parseTag(MusicInfo musicInfo);
+    void getHotMusicList();
+    MusicInfo getMusicInfo(MusicInfo musicInfo);
+    void parseTag(MusicInfo musicInfo);
 }

File diff suppressed because it is too large
+ 3 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/douyin/service/impl/DouyinMusicServiceImpl.java


+ 74 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/BytedanceMusicInfo.java

@@ -0,0 +1,74 @@
+package cn.com.ctop.crawler.modules.music.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+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 java.util.Date;
+
+/**
+ * 音乐信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_music_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_music_info对象", description="音乐信息")
+public class BytedanceMusicInfo {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**name*/
+	@Excel(name = "name", width = 15)
+    @ApiModelProperty(value = "name")
+	private String name;
+	/**author*/
+	@Excel(name = "author", width = 15)
+    @ApiModelProperty(value = "author")
+	private String author;
+	/**usedCount*/
+	@Excel(name = "usedCount", width = 15)
+    @ApiModelProperty(value = "usedCount")
+	private Integer usedCount;
+	/**musicUrl*/
+	@Excel(name = "musicUrl", width = 15)
+    @ApiModelProperty(value = "musicUrl")
+	private String musicUrl;
+	/**coverUrl*/
+	@Excel(name = "coverUrl", width = 15)
+    @ApiModelProperty(value = "coverUrl")
+	private String coverUrl;
+	/**duration*/
+	@Excel(name = "duration", width = 15)
+    @ApiModelProperty(value = "duration")
+	private Integer duration;
+	/**source*/
+	@Excel(name = "source", width = 15)
+    @ApiModelProperty(value = "source")
+	private String source;
+	/**extId*/
+	@Excel(name = "extId", width = 15)
+    @ApiModelProperty(value = "extId")
+	private String extId;
+	/**extInfo*/
+	@Excel(name = "extInfo", width = 15)
+    @ApiModelProperty(value = "extInfo")
+	private Object extInfo;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+	/**updateTime*/
+    @ApiModelProperty(value = "updateTime")
+	private Date updateTime;
+}

+ 66 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/BytedanceMusicType.java

@@ -0,0 +1,66 @@
+package cn.com.ctop.crawler.modules.music.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * 音乐类型信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_music_type")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_music_type对象", description="音乐类型信息")
+public class BytedanceMusicType {
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+    @ApiModelProperty(value = "id")
+	private Integer id;
+	/**type*/
+	@Excel(name = "type", width = 15)
+    @ApiModelProperty(value = "type")
+	private String type;
+	/**typeValue*/
+	@Excel(name = "typeValue", width = 15)
+    @ApiModelProperty(value = "typeValue")
+	private String typeValue;
+	/**extType*/
+	@Excel(name = "extType", width = 15)
+    @ApiModelProperty(value = "extType")
+	private String extType;
+	/**extTypeValue*/
+	@Excel(name = "extTypeValue", width = 15)
+    @ApiModelProperty(value = "extTypeValue")
+	private String extTypeValue;
+	/**musicId*/
+	@Excel(name = "musicId", width = 15)
+    @ApiModelProperty(value = "musicId")
+	private Integer musicId;
+	/**musicName*/
+	@Excel(name = "musicName", width = 15)
+    @ApiModelProperty(value = "musicName")
+	private String musicName;
+	/**author*/
+	@Excel(name = "author", width = 15)
+    @ApiModelProperty(value = "author")
+	private String author;
+	/**createTime*/
+    @ApiModelProperty(value = "createTime")
+	private Date createTime;
+}

+ 41 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/entity/DictMusicType.java

@@ -0,0 +1,41 @@
+package cn.com.ctop.crawler.modules.music.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 抖音音乐类型
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Data
+@TableName("ctop_dict_music_type_zh")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="ctop_dict_music_type_zh对象", description="抖音音乐类型")
+public class DictMusicType {
+
+	/**id*/
+	@TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+	private Long id;
+	private String extType;
+	private String extTypeValue;
+	private String extTypeZh;
+	private String extTypeValueZh;
+	private Date createTime;
+	private Date updateTime;
+	@TableField(exist = false)
+	private List<DictMusicType> detail;
+}

+ 14 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/BytedanceMusicInfoMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.crawler.modules.music.mapper;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 音乐信息
+ * @author: jeecg-boot
+ * @date:   2020-10-28
+ * @cersion: V1.0
+ */
+public interface BytedanceMusicInfoMapper extends BaseMapper<BytedanceMusicInfo> {
+
+}

+ 14 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/BytedanceMusicTypeMapper.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.crawler.modules.music.mapper;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicType;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 音乐类型信息
+ * @author: jeecg-boot
+ * @date:   2020-10-28
+ * @cersion: V1.0
+ */
+public interface BytedanceMusicTypeMapper extends BaseMapper<BytedanceMusicType> {
+
+}

+ 18 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/DictMusicTypeMapper.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.crawler.modules.music.mapper;
+
+import cn.com.ctop.crawler.modules.music.entity.DictMusicType;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * 抖音音乐类型
+ * @author: jeecg-boot
+ * @date:   2020-10-28
+ * @cersion: V1.0
+ */
+public interface DictMusicTypeMapper extends BaseMapper<DictMusicType> {
+
+    List<DictMusicType> getAllExtTypeZh();
+    List<DictMusicType> getExtTypeValueZhByType(String extType);
+}

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

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

+ 13 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/mapper/xml/DictMusicTypeMapper.xml

@@ -0,0 +1,13 @@
+<?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.crawler.modules.music.mapper.DictMusicTypeMapper">
+
+    <select id="getAllExtTypeZh" resultType="cn.com.ctop.crawler.modules.music.entity.DictMusicType">
+        select distinct ext_type_zh,ext_type from ctop_dict_music_type_zh
+    </select>
+
+    <select id="getExtTypeValueZhByType" resultType="cn.com.ctop.crawler.modules.music.entity.DictMusicType">
+        select distinct ext_type_value,ext_type_zh from ctop_dict_music_type_zh
+        where ext_type = #{extType}
+    </select>
+</mapper>

+ 14 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IBytedanceMusicInfoService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.crawler.modules.music.service;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 音乐信息
+ * @Author: jeecg-boot
+ * @Date:   2020-10-28
+ * @Version: V1.0
+ */
+public interface IBytedanceMusicInfoService extends IService<BytedanceMusicInfo> {
+
+}

+ 14 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IBytedanceMusicTypeService.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.crawler.modules.music.service;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicType;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 音乐类型信息
+ * @Author: jeecg-boot
+ * @Date:   2020-10-28
+ * @Version: V1.0
+ */
+public interface IBytedanceMusicTypeService extends IService<BytedanceMusicType> {
+
+}

+ 16 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/IDictMusicTypeService.java

@@ -0,0 +1,16 @@
+package cn.com.ctop.crawler.modules.music.service;
+
+import cn.com.ctop.crawler.modules.music.entity.DictMusicType;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 抖音音乐类型
+ * @Author: jeecg-boot
+ * @Date:   2020-10-28
+ * @Version: V1.0
+ */
+public interface IDictMusicTypeService extends IService<DictMusicType> {
+
+    JSONObject listAll();
+}

+ 18 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/impl/BytedanceMusicInfoServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.crawler.modules.music.service.impl;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicInfo;
+import cn.com.ctop.crawler.modules.music.mapper.BytedanceMusicInfoMapper;
+import cn.com.ctop.crawler.modules.music.service.IBytedanceMusicInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 音乐信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Service
+public class BytedanceMusicInfoServiceImpl extends ServiceImpl<BytedanceMusicInfoMapper, BytedanceMusicInfo> implements IBytedanceMusicInfoService {
+
+}

+ 18 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/impl/BytedanceMusicTypeServiceImpl.java

@@ -0,0 +1,18 @@
+package cn.com.ctop.crawler.modules.music.service.impl;
+
+import cn.com.ctop.crawler.modules.music.entity.BytedanceMusicType;
+import cn.com.ctop.crawler.modules.music.mapper.BytedanceMusicTypeMapper;
+import cn.com.ctop.crawler.modules.music.service.IBytedanceMusicTypeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 音乐类型信息
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Service
+public class BytedanceMusicTypeServiceImpl extends ServiceImpl<BytedanceMusicTypeMapper, BytedanceMusicType> implements IBytedanceMusicTypeService {
+
+}

+ 28 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/music/service/impl/DictMusicTypeServiceImpl.java

@@ -0,0 +1,28 @@
+package cn.com.ctop.crawler.modules.music.service.impl;
+
+import cn.com.ctop.crawler.modules.music.entity.DictMusicType;
+import cn.com.ctop.crawler.modules.music.mapper.DictMusicTypeMapper;
+import cn.com.ctop.crawler.modules.music.service.IDictMusicTypeService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 抖音音乐类型
+ * @author jeecg-boot
+ * @date   2020-10-28
+ * @version V1.0
+ */
+@Service
+public class DictMusicTypeServiceImpl extends ServiceImpl<DictMusicTypeMapper, DictMusicType> implements IDictMusicTypeService {
+    @Autowired
+    private DictMusicTypeMapper musicTypeMapper;
+    @Override
+    public JSONObject listAll() {
+        List<DictMusicType> musicTypeList = musicTypeMapper.getAllExtTypeZh();
+        return null;
+    }
+}

+ 25 - 15
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyMaterialReportJob.java

@@ -2,6 +2,7 @@ package cn.com.ctop.job.bytedance.handler;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
@@ -12,6 +13,7 @@ import org.springframework.stereotype.Component;
 
 import java.util.Date;
 import java.util.List;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -28,43 +30,51 @@ public class BytedanceDailyMaterialReportJob {
     public ReturnT<String> execute(String param) throws Exception {
         Date getDate2 = DateUtils.addDay(new Date(), -2);
         String date2 = DateUtils.formatDate(getDate2);
-
+        Long start = System.currentTimeMillis();
         Date getDate = DateUtils.addDay(new Date(), -1);
         String date = DateUtils.formatDate(getDate);
         XxlJobLogger.log("头条获取素材报表数据任务开始,任务时间:" + date2 + "~" + date);
 
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
-        if (null == tokens || tokens.size() <= 0) {
+        if (null == tokens || tokens.isEmpty()) {
             XxlJobLogger.log("头条获取素材报表数据任务执行失败:未获取到可用的token");
             return ReturnT.FAIL;
         }
+        CountDownLatch countDownLatch = new CountDownLatch(tokens.size());
 
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
+        tokens.forEach(token -> executorService.submit(new Runnable() {
                 @Override
                 public void run() {
                     try {
                         //获取头条素材报表两天前的数据
-                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务开始,任务时间:" + date2 + "~" + date2);
+                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务开始,任务时间:" + date + "~" + date2);
                         bytedanceReportService.bytedanceMaterialReport(token, date2, date2);
-                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务完成,任务时间:" + date2 + "~" + date2);
-
-                        //获取头条素材报表数据
-                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务开始,任务时间:" + date + "~" + date);
                         bytedanceReportService.bytedanceMaterialReport(token, date, date);
-                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务完成,任务时间:" + date + "~" + date);
-
-                        //获取头条素材报表两天前的数据
-                        bytedanceReportService.bytedanceVideoMaterialReport(token, date2, date2);
                         //获取头条素材报表数据
+                        bytedanceReportService.bytedanceVideoMaterialReport(token, date2, date2);
                         bytedanceReportService.bytedanceVideoMaterialReport(token, date, date);
+                        XxlJobLogger.log("账户"+token.getAccountId() + "素材报表数据任务完成,任务时间:" + date + "~" + date2);
                     } catch (Exception e) {
                         e.printStackTrace();
                     } finally {
+                        countDownLatch.countDown();
                     }
                 }
-            });
-        });
+            }));
+
+        try {
+            countDownLatch.await();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        Long end = System.currentTimeMillis();
+        XxlJobLogger.log("头条素材数据获取耗时:{}毫秒", end - start);
+
+        videoReportDailyService.videoInfoList(date, date);
+        videoReportDailyService.videoInfoList(date2, date2);
         return ReturnT.SUCCESS;
     }
+
+    @Autowired
+    private IByteDanceVideoReportDailyService videoReportDailyService;
 }

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

@@ -1,13 +1,20 @@
 package cn.com.ctop.kuaishou.modules.batch.controller;
 
 import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
+import cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -30,9 +37,7 @@ 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;
+import java.util.*;
 
 /**
  * @Description: 快手-获取视频接口
@@ -47,6 +52,8 @@ import java.util.Map;
 public class KuaiShouVideoGetController {
     @Autowired
     private IKuaiShouVideoGetService kuaiShouVideoGetService;
+    @Autowired
+    private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
 
     /**
      * 分页列表查询
@@ -73,6 +80,89 @@ public class KuaiShouVideoGetController {
         return result;
     }
 
+
+    @GetMapping(value = "/getVideoList")
+    public Result<PageInfo<KuaiShouVideoGetVo>> getVideoList(Long accountId,
+                                                             String startDate,
+                                                             String endDate,
+                                                             String materialType,
+                                                             String channelType,
+                                                             String orderBy,
+                                                             @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                             HttpServletRequest req) {
+
+
+        Result<PageInfo<KuaiShouVideoGetVo>> result = new Result<>();
+        try {
+            if (Check.isNull(accountId)) {
+                throw new Exception("请传入账户id");
+            }
+            if (Check.isNull(materialType)) {
+                throw new Exception("请传入素材类型");
+            }
+            if (Check.isNull(channelType)) {
+                throw new Exception("请传入素材渠道");
+            }
+            if (Check.isNull(orderBy)) {
+                throw new Exception("请传入排序方式");
+            }
+            List<KuaiShouVideoGetVo> list = new ArrayList<>();
+            PageHelper.startPage(pageNo, pageSize);
+            Map<String, Object> requestMap = new HashMap<>();
+            requestMap.put("accountId", accountId);
+            requestMap.put("orderBy", orderBy);
+            requestMap.put("materialType", materialType);
+            requestMap.put("channelType", channelType);
+            if (orderBy.equals("time")) {
+                if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
+                    requestMap.put("startDate", startDate + " 00:00:00");
+                    requestMap.put("endDate", endDate + " 59:59:59");
+                }
+                list = kuaiShouVideoGetService.getVideoList(requestMap);
+            } else if (orderBy.equals("cost")) {
+                if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
+                    requestMap.put("startDate", startDate);
+                    requestMap.put("endDate", endDate);
+                }
+                list = kuaiShouReportDailyMaterialService.getVideoList(requestMap);
+            }
+            PageInfo<KuaiShouVideoGetVo> pageInfo = new PageInfo<>(list);
+            result.setSuccess(true);
+            result.setResult(pageInfo);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+            result.setMessage(e.getMessage());
+        }
+
+
+        return result;
+
+    }
+
+
+    public static Map<String, Object> parseJSON2Map(String jsonStr) {
+        Map<String, Object> map = new HashMap<String, Object>();
+        JSONObject json = JSONObject.parseObject(jsonStr);
+        for (Object k : json.keySet()) {
+            Object v = json.get(k);
+            if (v instanceof JSONArray) {
+                List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
+                Iterator<Object> it = ((JSONArray) v).iterator();
+                while (it.hasNext()) {
+                    JSONObject json2 = (JSONObject) it.next();
+                    list.add(parseJSON2Map(json2.toString()));
+                }
+                map.put(k.toString(), list);
+            } else {
+                map.put(k.toString(), v);
+            }
+        }
+        return map;
+    }
+
+
     /**
      * 添加
      *

+ 116 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/vo/KuaiShouVideoGetVo.java

@@ -0,0 +1,116 @@
+package cn.com.ctop.kuaishou.modules.batch.entity.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @Description: 快手-获取视频接口
+ * @Author: jeecg-boot
+ * @Date: 2019-07-25
+ * @Version: V1.0
+ */
+
+public class KuaiShouVideoGetVo implements Serializable {
+
+    private BigDecimal charge;
+    private String statDate;
+
+    /**
+     * 视频id
+     */
+    @Excel(name = "视频id", width = 15)
+    @ApiModelProperty(value = "视频id")
+    private String photoId;
+
+    /**
+     * 视频预览链接
+     */
+    @Excel(name = "视频预览链接", width = 15)
+    @ApiModelProperty(value = "视频预览链接")
+    private String url;
+    /**
+     * 视频首帧图片链接
+     */
+    @Excel(name = "视频首帧图片链接", width = 15)
+    @ApiModelProperty(value = "视频首帧图片链接")
+    private String coverUrl;
+    /**
+     * 视频首帧图片链接
+     */
+    private String signature;
+
+    private Integer materialType;
+
+
+    public BigDecimal getCharge() {
+        return charge;
+    }
+
+    public void setCharge(BigDecimal charge) {
+        this.charge = charge;
+    }
+
+    public String getStatDate() {
+        return statDate;
+    }
+
+    public void setStatDate(String statDate) {
+        this.statDate = statDate;
+    }
+
+    public String getPhotoId() {
+        return photoId;
+    }
+
+    public void setPhotoId(String photoId) {
+        this.photoId = photoId;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getCoverUrl() {
+        return coverUrl;
+    }
+
+    public void setCoverUrl(String coverUrl) {
+        this.coverUrl = coverUrl;
+    }
+
+    public String getSignature() {
+        return signature;
+    }
+
+    public void setSignature(String signature) {
+        this.signature = signature;
+    }
+
+    public Integer getMaterialType() {
+        return materialType;
+    }
+
+    public void setMaterialType(Integer materialType) {
+        this.materialType = materialType;
+    }
+
+    @Override
+    public String toString() {
+        return "KuaiShouVideoGetVo{" +
+                "charge=" + charge +
+                ", statDate='" + statDate + '\'' +
+                ", photoId='" + photoId + '\'' +
+                ", url='" + url + '\'' +
+                ", coverUrl='" + coverUrl + '\'' +
+                ", signature='" + signature + '\'' +
+                ", materialType=" + materialType +
+                '}';
+    }
+}

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

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.batch.mapper;
 
+import cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo;
 import cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo;
@@ -7,6 +8,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 素材
@@ -24,4 +26,5 @@ public interface KuaiShouReportDailyMaterialMapper extends BaseMapper<KuaiShouRe
 
     List<KuaiShouReportDailyMaterialVo> getPhotoListByDate(@Param("statDate") String statDate);
 
+    List<KuaiShouVideoGetVo> getVideoList(Map<String, Object> requestMap);
 }

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

@@ -1,10 +1,12 @@
 package cn.com.ctop.kuaishou.modules.batch.mapper;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
+import cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 快手-获取视频接口
@@ -15,4 +17,6 @@ import java.util.List;
 public interface KuaiShouVideoGetMapper extends BaseMapper<KuaiShouVideoGet> {
 
     void replaceBatch(@Param(value = "videos") List<KuaiShouVideoGet> videoGets);
+
+    List<KuaiShouVideoGetVo> getVideoList(Map<String, Object> requestMap);
 }

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

@@ -143,4 +143,46 @@
       limit 1
     </select>
 
+
+    <select id="getVideoList" parameterType="java.util.Map"
+            resultType="cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo">
+
+        SELECT
+        sum(t1.charge) as 'charge',
+        t1.photo_id AS 'photoId',
+        t1.photo_url AS 'url',
+        t1.cover_url AS 'coverUrl',
+        t1.signature AS 'signature',
+        t2.material_type AS 'materialType'
+        FROM
+        ctop_kuaishou_report_daily_material t1
+        LEFT JOIN (
+        SELECT
+        material_type,
+        signature,
+        status
+        FROM
+        ctop_kuaishou_video_get
+        WHERE
+        account_id = #{accountId} group by signature) t2
+        ON t1.signature = t2.signature
+        WHERE
+        t1.account_id = #{accountId}
+        AND t1.channel_type = #{channelType}
+        AND t2.material_type = #{materialType}
+        AND t2.status = 0
+        <if test="startDate != null and startDate != '' ">
+            and t1.stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and t1.stat_date &lt;= #{endDate}
+        </if>
+
+        GROUP BY
+        signature
+        ORDER BY
+        sum(t1.charge) DESC
+    </select>
+
+
 </mapper>

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

@@ -13,7 +13,7 @@
         material_type,
         signature,
         update_time
-       )
+        )
         values
         <foreach collection="videos" item="video" separator=",">
             (
@@ -31,4 +31,30 @@
             )
         </foreach>
     </insert>
+
+
+    <select id="getVideoList" parameterType="java.util.Map"
+            resultType="cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo">
+        select
+        stat_date as 'statDate',
+        photo_id as 'photoId',
+        url as 'url',
+        cover_url as 'coverUrl',
+        signature as 'signature',
+        material_type as 'materialType'
+        from ctop_kuaishou_video_get
+        where account_id = #{accountId}
+        and channel_type = #{channelType}
+        and material_type = #{materialType}
+        and status = 0
+        <if test="startDate != null and startDate != '' ">
+            and stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate != null and endDate != '' ">
+            and stat_date &lt;= #{endDate}
+        </if>
+        group by signature
+        order by stat_date desc
+    </select>
+
 </mapper>

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

@@ -1,10 +1,11 @@
 package cn.com.ctop.kuaishou.modules.batch.service;
 
+import cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 素材
@@ -14,4 +15,5 @@ import java.util.List;
  */
 public interface IKuaiShouReportDailyMaterialService extends IService<KuaiShouReportDailyMaterial> {
 
+    List<KuaiShouVideoGetVo> getVideoList(Map<String, Object> requestMap);
 }

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

@@ -1,9 +1,11 @@
 package cn.com.ctop.kuaishou.modules.batch.service;
 
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
+import cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 快手-获取视频接口
@@ -15,4 +17,6 @@ public interface IKuaiShouVideoGetService extends IService<KuaiShouVideoGet> {
     void replaceBatch(List<KuaiShouVideoGet> videoGets);
 
     void getKeyFrame(String token, Long accountId, String md5, String photoId);
+
+    List<KuaiShouVideoGetVo> getVideoList(Map<String, Object> stringObjectMap);
 }

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

@@ -9,6 +9,7 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskServ
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
 import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyImageMapper;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -67,6 +68,7 @@ public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDail
         taskQueryWrapper.eq("task_status", 0);
         taskQueryWrapper.eq("account_id", accountId);
         taskQueryWrapper.eq("stat_date", statDate);
+        taskQueryWrapper.eq("view_type", 7);
         taskQueryWrapper.orderByDesc("create_time");
         List<KuaiShouDailyReportTask> dailyTaskList = this.list(taskQueryWrapper);
         if (!Check.isNull(dailyTaskList)) {
@@ -155,7 +157,12 @@ public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDail
                     };
                     thread.start();
                 }else if(task.getViewType() == 7){
-
+                    //封面报表
+                    kuaishouReportDailyImageMapper.loadImageDailyReport(task.getAccountId(),localPath);
+                    //清洗数据
+                    kuaishouReportDailyImageMapper.updateImageReportCode();
+                    kuaishouReportDailyImageMapper.updateImageReportUserId();
+                    kuaishouReportDailyImageMapper.updateImageReportRealname();
                 }
             }
 
@@ -168,5 +175,7 @@ public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDail
         this.updateById(task);
     }
 
+    @Autowired
+    private KuaishouReportDailyImageMapper kuaishouReportDailyImageMapper;
 
 }

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

@@ -156,7 +156,6 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
     public void getTaskList() {
         log.info("开始历史数据文件检查下载");
         QueryWrapper<KuaiShouHistoryReportTask> taskQueryWrapper = new QueryWrapper<>();
-        taskQueryWrapper.eq("view_type",7);
         taskQueryWrapper.eq("task_status", 0);
         taskQueryWrapper.orderByDesc("create_time");
         List<KuaiShouHistoryReportTask> taskList = this.list(taskQueryWrapper);
@@ -252,6 +251,10 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
                 }else if (task.getViewType() == 7){
                     //封面报表
                     kuaishouReportDailyImageMapper.loadImageDailyReport(task.getAccountId(),localPath);
+                    //清洗数据
+                    kuaishouReportDailyImageMapper.updateImageReportCode();
+                    kuaishouReportDailyImageMapper.updateImageReportUserId();
+                    kuaishouReportDailyImageMapper.updateImageReportRealname();
                 }
 
 
@@ -273,13 +276,13 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
     private void getHistoryTypeList() {
 
         historyTypeList = new ArrayList<>();
-        historyTypeList.add(5);
         historyTypeList.add(1);
         historyTypeList.add(2);
         historyTypeList.add(3);
-        historyTypeList.add(10);
         historyTypeList.add(4);
-     //   historyTypeList.add(7);
+        historyTypeList.add(5);
+        historyTypeList.add(7);
+        historyTypeList.add(10);
 
 
     }
@@ -290,16 +293,13 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
         dailyTypeList.add(3);
         dailyTypeList.add(4);
         dailyTypeList.add(5);
+        dailyTypeList.add(7);
         dailyTypeList.add(10);
-//        historyTypeList.add(7);
     }
 
 
     static ExecutorService executorService = Executors.newFixedThreadPool(30);
 
-    @Autowired
-    private ICtopOauthTokenService oauthTokenService;
-
     @Override
     public void getMd5(String statDate, Long accountId) {
         executorService.submit(new Runnable() {

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

@@ -1,11 +1,16 @@
 package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
+import cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouReportDailyMaterialMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 素材
  *
@@ -15,5 +20,11 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class KuaiShouReportDailyMaterialServiceImpl extends ServiceImpl<KuaiShouReportDailyMaterialMapper, KuaiShouReportDailyMaterial> implements IKuaiShouReportDailyMaterialService {
+    @Autowired
+    private KuaiShouReportDailyMaterialMapper dailyMaterialMapper;
 
+    @Override
+    public List<KuaiShouVideoGetVo> getVideoList(Map<String, Object> requestMap) {
+        return dailyMaterialMapper.getVideoList(requestMap);
+    }
 }

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

@@ -520,6 +520,13 @@ public class KuaiShouUpdateServiceImpl implements IKuaiShouUpdateService {
                     returnMap.put("code", -1);
                     returnMap.put("success", false);
                     returnMap.put("message", resultJson.getString("message"));
+                    if (resultJson.getString("message").equals("该账户下创意不存在")) {
+                        Map<String, Object> deleteMap = new HashMap<>();
+                        deleteMap.put("creative_id", creativeId);
+                        creativeMapper.deleteByMap(deleteMap);
+                    }
+
+
                 }
             } else {
                 log.error("修改广告创意返回结果为空,advertiserId:{},creativeId:{}", advertiserId, creativeId);

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

@@ -6,6 +6,7 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.common.module.utils.LoadFileUtil;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
+import cn.com.ctop.kuaishou.modules.batch.entity.vo.KuaiShouVideoGetVo;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouVideoGetMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
 import com.alibaba.fastjson.JSONArray;
@@ -117,4 +118,9 @@ public class KuaiShouVideoGetServiceImpl extends ServiceImpl<KuaiShouVideoGetMap
         }
 
     }
+
+    @Override
+    public List<KuaiShouVideoGetVo> getVideoList(Map<String, Object> requestMap) {
+        return videoGetMapper.getVideoList(requestMap);
+    }
 }

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

@@ -1289,12 +1289,16 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     @Override
     public void getCreativeList(CtopOauthToken token, Date startDate, Date endDate) {
+
         getCreativeListByPage(token.getAccessToken(), token.getAccountId(), startDate, endDate, 1);
     }
 
 
     public void getCreativeListByPage(String accessToken, Long advertiserId, Date startDate, Date endDate, Integer page) {
         try {
+
+
+            Thread.sleep(1500);
             String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_LIST;
             Map<String, String> headers = new HashMap<>();
             headers.put("Content-Type", " application/json");

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

@@ -51,6 +51,9 @@ public class KuaiShouAccountReportCtrl {
         String mediaId = requestBody.getString("mediaId");
         BigDecimal discount = requestBody.getBigDecimal("discount");
         JSONArray accounts = requestBody.getJSONArray("accountIds");
+        if(accounts.isEmpty()){
+            return resultBody;
+        }
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
         try {
@@ -80,6 +83,9 @@ public class KuaiShouAccountReportCtrl {
         String mediaId = requestBody.getString("mediaId");
         BigDecimal discount = requestBody.getBigDecimal("discount");
         JSONArray accounts = requestBody.getJSONArray("accountIds");
+        if(accounts.isEmpty()){
+            return result;
+        }
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
         int hour= requestBody.getInteger("hour");
@@ -117,6 +123,9 @@ public class KuaiShouAccountReportCtrl {
         columns.add(1,"authName");
         String mediaId = requestBody.getString("mediaId");
         JSONArray accounts = requestBody.getJSONArray("accountIds");
+        if(accounts.isEmpty()){
+            return;
+        }
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
         String target= requestBody.getString("target");

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

@@ -1,8 +1,13 @@
 package cn.com.ctop.kuaishou.modules.report.mapper;
 
+import cn.com.ctop.common.module.vo.KuaishouImageCostVO;
+import cn.com.ctop.common.module.vo.KuaishouImageCostVOEntity;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyImage;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * 快手图片报表
  * @author: jeecg-boot
@@ -12,4 +17,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 public interface KuaishouReportDailyImageMapper extends BaseMapper<KuaishouReportDailyImage> {
 
     void loadImageDailyReport(Long accountId, String localPath);
+
+    List<KuaishouImageCostVO> imageCost(String startDate, String endDate, JSONArray accountList, String code);
+
+    void updateImageReportCode();
+
+    List<KuaishouImageCostVOEntity> imageCostEntity(String startDate, String endDate, JSONArray accountList, String code);
+
+    void updateImageReportUserId();
+
+    void updateImageReportRealname();
 }

+ 10 - 11
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KsVideoReportMapper.xml

@@ -5,11 +5,11 @@
     <select id="queryVideoReportBy" resultType="com.alibaba.fastjson.JSONObject">
         SELECT * from (SELECT
         t1.signature,
-        t2.url,
-        (SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.clip_id=u.id where t3.material_id=t1.signature limit 1) AS clip,
-        (SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.shot_id=u.id where t3.material_id=t1.signature limit 1) AS shot,
-        (SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.plan_id=u.id where t3.material_id=t1.signature limit 1) AS plan,
-        t2.cover_url as converUrl,
+        t1.photo_url as url,
+        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.clip_id=u.id where t3.material_id=t1.signature limit 1),'') AS clip,
+        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.shot_id=u.id where t3.material_id=t1.signature limit 1),'') AS shot,
+        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.plan_id=u.id where t3.material_id=t1.signature limit 1),'') AS plan,
+        t1.cover_url as converUrl,
         t2.material_name AS materialName,
         (SELECT project_name FROM ctop_project t4 WHERE t4.id = t3.project_id) AS projectName,
         t2.create_time as createTime,
@@ -30,9 +30,9 @@
         </if>
         GROUP BY t1.signature
         ) t
-        WHERE t.clip like '%${clip}%'
-        AND (t.shot LIKE '%%' or t.shot is null)
-        AND t.plan like '%${plan}%'
+        WHERE (t.clip LIKE '%${clip}%')
+        AND (t.shot LIKE '%${shot}%')
+        AND (t.plan LIKE '%${plan}%')
         ORDER BY ${target} ${order}
     </select>
 
@@ -40,8 +40,8 @@
         SELECT
         t1.stat_date as statDate,
         t1.signature,
-        t2.url,
-        t2.cover_url as converUrl,
+        t1.photo_url as url,
+        t1.cover_url as converUrl,
         t2.material_name AS materialName,
         (
         SELECT
@@ -75,7 +75,6 @@
                 #{item}
             </foreach>
         </if>
-        AND t2.url!=""
         GROUP BY t1.signature,t1.stat_date
     </select>
 </mapper>

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

@@ -444,7 +444,7 @@
             and t1.stat_date = #{statDate}
         </if>
         ) t2
-        WHERE t2.campaignName in(581,582,583,584,552,553,554,680,681,845,846,847,848,849,850,1070,1071,1072,1066,1069,1064)
+        WHERE t2.campaignName in(68,441,469,470,481,581,582,583,584,552,553,554,680,681,845,846,847,848,849,850,1070,1071,1072,1066,1069,1063,1064)
 
     </select>
 

+ 18 - 8
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyAccountMapper.xml

@@ -545,7 +545,7 @@
         a.account_id as 'accountId',
         b.auth_name as 'authName',
         b.project_id as 'projectId',
-        (select  project_name from ctop_project where  id = b.project_id) as 'projectName',
+        (select project_name from ctop_project where id = b.project_id) as 'projectName',
         round(sum(a.charge),2) as 'charge',
         sum(a.photo_show) as 'photoShow', -- 封面曝光数
         sum(a.photo_click) as 'photoClick', -- 封面点击数
@@ -595,7 +595,7 @@
         ) as 'eventNextDayStayCost' -- 次日留存成本
         from
         ctop_kuaishou_report_daily_account a
-        left join  ctop_user_allocation b on a.account_id = b.account_id
+        left join ctop_user_allocation b on a.account_id = b.account_id
         where
         a.stat_date &gt;= #{startDate}
         and
@@ -637,6 +637,11 @@
         ) as 'responsibleName',
         (
         select realname from sys_user where id = (
+        select sale_id from ctop_project where id = b.project_id
+        )
+        ) as 'saleName',
+        (
+        select realname from sys_user where id = (
         select design_responsible_id from ctop_project where id = b.project_id
         )
         ) as 'designResponsibleName',
@@ -702,7 +707,7 @@
                  open="(" close=")">
             #{item}
         </foreach>
-        group by b.project_id  order by sum(a.charge) desc
+        group by b.project_id order by sum(a.charge) desc
     </select>
 
     <!-- 计划汇总 -->
@@ -713,7 +718,7 @@
         #{yn} as 'yn',
         concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
         b.project_id as 'projectId',
-        (select  project_name  from ctop_project where  id = b.project_id) as 'projectName',
+        (select project_name from ctop_project where id = b.project_id) as 'projectName',
         b.auth_name as 'authName',
         a.account_id as 'accountId',
         a.campaign_id as 'campaignId', -- 计划id
@@ -809,7 +814,7 @@
         #{yn} as 'yn',
         concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
         b.project_id as 'projectId',
-        (select  project_name  from ctop_project where  id = b.project_id) as 'projectName',
+        (select project_name from ctop_project where id = b.project_id) as 'projectName',
         a.account_id as 'accountId',
         b.auth_name as 'authName',
         a.campaign_id as 'campaignId', -- 计划id
@@ -991,7 +996,7 @@
         #{yn} as 'yn',
         concat(#{startDate}, '~' ,#{endDate}) as 'statDate',
         b.project_id as 'projectId',
-        (select  project_name  from ctop_project where  id = b.project_id) as 'projectName',
+        (select project_name from ctop_project where id = b.project_id) as 'projectName',
         a.account_id as 'accountId',
         b.auth_name as 'authName',
         a.creative_id as 'creativeId',
@@ -1052,7 +1057,7 @@
         (select material_type from ctop_kuaishou_video_get where photo_id = c.photo_id limit 1) as materialType
         from
         ctop_kuaishou_report_daily_creative a
-        left join ctop_user_allocation  b on a.account_id = b.account_id
+        left join ctop_user_allocation b on a.account_id = b.account_id
         left join ctop_kuaishou_creative c on a.creative_id = c.creative_id
         where
         a.stat_date &gt;= #{startDate}
@@ -1153,6 +1158,11 @@
         ) as 'responsibleName',
         (
         select realname from sys_user where id = (
+        select sale_id from ctop_project where id = b.project_id
+        )
+        ) as 'saleName',
+        (
+        select realname from sys_user where id = (
         select design_responsible_id from ctop_project where id = b.project_id
         )
         ) as 'designResponsibleName',
@@ -1218,7 +1228,7 @@
                  open="(" close=")">
             #{item}
         </foreach>
-        group by b.project_id  order by sum(a.charge) desc
+        group by b.project_id order by sum(a.charge) desc
 
     </select>
 

+ 100 - 6
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouReportDailyImageMapper.xml

@@ -7,10 +7,11 @@
 	    REPLACE INTO TABLE ctop_kuaishou_report_daily_image CHARACTER SET utf8mb4
 		FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n'
 		IGNORE 1 LINES
-		(cover_id,
-		image_token,
-		cover_url,
-		@ad_scene,
+		(
+		cover_id,
+        image_token,
+        cover_url,
+        ad_scene,
         charge,
         photo_show,
         aclick,
@@ -28,13 +29,13 @@
         activation,
         submit,
         stat_date,
-        @stat_hour,
+        stat_hour,
         photo_click,
         photo_click_ratio,
         action_ratio,
         impression_1k_cost,
         photo_click_cost,
-        @click_1k_cost,
+        click_1k_cost,
         action_cost,
         event_pay_first_day,
         event_pay_purchase_amount_first_day,
@@ -103,4 +104,97 @@
         )
           set account_id = #{accountId}
     </insert>
+    <select id="imageCost" resultType="cn.com.ctop.common.module.vo.KuaishouImageCostVO">
+        select
+        report.cover_url as 'image_url' ,
+        report.code as 'signature',
+        group_concat(distinct p.project_name) AS 'project_name',
+        sum(report.charge) AS 'charge',
+        sum(report.photo_click) AS 'photo_click',
+        sum(report.photo_show) AS 'photo_show',
+        sum(report.activation) AS 'activation',
+        sum(report.event_register) AS 'event_register',
+        sum(report.event_pay) AS 'event_pay',
+        sum(report.form_count) AS 'form_count',
+        sum(report.event_jin_jian_app) AS 'event_jin_jian_app',
+        sum(report.event_credit_grant_app) AS 'event_credit_grant_app',
+        report.realname as 'user_name'
+        from ctop_kuaishou_report_daily_image report
+        left join ctop_user_allocation allocation on allocation.account_id = report.account_id
+        left join ctop_project p on p.id = allocation.project_id
+        where
+            1=1
+        and
+            report.code is not null
+        <if test="startDate!=null">
+            and report.stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            and report.stat_date &lt;= #{endDate}
+        </if>
+        <if test="accountList!=null">
+            and report.account_id in
+            <foreach item="accountId" collection="accountList" open="(" separator="," close=")">
+                #{accountId}
+            </foreach>
+        </if>
+        <if test="code!=null">
+            and report.code = #{code}
+        </if>
+        group by report.code
+        order by sum(report.charge) desc
+    </select>
+    <select id="imageCostEntity" resultType="cn.com.ctop.common.module.vo.KuaishouImageCostVOEntity">
+        select
+        report.cover_url as 'image_url' ,
+        report.code as 'signature',
+        group_concat(distinct p.project_name) AS 'project_name',
+        sum(report.charge) AS 'charge',
+        sum(report.photo_click) AS 'photo_click',
+        sum(report.photo_show) AS 'photo_show',
+        sum(report.activation) AS 'activation',
+        sum(report.event_register) AS 'event_register',
+        sum(report.event_pay) AS 'event_pay',
+        sum(report.form_count) AS 'form_count',
+        sum(report.event_jin_jian_app) AS 'event_jin_jian_app',
+        sum(report.event_credit_grant_app) AS 'event_credit_grant_app',
+        report.realname as 'user_name'
+        from ctop_kuaishou_report_daily_image report
+        left join ctop_user_allocation allocation on allocation.account_id = report.account_id
+        left join ctop_project p on p.id = allocation.project_id
+        where
+        1=1
+        and
+        report.code is not null
+        <if test="startDate!=null">
+            and report.stat_date &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            and report.stat_date &lt;= #{endDate}
+        </if>
+        <if test="accountList!=null">
+            and report.account_id in
+            <foreach item="accountId" collection="accountList" open="(" separator="," close=")">
+                #{accountId}
+            </foreach>
+        </if>
+        <if test="code!=null">
+            and report.code = #{code}
+        </if>
+        group by report.code
+        order by sum(report.charge) desc
+    </select>
+
+    <update id="updateImageReportCode">
+        update ctop_kuaishou_report_daily_image a inner join  ctop_kuaishou_image_get  image on image.image_token =a.image_token  set a.code = image.signature
+        where a.code is null
+    </update>
+    <update id="updateImageReportUserId">
+        update ctop_kuaishou_report_daily_image a inner join  ctop_material_image_info  image on image.code =a.code  set a.user_id = image.user_id
+        where a.code is not null and a.user_id is null
+    </update>
+    <update id="updateImageReportRealname">
+        update ctop_kuaishou_report_daily_image a inner join  sys_user  user on user.id =a.user_id  set a.realname = user.realname
+        where a.user_id is not null and a.realname is null
+    </update>
 </mapper>

+ 0 - 1
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatDepartmentServiceImpl.java

@@ -47,7 +47,6 @@ public class WechatDepartmentServiceImpl extends ServiceImpl<WechatDepartmentMap
             params.put("access_token", qywxAccessToken.get("accessToken"));
             String resultStr = HttpUtils.httpGetRequest(QYWxConstant.QYWX_DEPART_LIST, null, params);
             JSONObject resultJson = JSONObject.parseObject(resultStr);
-            System.err.println(resultJson);
             Integer errcode = resultJson.getInteger("errcode");
             if (errcode == 0) {
                 JSONArray department = resultJson.getJSONArray("department");

+ 0 - 5
module-oa/src/main/java/cn/com/ctop/oa/modules/service/impl/WechatNoListServiceImpl.java

@@ -74,10 +74,8 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
             StringBuffer buf = new StringBuffer();
             //批量获取审批单号 URL
             buf.append(QYWxConstant.APP_ROVAL_INFO).append("?access_token=").append(getToken());
-            System.err.println(buf.toString());
             String resultStr = HttpUtils.httpPostRequestTest(buf.toString(), params.toJSONString(), null);
             JSONObject resultJson = JSONObject.parseObject(resultStr);
-            System.err.println(resultJson);
             Integer errcode = resultJson.getInteger("errcode");
             if (errcode == 0) {
                 return resultJson;
@@ -141,9 +139,6 @@ public class WechatNoListServiceImpl extends ServiceImpl<WechatNoListMapper, Wec
                             JSONObject applyer = info.getJSONObject("applyer");
                             if (!Check.isNull(applyer)) {
                                 userId = applyer.getString("userid");
-                                if ("LiuJing".equals(userId)) {
-                                    System.out.println(info);
-                                }
                             }
                             //审批申请数据
                             JSONObject applyData = info.getJSONObject("apply_data");

+ 64 - 0
module-shiwan/pom.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>jeecg-boot-parent</artifactId>
+        <groupId>org.jeecgframework.boot</groupId>
+        <version>2.0.2</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>cn.com.ctop</groupId>
+    <artifactId>module-shiwan</artifactId>
+
+    <name>module-shiwan</name>
+    <url>http://www.example.com</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.7</maven.compiler.source>
+        <maven.compiler.target>1.7</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-common</artifactId>
+            <version>2.0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.com.ctop</groupId>
+            <artifactId>module-crawler</artifactId>
+            <version>2.0.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.googlecode.plist</groupId>
+            <artifactId>dd-plist</artifactId>
+            <version>1.16</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.tony19</groupId>
+            <artifactId>apktool-lib</artifactId>
+            <version>1.4.4-3</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <resources>
+            <!-- 解决MyBatis配置文件引入问题 -->
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                </includes>
+                <!-- 是否替换资源中的属性-->
+                <filtering>false</filtering>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+    </build>
+</project>

+ 235 - 0
module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/FileUtil.java

@@ -0,0 +1,235 @@
+package cn.com.ctop.shiwan.modules;
+
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.Date;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * @ClassName ZipUtil
+ * @Author ZHAOXA
+ * @date 2020-10-23 10:05
+ */
+@Slf4j
+public class FileUtil {
+
+    /**
+     * 转MultipartFile格式文件
+     *
+     * @param
+     * @return org.springframework.web.multipart.MultipartFile
+     * @throws
+     * @author ZHAOXA
+     */
+    public static MultipartFile getMulFileByPath(String picPath) {
+        FileItem fileItem = createFileItem(picPath);
+        MultipartFile mfile = new CommonsMultipartFile(fileItem);
+        return mfile;
+    }
+
+    private static FileItem createFileItem(String filePath) {
+        FileItemFactory factory = new DiskFileItemFactory(16, null);
+        String textFieldName = "textField";
+        int num = filePath.lastIndexOf("/");
+        String fileName = filePath.substring(num);
+        FileItem item = factory.createItem(textFieldName, "text/plain", true,
+                fileName);
+        File newfile = new File(filePath);
+        int bytesRead = 0;
+        byte[] buffer = new byte[8192];
+        try {
+            FileInputStream fis = new FileInputStream(newfile);
+            OutputStream os = item.getOutputStream();
+            while ((bytesRead = fis.read(buffer, 0, 8192))
+                    != -1) {
+                os.write(buffer, 0, bytesRead);
+            }
+            os.close();
+            fis.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return item;
+    }
+
+
+    /**
+     * 下载文件到本地
+     *
+     * @param locationPath 本地路径
+     * @param fileUrl      文件下载路径
+     * @param fileName     下载后的名称含后缀
+     * @return java.lang.String
+     * @throws
+     * @author ZHAOXA
+     */
+    public static String writeFiles(String locationPath, String fileUrl, String fileName) {
+        InputStream is = null;
+        OutputStream os = null;
+        Date date = new Date();
+        String realPath = null;
+        try {
+            URL url = new URL(fileUrl);
+            is = url.openStream();
+            File file = new File(locationPath);
+            if (!file.exists()) {
+                boolean mkdirFlag = file.mkdirs();
+                if (!mkdirFlag) {
+                    log.error("[ ========== 下载,创建临时文件夹失败 ========== ]");
+                    return null;
+                }
+            }
+            realPath = locationPath.concat(fileName);
+            os = new FileOutputStream(realPath);
+            int bytesRead = 0;
+            byte[] buffer = new byte[8192];
+            while ((bytesRead = is.read(buffer, 0, 8192)) != -1) {
+                os.write(buffer, 0, bytesRead);
+                os.flush();
+            }
+
+        } catch (Exception e) {
+            log.error(" ========== 文件下载到本地异常:", e);
+            return null;
+        } finally {
+            try {
+                if (os != null) {
+                    os.close();
+                }
+                if (is != null) {
+                    is.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return realPath;
+    }
+
+    /**
+     * 通过MultipartFile获取本地下载路径
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
+     * @author ZHAOXA
+     */
+    public static String approvalFile(MultipartFile filecontent, String path) {
+        OutputStream os = null;
+        InputStream inputStream = null;
+        String fileName = filecontent.getOriginalFilename();
+        try {
+            inputStream = filecontent.getInputStream();
+        } catch (IOException e) {
+            log.error("获取文件流异常");
+        }
+        try {
+            byte[] bs = new byte[1024];
+            // 读取到的数据长度
+            int len;
+            // 输出的文件流保存到本地文件
+            File tempFile = new File(path);
+            if (!tempFile.exists()) {
+                tempFile.mkdirs();
+            }
+            os = new FileOutputStream(tempFile.getPath() + "/" + File.separator + fileName);
+            // 开始读取
+            while ((len = inputStream.read(bs)) != -1) {
+                os.write(bs, 0, len);
+            }
+        } catch (Exception e) {
+            log.error("获取文件的本地路径失败", e);
+        } finally {
+            // 完毕,关闭所有链接
+            try {
+                os.close();
+                inputStream.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return path + fileName;
+    }
+
+
+    /**
+     * @param zipSavePath 压缩好的zip包存放路径
+     * @param sourceFile  待压缩的文件(单个文件或者整个文件目录)
+     * @return
+     * @author
+     */
+    public static String zipCompress(String zipSavePath, File sourceFile) {
+        try {
+            //创建zip输出流
+            ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipSavePath));
+            File[] fileList = sourceFile.listFiles();
+            //如果文件夹为空,则只需在目的地zip文件中写入一个目录进入点
+            if (fileList.length != 0) {
+                for (File file : fileList) {
+                    compress(zos, file, file.getName());
+                }
+                zos.close();
+            }
+        } catch (Exception e) {
+            log.error("压缩文件异常 : {}, zipSavePath={}, sourceFile={}", e, zipSavePath, sourceFile.getName());
+        }
+        return zipSavePath;
+    }
+
+    /**
+     * 递归压缩文件
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    private static void compress(ZipOutputStream zos, File sourceFile, String fileName) throws Exception {
+        if (sourceFile.isDirectory()) {
+            //如果是文件夹,取出文件夹中的文件(或子文件夹)
+            File[] fileList = sourceFile.listFiles();
+            if (fileList.length == 0)//如果文件夹为空,则只需在目的地zip文件中写入一个目录进入点
+            {
+                zos.putNextEntry(new ZipEntry(fileName + "/"));
+            } else//如果文件夹不为空,则递归调用compress,文件夹中的每一个文件(或文件夹)进行压缩
+            {
+                for (File file : fileList) {
+                    compress(zos, file, fileName + "/" + file.getName());
+                }
+            }
+        } else {
+            if (!sourceFile.exists()) {
+                zos.putNextEntry(new ZipEntry("/"));
+                zos.closeEntry();
+            } else {
+                //单个文件,直接将其压缩到zip包中
+                zos.putNextEntry(new ZipEntry(fileName));
+                FileInputStream fis = new FileInputStream(sourceFile);
+                byte[] buf = new byte[1024];
+                int len;
+                //将源文件写入到zip文件中
+                while ((len = fis.read(buf)) != -1) {
+                    zos.write(buf, 0, len);
+                }
+                zos.closeEntry();
+                fis.close();
+            }
+        }
+    }
+
+
+}

+ 309 - 0
module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/controller/ShiwanFileUploadController.java

@@ -0,0 +1,309 @@
+package cn.com.ctop.shiwan.modules.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload;
+import cn.com.ctop.shiwan.modules.service.IShiwanFileUploadService;
+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 com.xxl.job.core.enums.NoEn;
+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.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.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 试玩平台,文件信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-21
+ */
+@Slf4j
+@Api(tags = "试玩平台,文件信息")
+@RestController
+@RequestMapping("/shiwan/shiwanFileUpload")
+public class ShiwanFileUploadController {
+    @Autowired
+    private IShiwanFileUploadService shiwanFileUploadService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param shiwanFileUpload
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "试玩平台,文件信息-分页列表查询")
+    @ApiOperation(value = "试玩平台,文件信息-分页列表查询", notes = "试玩平台,文件信息-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<ShiwanFileUpload>> queryPageList(ShiwanFileUpload shiwanFileUpload,
+                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                         HttpServletRequest req) {
+        Result<IPage<ShiwanFileUpload>> result = new Result<>();
+        //父级为0,是zip文件,其他为zip内部文件
+        shiwanFileUpload.setParentId((long) 0);
+        //状态为1,文件有效未被删除
+        shiwanFileUpload.setFileStatus(NoEn.NO1.valueStr());
+        QueryWrapper<ShiwanFileUpload> queryWrapper = QueryGenerator.initQueryWrapper(shiwanFileUpload, req.getParameterMap());
+        Page<ShiwanFileUpload> page = new Page<ShiwanFileUpload>(pageNo, pageSize);
+        IPage<ShiwanFileUpload> pageList = shiwanFileUploadService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    @PostMapping("/saveOrUpdateFile")
+    public Result<Object> saveOrUpdateFile(@RequestBody MultipartFile file, String userId, Long accountId, String fileType, HttpServletRequest request) {
+        Result<Object> result = new Result<>();
+        try {
+            ShiwanFileUpload entity = shiwanFileUploadService.saveOrUpdateFile(file, userId, accountId, fileType, null, null);
+            if (Check.isNull(entity)) {
+                result = Result.error("上传失败");
+            }
+            Object obj = entity;
+            result = Result.ok(obj);
+        } catch (Exception e) {
+            log.error("试玩素材上传COS异常", e);
+            result = Result.error(-1, "上传失败");
+        }
+        return result;
+    }
+
+
+    @PostMapping("/createNewZipFile")
+    public Result<Object> createNewZipFile(@RequestBody MultipartFile file, String id, String updateName, String userId, Long accountId, String fileType, String isCreate, String newFileName) {
+        Result<Object> result = new Result<>();
+        try {
+            return shiwanFileUploadService.createNewZipFile(file, id, updateName, userId, accountId, fileType, isCreate, newFileName);
+        } catch (Exception e) {
+            log.error("生成新的试玩素材ZIP包异常", e);
+            result = Result.error(-1, "上传失败");
+        }
+        return result;
+    }
+
+    @GetMapping("/selectListByParentId")
+    public Result<List<ShiwanFileUpload>> selectListByParentId(String id) {
+        Result<List<ShiwanFileUpload>> result = new Result<>();
+        ShiwanFileUpload shiwanFileUploadEntity = shiwanFileUploadService.getById(id);
+        if (shiwanFileUploadEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            List<ShiwanFileUpload> list = shiwanFileUploadService.selectListByParentId(id);
+            if (!Check.isNull(list)) {
+                result.success("查询成功!");
+                result.setResult(list);
+            } else {
+                result.error(-1, "查询失败");
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param shiwanFileUpload
+     * @return
+     */
+    @AutoLog(value = "试玩平台,文件信息-添加")
+    @ApiOperation(value = "试玩平台,文件信息-添加", notes = "试玩平台,文件信息-添加")
+    @PostMapping(value = "/add")
+    public Result<ShiwanFileUpload> add(@RequestBody ShiwanFileUpload shiwanFileUpload) {
+        Result<ShiwanFileUpload> result = new Result<>();
+        try {
+            shiwanFileUploadService.save(shiwanFileUpload);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param shiwanFileUpload
+     * @return
+     */
+    @AutoLog(value = "试玩平台,文件信息-编辑")
+    @ApiOperation(value = "试玩平台,文件信息-编辑", notes = "试玩平台,文件信息-编辑")
+    @PostMapping(value = "/edit")
+    public Result<ShiwanFileUpload> edit(@RequestBody ShiwanFileUpload shiwanFileUpload) {
+        Result<ShiwanFileUpload> result = new Result<ShiwanFileUpload>();
+        ShiwanFileUpload shiwanFileUploadEntity = shiwanFileUploadService.getById(shiwanFileUpload.getId());
+        if (shiwanFileUploadEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = shiwanFileUploadService.updateById(shiwanFileUpload);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "试玩平台,文件信息-通过id删除")
+    @ApiOperation(value = "试玩平台,文件信息-通过id删除", notes = "试玩平台,文件信息-通过id删除")
+    @GetMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            shiwanFileUploadService.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<ShiwanFileUpload> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<ShiwanFileUpload> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.shiwanFileUploadService.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<ShiwanFileUpload> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<ShiwanFileUpload> result = new Result<>();
+        ShiwanFileUpload shiwanFileUpload = shiwanFileUploadService.getById(id);
+        if (shiwanFileUpload == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(shiwanFileUpload);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<ShiwanFileUpload> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                ShiwanFileUpload shiwanFileUpload = JSON.parseObject(deString, ShiwanFileUpload.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(shiwanFileUpload, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<ShiwanFileUpload> pageList = shiwanFileUploadService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "试玩平台,文件信息列表");
+        mv.addObject(NormalExcelConstants.CLASS, ShiwanFileUpload.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<ShiwanFileUpload> listShiwanFileUploads = ExcelImportUtil.importExcel(file.getInputStream(), ShiwanFileUpload.class, params);
+                shiwanFileUploadService.saveBatch(listShiwanFileUploads);
+                return Result.ok("文件导入成功!数据行数:" + listShiwanFileUploads.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("文件导入失败!");
+    }
+
+}

+ 111 - 0
module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/entity/ShiwanFileUpload.java

@@ -0,0 +1,111 @@
+package cn.com.ctop.shiwan.modules.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 试玩平台,文件信息
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-21
+ */
+@Data
+@TableName("ctop_shiwan_file_upload")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_shiwan_file_upload对象", description = "试玩平台,文件信息")
+public class ShiwanFileUpload {
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private Long id;
+    /**
+     * 文件类型
+     */
+    @Excel(name = "文件类型", width = 15)
+    @ApiModelProperty(value = "文件类型")
+    private String fileType;
+    /**
+     * 文件级别
+     */
+    @Excel(name = "文件级别", width = 15)
+    @ApiModelProperty(value = "文件级别")
+    private Integer fileLevel;
+    /**
+     * 文件名称
+     */
+    @Excel(name = "文件名称", width = 15)
+    @ApiModelProperty(value = "文件名称")
+    private String fileName;
+    /**
+     * 存储路径
+     */
+    @Excel(name = "存储路径", width = 15)
+    @ApiModelProperty(value = "存储路径")
+    private String fileUrl;
+    /**
+     * 文件状态,0-无效,1有效
+     */
+    @Excel(name = "文件状态,0-无效,1有效", width = 15)
+    @ApiModelProperty(value = "文件状态,0-无效,1有效")
+    private String fileStatus;
+    /**
+     * 文件大小
+     */
+    @Excel(name = "文件大小", width = 15)
+    @ApiModelProperty(value = "文件大小")
+    private String fileSize;
+    /**
+     * 上传时间
+     */
+    @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 uploadTime;
+
+    private Date createTime;
+
+    private Date updateTime;
+    /**
+     * 操作人
+     */
+    @Excel(name = "操作人", width = 15)
+    @ApiModelProperty(value = "操作人")
+    private String userId;
+    /**
+     * remake
+     */
+    @Excel(name = "remake", width = 15)
+    @ApiModelProperty(value = "remake")
+    private String remake;
+    /**
+     * 文件后缀
+     */
+    private String fileSuffix;
+
+    private String cfileName;
+    /**
+     * MD5签名
+     */
+    private String signature;
+
+    private Long accountId;
+
+    private Long parentId;
+}

+ 23 - 0
module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/mapper/ShiwanFileUploadMapper.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.shiwan.modules.mapper;
+
+import cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * 试玩平台,文件信息
+ *
+ * @author: jeecg-boot
+ * @date: 2020-10-21
+ * @cersion: V1.0
+ */
+public interface ShiwanFileUploadMapper extends BaseMapper<ShiwanFileUpload> {
+
+    ShiwanFileUpload selectEntity(JSONObject job);
+
+    void deleteByParentId(Long id);
+
+    List<ShiwanFileUpload> selectListByParentId(String id);
+}

+ 44 - 0
module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/mapper/xml/ShiwanFileUploadMapper.xml

@@ -0,0 +1,44 @@
+<?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.shiwan.modules.mapper.ShiwanFileUploadMapper">
+
+    <select id="selectEntity" resultType="cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload">
+        SELECT
+        *
+        FROM ctop_shiwan_file_upload
+        WHERE
+        file_status = 1
+        <if test="fileName != null and fileName != '' ">
+            and file_name = #{fileName}
+        </if>
+        <if test="fileType != null and fileType != '' ">
+            and file_type = #{fileType}
+        </if>
+        <if test="accountId != null and accountId != '' ">
+            and account_id = #{accountId}
+        </if>
+        <if test="userId != null and userId != '' ">
+            and user_id = #{userId}
+        </if>
+        <if test="parentId != null and parentId != '' ">
+            and parent_id = #{parentId}
+        </if>
+        <if test="signature != null and signature != '' ">
+            and signature = #{signature}
+        </if>
+        LIMIT 1
+    </select>
+    <select id="selectListByParentId" resultType="cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload">
+        SELECT
+        *
+        FROM ctop_shiwan_file_upload
+        WHERE file_status = 1
+        AND parent_id=#{id}
+    </select>
+
+    <delete id="deleteByParentId" parameterType="java.lang.Long">
+        delete from ctop_shiwan_file_upload
+    where parent_id = #{parentId}
+    </delete>
+
+</mapper>

+ 419 - 0
module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/service/ShiwanFileUploadServiceImpl.java

@@ -0,0 +1,419 @@
+package cn.com.ctop.shiwan.modules.service;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.common.module.utils.CosUtils;
+import cn.com.ctop.common.module.utils.LoadFileUtil;
+import cn.com.ctop.common.module.vo.ResFileDTO;
+import cn.com.ctop.shiwan.modules.FileUtil;
+import cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload;
+import cn.com.ctop.shiwan.modules.mapper.ShiwanFileUploadMapper;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.core.enums.NoEn;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+/**
+ * 试玩平台,文件信息
+ * try-play
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-21
+ */
+@Slf4j
+@Service
+public class ShiwanFileUploadServiceImpl extends ServiceImpl<ShiwanFileUploadMapper, ShiwanFileUpload> implements cn.com.ctop.shiwan.modules.service.IShiwanFileUploadService {
+
+    @Autowired
+    private ShiwanFileUploadMapper shiwanFileUploadMapper;
+    @Value("${zip.local.download-path}")
+    private String downloadPath;
+
+    @Override
+    public ShiwanFileUpload saveOrUpdateFile(MultipartFile file, String userId, Long accountId, String fileType, Long parentId, String uuid) {
+        StringBuffer path = new StringBuffer();
+        path.append(downloadPath).append(DateUtils.getNowDate(DateUtils.WEB_FORMAT)).append("/").append(UUID.randomUUID().toString()).append("/");
+        log.info("-------下载到服务器地址:{}", path.toString());
+        ShiwanFileUpload shiwanFileUpload = null;
+        String newFileUrl = FileUtil.approvalFile(file, path.toString());
+        String md5 = null;
+        try {
+            md5 = LoadFileUtil.getMD5(newFileUrl);
+        } catch (IOException e) {
+            log.error("获取MD5签名失败", e);
+        }
+        ShiwanFileUpload existFiles = getExistFiles(userId, accountId, file.getOriginalFilename(), fileType, parentId, md5);
+        if (!Check.isNull(existFiles)) {
+            long start = System.currentTimeMillis();
+            existFiles.setSignature(md5);
+            try {
+                shiwanFileUpload = updateFile(file, existFiles);
+            } catch (IOException e) {
+                log.error("更新文件,上传SOC异常", e);
+            }
+            if (!Check.isNull(shiwanFileUpload)) {
+                List<String> urlList = unzipFiles(shiwanFileUpload, path.toString(), newFileUrl);
+                saveInnerFiles(shiwanFileUpload, urlList);
+            }
+            long end = System.currentTimeMillis();
+            log.info("文件更新完成,耗时:{} ms", (end - start));
+        } else {
+            long start = System.currentTimeMillis();
+            ShiwanFileUpload fileUpload = new ShiwanFileUpload();
+            fileUpload.setSignature(md5);
+            fileUpload.setUserId(userId);
+            fileUpload.setAccountId(accountId);
+            fileUpload.setFileType(fileType);
+            try {
+                //新增zip包
+                shiwanFileUpload = saveFile(file, fileUpload, null);
+            } catch (IOException e) {
+                log.error("新增文件,上传SOC异常", e);
+            }
+            if (!Check.isNull(shiwanFileUpload)) {
+                List<String> urlList = unzipFiles(shiwanFileUpload, path.toString(), newFileUrl);
+                saveInnerFiles(shiwanFileUpload, urlList);
+            }
+            long end = System.currentTimeMillis();
+            log.info("文件新增完成,耗时:{} ms", (end - start));
+        }
+        return shiwanFileUpload;
+    }
+
+    /**
+     * 更新数据并上传文件到COS
+     *
+     * @param
+     * @return cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload
+     * @throws
+     * @author ZHAOXA
+     */
+    private ShiwanFileUpload updateFile(MultipartFile file, ShiwanFileUpload existFiles) throws IOException {
+        ResFileDTO resultFile = null;
+        String url = "";
+        ShiwanFileUpload fileUpload = new ShiwanFileUpload();
+        if (existFiles.getParentId() != 0) {
+            url = "try-play/inner-file/";
+        } else {
+            url = "try-play/zip/";
+        }
+        InputStream inputStream = null;
+        try {
+            inputStream = file.getInputStream();
+            resultFile = CosUtils.uploadDetailInputStreamV2(inputStream, existFiles.getFileName(), existFiles.getFileSuffix(), file.getSize(), url);
+        } catch (IOException e) {
+            log.error("更新文件,上传COS失败", e);
+        } finally {
+            if (inputStream != null) {
+                inputStream.close();
+            }
+        }
+        QueryWrapper<ShiwanFileUpload> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("id", existFiles.getId());
+        existFiles.setFileSize(resultFile.getFileSize() + "B");
+        existFiles.setUploadTime(new Date());
+        existFiles.setFileUrl(resultFile.getFileUrl());
+        existFiles.setCfileName(resultFile.getCFileName());
+        shiwanFileUploadMapper.update(existFiles, queryWrapper);
+        shiwanFileUploadMapper.deleteByParentId(existFiles.getId());
+        return existFiles;
+    }
+
+    /**
+     * 存储数据并上传文件到COS
+     *
+     * @param
+     * @return cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload
+     * @throws
+     * @author ZHAOXA
+     */
+    private ShiwanFileUpload saveFile(MultipartFile file, ShiwanFileUpload fileUpload, String uuid) throws IOException {
+        String filename = file.getOriginalFilename();
+        ResFileDTO resultFile = null;
+        String url = "";
+        if (Check.isNull(fileUpload.getParentId())) {
+            url = "try-play/zip/";
+            fileUpload.setParentId((long) NoEn.NO0.valueInt());
+        } else {
+            url = "try-play/inner-file/".concat(uuid).concat("/");
+        }
+        String fileSuffix = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();
+        InputStream inputStream = null;
+        try {
+            inputStream = file.getInputStream();
+            resultFile = CosUtils.uploadDetailInputStreamV2(inputStream, filename, fileSuffix, file.getSize(), url);
+        } catch (IOException e) {
+            log.error("上传COS异常", e);
+        } finally {
+            if (inputStream != null) {
+                inputStream.close();
+            }
+        }
+        if (!Check.isNull(resultFile)) {
+            fileUpload.setCfileName(resultFile.getCFileName());
+            fileUpload.setFileName(filename);
+            fileUpload.setFileSuffix(fileSuffix);
+            if ("zip".equals(fileSuffix)) {
+                fileUpload.setFileLevel(NoEn.NO0.valueInt());
+            } else {
+                fileUpload.setFileLevel(NoEn.NO1.valueInt());
+            }
+            fileUpload.setFileStatus(NoEn.NO1.valueStr());
+            fileUpload.setFileSize(resultFile.getFileSize() + "B");
+            fileUpload.setFileUrl(resultFile.getFileUrl());
+            fileUpload.setUploadTime(new Date());
+            shiwanFileUploadMapper.insert(fileUpload);
+        }
+        return shiwanFileUploadMapper.selectById(fileUpload.getId());
+    }
+
+
+    @Override
+    public Result<Object> createNewZipFile(MultipartFile file, String id, String updateName, String userId, Long accountId, String fileType, String isCreate, String newFileName) throws IOException {
+        ShiwanFileUpload oldFile = shiwanFileUploadMapper.selectById(id);
+        if (Check.isNull(oldFile)) {
+            return Result.error("查询原文件数据失败");
+        }
+        StringBuffer path = new StringBuffer();
+        String uuid = UUID.randomUUID().toString();
+        path.append(downloadPath).append(DateUtils.getNowDate(DateUtils.WEB_FORMAT)).append("/").append(uuid).append("/");
+        log.info("----------服务器下载地址:{}", path.toString());
+        //解压zip文件
+        List<String> urlList = unzipFiles(oldFile, path.toString(), null);
+        String newFilePath = "";
+        if (null != urlList && urlList.size() > 0) {
+            Iterator it = urlList.iterator();
+            while (it.hasNext()) {
+                String url = it.next().toString();
+                String fileName = url.substring(url.lastIndexOf("/") + 1);
+                if (updateName.equals(fileName)) {
+                    newFilePath = url.substring(0, url.lastIndexOf("/") + 1);
+                    //移除被替换的对象
+                    it.remove();
+                    deletelocalFiles(url);
+                    break;
+                }
+            }
+        }
+        if (Check.isNull(newFilePath)) {
+            return Result.error("被替换文件名称有误");
+        }
+        //添加上新的对象
+        String newUrl = FileUtil.approvalFile(file, newFilePath);
+        urlList.add(newUrl);
+        //压缩zip文件
+        if (Check.isNull(newFileName) && NoEn.NO1.valueStr().equals(isCreate)) {
+            newFileName = DateUtils.getNowDate(DateUtils.LONG_FORMAT).concat("_COPY-FROM_").concat(oldFile.getFileName());
+        }
+        ShiwanFileUpload newFile = new ShiwanFileUpload();
+        newFile.setUserId(userId);
+        newFile.setAccountId(accountId);
+        newFile.setFileType(fileType);
+        newFile.setFileName(newFileName);
+        oldFile.setUserId(userId);
+        oldFile.setAccountId(accountId);
+        oldFile.setFileType(fileType);
+        oldFile.setFileName(newFileName);
+        ShiwanFileUpload newZipFiles = createNewZipFiles(urlList, path.toString(), newFile, isCreate, oldFile);
+        return Result.ok(newZipFiles);
+    }
+
+    @Override
+    public List<ShiwanFileUpload> selectListByParentId(String id) {
+        return shiwanFileUploadMapper.selectListByParentId(id);
+    }
+
+    /**
+     * 解压文件
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    private List<String> unzipFiles(ShiwanFileUpload fileUpload, String path, String innerZipPath) {
+        long start = System.currentTimeMillis();
+        List<String> urlList = new ArrayList<>();
+        //下载到本地服务器
+        if (Check.isNull(innerZipPath)) {
+            innerZipPath = FileUtil.writeFiles(path.concat("oldZip/"), fileUpload.getFileUrl(), fileUpload.getCfileName());
+        }
+        try {
+            log.info("----------zip包下载地址:{}", innerZipPath);
+            ZipFile zipFile = new ZipFile(innerZipPath, Charset.forName("GBK"));
+            Enumeration<?> enumeration = zipFile.entries();
+            ZipEntry zipEntry = null;
+            String innerPath = path.concat("innerFiles/");
+            while (enumeration.hasMoreElements()) {
+                zipEntry = (ZipEntry) enumeration.nextElement();
+                // 如果是文件夹,就创建个文件夹
+                if (zipEntry.isDirectory()) {
+                    String dirPath = innerPath + zipEntry.getName();
+                    File dir = new File(dirPath);
+                    dir.mkdirs();
+                } else {
+                    String url = innerPath + zipEntry.getName();
+                    // 如果是文件,就先创建一个文件,然后用io流把内容copy过去
+                    File targetFile = new File(url);
+                    // 保证这个文件的父文件夹必须要存在
+                    if (!targetFile.getParentFile().exists()) {
+                        targetFile.getParentFile().mkdirs();
+                    }
+                    targetFile.createNewFile();
+                    // 将压缩文件内容写入到这个文件中
+                    InputStream is = zipFile.getInputStream(zipEntry);
+                    FileOutputStream fos = new FileOutputStream(targetFile);
+                    int len;
+                    byte[] buf = new byte[2048];
+                    while ((len = is.read(buf)) != -1) {
+                        fos.write(buf, 0, len);
+                    }
+                    // 关流顺序,先打开的后关闭
+                    fos.close();
+                    is.close();
+                    urlList.add(url);
+                }
+            }
+        } catch (IOException e) {
+            log.error("解压原zip文件失败 ", e);
+        }
+        deletelocalFiles(innerZipPath);
+        long end = System.currentTimeMillis();
+        log.info("文件解压完成,耗时:{} ms", (end - start));
+        return urlList;
+    }
+
+    /**
+     * 压缩ZIP文件,并存储数据到本地
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    private ShiwanFileUpload createNewZipFiles(List<String> list, String path, ShiwanFileUpload addFile, String isCreate, ShiwanFileUpload updateFile) throws IOException {
+        String zipUrl = FileUtil.zipCompress(path.concat(addFile.getFileName()), new File(path.concat("innerFiles/")));
+        try {
+            String md5 = LoadFileUtil.getMD5(zipUrl);
+            addFile.setSignature(md5);
+            updateFile.setSignature(md5);
+        } catch (IOException e) {
+            log.error("获取MD5签名失败", e);
+        }
+        ShiwanFileUpload newZipEntity = null;
+        //判断是新增还是更新
+        if (NoEn.NO1.valueStr().equals(isCreate)) {
+            //存储新ZIP包
+            newZipEntity = saveFile(FileUtil.getMulFileByPath(zipUrl), addFile, null);
+            deletelocalFiles(zipUrl);
+            if (!Check.isNull(newZipEntity)) {
+                saveInnerFiles(newZipEntity, list);
+            }
+        } else {
+            newZipEntity = updateFile(FileUtil.getMulFileByPath(zipUrl), updateFile);
+            deletelocalFiles(zipUrl);
+            if (!Check.isNull(newZipEntity)) {
+                saveInnerFiles(newZipEntity, list);
+            }
+        }
+        return newZipEntity;
+    }
+
+    /**
+     * 存储zip内部文件
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    private void saveInnerFiles(ShiwanFileUpload newZipEntity, List<String> list) {
+        MultipartFile mulFileByPath = null;
+        for (String url : list) {
+            ShiwanFileUpload shiwanFileUpload = new ShiwanFileUpload();
+            shiwanFileUpload.setUserId(newZipEntity.getUserId());
+            shiwanFileUpload.setAccountId(newZipEntity.getAccountId());
+            shiwanFileUpload.setFileType(newZipEntity.getFileType());
+            shiwanFileUpload.setParentId(newZipEntity.getId());
+            String urlpath = url.substring(0, url.lastIndexOf("/"));
+            String lastFileName = urlpath.substring(urlpath.lastIndexOf("/") + 1);
+            String cosFilePath = "";
+            if ("innerFiles".equals(lastFileName)) {
+                cosFilePath = newZipEntity.getCfileName();
+            } else {
+                cosFilePath = newZipEntity.getCfileName().concat("/").concat(lastFileName);
+            }
+            try {
+                shiwanFileUpload.setSignature(LoadFileUtil.getMD5(url));
+            } catch (IOException e) {
+                log.error("获取MD5签名失败", e);
+            }
+            mulFileByPath = FileUtil.getMulFileByPath(url);
+            try {
+                saveFile(mulFileByPath, shiwanFileUpload, cosFilePath);
+            } catch (IOException e) {
+                log.error("新增内部文件,上传SOC异常", e);
+            }
+            deletelocalFiles(url);
+        }
+    }
+
+    /**
+     * 删除本地文件
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    private void deletelocalFiles(String filePath) {
+        File file = new File(filePath);
+        if (file.exists()) {
+            file.delete();
+        }
+    }
+
+    /**
+     * 查询现有的文件
+     *
+     * @param
+     * @return cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload
+     * @throws
+     * @author ZHAOXA
+     */
+    private ShiwanFileUpload getExistFiles(String userId, Long accountId, String fileName, String fileType, Long parentId, String md5) {
+        JSONObject job = new JSONObject();
+        job.put("useId", userId);
+        job.put("accountId", accountId);
+        job.put("fileName", fileName);
+        job.put("fileType", fileType);
+        job.put("parentId", parentId);
+        job.put("signature", md5);
+        ShiwanFileUpload fileEntity = shiwanFileUploadMapper.selectEntity(job);
+        if (Check.isNull(fileEntity)) {
+            return null;
+        }
+        return fileEntity;
+    }
+}

+ 40 - 0
module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/service/impl/IShiwanFileUploadService.java

@@ -0,0 +1,40 @@
+package cn.com.ctop.shiwan.modules.service;
+
+import cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * @Description: 试玩平台,文件信息
+ * @Author: jeecg-boot
+ * @Date: 2020-10-21
+ * @Version: V1.0
+ */
+public interface IShiwanFileUploadService extends IService<ShiwanFileUpload> {
+
+    /**
+     * 上传或更新文件(同名同账户同操作人同类型的文件会被新文件更新覆盖)
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
+     * @author ZHAOXA
+     */
+    ShiwanFileUpload saveOrUpdateFile(MultipartFile file, String userId, Long accountId, String fileType, Long parentId, String uuid);
+
+    /**
+     * 创建新的zip文件
+     *
+     * @param
+     * @return java.lang.String
+     * @throws
+     * @author ZHAOXA
+     */
+    Result<Object> createNewZipFile(MultipartFile file, String id, String updateName, String userId, Long accountId, String fileType, String isCreate, String newFileName) throws IOException;
+
+    List<ShiwanFileUpload> selectListByParentId(String id);
+}

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

@@ -216,6 +216,9 @@ public class ByteDanceAdvertisePlan {
 
     public ByteDanceAdvertisePlan(JSONObject dataObject, String accountId) {
         this.id = dataObject.getLong("id");
+        if(id == 1680967865840670L||id ==1680968574657556L||id == 1680970557193228L ){
+            System.out.println(dataObject.toJSONString());
+        }
         this.accountId = accountId;
         String name = dataObject.getString("name");
         if (null != name && !"".equals(name.trim())) {

+ 9 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/controller/BytedanceAccountReportCtrl.java

@@ -53,6 +53,9 @@ public class BytedanceAccountReportCtrl {
         String mediaId = requestBody.getString("mediaId");
         BigDecimal discount = requestBody.getBigDecimal("discount");
         JSONArray accounts = requestBody.getJSONArray("accountIds");
+        if(accounts.isEmpty()){
+         return resultBody;
+        }
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
         try {
@@ -84,6 +87,9 @@ public class BytedanceAccountReportCtrl {
         String mediaId = requestBody.getString("mediaId");
         BigDecimal discount = requestBody.getBigDecimal("discount");
         JSONArray accounts = requestBody.getJSONArray("accountIds");
+        if(accounts.isEmpty()){
+            return result;
+        }
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
         int hour= requestBody.getInteger("hour");
@@ -124,6 +130,9 @@ public class BytedanceAccountReportCtrl {
         columns.add(1,"authName");
         String mediaId = requestBody.getString("mediaId");
         JSONArray accounts = requestBody.getJSONArray("accountIds");
+        if(accounts.isEmpty()){
+            return;
+        }
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
         String target= requestBody.getString("target");

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

@@ -54,8 +54,6 @@ public interface BytedanceAccountReportMapper {
 
     String getRoleCodeByUserId(@Param("userId")String userId);
 
-    //List<Long> queryProjectInfoByAdmin(@Param("userId")String userId, @Param("mediaIds")List<Long> mediaIds);
-
     List<Long> getSaleProjects(@Param("userId")String userId, @Param("mediaIds")List<Long> mediaIds);
 
     List<Long> queryProjectInfoByAdmin(@Param("mediaIds")List<Long> mediaIds);

+ 16 - 7
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceReportMaterialDailyMapper.java

@@ -1,7 +1,8 @@
 package cn.com.ctop.toutiao.modules.report.mapper;
 
+import cn.com.ctop.common.module.vo.BytedanceImageCostVO;
+import cn.com.ctop.common.module.vo.BytedanceImageCostVOEntity;
 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.entity.BytedanceReportMaterialRetry;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportVideoMaterialDaily;
@@ -31,12 +32,20 @@ public interface BytedanceReportMaterialDailyMapper extends BaseMapper<Bytedance
 
     List<BytedanceVideoVo> getVideoVoByDate(@Param("date")String date);
 
-    List<ImageCostVO> bytedanceImageCost(@Param("startDate")String startDate,
-                                         @Param("endDate")String endDate,
-                                         @Param("accountList")JSONArray accountList,
-                                         @Param("code")String code,
-                                         @Param("startIndex")Integer startIndex,
-                                         @Param("pageSize")Integer pageSize);
+    List<BytedanceImageCostVO> bytedanceImageCost(@Param("startDate")String startDate,
+                                                  @Param("endDate")String endDate,
+                                                  @Param("accountList")JSONArray accountList,
+                                                  @Param("code")String code);
 
     void replaceImageBatch(@Param("infos")List<BytedanceReportMaterialDaily> bytedanceReportImageDailyList);
+    void updateImageReportCode();
+    void updateImageReportProjectId();
+    void updateImageReportProjectName();
+    void updateImageReportPlaneId();
+    void updateImageReportPlaneName();
+
+    List<BytedanceImageCostVOEntity> bytedanceImageCostEntity(@Param("startDate")String startDate,
+                                                              @Param("endDate")String endDate,
+                                                              @Param("accountList")JSONArray accountList,
+                                                              @Param("code")String code);
 }

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

@@ -374,6 +374,11 @@
         ) as 'designResponsibleName',
         b.auth_name as 'authName',
         b.project_id as 'projectId',
+        (
+        select realname from sys_user where id = (
+        select sale_id from ctop_project where id = b.project_id
+        )
+        ) as 'saleName',
         (select project_name from ctop_project where id = b.project_id) as 'projectName',
         c.media_id as 'mediaId',
         <include refid="selectSql"></include>
@@ -526,6 +531,12 @@
         select design_responsible_id from ctop_project where id = b.project_id
         )
         ) as 'designResponsibleName',
+
+        (
+        select realname from sys_user where id = (
+        select sale_id from ctop_project where id = b.project_id
+        )
+        ) as 'saleName',
         b.auth_name as 'authName',
         b.project_id as 'projectId',
         (select project_name from ctop_project where id = b.project_id) as 'projectName',

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

@@ -238,19 +238,22 @@
         ctop_bytedance_report_material_retry
         where status = 0
     </select>
-    <select id="bytedanceImageCost" resultType="cn.com.ctop.toutiao.modules.report.DTO.ImageCostVO">
+    <select id="bytedanceImageCost" resultType="cn.com.ctop.common.module.vo.BytedanceImageCostVO">
         select round(sum(report.cost),2)                              as 'cost',
         sum(report.click)                                             as 'click',
-        sum(report.show_material)                                     as 'showNum',
+        sum(report.show_material)                                     as 'show_num',
         sum(report.convert_material)                                  as 'convert',
-        imageInfo.image_url                                           as 'imageUrl',
-        imageInfo.signature                                           as 'signature',
-        group_concat(distinct report.project_name)                as 'projectName',
-        report.stat_datetime                                          as 'statDate'
+        report.image_url                                           as 'image_url',
+        report.code                                           as 'signature',
+        group_concat(distinct report.project_name)                    as 'project_name',
+        report.stat_datetime                                          as 'stat_date',
+        report.plane_id as 'user_id',
+        report.plane_name as 'user_name'
             from ctop_bytedance_report_image_daily report
             left join ctop_bytedance_image_info imageInfo on imageInfo.material_id = report.material_id
         where
         1=1
+        and report.code is not null
         <if test="startDate!=null">
             and report.stat_datetime &gt;= #{startDate}
         </if>
@@ -264,11 +267,40 @@
             </foreach>
         </if>
         <if test="code!=null">
-            and imageInfo.signature = #{code}
+            and report.code = #{code}
         </if>
-        group by imageInfo.signature
+        group by report.code
         order by sum(report.cost) desc
     </select>
+
+    <update id="updateImageReportCode">
+        update ctop_bytedance_report_image_daily a inner join ctop_bytedance_image_info image on image.material_id =a.material_id  set a.code = image.signature,a.image_url = image.image_url
+        where a.material_id is not null and a.code is null
+    </update>
+
+    <update id="updateImageReportProjectId">
+        update ctop_bytedance_report_image_daily a inner join ctop_user_allocation allocation on allocation.account_id =a.account_id  set a.project_id = allocation.project_id
+        where a.account_id is not null and a.project_id is null
+    </update>
+
+    <update id="updateImageReportProjectName">
+        update ctop_bytedance_report_image_daily a inner join ctop_project p on p.id =a.project_id  set a.project_name = p.project_name
+        where a.project_id is not null and a.project_name is null
+    </update>
+
+    <update id="updateImageReportPlaneId">
+        update ctop_bytedance_report_image_daily a inner join ctop_material_image_info image on image.code =a.code  set a.plane_id = image.user_id
+where a.code is not null and a.plane_id is null
+    </update>
+
+    <update id="updateImageReportPlaneName">
+        update ctop_bytedance_report_image_daily a inner join sys_user u on u.id =a.plane_id  set a.plane_name = u.realname
+where a.plane_id is not null and a.plane_name is null
+    </update>
+
+
+
+
     <select id="getVideoVoByDate" resultType="cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo">
         select
             distinct video.signature as 'code',video.video_url as 'url',report.stat_datetime as 'initial_cost_date'
@@ -295,6 +327,39 @@
         and start_date = #{retry.startDate}
         and end_date = #{retry.endDate}
     </update>
+    <select id="bytedanceImageCostEntity" resultType="cn.com.ctop.common.module.vo.BytedanceImageCostVOEntity">
+        select round(sum(report.cost),2)                              as 'cost',
+        sum(report.click)                                             as 'click',
+        sum(report.show_material)                                     as 'show_num',
+        sum(report.convert_material)                                  as 'convert',
+        report.image_url                                           as 'image_url',
+        report.code                                           as 'signature',
+        group_concat(distinct report.project_name)                    as 'project_name',
+        report.stat_datetime                                          as 'stat_date',
+        report.plane_id as 'user_id',
+        report.plane_name as 'user_name'
+        from ctop_bytedance_report_image_daily report
+        where
+        1=1
+        and report.code is not null
+        <if test="startDate!=null">
+            and report.stat_datetime &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            and report.stat_datetime &lt;= #{endDate}
+        </if>
+        <if test="accountList!=null">
+            and report.account_id in
+            <foreach item="accountId" collection="accountList" open="(" separator="," close=")">
+                #{accountId}
+            </foreach>
+        </if>
+        <if test="code!=null">
+            and report.code = #{code}
+        </if>
+        group by report.code
+        order by sum(report.cost) desc
+    </select>
 
     <insert id="replaceIntoVideoMaterialBatch">
         REPLACE INTO ctop_bytedance_report_video_material_daily

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

@@ -6,9 +6,9 @@
         SELECT * from (SELECT
         t1.signature,
         t2.url,
-        (SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.clip_id=u.id where t3.material_id=t1.signature limit 1) AS clip,
-        (SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.shot_id=u.id where t3.material_id=t1.signature limit 1) AS shot,
-        (SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.plan_id=u.id where t3.material_id=t1.signature limit 1) AS plan,
+        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.clip_id=u.id where t3.material_id=t1.signature limit 1),'') AS clip,
+        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.shot_id=u.id where t3.material_id=t1.signature limit 1),'') AS shot,
+        IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.plan_id=u.id where t3.material_id=t1.signature limit 1),'') AS plan,
         t2.cover_url as converUrl,
         t2.material_name AS materialName,
         (SELECT project_name FROM ctop_project t4 WHERE t4.id = t3.project_id) AS projectName,
@@ -22,18 +22,18 @@
         t1.stat_datetime >= #{startDate}
         AND t1.stat_datetime &lt;= #{endDate}
         <if test="accountIds != null">
-        AND t1.account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
         AND t2.url!=""
         GROUP BY t1.signature
         ) t
-        WHERE t.clip like '%${clip}%'
-        AND (t.shot LIKE '%%' or t.shot is null)
-        AND t.plan like '%${plan}%'
+        WHERE (t.clip LIKE '%${clip}%')
+        AND (t.shot LIKE '%${shot}%')
+        AND (t.plan LIKE '%${plan}%')
         ORDER BY ${target} ${order}
     </select>
 

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

@@ -30,6 +30,9 @@ public class BytedanceFundDailyServiceImpl extends ServiceImpl<BytedanceFundDail
     public void loadFundDataByPage(CtopOauthToken token, String startDate, String endDate, Integer pageNum) {
         Integer pageSize = 100;
         JSONObject result = getAdvertiserFundDailyStat(token, startDate, endDate, pageNum, pageSize);
+        if(null == result||result.isEmpty()){
+            return;
+        }
         var code = result.getInteger("code");
         var message = result.getString("message");
         if (null == code || code != 0) {

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

@@ -740,7 +740,6 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
         log.info("头条素材报表重试结束 当前accountId:{}  {}~{},type:{},code:{}" , accountId, startDate,endDate,type,code);
         return code;
     }
-
     @Override
     public int bytedanceMaterialReport(CtopOauthToken token, String startDate, String endDate) {
         Long accountId = token.getAccountId();
@@ -758,6 +757,11 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             retry.setType(1);
             bytedanceReportMaterialDailyMapper.replaceMaterialRetry(retry);
         }
+        bytedanceReportMaterialDailyMapper.updateImageReportCode();
+        bytedanceReportMaterialDailyMapper.updateImageReportProjectId();
+        bytedanceReportMaterialDailyMapper.updateImageReportProjectName();
+        bytedanceReportMaterialDailyMapper.updateImageReportPlaneId();
+        bytedanceReportMaterialDailyMapper.updateImageReportPlaneName();
         log.info("头条素材报表结束 当前accountId为:{}  {}~{}" , accountId, startDate,endDate);
         return code;
     }

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

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

+ 1 - 0
pom.xml

@@ -21,6 +21,7 @@
         <module>module-crawler</module>
         <module>module-kuaishou</module>
         <module>module-toutiao</module>
+        <module>module-shiwan</module>
         <module>module-media</module>
         <module>module-ctop</module>
         <module>performance-appraisal</module>