Browse Source

代码整理

zhoutg 5 years atrás
parent
commit
ee8742b348

+ 121 - 93
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -73,6 +73,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
     DictionaryFacade dictionaryFacade;
     @Autowired
     KnowledgemanServiceClient knowledgemanServiceClient;
+
     /**
      * 根据id删除标签模板
      *
@@ -82,22 +83,22 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
     public Boolean deleteByIdsFac(String ids) {
         //如果是子模板,删除该子模板与其他模板的关联
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        moduleInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
-                .eq("id",ids);
+        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", ids);
         ModuleInfo moduleInfo = this.getOne(moduleInfoQueryWrapper, false);
         String userId = UserUtils.getCurrentPrincipleID();
         Date date = DateUtil.now();
-        if(null != moduleInfo){
-            if("31".equals(moduleInfo.getType())
+        if (null != moduleInfo) {
+            if ("31".equals(moduleInfo.getType())
                     || "32".equals(moduleInfo.getType())
-                    || "322".equals(moduleInfo.getType())){
+                    || "322".equals(moduleInfo.getType())) {
                 UpdateWrapper<ModuleDetail> moduleDetailUpdateWrapper = new UpdateWrapper<>();
                 moduleDetailUpdateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                         .eq("relation_module", moduleInfo.getId())
                         .set("is_deleted", IsDeleteEnum.Y.getKey())
                         .set("modifier", userId)
-                        .set("gmt_modified",date );
-                moduleDetailFacade.update(new ModuleDetail(),moduleDetailUpdateWrapper);
+                        .set("gmt_modified", date);
+                moduleDetailFacade.update(new ModuleDetail(), moduleDetailUpdateWrapper);
             }
         }
         if (StringUtil.isEmpty(ids)) {
@@ -135,7 +136,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         moduleInfo.setType(addModulInfoVO.getType());
         moduleInfo.setModuleType(addModulInfoVO.getModuleType());
         //当添加为科室专用模板或者慢病模板时添加关联id
-        if(addModulInfoVO.getModuleType().intValue() == 1 || addModulInfoVO.getModuleType().intValue() == 2){
+        if (addModulInfoVO.getModuleType().intValue() == 1 || addModulInfoVO.getModuleType().intValue() == 2) {
             moduleInfo.setRelationId(addModulInfoVO.getRelationId());
         }
         this.save(moduleInfo);
@@ -156,10 +157,10 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .eq("id", updateModuleInfoVO.getId())
                 .set("name", updateModuleInfoVO.getName())
                 .set("type", updateModuleInfoVO.getType())
-                .set("module_type",updateModuleInfoVO.getModuleType())
+                .set("module_type", updateModuleInfoVO.getModuleType())
                 .set("modifier", userId)
                 .set("gmt_modified", DateUtil.now());
-        if(updateModuleInfoVO.getRelationId() != null){
+        if (updateModuleInfoVO.getRelationId() != null) {
             moduleInfoUpdateWrapper.set("relation_id", updateModuleInfoVO.getRelationId());
         }
         this.update(new ModuleInfo(), moduleInfoUpdateWrapper);
@@ -178,17 +179,18 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         List<GetQuestionInfoDTO> getQuestionInfoDTOS = new ArrayList<>();
         GetQuestionInfoDTO getQuestionInfoDTO = new GetQuestionInfoDTO();
         //如果是辅检,调用aipt-获取概念信息
-        if(moduleGetQuestionInfoVO.getType().intValue() == QuestionTypeEnum.Pacs.getKey()){
+        if (moduleGetQuestionInfoVO.getType().intValue() == QuestionTypeEnum.Pacs.getKey()) {
             getQuestionInfoDTOS = new ArrayList<>();
             GetConceptPacInfosVO getConceptPacInfosVO = new GetConceptPacInfosVO();
             getConceptPacInfosVO.setInputStr(moduleGetQuestionInfoVO.getTagName());
-            RespDTO<List<ConceptBaseDTO>> conceptBaseDTOS = knowledgemanServiceClient.getConceptPacInfos(getConceptPacInfosVO);
-            RespDTOUtil.respNGDeal(conceptBaseDTOS,"获取辅检标签失败");
-            if(ListUtil.isNotEmpty(moduleGetQuestionInfoVO.getNoIds())){
+            RespDTO<List<ConceptBaseDTO>> conceptBaseDTOS =
+                    knowledgemanServiceClient.getConceptPacInfos(getConceptPacInfosVO);
+            RespDTOUtil.respNGDeal(conceptBaseDTOS, "获取辅检标签失败");
+            if (ListUtil.isNotEmpty(moduleGetQuestionInfoVO.getNoIds())) {
                 Iterator<ConceptBaseDTO> conceptBaseDTOIterator = conceptBaseDTOS.data.iterator();
-                while (conceptBaseDTOIterator.hasNext()){
+                while (conceptBaseDTOIterator.hasNext()) {
                     for (Long notId : moduleGetQuestionInfoVO.getNoIds()) {
-                        if(conceptBaseDTOIterator.next().getConceptId().intValue() == notId.intValue()){
+                        if (conceptBaseDTOIterator.next().getConceptId().intValue() == notId.intValue()) {
                             conceptBaseDTOIterator.remove();
                         }
                     }
@@ -200,7 +202,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 getQuestionInfoDTO.setTagName(conceptBaseDTO.getName());
                 getQuestionInfoDTOS.add(getQuestionInfoDTO);
             }
-        }else {//返回除辅检以外的questionInfo信息
+        } else {//返回除辅检以外的questionInfo信息
             getQuestionInfoDTOS = new ArrayList<>();
             getQuestionInfoDTOS = questionFacade.moduleGetQuestiongInfoByName(moduleGetQuestionInfoVO);
         }
@@ -221,13 +223,13 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         if (getModuleInfoVO.getModuleType() != null) {
             moduleInfoQueryWrapper.eq("module_type", getModuleInfoVO.getModuleType());
         }
-        if(getModuleInfoVO.getType() != null) {
+        if (getModuleInfoVO.getType() != null) {
             moduleInfoQueryWrapper.eq("type", getModuleInfoVO.getType());
         }
-        if(ListUtil.isNotEmpty(getModuleInfoVO.getNoIds())){
+        if (ListUtil.isNotEmpty(getModuleInfoVO.getNoIds())) {
             moduleInfoQueryWrapper.notIn("id", getModuleInfoVO.getNoIds());
         }
-        if(getModuleInfoVO.getRelationId() != null) {
+        if (getModuleInfoVO.getRelationId() != null) {
             moduleInfoQueryWrapper.eq("relation_id", getModuleInfoVO.getRelationId());
         }
         List<ModuleInfo> moduleInfoList = this.list(moduleInfoQueryWrapper);
@@ -276,10 +278,10 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         List<Long> disId = new ArrayList<>();
         for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
             ids.add(moduleInfoListDTO.getModifier());
-            if(moduleInfoListDTO.getModuleType().intValue() == 1){
+            if (moduleInfoListDTO.getModuleType().intValue() == 1) {
                 deptId.add(moduleInfoListDTO.getRelationId());
             }
-            if(moduleInfoListDTO.getModuleType().intValue() == 2){
+            if (moduleInfoListDTO.getModuleType().intValue() == 2) {
                 disId.add(moduleInfoListDTO.getRelationId());
             }
         }
@@ -287,14 +289,16 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
         conceptTypeVO.setType(1);
         RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-        RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
-        Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
+        RespDTOUtil.respNGDeal(deptInfoList, "获取科室信息失败");
+        Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream()
+                .collect(Collectors.toMap(ConceptBaseDTO::getConceptId, conceptBaseDTO -> conceptBaseDTO));
         //获取疾病名称
         conceptTypeVO = new ConceptTypeVO();
         conceptTypeVO.setType(3);
         RespDTO<List<ConceptBaseDTO>> disInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-        RespDTOUtil.respNGDeal(disInfoList,"获取疾病信息失败");
-        Map<Long, ConceptBaseDTO> disInfoMap = disInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
+        RespDTOUtil.respNGDeal(disInfoList, "获取疾病信息失败");
+        Map<Long, ConceptBaseDTO> disInfoMap = disInfoList.data.stream()
+                .collect(Collectors.toMap(ConceptBaseDTO::getConceptId, conceptBaseDTO -> conceptBaseDTO));
         //获取模板类型名称
         QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
         dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -302,32 +306,35 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .eq("return_type", 1)
                 .orderByDesc("order_no");
         List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
-        Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream().collect(Collectors.toMap(DictionaryInfo::getVal,dictionaryInfo -> dictionaryInfo));
-        if(ListUtil.isNotEmpty(moduleInfoDTOIPage.getRecords())){
+        Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream()
+                .collect(Collectors.toMap(DictionaryInfo::getVal, dictionaryInfo -> dictionaryInfo));
+        if (ListUtil.isNotEmpty(moduleInfoDTOIPage.getRecords())) {
             //获取用户信息
             RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
-            RespDTOUtil.respNGDeal(respDTO,"获取用户信息失败");
+            RespDTOUtil.respNGDeal(respDTO, "获取用户信息失败");
             //将用户信息放入实体
             for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
                 moduleInfoListDTO.setUserName(respDTO.data.get(moduleInfoListDTO.getModifier()));
-                if(dictionaryInfoMap.get(moduleInfoListDTO.getType()) != null ){
+                if (dictionaryInfoMap.get(moduleInfoListDTO.getType()) != null) {
                     moduleInfoListDTO.setAscriptionName(dictionaryInfoMap.get(moduleInfoListDTO.getType()).getName());
                 }
-                if(moduleInfoListDTO.getModuleType().intValue() == 1){//根据科室
-                    if(moduleInfoListDTO.getRelationId().intValue() != -1){//判断是不是科室通用子模板
-                        if(null != deptInfoMap.get(moduleInfoListDTO.getRelationId())){
-                            moduleInfoListDTO.setRelationName(deptInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
+                if (moduleInfoListDTO.getModuleType().intValue() == 1) {//根据科室
+                    if (moduleInfoListDTO.getRelationId().intValue() != -1) {//判断是不是科室通用子模板
+                        if (null != deptInfoMap.get(moduleInfoListDTO.getRelationId())) {
+                            moduleInfoListDTO.setRelationName(
+                                    deptInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
                         }
-                    }else {
+                    } else {
                         moduleInfoListDTO.setRelationName(ModuleInfoTypeEnum.Common.getName());
                     }
                 }
-                if(moduleInfoListDTO.getModuleType().intValue() == 2){//根据疾病
-                    if(moduleInfoListDTO.getRelationId().intValue() != -1){//判断是不是疾病通用子模板
-                        if(null != disInfoMap.get(moduleInfoListDTO.getRelationId())){
-                            moduleInfoListDTO.setRelationName(disInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
+                if (moduleInfoListDTO.getModuleType().intValue() == 2) {//根据疾病
+                    if (moduleInfoListDTO.getRelationId().intValue() != -1) {//判断是不是疾病通用子模板
+                        if (null != disInfoMap.get(moduleInfoListDTO.getRelationId())) {
+                            moduleInfoListDTO.setRelationName(
+                                    disInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
                         }
-                    }else {
+                    } else {
                         moduleInfoListDTO.setRelationName(ModuleInfoTypeEnum.Common.getName());
                     }
                 }
@@ -352,51 +359,60 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .eq("module_id", getModuleDetailInfoVO.getModuleId())
                 .orderByAsc("order_no");
         List<ModuleDetail> moduleDetailList = moduleDetailFacade.list(moduleDetailQueryWrapper);
-        List<Long> questionIdList = moduleDetailList.stream().map(moduleDetail -> moduleDetail.getQuestionId()).collect(Collectors.toList());
-        List<Long> moduleIdList = moduleDetailList.stream().map(moduleDetail -> moduleDetail.getRelationModule()).collect(Collectors.toList());
+        List<Long> questionIdList = moduleDetailList.stream().map(moduleDetail -> moduleDetail.getQuestionId())
+                .collect(Collectors.toList());
+        List<Long> moduleIdList = moduleDetailList.stream().map(moduleDetail -> moduleDetail.getRelationModule())
+                .collect(Collectors.toList());
 
-        if(getModuleDetailInfoVO.getType().intValue() == QuestionTypeEnum.Pacs.getKey()){//如果是辅检,调用knowledgeman获取辅检信息
+        if (getModuleDetailInfoVO.getType().intValue() == QuestionTypeEnum.Pacs.getKey()) {
+            //如果是辅检,调用knowledgeman获取辅检信息
             ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
             conceptTypeVO.setType(2);
             RespDTO<List<ConceptBaseDTO>> pacsCeptInfo = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-            Map<Long,ConceptBaseDTO> pacsCeptMap = pacsCeptInfo.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
+            Map<Long, ConceptBaseDTO> pacsCeptMap = pacsCeptInfo.data.stream()
+                    .collect(Collectors.toMap(ConceptBaseDTO::getConceptId, conceptBaseDTO -> conceptBaseDTO));
             //循环给出参赋值
             for (ModuleDetail moduleDetail : moduleDetailList) {
                 getModuleDetailInfoDTO = new GetModuleDetailInfoDTO();
                 BeanUtil.copyProperties(moduleDetail, getModuleDetailInfoDTO);
-                if(pacsCeptMap.get(getModuleDetailInfoDTO.getQuestionId()) != null){
+                if (pacsCeptMap.get(getModuleDetailInfoDTO.getQuestionId()) != null) {
                     getModuleDetailInfoDTO.setTagName(pacsCeptMap.get(getModuleDetailInfoDTO.getQuestionId()).getName());
                 }
-                if(pacsCeptMap.get(getModuleDetailInfoDTO.getQuestionId()) != null) {//如果标准词库中没有该标签,则不显示
+                if (pacsCeptMap.get(getModuleDetailInfoDTO.getQuestionId()) != null) {//如果标准词库中没有该标签,则不显示
                     getModuleDetailInfoDTOList.add(getModuleDetailInfoDTO);
                 }
             }
-        }else {
+        } else {
             //获取标签信息
             QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
             questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                     .in("id", questionIdList);
             List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
-            Map<Long, QuestionInfo> questionInfoMap = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getId, questionInfo -> questionInfo));
+            Map<Long, QuestionInfo> questionInfoMap = questionInfoList.stream()
+                    .collect(Collectors.toMap(QuestionInfo::getId, questionInfo -> questionInfo));
             //获取模板信息
             QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
             questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                     .in("id", moduleIdList);
             List<ModuleInfo> moduleInfoList = this.list(moduleInfoQueryWrapper);
-            Map<Long, ModuleInfo> moduleInfoMap = moduleInfoList.stream().collect(Collectors.toMap(ModuleInfo::getId, moduleInfo -> moduleInfo));
+            Map<Long, ModuleInfo> moduleInfoMap = moduleInfoList.stream()
+                    .collect(Collectors.toMap(ModuleInfo::getId, moduleInfo -> moduleInfo));
             //循环给出参赋值
             for (ModuleDetail moduleDetail : moduleDetailList) {
                 getModuleDetailInfoDTO = new GetModuleDetailInfoDTO();
                 BeanUtil.copyProperties(moduleDetail, getModuleDetailInfoDTO);
                 if (moduleDetail.getQuestionId() != null) {
-                    if(questionInfoMap.get(moduleDetail.getQuestionId()) != null){
+                    if (questionInfoMap.get(moduleDetail.getQuestionId()) != null) {
                         getModuleDetailInfoDTO.setTagName(questionInfoMap.get(moduleDetail.getQuestionId()).getTagName());
                         getModuleDetailInfoDTO.setTagType(questionInfoMap.get(moduleDetail.getQuestionId()).getTagType());
                     }
                 } else {
-                    getModuleDetailInfoDTO.setRelationModuleName(moduleInfoMap.get(moduleDetail.getRelationModule()).getName());
+                    getModuleDetailInfoDTO.setRelationModuleName(
+                            moduleInfoMap.get(moduleDetail.getRelationModule()).getName());
                 }
-                if(questionInfoMap.get(moduleDetail.getQuestionId()) != null || moduleInfoMap.get(moduleDetail.getRelationModule()) != null){//如果标签表中已经删除这条数据,则不再显示该标签
+                if (questionInfoMap.get(moduleDetail.getQuestionId()) != null ||
+                        moduleInfoMap.get(moduleDetail.getRelationModule()) != null) {
+                    //如果标签表中已经删除这条数据,则不再显示该标签
                     getModuleDetailInfoDTOList.add(getModuleDetailInfoDTO);
                 }
             }
@@ -420,24 +436,26 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .eq("id", getModuleInfoOneVO.getModuleId());
         ModuleInfo moduleInfo = this.getOne(moduleInfoQueryWrapper, false);
         //获取模板类型名称
-        if(moduleInfo.getModuleType().intValue() == 1){
+        if (moduleInfo.getModuleType().intValue() == 1) {
             deptId.add(moduleInfo.getRelationId());
         }
-        if(moduleInfo.getModuleType().intValue() == 2){
+        if (moduleInfo.getModuleType().intValue() == 2) {
             disId.add(moduleInfo.getRelationId());
         }
         //获取科室名称
         ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
         conceptTypeVO.setType(1);
         RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-        RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
-        Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
+        RespDTOUtil.respNGDeal(deptInfoList, "获取科室信息失败");
+        Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream()
+                .collect(Collectors.toMap(ConceptBaseDTO::getConceptId, conceptBaseDTO -> conceptBaseDTO));
         //获取疾病名称
         conceptTypeVO = new ConceptTypeVO();
         conceptTypeVO.setType(3);
         RespDTO<List<ConceptBaseDTO>> disInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-        RespDTOUtil.respNGDeal(disInfoList,"获取疾病信息失败");
-        Map<Long, ConceptBaseDTO> disInfoMap = disInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
+        RespDTOUtil.respNGDeal(disInfoList, "获取疾病信息失败");
+        Map<Long, ConceptBaseDTO> disInfoMap = disInfoList.data.stream()
+                .collect(Collectors.toMap(ConceptBaseDTO::getConceptId, conceptBaseDTO -> conceptBaseDTO));
         //获取模板类型
         QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
         dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -445,17 +463,18 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .eq("return_type", 1)
                 .orderByDesc("order_no");
         List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
-        Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream().collect(Collectors.toMap(DictionaryInfo::getVal,dictionaryInfo -> dictionaryInfo));
+        Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream()
+                .collect(Collectors.toMap(DictionaryInfo::getVal, dictionaryInfo -> dictionaryInfo));
         BeanUtil.copyProperties(moduleInfo, getModuleInfoOneDTO);
         getModuleInfoOneDTO.setAscriptionName(dictionaryInfoMap.get(String.valueOf(moduleInfo.getType())).getName());
         getModuleInfoOneDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(getModuleInfoOneDTO.getModuleType().intValue()));
-        if(getModuleInfoOneDTO.getModuleType().intValue() == 1){
-            if(null != deptInfoMap.get(getModuleInfoOneDTO.getRelationId())){
+        if (getModuleInfoOneDTO.getModuleType().intValue() == 1) {
+            if (null != deptInfoMap.get(getModuleInfoOneDTO.getRelationId())) {
                 getModuleInfoOneDTO.setRelationName(deptInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
             }
         }
-        if(getModuleInfoOneDTO.getModuleType().intValue() == 2){
-            if(null != disInfoMap.get(getModuleInfoOneDTO.getRelationId())){
+        if (getModuleInfoOneDTO.getModuleType().intValue() == 2) {
+            if (null != disInfoMap.get(getModuleInfoOneDTO.getRelationId())) {
                 getModuleInfoOneDTO.setRelationName(disInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
             }
         }
@@ -468,11 +487,11 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      * @param getModuleTypeVO
      * @return
      */
