浏览代码

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
syh 4 年之前
父节点
当前提交
ded1e7b924
共有 26 个文件被更改,包括 1835 次插入199 次删除
  1. 7 0
      jeecg-boot-module-system/pom.xml
  2. 175 166
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ProjectTransferRecordController.java
  3. 20 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ProjectTransferRecordServiceImpl.java
  4. 3 0
      jeecg-boot-module-system/src/main/resources/application-dev.yml
  5. 4 0
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  6. 4 0
      jeecg-boot-module-system/src/main/resources/application-prod2.yml
  7. 6 2
      jeecg-boot-module-system/src/main/resources/application-test.yml
  8. 6 1
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  9. 248 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouCreativeTagCollectionController.java
  10. 77 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreativeTagCollection.java
  11. 15 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouCreativeTagCollectionMapper.java
  12. 5 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouCreativeTagCollectionMapper.xml
  13. 14 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouCreativeTagCollectionService.java
  14. 19 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouCreativeTagCollectionServiceImpl.java
  15. 7 9
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KsVideoReportMapper.xml
  16. 0 1
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaiShouAccountReportServiceImpl.java
  17. 64 0
      module-shiwan/pom.xml
  18. 287 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/FileUtil.java
  19. 314 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/controller/ShiwanFileUploadController.java
  20. 111 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/entity/ShiwanFileUpload.java
  21. 23 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/mapper/ShiwanFileUploadMapper.java
  22. 40 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/mapper/xml/ShiwanFileUploadMapper.xml
  23. 343 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/service/ShiwanFileUploadServiceImpl.java
  24. 39 0
      module-shiwan/src/main/java/cn/com/ctop/shiwan/modules/service/impl/IShiwanFileUploadService.java
  25. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceVideoReportMapper.xml
  26. 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>

+ 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;
+    }
 }

+ 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/

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

@@ -7,7 +7,11 @@ import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.message.handle.impl.EmailSendMsgHandle;
-import cn.com.ctop.common.module.service.*;
+import cn.com.ctop.common.module.service.IBindAccountLoginService;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.IUReportExportService;
+import cn.com.ctop.common.module.service.IUReportService;
+import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
@@ -29,6 +33,7 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
+import java.io.IOException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;

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

