|
@@ -2,13 +2,33 @@ package org.jeecg.modules.ctop.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.annotation.AutoLog;
|
|
|
import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
|
|
|
-import cn.com.ctop.common.module.entity.*;
|
|
|
+import cn.com.ctop.common.module.entity.ByteDanceCleanMaterialReport;
|
|
|
+import cn.com.ctop.common.module.entity.KuaiShouCleanMaterialReport;
|
|
|
+import cn.com.ctop.common.module.entity.MaterialAscription;
|
|
|
+import cn.com.ctop.common.module.entity.MaterialCutFrame;
|
|
|
+import cn.com.ctop.common.module.entity.MaterialImageInfo;
|
|
|
+import cn.com.ctop.common.module.entity.MaterialInfo;
|
|
|
+import cn.com.ctop.common.module.entity.MaterialParameter;
|
|
|
+import cn.com.ctop.common.module.entity.MaterialTag;
|
|
|
+import cn.com.ctop.common.module.entity.Project;
|
|
|
import cn.com.ctop.common.module.enums.MaterialSupplierEnum;
|
|
|
-import cn.com.ctop.common.module.service.*;
|
|
|
+import cn.com.ctop.common.module.service.IByteDanceCleanMaterialReportService;
|
|
|
+import cn.com.ctop.common.module.service.IKuaiShouCleanMaterialReportService;
|
|
|
+import cn.com.ctop.common.module.service.IMaterialAscriptionService;
|
|
|
+import cn.com.ctop.common.module.service.IMaterialCutFrameService;
|
|
|
+import cn.com.ctop.common.module.service.IMaterialImageInfoService;
|
|
|
+import cn.com.ctop.common.module.service.IMaterialInfoService;
|
|
|
+import cn.com.ctop.common.module.service.IMaterialParameterService;
|
|
|
+import cn.com.ctop.common.module.service.IMaterialTagService;
|
|
|
+import cn.com.ctop.common.module.service.IMessageTemplate;
|
|
|
+import cn.com.ctop.common.module.service.IProjectService;
|
|
|
+import cn.com.ctop.common.module.service.ISendMessageService;
|
|
|
+import cn.com.ctop.common.module.service.IVideoWatermarkTaskService;
|
|
|
import cn.com.ctop.common.module.utils.Check;
|
|
|
import cn.com.ctop.common.module.utils.CloudVideoProcessUtil;
|
|
|
import cn.com.ctop.common.module.utils.JsonUtil;
|
|
|
import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -25,13 +45,24 @@ import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.modules.ctop.service.IProjectMemberService;
|
|
|
import org.jeecg.modules.system.service.ISysRoleService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+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.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.net.URLDecoder;
|
|
|
import java.text.ParseException;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 素材信息
|
|
@@ -65,6 +96,8 @@ public class MaterialInfoController {
|
|
|
private IProjectMemberService memberService;
|
|
|
@Autowired
|
|
|
private IMaterialImageInfoService iMaterialImageInfoService;
|
|
|
+ @Autowired
|
|
|
+ private IKuaiShouReportDailyMaterialService kuaiShouReportDailyMaterialService;
|
|
|
|
|
|
|
|
|
@GetMapping("/supplierWatermark")
|
|
@@ -309,40 +342,40 @@ public class MaterialInfoController {
|
|
|
}
|
|
|
|
|
|
@GetMapping(value = "/listV2")
|
|
|
- public Map<String,Object> queryPageList(String type,Integer status,Long projectId,String materialName,String code,
|
|
|
- String startDate,String endDate,String tagCode,
|
|
|
- @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
- @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
+ public Map<String, Object> queryPageList(String type, Integer status, Long projectId, String materialName, String code,
|
|
|
+ String startDate, String endDate, String tagCode,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
- List<Long>projectIds = null;
|
|
|
+ List<Long> projectIds = null;
|
|
|
String userId = user.getId();
|
|
|
String roleCode = roleService.getRoleCodeByUserId(userId);
|
|
|
- if(null == tagCode||tagCode.trim().equals("")){
|
|
|
+ if (null == tagCode || tagCode.trim().equals("")) {
|
|
|
tagCode = null;
|
|
|
}
|
|
|
- if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale")){
|
|
|
+ if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale")) {
|
|
|
//查询所有
|
|
|
- if(null!=projectId&&projectId!=0){
|
|
|
+ if (null != projectId && projectId != 0) {
|
|
|
projectIds = new ArrayList<>();
|
|
|
projectIds.add(projectId);
|
|
|
}
|
|
|
- return materialInfoService.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate,null,pageNo,pageSize);
|
|
|
- }else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)){
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
|
|
|
+ } else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)) {
|
|
|
//查询自己所在项目下的数据
|
|
|
- if(null == projectId||projectId == 0){
|
|
|
+ if (null == projectId || projectId == 0) {
|
|
|
projectIds = memberService.selectProjectsByUserId(userId);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
projectIds = new ArrayList<>();
|
|
|
projectIds.add(projectId);
|
|
|
}
|
|
|
- return materialInfoService.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate,null,pageNo,pageSize);
|
|
|
- }else{
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, null, pageNo, pageSize);
|
|
|
+ } else {
|
|
|
//查询自己上传的视频
|
|
|
- if(null!=projectId&&projectId!=0){
|
|
|
+ if (null != projectId && projectId != 0) {
|
|
|
projectIds = new ArrayList<>();
|
|
|
projectIds.add(projectId);
|
|
|
}
|
|
|
- return materialInfoService.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate,userId,pageNo,pageSize);
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, userId, pageNo, pageSize);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -726,4 +759,32 @@ public class MaterialInfoController {
|
|
|
result.setResult(pageList);
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 统计素材总消耗数据
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return org.jeecg.common.api.vo.Result<com.baomidou.mybatisplus.core.metadata.IPage < cn.com.ctop.common.module.entity.MaterialInfo>>
|
|
|
+ * @throws KuaishouReportDailyMaterial
|
|
|
+ * @author ZHAOXA
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/getMaterialTotalCharge")
|
|
|
+ public Result<List<JSONObject>> getMaterialTotalCharge(@RequestBody List<String> list) {
|
|
|
+ Result<List<JSONObject>> result = new Result<>();
|
|
|
+ try {
|
|
|
+ if (Check.isNull(list)) {
|
|
|
+ result.setMessage("请输入素材消息");
|
|
|
+ result.setSuccess(false);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ List<JSONObject> arr = kuaiShouReportDailyMaterialService.getMaterialTotalCharge(list);
|
|
|
+ result.success("查询成功!");
|
|
|
+ result.setResult(arr);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ result.error500("查询失败");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|