浏览代码

二期模板类型获取

wangyu 6 年之前
父节点
当前提交
1eaad20c4a

+ 1 - 1
docs/006.20190304慢病基于icss增量脚本/init_icss_NCD.sql

@@ -260,4 +260,4 @@ INSERT INTO `icss_index_config` VALUES ('5', 'N', '1970-01-01 12:00:00', '1970-0
 --模板信息字段修改
 alter table icss_module_info change  column disease module_type bigint(20) COMMENT '(0.通用 1.根据科室划分 2.慢病)';
 alter table icss_module_info add  column relation_id bigint(20) NOT NULL DEFAULT '0' COMMENT '关联id';
-ALTER TABLE `icss_module_info` MODIFY COLUMN `type`  int(11) NOT NULL DEFAULT 0 COMMENT '类型(1.主诉 2.现病史 3.其他史 4.查体 5.化验 6.辅检 7.诊断 8.医嘱 22.现病史空模板 30.通用子模板 31.主诉子模板 32.现病史子模板)' AFTER `name`;
+ALTER TABLE `icss_module_info` MODIFY COLUMN `type`  varchar(20) NOT NULL DEFAULT 0 COMMENT '类型(1.主诉 2.现病史 3.其他史 4.查体 5.化验 6.辅检 7.诊断 8.医嘱 22.现病史空模板 31.主诉子模板 32.现病史子模板 322.现病史空模板子模板)' AFTER `name`;

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

@@ -26,7 +26,7 @@ public class ModuleInfoDTO implements Serializable {
     private Long id; //主键
     private String name;//名称
     private List<ModuleDetailDTO> moduleDetailDTOList = new ArrayList<>(); //模板明细表
-    private Integer type;//模板类型
+    private String type;//模板类型
     private String remark;
 
 }

+ 1 - 1
icss-service/src/main/java/com/diagbot/entity/ModuleInfo.java

@@ -63,7 +63,7 @@ public class ModuleInfo implements Serializable {
     /**
      * 类型
      */
-    private Integer type;
+    private String type;
 
     /**
      * 慢病

+ 1 - 1
icssman-service/src/main/java/com/diagbot/dto/GetModuleTypeDTO.java

@@ -12,7 +12,7 @@ import lombok.Setter;
 @Setter
 public class GetModuleTypeDTO {
     //类型
-    private Integer type;
+    private String type;
     //类型名称
     private String name;
 

+ 1 - 1
icssman-service/src/main/java/com/diagbot/entity/ModuleInfo.java

@@ -63,7 +63,7 @@ public class ModuleInfo implements Serializable {
     /**
      * 类型
      */
-    private Integer type;
+    private String type;
 
     /**
      * 慢病

+ 1 - 2
icssman-service/src/main/java/com/diagbot/enums/ModuleInfoTypeEnum.java

@@ -11,8 +11,7 @@ import lombok.Setter;
 public enum ModuleInfoTypeEnum implements KeyedNamed {
     Common(0, "通用"),
     ByDept(1, "根据科室划分"),
-    ByDis(2, "慢病"),
-    Nesting(3, "子模板");
+    ByDis(2, "慢病");
     @Setter
     private Integer key;
 

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

@@ -184,13 +184,20 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
     public List<ModuleInfoDTO> getModuleInfo(GetModuleInfoVO getModuleInfoVO) {
         //获取模板信息
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("relation_id", "0");
         if (getModuleInfoVO.getModuleType() != null) {
             moduleInfoQueryWrapper.eq("module_type", getModuleInfoVO.getModuleType());
         }
+        if(getModuleInfoVO.getType() != null) {
+            moduleInfoQueryWrapper.eq("type", getModuleInfoVO.getType());
+        }
         if(ListUtil.isNotEmpty(getModuleInfoVO.getNoIds())){
             moduleInfoQueryWrapper.notIn("id", getModuleInfoVO.getNoIds());
         }
+        if(getModuleInfoVO.getRelationId() != null) {
+            moduleInfoQueryWrapper.eq("relation_id", getModuleInfoVO.getRelationId());
+        }
         List<ModuleInfo> moduleInfoList = this.list(moduleInfoQueryWrapper);
         List<Long> moduleIdList = moduleInfoList.stream().map(m -> m.getId()).collect(Collectors.toList());
         //获取模板明细信息
@@ -275,7 +282,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
             for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
                 moduleInfoListDTO.setUserName(respDTO.data.get(moduleInfoListDTO.getModifier()));
                 if(moduleInfoListDTO.getModuleType().intValue() != 3){
-                    moduleInfoListDTO.setAscriptionName(dictionaryInfoMap.get(String.valueOf(moduleInfoListDTO.getType().intValue())).getName());
+                    moduleInfoListDTO.setAscriptionName(dictionaryInfoMap.get(moduleInfoListDTO.getType()).getName());
                 }
                 if(moduleInfoListDTO.getModuleType().intValue() == 1){
                     moduleInfoListDTO.setRelationName(deptInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
@@ -393,10 +400,12 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
     public List<GetModuleTypeDTO> getModuleType(GetModuleTypeVO getModuleTypeVO){
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
         moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("module_Type", getModuleTypeVO.getModuleType())
-                .eq("relation_id", getModuleTypeVO.getRelationId());
+                .eq("module_Type", getModuleTypeVO.getModuleType());
+        if(getModuleTypeVO.getRelationId() != null){
+            moduleInfoQueryWrapper.eq("relation_id", getModuleTypeVO.getRelationId());
+        }
         List<ModuleInfo> moduleInfos = this.list(moduleInfoQueryWrapper);
-        List<Integer> types = moduleInfos.stream().map(moduleInfo -> moduleInfo.getType()).collect(Collectors.toList());
+        List<String> types = moduleInfos.stream().map(moduleInfo -> moduleInfo.getType()).collect(Collectors.toList());
         //获取模板类型
         QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
         dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -409,7 +418,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         for (DictionaryInfo dictionaryInfo: dictionaryInfoList) {
             GetModuleTypeDTO getModuleTypeDTO = new GetModuleTypeDTO();
             getModuleTypeDTO.setName(dictionaryInfo.getName());
-            getModuleTypeDTO.setType(Integer.parseInt(dictionaryInfo.getVal()));
+            getModuleTypeDTO.setType(dictionaryInfo.getVal());
             getModuleTypeDTOS.add(getModuleTypeDTO);
         }
         return getModuleTypeDTOS;

+ 0 - 2
icssman-service/src/main/java/com/diagbot/service/impl/EnumsDataServiceImpl.java

@@ -3,7 +3,6 @@ package com.diagbot.service.impl;
 import com.diagbot.enums.DisclaimerCodeEnum;
 import com.diagbot.enums.IntroducePositionEnum;
 import com.diagbot.enums.ModuleInfoTypeEnum;
-import com.diagbot.enums.ModuleTypeEnum;
 import com.diagbot.enums.QuestionTypeEnum;
 import com.diagbot.enums.QuestionUsualTypeEnum;
 import com.diagbot.service.EnumsDataService;
@@ -32,7 +31,6 @@ public class EnumsDataServiceImpl implements EnumsDataService {
                 .addEnums("questionTypeEnum", QuestionTypeEnum.values())
                 .addEnums("introducePositionEnum", IntroducePositionEnum.values())
                 .addEnums("disclaimerCodeEnum", DisclaimerCodeEnum.values())
-                .addEnums("moduleTypeEnum", ModuleTypeEnum.values())
                 .addEnums("questionUsualTypeEnum", QuestionUsualTypeEnum.values())
                 .addEnums("dataSourcesEnums", QuestionUsualTypeEnum.values())
                 .addEnums("moduleInfoTypeEnum", ModuleInfoTypeEnum.values())

+ 1 - 1
icssman-service/src/main/java/com/diagbot/vo/AddModuleInfoVO.java

@@ -17,7 +17,7 @@ public class AddModuleInfoVO {
     @NotNull(message="模板名称不能为空")
     private String name;
     @NotNull(message="模板归属不能为空")
-    private int type;
+    private String type;
     //特殊标签归属类型
     private Integer textType;
     //标签id

+ 1 - 1
icssman-service/src/main/java/com/diagbot/vo/GetModuleInfoVO.java

@@ -15,7 +15,7 @@ import java.util.List;
 @Setter
 public class GetModuleInfoVO extends Page {
     //模板归属
-    private Integer type;
+    private String type;
     //模板类型
     private Integer moduleType;
     //关联id

+ 0 - 1
icssman-service/src/main/java/com/diagbot/vo/GetModuleTypeVO.java

@@ -15,6 +15,5 @@ import javax.validation.constraints.NotNull;
 public class GetModuleTypeVO {
     @NotNull(message = "请输入moduleType")
     private Long moduleType;
-    @NotNull(message = "请输入relationId")
     private Long relationId;
 }

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

@@ -146,7 +146,7 @@ public class ModuleInfoController {
         return RespDTO.onSuc(date);
     }
 
-    @ApiOperation(value = "2期-获取模板Type[主诉到诊断][by:wangyu]",
+    @ApiOperation(value = "2期-获取模板Type[主诉到诊断](修改获取类型用)[by:wangyu]",
             notes = "moduleType: 模板mouduleType,必填<br>" +
                     "")
     @PostMapping("/getModuleType")
@@ -156,7 +156,7 @@ public class ModuleInfoController {
         return RespDTO.onSuc(date);
     }
 
-    @ApiOperation(value = "2期-获取科室和疾病所有信息[by:wangyu]",
+    @ApiOperation(value = "2期-获取科室和疾病所有信息(主页面下拉用)[by:wangyu]",
             notes = "")
     @PostMapping("/getAllDeptAndDisInfo")
     @SysLogger("getAllDeptAndDisInfo")