|
@@ -20,7 +20,6 @@ import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
-import org.jeecg.common.constant.CommonConstant;
|
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.modules.ctop.service.IProjectMemberService;
|
|
import org.jeecg.modules.ctop.service.IProjectMemberService;
|
|
@@ -315,7 +314,7 @@ public class MaterialInfoController {
|
|
List<Long> projectIdsByProductId = projectService.getProjectIdsByProductId(productId);
|
|
List<Long> projectIdsByProductId = projectService.getProjectIdsByProductId(productId);
|
|
projectIds.addAll(projectIdsByProductId);
|
|
projectIds.addAll(projectIdsByProductId);
|
|
}
|
|
}
|
|
- return materialInfoService.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, null, projectIds, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
|
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
//运营经理、运营、运营助理
|
|
//运营经理、运营、运营助理
|
|
} else if ("operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
|
|
} else if ("operator".equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "operationAssistant".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
|
|
if (!Check.isNull(projectId)) {
|
|
if (!Check.isNull(projectId)) {
|
|
@@ -331,7 +330,7 @@ public class MaterialInfoController {
|
|
projectIds.addAll(partakeProjectIds);
|
|
projectIds.addAll(partakeProjectIds);
|
|
projectIds.addAll(productProjectIds);
|
|
projectIds.addAll(productProjectIds);
|
|
}
|
|
}
|
|
- return materialInfoService.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, null, projectIds, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
|
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, 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)) {
|
|
//查询自己所在项目下的数据
|
|
//查询自己所在项目下的数据
|
|
@@ -343,7 +342,7 @@ public class MaterialInfoController {
|
|
} else {
|
|
} else {
|
|
projectIds = projectMemberService.getProjectIdsByProductId(null, userId);
|
|
projectIds = projectMemberService.getProjectIdsByProductId(null, userId);
|
|
}
|
|
}
|
|
- return materialInfoService.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, null, projectIds, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
|
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, null, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
} else {
|
|
} else {
|
|
//查询自己上传的视频
|
|
//查询自己上传的视频
|
|
if (!Check.isNull(projectId)) {
|
|
if (!Check.isNull(projectId)) {
|
|
@@ -351,7 +350,7 @@ public class MaterialInfoController {
|
|
} else if (!Check.isNull(productId)) {
|
|
} else if (!Check.isNull(productId)) {
|
|
projectIds = projectMemberService.getProjectIdsByProductId(productId, userId);
|
|
projectIds = projectMemberService.getProjectIdsByProductId(productId, userId);
|
|
}
|
|
}
|
|
- return materialInfoService.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, userId, projectIds, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
|
|
|
|
+ return materialInfoService.getListByParams(tagCode, type, status, materialName, projectIds, code, startDate, endDate, userId, clipId, shotId, planId, offlineFlag, pageNo, pageSize);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -544,12 +543,12 @@ public class MaterialInfoController {
|
|
if (null != slogans && !slogans.isEmpty()) {
|
|
if (null != slogans && !slogans.isEmpty()) {
|
|
|
|
|
|
|
|
|
|
- for (int i = 0;i<slogans.size();i++) {
|
|
|
|
|
|
+ for (int i = 0; i < slogans.size(); i++) {
|
|
JSONObject slogenInfo = slogans.getJSONObject(i);
|
|
JSONObject slogenInfo = slogans.getJSONObject(i);
|
|
String title = slogenInfo.getString("title");
|
|
String title = slogenInfo.getString("title");
|
|
- title = title.trim().replaceAll("[\\{]{2,}","{");
|
|
|
|
- title = title.trim().replaceAll("[\\}]{2,}","}");
|
|
|
|
- slogenInfo.put("title",title);
|
|
|
|
|
|
+ title = title.trim().replaceAll("[\\{]{2,}", "{");
|
|
|
|
+ title = title.trim().replaceAll("[\\}]{2,}", "}");
|
|
|
|
+ slogenInfo.put("title", title);
|
|
String reg = "\\{[\\u4e00-\\u9fa5\\-]{2,6}\\}";
|
|
String reg = "\\{[\\u4e00-\\u9fa5\\-]{2,6}\\}";
|
|
Pattern pattern = Pattern.compile(reg);
|
|
Pattern pattern = Pattern.compile(reg);
|
|
Matcher matcher = pattern.matcher(title);
|
|
Matcher matcher = pattern.matcher(title);
|
|
@@ -558,44 +557,44 @@ public class MaterialInfoController {
|
|
int len = StringUtils.lengthAsSlogan(title);
|
|
int len = StringUtils.lengthAsSlogan(title);
|
|
int left = title.indexOf("{");
|
|
int left = title.indexOf("{");
|
|
int right = title.indexOf("}");
|
|
int right = title.indexOf("}");
|
|
- if(left >= 0 || right >= 0){
|
|
|
|
|
|
+ if (left >= 0 || right >= 0) {
|
|
int times = 0;
|
|
int times = 0;
|
|
while (matcher.find()) { //此处find()每次被调用后,会偏移到下一个匹配
|
|
while (matcher.find()) { //此处find()每次被调用后,会偏移到下一个匹配
|
|
times++;
|
|
times++;
|
|
- if(times>=3){
|
|
|
|
|
|
+ if (times >= 3) {
|
|
result.setCode(500);
|
|
result.setCode(500);
|
|
result.setMessage("动态词包不合法,词包数量超过2个");
|
|
result.setMessage("动态词包不合法,词包数量超过2个");
|
|
- return result;
|
|
|
|
|
|
+ return result;
|
|
}
|
|
}
|
|
String matchStr = matcher.group();//获取当前匹配的值
|
|
String matchStr = matcher.group();//获取当前匹配的值
|
|
- title = title.replace(matchStr,"");
|
|
|
|
- ByteDanceCreativeWordPackage creativeWordPackage = byteDanceGeneralCopywriterService.selectCreativeWordPackageByName(matchStr.substring(1,matchStr.length()-1));
|
|
|
|
- if(Check.isNull(creativeWordPackage)){
|
|
|
|
|
|
+ title = title.replace(matchStr, "");
|
|
|
|
+ ByteDanceCreativeWordPackage creativeWordPackage = byteDanceGeneralCopywriterService.selectCreativeWordPackageByName(matchStr.substring(1, matchStr.length() - 1));
|
|
|
|
+ if (Check.isNull(creativeWordPackage)) {
|
|
result.setCode(500);
|
|
result.setCode(500);
|
|
result.setMessage("动态词包不合法,词包不存在或者含有单独的非词包大括号");
|
|
result.setMessage("动态词包不合法,词包不存在或者含有单独的非词包大括号");
|
|
- return result;
|
|
|
|
|
|
+ return result;
|
|
}
|
|
}
|
|
creativeWordIdsArray.add(creativeWordPackage.getCreativeWordId());
|
|
creativeWordIdsArray.add(creativeWordPackage.getCreativeWordId());
|
|
len = len - (right - left) + creativeWordPackage.getMaxWordLen();
|
|
len = len - (right - left) + creativeWordPackage.getMaxWordLen();
|
|
left = title.indexOf("{");
|
|
left = title.indexOf("{");
|
|
right = title.indexOf("}");
|
|
right = title.indexOf("}");
|
|
}
|
|
}
|
|
- if(title.contains("{") || title.contains("}")){
|
|
|
|
|
|
+ if (title.contains("{") || title.contains("}")) {
|
|
return result.error500("大括号单独出现或大括号中内容不合法");
|
|
return result.error500("大括号单独出现或大括号中内容不合法");
|
|
}
|
|
}
|
|
- slogenInfo.put("creative_word_ids",creativeWordIdsArray.toJSONString());
|
|
|
|
|
|
+ slogenInfo.put("creative_word_ids", creativeWordIdsArray.toJSONString());
|
|
}
|
|
}
|
|
//校验标题长度,长度小于5和大于30的全部过滤
|
|
//校验标题长度,长度小于5和大于30的全部过滤
|
|
- if(len<5 || len>30){
|
|
|
|
|
|
+ if (len < 5 || len > 30) {
|
|
result.setCode(500);
|
|
result.setCode(500);
|
|
result.setMessage("文案长度不合法,小于5或大于30");
|
|
result.setMessage("文案长度不合法,小于5或大于30");
|
|
- return result;
|
|
|
|
|
|
+ return result;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
- slogenInfoService.deleteAllSlogens(Check.isNull(materialInfo.getProjectId()) ? materialInfoEntity.getProjectId() : materialInfo.getProjectId(),materialInfoEntity.getCode(),user.getId());
|
|
|
|
- slogenInfoService.insertSlogans(Check.isNull(materialInfo.getProjectId()) ? materialInfoEntity.getProjectId() : materialInfo.getProjectId() , materialInfoEntity.getCode(), slogans, user.getId());
|
|
|
|
|
|
+ slogenInfoService.deleteAllSlogens(Check.isNull(materialInfo.getProjectId()) ? materialInfoEntity.getProjectId() : materialInfo.getProjectId(), materialInfoEntity.getCode(), user.getId());
|
|
|
|
+ slogenInfoService.insertSlogans(Check.isNull(materialInfo.getProjectId()) ? materialInfoEntity.getProjectId() : materialInfo.getProjectId(), materialInfoEntity.getCode(), slogans, user.getId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
boolean ok = materialInfoService.updateById(materialInfo);
|
|
boolean ok = materialInfoService.updateById(materialInfo);
|