浏览代码

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

gaodm 6 年之前
父节点
当前提交
cb885cd39f
共有 1 个文件被更改,包括 21 次插入5 次删除
  1. 21 5
      icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

+ 21 - 5
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -185,7 +185,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         //获取模板信息
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
         moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("relation_id", "0");
+                .eq("relation_id", "-1");
         if (getModuleInfoVO.getModuleType() != null) {
             moduleInfoQueryWrapper.eq("module_type", getModuleInfoVO.getModuleType());
         }
@@ -284,11 +284,19 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 if(moduleInfoListDTO.getModuleType().intValue() != 3){
                     moduleInfoListDTO.setAscriptionName(dictionaryInfoMap.get(moduleInfoListDTO.getType()).getName());
                 }
-                if(moduleInfoListDTO.getModuleType().intValue() == 1){
-                    moduleInfoListDTO.setRelationName(deptInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
+                if(moduleInfoListDTO.getModuleType().intValue() == 1){//根据科室
+                    if(moduleInfoListDTO.getRelationId().intValue() != -1){//判断是不是科室通用子模板
+                        moduleInfoListDTO.setRelationName(deptInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
+                    }else {
+                        moduleInfoListDTO.setRelationName(ModuleInfoTypeEnum.Common.getName());
+                    }
                 }
-                if(moduleInfoListDTO.getModuleType().intValue() == 2){
-                    moduleInfoListDTO.setRelationName(questionInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
+                if(moduleInfoListDTO.getModuleType().intValue() == 2){//根据疾病
+                    if(moduleInfoListDTO.getRelationId().intValue() != -1){//判断是不是科室通用子模板
+                        moduleInfoListDTO.setRelationName(questionInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
+                    }else {
+                        moduleInfoListDTO.setRelationName(ModuleInfoTypeEnum.Common.getName());
+                    }
                 }
                 moduleInfoListDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(moduleInfoListDTO.getModuleType().intValue()));
             }
@@ -413,6 +421,9 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .eq("return_type", 1)
                 .notIn("val",types)
                 .orderByAsc("order_no");
+        if(getModuleTypeVO.getRelationId() != null && getModuleTypeVO.getRelationId().intValue() == -1){//如果是-1时返回所有子模板
+            dictionaryInfoQueryWrapper.in("val","322","31","32");
+        }
         List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
         List<GetModuleTypeDTO> getModuleTypeDTOS = new ArrayList<>();
         for (DictionaryInfo dictionaryInfo: dictionaryInfoList) {
@@ -424,6 +435,11 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         return getModuleTypeDTOS;
     }
 
+    /**
+     * 获取所有的科室和疾病信息
+     *
+     * @return
+     */
     public GetAllDeptAndDisInfoDTO getAllDeptAndDisInfo(){
         //获取所有科室
         QueryWrapper<DeptInfo> deptInfoQueryWrapper = new QueryWrapper<>();