yumeng vor 4 Jahren
Ursprung
Commit
200cd8a921

+ 21 - 22
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -20,7 +20,6 @@ import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
@@ -315,7 +314,7 @@ public class MaterialInfoController {
                 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);
+            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)) {
             if (!Check.isNull(projectId)) {
@@ -331,7 +330,7 @@ public class MaterialInfoController {
                 projectIds.addAll(partakeProjectIds);
                 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)) {
             //查询自己所在项目下的数据
@@ -343,7 +342,7 @@ public class MaterialInfoController {
             } else {
                 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 {
             //查询自己上传的视频
             if (!Check.isNull(projectId)) {
@@ -351,7 +350,7 @@ public class MaterialInfoController {
             } else if (!Check.isNull(productId)) {
                 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()) {
 
 
-                for (int i = 0;i<slogans.size();i++) {
+                for (int i = 0; i < slogans.size(); i++) {
                     JSONObject slogenInfo = slogans.getJSONObject(i);
                     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}\\}";
                     Pattern pattern = Pattern.compile(reg);
                     Matcher matcher = pattern.matcher(title);
@@ -558,44 +557,44 @@ public class MaterialInfoController {
                     int len = StringUtils.lengthAsSlogan(title);
                     int left = title.indexOf("{");
                     int right = title.indexOf("}");
-                    if(left >= 0 || right >= 0){
+                    if (left >= 0 || right >= 0) {
                         int times = 0;
                         while (matcher.find()) { //此处find()每次被调用后,会偏移到下一个匹配
                             times++;
-                            if(times>=3){
+                            if (times >= 3) {
                                 result.setCode(500);
                                 result.setMessage("动态词包不合法,词包数量超过2个");
-                                return  result;
+                                return result;
                             }
                             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.setMessage("动态词包不合法,词包不存在或者含有单独的非词包大括号");
-                                return  result;
+                                return result;
                             }
                             creativeWordIdsArray.add(creativeWordPackage.getCreativeWordId());
                             len = len - (right - left) + creativeWordPackage.getMaxWordLen();
                             left = title.indexOf("{");
                             right = title.indexOf("}");
                         }
-                        if(title.contains("{") || title.contains("}")){
+                        if (title.contains("{") || title.contains("}")) {
                             return result.error500("大括号单独出现或大括号中内容不合法");
                         }
-                        slogenInfo.put("creative_word_ids",creativeWordIdsArray.toJSONString());
+                        slogenInfo.put("creative_word_ids", creativeWordIdsArray.toJSONString());
                     }
                     //校验标题长度,长度小于5和大于30的全部过滤
-                    if(len<5 || len>30){
+                    if (len < 5 || len > 30) {
                         result.setCode(500);
                         result.setMessage("文案长度不合法,小于5或大于30");
-                        return  result;
+                        return result;
                     }
                 }
 
                 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);

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java

@@ -81,5 +81,5 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
 
     JSONArray getIdListByProject(Long projectId);
 
-    Map<String, Object> getListByParams(String tagCode, String type, Integer status, List<Long> projectIds, String materialName, String clipId, String code, String startDate, String endDate, String userId, String shotId, String planId, Integer offlineFlag, Integer pageNo, Integer pageSize);
+    Map<String, Object> getListByParams(String tagCode, String type, Integer status, String materialName, List<Long> projectIds, String code, String startDate, String endDate, String userId, String clipId, String shotId, String planId, Integer offlineFlag, Integer pageNo, Integer pageSize);
 }

+ 3 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -773,7 +773,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
 
 
     @Override
-    public Map<String, Object> getListByParams(String tagCode, String type, Integer status, List<Long> projectIds, String materialName, String clipId, String code, String startDate, String endDate, String userId, String shotId, String planId, Integer offlineFlag, Integer pageNo, Integer pageSize) {
+    public Map<String, Object> getListByParams(String tagCode, String type, Integer status, String materialName, List<Long> projectIds, String code, String startDate, String endDate, String userId, String clipId, String shotId, String planId, Integer offlineFlag, Integer pageNo, Integer pageSize) {
         Map<String, Object> result = new HashMap<>();
         PageHelper.startPage(pageNo, pageSize);
 
@@ -863,6 +863,8 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
     public JSONArray getIdListByProject(Long projectId) {
         return materialInfoMapper.getIdListByProject(projectId);
     }
+
+
 }