Parcourir la source

素材标签逻辑修改

syh il y a 4 ans
Parent
commit
a4350ede62

+ 7 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TagInfoController.java

@@ -64,6 +64,11 @@ public class TagInfoController {
 	public Result<TagInfo> add(@RequestBody TagInfo tagInfo) {
 		Result<TagInfo> result = new Result<>();
 		try {
+			TagInfo getTag = tagInfoService.getByTagCode(tagInfo.getTagCode());
+			if(null!=getTag){
+				result.error500("标签编码已存在");
+				return result;
+			}
 			LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 			tagInfo.setDelFlag(0);
 			if(null == tagInfo.getStatus()){
@@ -79,8 +84,8 @@ public class TagInfoController {
 					return result;
 				}
 				String tagCode = parentTag.getTagCode()+tagInfo.getTagCode();
-				TagInfo getTag = tagInfoService.getByTagCode(tagCode);
-				if(null!=getTag){
+				TagInfo getTag2 = tagInfoService.getByTagCode(tagCode);
+				if(null!=getTag2){
 					result.error500("标签编码已存在");
 					return result;
 				}