|
@@ -79,6 +79,9 @@ public class MaterialInfoController {
|
|
@Autowired
|
|
@Autowired
|
|
private IProjectService projectService;
|
|
private IProjectService projectService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private IProjectMemberService projectMemberService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
private IByteDanceCreativeWordPackageService byteDanceGeneralCopywriterService;
|
|
private IByteDanceCreativeWordPackageService byteDanceGeneralCopywriterService;
|
|
|
|
|
|
@GetMapping("/supplierWatermark")
|
|
@GetMapping("/supplierWatermark")
|
|
@@ -298,36 +301,57 @@ public class MaterialInfoController {
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
- List<Long> productIds = null;
|
|
|
|
|
|
+ List<Long> projectIds = null;
|
|
String userId = user.getId();
|
|
String userId = user.getId();
|
|
String roleCode = roleService.getRoleCodeByUserId(userId);
|
|
String roleCode = roleService.getRoleCodeByUserId(userId);
|
|
if (null == tagCode || "".equals(tagCode.trim())) {
|
|
if (null == tagCode || "".equals(tagCode.trim())) {
|
|
tagCode = null;
|
|
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 (null != productId && productId != 0) {
|
|
|
|
- productIds = new ArrayList<>();
|
|
|
|
- productIds.add(productId);
|
|
|
|
|
|
+ //管理员、销售查询所有素材
|
|
|
|
+ if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || roleCode.contains("sale")) {
|
|
|
|
+ if (!Check.isNull(projectId)) {
|
|
|
|
+ projectIds.add(projectId);
|
|
|
|
+ } else if (!Check.isNull(productId)) {
|
|
|
|
+ List<Long> projectIdsByProductId = projectService.getProjectIdsByProductId(productId);
|
|
|
|
+ projectIds.addAll(projectIdsByProductId);
|
|
|
|
+ }
|
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, null, projectIds, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
|
|
+ //运营经理、运营、运营助理
|
|
|
|
+ } else if ("operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
|
|
|
|
+ if (!Check.isNull(projectId)) {
|
|
|
|
+ projectIds.add(projectId);
|
|
|
|
+ } else if (!Check.isNull(productId)) {
|
|
|
|
+ List<Long> partakeProjectIds = projectMemberService.getProjectIdsByProductId(productId, userId);
|
|
|
|
+ List<Long> productProjectIds = projectService.getProjectIdsByProductIdAndNotIn(productId, partakeProjectIds);
|
|
|
|
+ projectIds.addAll(partakeProjectIds);
|
|
|
|
+ projectIds.addAll(productProjectIds);
|
|
|
|
+ } else {
|
|
|
|
+ List<Long> partakeProjectIds = projectMemberService.getProjectIdsByProductId(null, userId);
|
|
|
|
+ List<Long> productProjectIds = projectService.getProjectIdsByProductIdAndNotIn(null, partakeProjectIds);
|
|
|
|
+ projectIds.addAll(partakeProjectIds);
|
|
|
|
+ projectIds.addAll(productProjectIds);
|
|
}
|
|
}
|
|
- return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, null, projectId, clipId, shotId, planId,offlineFlag, pageNo, pageSize);
|
|
|
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, null, projectIds, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
|
|
+
|
|
} else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)) {
|
|
} else if ("designTeamLeader".equals(roleCode) || "planeLeader".equals(roleCode) || "plane".equals(roleCode) || "plan".equals(roleCode) || "shot".equals(roleCode)) {
|
|
//查询自己所在项目下的数据
|
|
//查询自己所在项目下的数据
|
|
- if (null == productId || productId == 0) {
|
|
|
|
- productIds = memberService.selectProductsByUserId(userId);
|
|
|
|
|
|
+ if (!Check.isNull(projectId)) {
|
|
|
|
+ projectIds.add(projectId);
|
|
|
|
+ } else if (!Check.isNull(productId)) {
|
|
|
|
+ projectIds = projectMemberService.getProjectIdsByProductId(productId, userId);
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- productIds = new ArrayList<>();
|
|
|
|
- productIds.add(productId);
|
|
|
|
|
|
+ projectIds = projectMemberService.getProjectIdsByProductId(null, userId);
|
|
}
|
|
}
|
|
- return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, null, projectId, clipId, shotId, planId,offlineFlag, pageNo, pageSize);
|
|
|
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, null, projectIds, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
} else {
|
|
} else {
|
|
//查询自己上传的视频
|
|
//查询自己上传的视频
|
|
- if (null != productId && productId != 0) {
|
|
|
|
- productIds = new ArrayList<>();
|
|
|
|
- productIds.add(productId);
|
|
|
|
|
|
+ if (!Check.isNull(projectId)) {
|
|
|
|
+ projectIds.add(projectId);
|
|
|
|
+ } else if (!Check.isNull(productId)) {
|
|
|
|
+ projectIds = projectMemberService.getProjectIdsByProductId(productId, userId);
|
|
}
|
|
}
|
|
- return materialInfoService.getListByParams(tagCode, type, status, productIds, materialName, code, startDate, endDate, userId, projectId, clipId, shotId, planId,offlineFlag, pageNo, pageSize);
|
|
|
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, userId, projectIds, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|