Sfoglia il codice sorgente

删除标签,标签关联父级提示

wangyu 6 anni fa
parent
commit
d58e63e320

+ 15 - 1
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -23,6 +23,7 @@ import com.diagbot.entity.ModuleInfo;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.ModuleInfoTypeEnum;
+import com.diagbot.enums.TagTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.ModuleInfoServiceImpl;
@@ -514,8 +515,21 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 errMsg.append("该标签已关联").append("【" + mouduleName + "】").append("<br/>");
             }
         }
+        StringBuffer titalMsg = new StringBuffer();
+        StringBuffer questionMsg = new StringBuffer();
+        List<QuestionInfo> info = questionFacade.getParentQuestion(getQuestiongAndModuleRelationsVO.getQuestionId());
+        for (QuestionInfo bean : info) {
+            if (bean.getTagType() != null && bean.getTagType() == TagTypeEnum.T10.getKey()) {
+                List<QuestionInfo> info2 = questionFacade.getParentQuestion(bean.getId());
+                List<String> msg = info2.stream().map(row -> "【" + row.getTagName() + "】").collect(Collectors.toList());
+                questionMsg.append(String.join("", msg));
+            } else {
+                questionMsg.append("【"+bean.getTagName()+"】");
+            }
+        }
+        titalMsg.append("该标签已关联父级:").append(questionMsg).append("<br/>").append(errMsg);
         GetQuestiongAndModuleRelationsDTO getQuestiongAndModuleRelationsDTO = new GetQuestiongAndModuleRelationsDTO();
-        getQuestiongAndModuleRelationsDTO.setRelationInfos(errMsg.append("是否删除?"));
+        getQuestiongAndModuleRelationsDTO.setRelationInfos(titalMsg.append("是否删除?"));
         return getQuestiongAndModuleRelationsDTO;
     }
 

+ 2 - 2
icssman-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -457,7 +457,7 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
         String person = UserUtils.getCurrentPrincipleID();
         for (String id : idList) {
             // 查询映射关系中是否存在父级
-            List<QuestionInfo> info = this.getParentQuestion(Long.parseLong(id));
+           /* List<QuestionInfo> info = this.getParentQuestion(Long.parseLong(id));
             for (QuestionInfo bean : info) {
                 if (bean.getTagType() != null && bean.getTagType() == TagTypeEnum.T10.getKey()) {
                     List<QuestionInfo> info2 = this.getParentQuestion(bean.getId());
@@ -469,7 +469,7 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
             }
             if (StringUtil.isNotEmpty(errMsg.toString())) {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请先删除标签的关联:" + errMsg);
-            }
+            }*/
 
             // 查询模板中是否存在
             /*List<ModuleDetail> moduleDetails = moduleDetailFacade.list(new QueryWrapper<ModuleDetail>()

+ 1 - 1
icssman-service/src/main/java/com/diagbot/web/ModuleInfoController.java

@@ -163,7 +163,7 @@ public class ModuleInfoController {
             notes = "")
     @PostMapping("/getAllDeptAndDisInfo")
     @SysLogger("getAllDeptAndDisInfo")
-    public RespDTO<GetAllDeptAndDisInfoDTO> getAllDeptAndDisInfo(GetAllDeptAndDisInfoVO getAllDeptAndDisInfoVO) {
+    public RespDTO<GetAllDeptAndDisInfoDTO> getAllDeptAndDisInfo(@RequestBody GetAllDeptAndDisInfoVO getAllDeptAndDisInfoVO) {
         GetAllDeptAndDisInfoDTO date = moduleInfoFacade.getAllDeptAndDisInfo(getAllDeptAndDisInfoVO);
         return RespDTO.onSuc(date);
     }