@@ -0,0 +1,248 @@
+package cn.com.ctop.kuaishou.modules.batch.controller;
+
+import cn.com.ctop.common.module.annotation.AutoLog;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreativeTagCollection;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCreativeTagCollectionService;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 快手-创意标签收藏
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-22
+ */
+@Slf4j
+@Api(tags = "快手-创意标签收藏")
+@RestController
+@RequestMapping("/tag/kuaiShouCreativeTagCollection")
+public class KuaiShouCreativeTagCollectionController {
+    @Autowired
+    private IKuaiShouCreativeTagCollectionService kuaiShouCreativeTagCollectionService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param kuaiShouCreativeTagCollection
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @AutoLog(value = "快手-创意标签收藏-分页列表查询")
+    @ApiOperation(value = "快手-创意标签收藏-分页列表查询", notes = "快手-创意标签收藏-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<KuaiShouCreativeTagCollection>> queryPageList(KuaiShouCreativeTagCollection kuaiShouCreativeTagCollection,
+                                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                      HttpServletRequest req) {
+        Result<IPage<KuaiShouCreativeTagCollection>> result = new Result<>();
+        QueryWrapper<KuaiShouCreativeTagCollection> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouCreativeTagCollection, req.getParameterMap());
+        Page<KuaiShouCreativeTagCollection> page = new Page<KuaiShouCreativeTagCollection>(pageNo, pageSize);
+        IPage<KuaiShouCreativeTagCollection> pageList = kuaiShouCreativeTagCollectionService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param kuaiShouCreativeTagCollection
+     * @return
+     */
+    @AutoLog(value = "快手-创意标签收藏-添加")
+    @ApiOperation(value = "快手-创意标签收藏-添加", notes = "快手-创意标签收藏-添加")
+    @PostMapping(value = "/add")
+    public Result<KuaiShouCreativeTagCollection> add(@RequestBody KuaiShouCreativeTagCollection kuaiShouCreativeTagCollection) {
+        Result<KuaiShouCreativeTagCollection> result = new Result<>();
+        try {
+            kuaiShouCreativeTagCollectionService.save(kuaiShouCreativeTagCollection);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    /**
+     * 编辑
+     *
+     * @param kuaiShouCreativeTagCollection
+     * @return
+     */
+    @AutoLog(value = "快手-创意标签收藏-编辑")
+    @ApiOperation(value = "快手-创意标签收藏-编辑", notes = "快手-创意标签收藏-编辑")
+    @PutMapping(value = "/edit")
+    public Result<KuaiShouCreativeTagCollection> edit(@RequestBody KuaiShouCreativeTagCollection kuaiShouCreativeTagCollection) {
+        Result<KuaiShouCreativeTagCollection> result = new Result<KuaiShouCreativeTagCollection>();
+        KuaiShouCreativeTagCollection kuaiShouCreativeTagCollectionEntity = kuaiShouCreativeTagCollectionService.getById(kuaiShouCreativeTagCollection.getId());
+        if (kuaiShouCreativeTagCollectionEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = kuaiShouCreativeTagCollectionService.updateById(kuaiShouCreativeTagCollection);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "快手-创意标签收藏-通过id删除")
+    @ApiOperation(value = "快手-创意标签收藏-通过id删除", notes = "快手-创意标签收藏-通过id删除")
+    @DeleteMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+        try {
+            kuaiShouCreativeTagCollectionService.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<KuaiShouCreativeTagCollection> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        Result<KuaiShouCreativeTagCollection> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.kuaiShouCreativeTagCollectionService.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<KuaiShouCreativeTagCollection> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<KuaiShouCreativeTagCollection> result = new Result<>();
+        KuaiShouCreativeTagCollection kuaiShouCreativeTagCollection = kuaiShouCreativeTagCollectionService.getById(id);
+        if (kuaiShouCreativeTagCollection == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(kuaiShouCreativeTagCollection);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param response
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+        // Step.1 组装查询条件
+        QueryWrapper<KuaiShouCreativeTagCollection> queryWrapper = null;
+        try {
+            String paramsStr = request.getParameter("paramsStr");
+            if (oConvertUtils.isNotEmpty(paramsStr)) {
+                String deString = URLDecoder.decode(paramsStr, "UTF-8");
+                KuaiShouCreativeTagCollection kuaiShouCreativeTagCollection = JSON.parseObject(deString, KuaiShouCreativeTagCollection.class);
+                queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouCreativeTagCollection, request.getParameterMap());
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+
+        //Step.2 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        List<KuaiShouCreativeTagCollection> pageList = kuaiShouCreativeTagCollectionService.list(queryWrapper);
+        //导出文件名称
+        mv.addObject(NormalExcelConstants.FILE_NAME, "快手-创意标签收藏列表");
+        mv.addObject(NormalExcelConstants.CLASS, KuaiShouCreativeTagCollection.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<KuaiShouCreativeTagCollection> listKuaiShouCreativeTagCollections = ExcelImportUtil.importExcel(file.getInputStream(), KuaiShouCreativeTagCollection.class, params);
+                kuaiShouCreativeTagCollectionService.saveBatch(listKuaiShouCreativeTagCollections);
+                return Result.ok("文件导入成功!数据行数:" + listKuaiShouCreativeTagCollections.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("文件导入失败!");
+    }
+
+}

+ 77 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouCreativeTagCollection.java

@@ -0,0 +1,77 @@
+package cn.com.ctop.kuaishou.modules.batch.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-22
+ */
+@Data
+@TableName("ctop_kuaishou_creative_tag_collection")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_kuaishou_creative_tag_collection对象", description = "快手-创意标签收藏")
+public class KuaiShouCreativeTagCollection {
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private Long id;
+    /**
+     * tagName
+     */
+    @Excel(name = "tagName", width = 15)
+    @ApiModelProperty(value = "tagName")
+    private String tagName;
+    /**
+     * tagArray
+     */
+    @Excel(name = "tagArray", width = 15)
+    @ApiModelProperty(value = "tagArray")
+    private String tagArray;
+    /**
+     * 人员ID
+     */
+    @Excel(name = "人员ID", width = 15)
+    @ApiModelProperty(value = "人员ID")
+    private String userId;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Integer accountId;
+    /**
+     * createTime
+     */
+    @Excel(name = "createTime", 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 = "createTime")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @Excel(name = "updateTime", 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 = "updateTime")
+    private Date updateTime;
+}

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

@@ -0,0 +1,15 @@
+package cn.com.ctop.kuaishou.modules.batch.mapper;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreativeTagCollection;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 快手-创意标签收藏
+ *
+ * @author: jeecg-boot
+ * @date: 2020-10-22
+ * @cersion: V1.0
+ */
+public interface KuaiShouCreativeTagCollectionMapper extends BaseMapper<KuaiShouCreativeTagCollection> {
+
+}

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

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

@@ -0,0 +1,14 @@
+package cn.com.ctop.kuaishou.modules.batch.service;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreativeTagCollection;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 快手-创意标签收藏
+ * @Author: jeecg-boot
+ * @Date: 2020-10-22
+ * @Version: V1.0
+ */
+public interface IKuaiShouCreativeTagCollectionService extends IService<KuaiShouCreativeTagCollection> {
+
+}

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

@@ -0,0 +1,19 @@
+package cn.com.ctop.kuaishou.modules.batch.service.impl;
+
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreativeTagCollection;
+import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCreativeTagCollectionMapper;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCreativeTagCollectionService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 快手-创意标签收藏
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2020-10-22
+ */
+@Service
+public class KuaiShouCreativeTagCollectionServiceImpl extends ServiceImpl<KuaiShouCreativeTagCollectionMapper, KuaiShouCreativeTagCollection> implements IKuaiShouCreativeTagCollectionService {
+
+}

+ 7 - 9
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,
+        t1.photo_url as 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.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,
@@ -28,12 +28,11 @@
             #{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}%' or t.clip is null)
+        AND (t.shot LIKE '%${shot}%' or t.shot is null)
+        AND (t.plan LIKE '%${plan}%' or t.plan is null)
         ORDER BY ${target} ${order}
     </select>
 
@@ -41,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
@@ -76,7 +75,6 @@
                 #{item}
             </foreach>
         </if>
-        AND t2.url!=""
         GROUP BY t1.signature,t1.stat_date
     </select>
 </mapper>

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

@@ -183,7 +183,6 @@ public class KuaiShouAccountReportServiceImpl implements IKuaiShouAccountReportS
             if (k.equals("accountId") || k.equals("authName") || v.toString().contains("%")||before.getString(k).contains("%")) {
                 jsonObject.put(k, "-");
             }else {
-                System.out.println(k+"--"+after.getBigDecimal(k)+"--"+before.getBigDecimal(k));
                 jsonObject.put(k, LinkUtils.countLink(after.getBigDecimal(k)==null?zero:after.getBigDecimal(k), before.getBigDecimal(k)==null?zero:before.getBigDecimal(k)));
             }
         });

+ 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>

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

@@ -0,0 +1,287 @@
+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.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * TODO
+ *
+ * @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("/").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();
+                }
+            } catch (IOException e) {
+                log.error("Close OutputStream error", e);
+            }
+            try {
+                if (is != null) {
+                    is.close();
+                }
+            } catch (IOException e) {
+                log.error("Close InputStream error", e);
+            }
+        }
+        return realPath;
+    }
+
+
+    /**
+     * //创建zip方法,其中的参数ZipFileName是压缩后文件,inputFile要压缩的文件。
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    public static void zip(String ZipFileName, File inputFile) throws IOException {
+        ZipOutputStream out = new ZipOutputStream(new FileOutputStream(ZipFileName));//创建了输出流,这里ZipOutputStream()的参数是FileOutPutStream的原因是因为ZIP压缩的对象是文件。
+        zip(out, inputFile, "");//调用zip方法,实现了zip的重载。这次的参数是本方法中定义过的输出流out,要压缩的文件:inputFile以及文件最后的存储目录base
+        log.info("压缩中....");
+        out.close();
+        log.info("压缩完成!");
+    }
+
+    public static void zip(ZipOutputStream out, File f, String base) throws IOException {//方法重载
+        if (f.isDirectory()) {//判断要压缩的文件是否是文件夹
+            File[] fl = f.listFiles();//如果是文件夹就对把该文件夹中的文件的路径以文件数组的形式获得
+            if (base.length() != 0) {//判断最后要存储的路径是否已存在
+                out.putNextEntry(new ZipEntry(base + "/"));//如果已经存在,写入此目录的entry
+            }
+            for (int i = 0; i < fl.length; i++) {//遍历文件数组
+                zip(out, fl[i], base + fl[i]);//将文件数组中的文件添加到已经创建的ZIP中。
+            }
+        } else {
+            out.putNextEntry(new ZipEntry(base));//如果base为空。那么就创建新的进入点
+            //创建FileInputStream对象
+            FileInputStream in = new FileInputStream(f);//创建该输入流的原因是为了后边判断该流是否到达尾部
+            int b;
+            System.out.println(base);
+            while ((b = in.read()) != -1) {
+                out.write(b);//在没有到达尾部的情况下向已经创建的ZIP中添加
+            }
+            in.close();//关闭流
+        }
+    }
+
+    /**
+     * 文件压缩方法
+     *
+     * @param list
+     * @param zipfilename
+     * @param basePath
+     * @param vid
+     * @throws
+     * @Title: listToZip
+     * @date 2020年1月20日
+     */
+    public static String listToZip(List<String> list, String localPath, String zipfilename) {
+        FileInputStream is = null;
+        ZipOutputStream zos = null;
+        String realPath = localPath + "/newFiles/" + zipfilename;
+        try {
+            if (list != null && list.size() > 0) {
+                File f = new File(localPath, "newFiles");
+                if (!f.exists()) {
+                    boolean mkdirFlag = f.mkdirs();
+                    if (!mkdirFlag) {
+                        log.error(" ==========压缩, 创建临时文件夹失败 ========== ");
+                        return null;
+                    }
+                }
+                // 创建zip文件输出流
+                zos = new ZipOutputStream(new FileOutputStream(new File(realPath)));
+                File file = null;
+                String path = "";
+                for (int i = 0; i < list.size(); i++) {
+                    path = list.get(i);
+                    // file 拿到待压缩文件
+                    file = new File(path);
+                    if (file.exists()) {
+                        // 创建源文件输入流
+                        is = new FileInputStream(file);
+                        zos.putNextEntry(new ZipEntry(file.getName()));
+                        byte[] buf = new byte[2048];
+                        int length = -1;
+                        while ((length = is.read(buf)) != -1) {
+                            zos.write(buf, 0, length);
+                            zos.flush();
+                        }
+                        zos.closeEntry();
+                        is.close();
+                      /*  if (file.delete()) {
+                            // 删除图片
+                            log.debug("[ ===== File deleted successfully ===== ]");
+                        }*/
+                    } else {
+                        log.warn("[ ======= {} 源文件不存在 ======= ]", path);
+                        return null;
+                    }
+                }
+            }
+        } catch (Exception e) {
+            log.error("[ ==========压缩文件异常 ========== ]", e);
+            return null;
+        } finally {
+            try {
+                if (is != null) {
+                    is.close();
+                }
+                if (zos != null) {
+                    zos.close();
+                }
+            } catch (IOException e) {
+                log.error("[ ==========关闭IO流失败========== ]", e);
+            }
+        }
+        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;
+    }
+
+}

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

