소스 검색

二期模板维护获取模板信息

wangyu 6 년 전
부모
커밋
ef68abc327

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

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2019/3/28 14:44
+ */
+@Getter
+@Setter
+public class GetModuleTypeDTO {
+    //类型
+    private Integer type;
+    //类型名称
+    private String name;
+
+}

+ 31 - 1
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.UserServiceClient;
 import com.diagbot.dto.GetModuleDetailInfoDTO;
 import com.diagbot.dto.GetModuleInfoOneDTO;
+import com.diagbot.dto.GetModuleTypeDTO;
 import com.diagbot.dto.GetQuestionInfoDTO;
 import com.diagbot.dto.ModuleInfoDTO;
 import com.diagbot.dto.ModuleInfoListDTO;
@@ -29,6 +30,7 @@ import com.diagbot.vo.AddModuleInfoVO;
 import com.diagbot.vo.GetModuleDetailInfoVO;
 import com.diagbot.vo.GetModuleInfoOneVO;
 import com.diagbot.vo.GetModuleInfoVO;
+import com.diagbot.vo.GetModuleTypeVO;
 import com.diagbot.vo.ModuleGetQuestionInfoVO;
 import com.diagbot.vo.UpdateModuleInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -376,5 +378,33 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         return getModuleInfoOneDTO;
     }
 
-
+    /**
+     * 获取模板类型(从主诉到诊断)
+     *
+     * @param getModuleTypeVO
+     * @return
+     */
+    public List<GetModuleTypeDTO> getModuleType(GetModuleTypeVO getModuleTypeVO){
+        QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
+        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("module_Type", getModuleTypeVO.getModuleType());
+        List<ModuleInfo> moduleInfos = this.list(moduleInfoQueryWrapper);
+        List<Integer> types = moduleInfos.stream().map(moduleInfo -> moduleInfo.getType()).collect(Collectors.toList());
+        //获取模板类型
+        QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
+        dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("group_type", 4)
+                .eq("return_type", 1)
+                .notIn("val",types)
+                .orderByAsc("order_no");
+        List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
+        List<GetModuleTypeDTO> getModuleTypeDTOS = new ArrayList<>();
+        for (DictionaryInfo dictionaryInfo: dictionaryInfoList) {
+            GetModuleTypeDTO getModuleTypeDTO = new GetModuleTypeDTO();
+            getModuleTypeDTO.setName(dictionaryInfo.getName());
+            getModuleTypeDTO.setType(Integer.parseInt(dictionaryInfo.getVal()));
+            getModuleTypeDTOS.add(getModuleTypeDTO);
+        }
+        return getModuleTypeDTOS;
+    }
 }

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

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2019/3/28 14:46
+ */
+@Getter
+@Setter
+public class GetModuleTypeVO {
+    @NotNull(message = "请输入moduleType")
+    private Long moduleType;
+}

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

@@ -8,6 +8,7 @@ import com.diagbot.dto.GetModuleInfoOneDTO;
 import com.diagbot.dto.GetQuestionInfoDTO;
 import com.diagbot.dto.ModuleInfoDTO;
 import com.diagbot.dto.ModuleInfoListDTO;
+import com.diagbot.dto.GetModuleTypeDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.ModuleInfoFacade;
 import com.diagbot.vo.AddModuleInfoVO;
@@ -15,6 +16,7 @@ import com.diagbot.vo.DeleteModuleVO;
 import com.diagbot.vo.GetModuleDetailInfoVO;
 import com.diagbot.vo.GetModuleInfoOneVO;
 import com.diagbot.vo.GetModuleInfoVO;
+import com.diagbot.vo.GetModuleTypeVO;
 import com.diagbot.vo.ModuleGetQuestionInfoVO;
 import com.diagbot.vo.UpdateModuleInfoVO;
 import io.swagger.annotations.Api;
@@ -103,8 +105,8 @@ public class ModuleInfoController {
         return RespDTO.onSuc(date);
     }
 
-    @ApiOperation(value = "【二期】获取模板信息(作为子模板使用时传入type)[by:wangyu]",
-            notes = "type: 模板类型,1:主诉模板 2:现病史模板 3:现病史空模板 4 : 其他史模板 5:嵌套模板 6:慢病模板<br>" +
+    @ApiOperation(value = "【二期】获取模板信息(作为子模板使用时传入moduleType)[by:wangyu]",
+            notes = "moduleType: 模板类型,0.通用 1.根据科室划分 2.慢病 3.子模板<br>" +
                     "<br>")
     @PostMapping("/getModuleInfo")
     @SysLogger("getModuleInfo")
@@ -143,4 +145,14 @@ public class ModuleInfoController {
         return RespDTO.onSuc(date);
     }
 
+    @ApiOperation(value = "【二期】获取模板Type[主诉到诊断][by:wangyu]",
+            notes = "moduleType: 模板mouduleType,必填<br>" +
+                    "")
+    @PostMapping("/getModuleType")
+    @SysLogger("getModuleType")
+    public RespDTO<List<GetModuleTypeDTO>> getModuleType(@Valid @RequestBody GetModuleTypeVO getModuleTypeVO) {
+        List<GetModuleTypeDTO> date = moduleInfoFacade.getModuleType(getModuleTypeVO);
+        return RespDTO.onSuc(date);
+    }
+
 }