Forráskód Böngészése

Merge remote-tracking branch 'origin/dev/icssNCD' into dev/icssNCD

wangyu 6 éve
szülő
commit
175907b069

+ 1 - 0
icss-service/src/main/java/com/diagbot/dto/ModuleDetailDTO.java

@@ -25,5 +25,6 @@ public class ModuleDetailDTO extends QuestionDTO implements Serializable {
     private Long questionId; //questionId
     private String flag; //特殊标识
     private Long relationModule; //关联模板
+    private String relationModuleName;//关联模板名称
 
 }

+ 11 - 6
icss-service/src/main/java/com/diagbot/facade/ModuleFacade.java

@@ -49,9 +49,9 @@ public class ModuleFacade extends ModuleInfoServiceImpl {
         Boolean isDefault = false;
         if(moduleVO.getMouduleType().intValue() == 1){
             //根据科室筛选如果没有,返回通用模板
-            List<ModuleInfo> moduleInfoByDept = getModuleInfoByDisType(moduleVO.getMouduleType(),moduleVO.getRelationId());
-            if(ListUtil.isNotEmpty(moduleInfoByDept)){
-                ids = moduleInfoByDept.stream()
+            list = getModuleInfoByDisType(moduleVO.getMouduleType(),moduleVO.getRelationId());
+            if(ListUtil.isNotEmpty(list)){
+                ids = list.stream()
                         .map(moduleInfo -> moduleInfo.getId())
                         .collect(Collectors.toList());
             }else {
@@ -59,9 +59,9 @@ public class ModuleFacade extends ModuleInfoServiceImpl {
             }
         }else if(moduleVO.getMouduleType().intValue() == 2){
             //根据慢病筛选如果没有返回通用模板
-            List<ModuleInfo> moduleInfoByDis = getModuleInfoByDisType(moduleVO.getMouduleType(),moduleVO.getRelationId());
-            if(ListUtil.isNotEmpty(moduleInfoByDis)){
-                ids = moduleInfoByDis.stream()
+            list = getModuleInfoByDisType(moduleVO.getMouduleType(),moduleVO.getRelationId());
+            if(ListUtil.isNotEmpty(list)){
+                ids = list.stream()
                         .map(moduleDeptMapping -> moduleDeptMapping.getId())
                         .collect(Collectors.toList());
             }else {
@@ -80,6 +80,8 @@ public class ModuleFacade extends ModuleInfoServiceImpl {
                     .collect(Collectors.toList());
         }
         data = BeanUtil.listCopyTo(list, ModuleInfoDTO.class);
+        Map<Long,ModuleInfo> moduleInfoMap
+                = list.stream().collect(Collectors.toMap(ModuleInfo::getId,moduleInfo -> moduleInfo));
         Map<Long, List<ModuleDetail>> moduleDetailMap = new LinkedHashMap<>();
         //取到所有模板明细
         if (ListUtil.isNotEmpty(ids)) {
@@ -106,6 +108,9 @@ public class ModuleFacade extends ModuleInfoServiceImpl {
                         QuestionDTO questionDTO = questionFacade.getById(questionVO);
                         BeanUtil.copyProperties(questionDTO, detailDTO);
                     }
+                    if(null != detailDTO.getRelationModule()){
+                        detailDTO.setRelationModuleName(moduleInfoMap.get(detailDTO.getRelationModule()).getName());
+                    }
                 }
                 bean.setModuleDetailDTOList(moduleDetailDTOList);
             }