wangyu преди 6 години
родител
ревизия
58ef4e9517

+ 0 - 54
icssman-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java

@@ -44,8 +44,6 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
     private UserServiceClient userServiceClient;
     @Autowired
     private QuestionUsualFacade questionUsualFacade;
-    @Autowired
-    private QuestionFacade questionFacade;
     /**
      * 添加科室信息
      *
@@ -182,58 +180,6 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
                 .notIn("id",deptIds);
         List<DeptInfo> deptInfoList = this.list(queryWrapper);
         List<GetDeptNameDTO> getDeptNameDTOS = BeanUtil.listCopyTo(deptInfoList,GetDeptNameDTO.class);
-        /*//查询所有科室
-        QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey());
-        List<DeptInfo> deptInfoList = this.list(queryWrapper);
-        List<DeptInfoDTO> deptInfoDTOList = BeanUtil.listCopyTo(deptInfoList,DeptInfoDTO.class);
-        List<Long> deptIds = new ArrayList<>();
-        deptInfoList.stream().forEach(deptInfoDTO -> deptIds.add(deptInfoDTO.getId()));
-        //在常用标签中查询所有相关标签
-        GetQuestionUsualAndTypeVO getQuestionUsualAndTypeVO = new GetQuestionUsualAndTypeVO();
-        getQuestionUsualAndTypeVO.setDeptIds(deptIds);
-        List<GetQuestionUsualAndTypeDTO> getQuestionUsualAndTypeDTOS = questionUsualFacade.getQuestionUsualByDeptIds(getQuestionUsualAndTypeVO);
-        List<GetQuestionUsualAndTypeDTO> questionUsuals = new ArrayList<>();
-        List<DeptInfoDTO> deptInfoDTOS = new ArrayList<>();
-        List<QuestionTypeDTO> questionTypeDTOS = new ArrayList<>();
-        QuestionTypeDTO questionTypeDTO = null;
-        //将标签明细放入科室信息中,并排除类型
-        for (DeptInfoDTO deptInfoDTO : deptInfoDTOList) {
-            questionUsuals = new ArrayList<>();
-            questionTypeDTOS = new ArrayList<>();
-            for (GetQuestionUsualAndTypeDTO getQuestionUsualAndTypeDTO : getQuestionUsualAndTypeDTOS) {
-                    if (deptInfoDTO.getId().intValue() == getQuestionUsualAndTypeDTO.getDeptId().intValue()){
-                        questionUsuals.add(getQuestionUsualAndTypeDTO);
-                    }
-            }
-            deptInfoDTO.setQuestionUsuals(questionUsuals);
-            List<Integer> questionType = new ArrayList<>();
-            deptInfoDTO.getQuestionUsuals().forEach(getQuestionUsualAndTypeDTO -> questionType.add(getQuestionUsualAndTypeDTO.getType()));
-            //对类型进行筛选,已经添加过得类型不再显示
-            if(!questionType.contains(QuestionTypeEnum.Symptom.getKey())){
-                questionTypeDTO = new QuestionTypeDTO();
-                questionTypeDTO.setType(QuestionTypeEnum.Symptom.getKey());
-                questionTypeDTO.setTypeName(QuestionTypeEnum.getName(QuestionTypeEnum.Symptom.getKey()));
-                questionTypeDTOS.add(questionTypeDTO);
-            }
-            if(!questionType.contains(QuestionTypeEnum.Lis.getKey())){
-                questionTypeDTO = new QuestionTypeDTO();
-                questionTypeDTO.setType(QuestionTypeEnum.Lis.getKey());
-                questionTypeDTO.setTypeName(QuestionTypeEnum.getName(QuestionTypeEnum.Lis.getKey()));
-                questionTypeDTOS.add(questionTypeDTO);
-            }
-            if(!questionType.contains(QuestionTypeEnum.Pacs.getKey())){
-                questionTypeDTO = new QuestionTypeDTO();
-                questionTypeDTO.setType(QuestionTypeEnum.Pacs.getKey());
-                questionTypeDTO.setTypeName(QuestionTypeEnum.getName(QuestionTypeEnum.Pacs.getKey()));
-                questionTypeDTOS.add(questionTypeDTO);
-            }
-            deptInfoDTO.setTypeDTOList(questionTypeDTOS);
-            //对总体类型进行筛选,若该科室已经添加过疾病,化验,复检的常用标签,则该科室不再显示
-            if(ListUtil.isNotEmpty(deptInfoDTO.getTypeDTOList())){
-                deptInfoDTOS.add(deptInfoDTO);
-            }
-        }*/
         return getDeptNameDTOS;
     }
 

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

@@ -319,14 +319,18 @@ 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());
         //获取标签信息
         QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
-        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        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));
         //获取模板信息
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        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));
         //循环给出参赋值