-    public List<GetModuleTypeDTO> getModuleType(GetModuleTypeVO getModuleTypeVO){
+    public List<GetModuleTypeDTO> getModuleType(GetModuleTypeVO getModuleTypeVO) {
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
         moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("module_Type", getModuleTypeVO.getModuleType());
-        if(getModuleTypeVO.getRelationId() != null){
+        if (getModuleTypeVO.getRelationId() != null) {
             moduleInfoQueryWrapper.eq("relation_id", getModuleTypeVO.getRelationId());
         }
         List<ModuleInfo> moduleInfos = this.list(moduleInfoQueryWrapper);
@@ -482,20 +501,24 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("group_type", 4)
                 .eq("return_type", 1)
-                .notIn("val",types)
+                .notIn("val", types)
                 .orderByAsc("order_no");
-        if(getModuleTypeVO.getRelationId() != null && getModuleTypeVO.getRelationId().intValue() == -1){//如果是-1时返回所有子模板
-            dictionaryInfoQueryWrapper.in("val","322","31","32");
+        if (getModuleTypeVO.getRelationId() != null && getModuleTypeVO.getRelationId().intValue() == -1) {
+            //如果是-1时返回所有子模板
+            dictionaryInfoQueryWrapper.in("val", "322", "31", "32");
         }
-        if(getModuleTypeVO.getModuleType() != null && getModuleTypeVO.getModuleType().intValue() == 2){//为慢病时过滤现病史空模板、主诉模板、现病史空模板子模板
-            dictionaryInfoQueryWrapper.notIn("val","1","22","31","322");
+        if (getModuleTypeVO.getModuleType() != null && getModuleTypeVO.getModuleType().intValue() == 2) {
+            //为慢病时过滤现病史空模板、主诉模板、现病史空模板子模板
+            dictionaryInfoQueryWrapper.notIn("val", "1", "22", "31", "322");
         }
-        if(getModuleTypeVO.getModuleType() != null && getModuleTypeVO.getModuleType().intValue() == 0 || getModuleTypeVO.getModuleType() != null && getModuleTypeVO.getModuleType().intValue() == 1){//为通用或科室时过滤化验附件诊断
-            dictionaryInfoQueryWrapper.notIn("val","4","5","6","7");
+        if (getModuleTypeVO.getModuleType() != null && getModuleTypeVO.getModuleType().intValue() == 0 ||
+                getModuleTypeVO.getModuleType() != null && getModuleTypeVO.getModuleType().intValue() == 1) {
+            //为通用或科室时过滤化验附件诊断
+            dictionaryInfoQueryWrapper.notIn("val", "4", "5", "6", "7");
         }
         List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
         List<GetModuleTypeDTO> getModuleTypeDTOS = new ArrayList<>();
-        for (DictionaryInfo dictionaryInfo: dictionaryInfoList) {
+        for (DictionaryInfo dictionaryInfo : dictionaryInfoList) {
             GetModuleTypeDTO getModuleTypeDTO = new GetModuleTypeDTO();
             getModuleTypeDTO.setName(dictionaryInfo.getName());
             getModuleTypeDTO.setType(dictionaryInfo.getVal());
@@ -509,45 +532,49 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      *
      * @return
      */
-    public GetAllDeptAndDisInfoDTO getAllDeptAndDisInfo(GetAllDeptAndDisInfoVO getAllDeptAndDisInfoVO){
+    public GetAllDeptAndDisInfoDTO getAllDeptAndDisInfo(GetAllDeptAndDisInfoVO getAllDeptAndDisInfoVO) {
         //获取所有科室
         ConceptTypeVO deptType = new ConceptTypeVO();
         deptType.setType(1);
         RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(deptType);
-        RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
-        if(getAllDeptAndDisInfoVO.getModuleType() != null && getAllDeptAndDisInfoVO.getModuleType().intValue() == 1){//过滤添加过得科室
-            List<ModuleInfo> moduleInfoList = getModuleInfos(getAllDeptAndDisInfoVO.getModuleType(),getAllDeptAndDisInfoVO.getType());
+        RespDTOUtil.respNGDeal(deptInfoList, "获取科室信息失败");
+        if (getAllDeptAndDisInfoVO.getModuleType() != null && getAllDeptAndDisInfoVO.getModuleType().intValue() == 1) {
+            //过滤添加过得科室
+            List<ModuleInfo> moduleInfoList = getModuleInfos(getAllDeptAndDisInfoVO.getModuleType(),
+                    getAllDeptAndDisInfoVO.getType());
             List<Long> deptIds = moduleInfoList.stream().map(ModuleInfo::getRelationId).collect(Collectors.toList());
             Iterator<ConceptBaseDTO> deptIterator = deptInfoList.data.iterator();
             for (Long deptId : deptIds) {
-                while (deptIterator.hasNext()){
+                while (deptIterator.hasNext()) {
                     Long deptConceptId = deptIterator.next().getConceptId();
-                    if(deptId.intValue() == deptConceptId.intValue()){
+                    if (deptId.intValue() == deptConceptId.intValue()) {
                         deptIterator.remove();
                     }
                 }
             }
         }
-        List<DeptDTO> deptDTOS = BeanUtil.listCopyTo(deptInfoList.data,DeptDTO.class);
+        List<DeptDTO> deptDTOS = BeanUtil.listCopyTo(deptInfoList.data, DeptDTO.class);
         //获取所有疾病
         ConceptTypeVO disType = new ConceptTypeVO();
         disType.setType(3);
         RespDTO<List<ConceptBaseDTO>> disTypes = knowledgemanServiceClient.getConceptListByType(disType);
-        RespDTOUtil.respNGDeal(disTypes,"获取疾病信息失败");
-        if(getAllDeptAndDisInfoVO.getModuleType() != null && getAllDeptAndDisInfoVO.getModuleType().intValue() == 2){//过滤添加过得疾病
-            List<ModuleInfo> moduleInfoList = getModuleInfos(getAllDeptAndDisInfoVO.getModuleType(),getAllDeptAndDisInfoVO.getType());
+        RespDTOUtil.respNGDeal(disTypes, "获取疾病信息失败");
+        if (getAllDeptAndDisInfoVO.getModuleType() != null
+                && getAllDeptAndDisInfoVO.getModuleType().intValue() == 2) {//过滤添加过得疾病
+            List<ModuleInfo> moduleInfoList = getModuleInfos(getAllDeptAndDisInfoVO.getModuleType(),
+                    getAllDeptAndDisInfoVO.getType());
             List<Long> disIds = moduleInfoList.stream().map(ModuleInfo::getRelationId).collect(Collectors.toList());
             Iterator<ConceptBaseDTO> disIterator = disTypes.data.iterator();
             for (Long disId : disIds) {
-                while (disIterator.hasNext()){
+                while (disIterator.hasNext()) {
                     Long disConceptId = disIterator.next().getConceptId();
-                    if(disId.intValue() == disConceptId.intValue()){
+                    if (disId.intValue() == disConceptId.intValue()) {
                         disIterator.remove();
                     }
                 }
             }
         }
-        List<DisDTO> disDTOS = BeanUtil.listCopyTo(disTypes.data,DisDTO.class);
+        List<DisDTO> disDTOS = BeanUtil.listCopyTo(disTypes.data, DisDTO.class);
         GetAllDeptAndDisInfoDTO getAllDeptAndDisInfoDTO = new GetAllDeptAndDisInfoDTO();
         getAllDeptAndDisInfoDTO.setDeptDTOS(deptDTOS);
         getAllDeptAndDisInfoDTO.setDisDTOS(disDTOS);
@@ -561,11 +588,11 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      * @param type
      * @return
      */
-    public List<ModuleInfo> getModuleInfos(Long moduleType,String type){
+    public List<ModuleInfo> getModuleInfos(Long moduleType, String type) {
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        moduleInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
-                .eq("module_type",moduleType)
-                .eq("type",type);
+        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("module_type", moduleType)
+                .eq("type", type);
         return this.list(moduleInfoQueryWrapper);
     }
 
@@ -575,7 +602,8 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
      * @param getQuestiongAndModuleRelationsVO
      * @return
      */
-    public GetQuestiongAndModuleRelationsDTO getQuestiongAndModuleRelations(GetQuestiongAndModuleRelationsVO getQuestiongAndModuleRelationsVO){
+    public GetQuestiongAndModuleRelationsDTO getQuestiongAndModuleRelations(
+            GetQuestiongAndModuleRelationsVO getQuestiongAndModuleRelationsVO) {
         StringBuffer errMsg = new StringBuffer();
         List<ModuleDetail> moduleDetails = moduleDetailFacade.list(new QueryWrapper<ModuleDetail>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -585,8 +613,8 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
             List<String> moduleNames = this.list(new QueryWrapper<ModuleInfo>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .in("id", moduleIds))
-                    .stream().map(row ->  row.getName()).collect(Collectors.toList());
-            for (String mouduleName: moduleNames) {
+                    .stream().map(row -> row.getName()).collect(Collectors.toList());
+            for (String mouduleName : moduleNames) {
                 errMsg.append("请先删除关联模板:").append("【" + mouduleName + "】").append("<br/>");
             }
         }

+ 7 - 4
icssman-service/src/main/java/com/diagbot/mapper/QuestionInfoMapper.java

@@ -25,7 +25,8 @@ import java.util.Map;
 public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
 
     /**
-     *  根据参数获取标签信息
+     * 根据参数获取标签信息
+     *
      * @param map 参数
      * @return
      */
@@ -43,7 +44,7 @@ public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
      * @param getQuestionInfoVO
      * @return
      */
-    public List<GetQuestionInfoDTO> getQuestiongInfoByName(GetQuestionInfoVO  getQuestionInfoVO);
+    public List<GetQuestionInfoDTO> getQuestiongInfoByName(GetQuestionInfoVO getQuestionInfoVO);
 
     /**
      * 根据名称获取标签信息
@@ -55,6 +56,7 @@ public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
 
     /**
      * 根据科室id获取标签信息
+     *
      * @param getQuestionUsualByDeptVO
      * @return
      */
@@ -63,6 +65,7 @@ public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
 
     /**
      * 获取特殊标签,同伴|无
+     *
      * @param map
      * @return
      */
@@ -87,9 +90,9 @@ public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
     public IPage<QuestionPageDTO> getList(QuestionPageVO questionPageVO);
 
 
-
     /**
-     *  根据questionMapping获取标签信息
+     * 根据questionMapping获取标签信息
+     *
      * @param map 参数
      * @return
      */

+ 2 - 2
icssman-service/src/main/java/com/diagbot/vo/GetQuestionInfoVO.java

@@ -22,7 +22,7 @@ public class GetQuestionInfoVO {
     /**
      * 科室id
      */
-    @NotNull(message="科室id不能为空")
+    @NotNull(message = "科室id不能为空")
     private String deptId;
 
     /**
@@ -33,6 +33,6 @@ public class GetQuestionInfoVO {
     /**
      * 归属类型
      */
-    @NotNull(message="归属类型不能为空")
+    @NotNull(message = "归属类型不能为空")
     private Integer type;
 }