@@ -0,0 +1,314 @@
+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) {
+        Result<Object> result = new Result<>();
+        try {
+            ShiwanFileUpload entity = shiwanFileUploadService.createNewZipFile(file, id, updateName, userId, accountId, fileType);
+            if (Check.isNull(entity)) {
+                result = Result.error("上传失败");
+            }
+            Object obj = entity;
+            result = Result.ok(obj);
+        } 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<List<ShiwanFileUpload>>();
+        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);
+}

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

@@ -0,0 +1,40 @@
+<?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>
+    </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>

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

@@ -0,0 +1,343 @@
+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.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) {
+        ShiwanFileUpload existFiles = getExistFiles(userId, accountId, file.getOriginalFilename(), fileType, parentId);
+        StringBuffer path = new StringBuffer();
+        String uuids = UUID.randomUUID().toString();
+        path.append(downloadPath).append(DateUtils.getNowDate(DateUtils.WEB_FORMAT)).append("/").append(uuids).append("/");
+        log.info("----------服务器下载地址:{}", path.toString());
+        ShiwanFileUpload shiwanFileUpload = null;
+        String newUrl = FileUtil.approvalFile(file, path.toString());
+        String md5 = null;
+        try {
+            md5 = LoadFileUtil.getMD5(newUrl);
+        } catch (IOException e) {
+            log.error("获取MD5签名失败", e);
+        }
+        if (!Check.isNull(existFiles)) {
+            existFiles.setSignature(md5);
+            shiwanFileUpload = updateFile(file, existFiles);
+            if (!Check.isNull(shiwanFileUpload)) {
+                List<String> urlList = unzipFiles(shiwanFileUpload, path.toString());
+                saveInnerFiles(shiwanFileUpload, urlList);
+            }
+        } else {
+            ShiwanFileUpload fileUpload = new ShiwanFileUpload();
+            fileUpload.setSignature(md5);
+            fileUpload.setUserId(userId);
+            fileUpload.setAccountId(accountId);
+            fileUpload.setFileType(fileType);
+            fileUpload.setParentId(parentId);
+            shiwanFileUpload = saveFile(file, fileUpload, uuid);
+            if (!Check.isNull(shiwanFileUpload)) {
+                List<String> urlList = unzipFiles(shiwanFileUpload, path.toString());
+                saveInnerFiles(shiwanFileUpload, urlList);
+            }
+        }
+        return shiwanFileUpload;
+    }
+
+    /**
+     * 更新数据并上传文件到COS
+     *
+     * @param
+     * @return cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload
+     * @throws
+     * @author ZHAOXA
+     */
+    private ShiwanFileUpload updateFile(MultipartFile file, ShiwanFileUpload existFiles) {
+        ResFileDTO resultFile = null;
+        String url = "";
+        ShiwanFileUpload fileUpload = new ShiwanFileUpload();
+        if (existFiles.getParentId() != 0) {
+            url = "try-play/inner-file/";
+        } else {
+            url = "try-play/zip/";
+        }
+        try {
+            resultFile = CosUtils.uploadDetailInputStreamV2(file.getInputStream(), existFiles.getCfileName(), existFiles.getFileSuffix(), file.getSize(), url);
+        } catch (IOException e) {
+            log.error("更新文件,上传COS失败", e);
+        }
+        QueryWrapper<ShiwanFileUpload> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("id", existFiles.getId());
+        existFiles.setFileSize(resultFile.getFileSize() + "b");
+        existFiles.setUploadTime(new Date());
+        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) {
+        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();
+        try {
+            resultFile = CosUtils.uploadDetailInputStream(file.getInputStream(), filename, fileSuffix, file.getSize(), url);
+        } catch (IOException e) {
+            log.error("上传COS异常", e);
+        }
+        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 ShiwanFileUpload createNewZipFile(MultipartFile file, String id, String updateName, String userId, Long accountId, String fileType) throws IOException {
+        ShiwanFileUpload fileUpload = shiwanFileUploadMapper.selectById(id);
+        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(fileUpload, path.toString());
+        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)) {
+                    //移除被替换的对象
+                    it.remove();
+                }
+            }
+        }
+        //添加上新的对象
+        String newUrl = FileUtil.approvalFile(file, path.toString());
+        urlList.add(newUrl);
+        //压缩zip文件
+        String newFileName = DateUtils.getNowDate(DateUtils.LONG_FORMAT).concat("_COPYFROM_").concat(fileUpload.getFileName());
+        return createNewZipFiles(urlList, path.toString(), newFileName, updateName, userId, accountId, fileType);
+    }
+
+    @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) {
+        List<String> urlList = new ArrayList<>();
+        try {
+            //下载到本地服务器
+            String innerZipPath = FileUtil.writeFiles(path.concat("oldZip/"), fileUpload.getFileUrl(), fileUpload.getCfileName());
+            log.info("----------zip包解压地址:{}", innerZipPath);
+            ZipFile zipFile = new ZipFile(innerZipPath, Charset.forName("GBK"));
+            Enumeration<?> enumeration = zipFile.entries();
+            ZipEntry zipEntry = null;
+            path.concat("innerFile/");
+            while (enumeration.hasMoreElements()) {
+                zipEntry = (ZipEntry) enumeration.nextElement();
+                // 如果是文件夹,就创建个文件夹
+                if (zipEntry.isDirectory()) {
+                    String dirPath = path + zipEntry.getName();
+                    File dir = new File(dirPath);
+                    dir.mkdirs();
+                } else {
+                    String url = path + 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[8192];
+                    while ((len = is.read(buf)) != -1) {
+                        fos.write(buf, 0, len);
+                    }
+                    urlList.add(url);
+                    // 关流顺序,先打开的后关闭
+                    fos.close();
+                    is.close();
+                }
+            }
+            deletelocalFiles(path.concat("oldZip/").concat(fileUpload.getCfileName()));
+        } catch (IOException e) {
+            log.error("解压原zip失败 ", e);
+        }
+        return urlList;
+    }
+
+    /**
+     * 压缩ZIP文件,并存储数据到本地
+     *
+     * @param
+     * @return void
+     * @throws
+     * @author ZHAOXA
+     */
+    private ShiwanFileUpload createNewZipFiles(List<String> list, String innerFilePath, String zipfilename, String updateName, String userId, Long accountId, String fileType) throws IOException {
+        String zipUrl = FileUtil.listToZip(list, innerFilePath, zipfilename);
+        ShiwanFileUpload shiwanFileUpload = new ShiwanFileUpload();
+        shiwanFileUpload.setUserId(userId);
+        shiwanFileUpload.setAccountId(accountId);
+        shiwanFileUpload.setFileType(fileType);
+        try {
+            shiwanFileUpload.setSignature(LoadFileUtil.getMD5(zipUrl));
+        } catch (IOException e) {
+            log.error("获取MD5签名失败", e);
+        }
+        //存储新ZIP包
+        ShiwanFileUpload newZipEntity = saveFile(FileUtil.getMulFileByPath(zipUrl), shiwanFileUpload, null);
+        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());
+            try {
+                shiwanFileUpload.setSignature(LoadFileUtil.getMD5(url));
+            } catch (IOException e) {
+                log.error("获取MD5签名失败", e);
+            }
+            mulFileByPath = FileUtil.getMulFileByPath(url);
+            saveFile(mulFileByPath, shiwanFileUpload, newZipEntity.getCfileName());
+            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) {
+        JSONObject job = new JSONObject();
+        job.put("useId", userId);
+        job.put("accountId", accountId);
+        job.put("fileName", fileName);
+        job.put("fileType", fileType);
+        job.put("parentId", parentId);
+        ShiwanFileUpload fileEntity = shiwanFileUploadMapper.selectEntity(job);
+        if (Check.isNull(fileEntity)) {
+            return null;
+        }
+        return fileEntity;
+    }
+}

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

@@ -0,0 +1,39 @@
+package cn.com.ctop.shiwan.modules.service;
+
+import cn.com.ctop.shiwan.modules.entity.ShiwanFileUpload;
+import com.baomidou.mybatisplus.extension.service.IService;
+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
+     */
+    ShiwanFileUpload createNewZipFile(MultipartFile file, String id, String updateName, String userId, Long accountId, String fileType) throws IOException;
+
+    List<ShiwanFileUpload> selectListByParentId(String id);
+}

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

@@ -31,9 +31,9 @@
         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}%' or t.clip is null)
+        AND (t.shot LIKE '%${shot}%' or t.shot is null)
+        AND (t.plan LIKE '%${plan}%' or t.plan is null)
         ORDER BY ${target} ${order}
     </select>
 

+ 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>