Browse Source

智能预问诊模板维护

wangyu 6 năm trước cách đây
mục cha
commit
16c394db94

+ 4 - 0
precman-service/src/main/java/com/diagbot/dto/GetModuleInfoOneDTO.java

@@ -3,6 +3,8 @@ package com.diagbot.dto;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.List;
+
 /**
  * @Description:
  * @author: wangyu
@@ -27,4 +29,6 @@ public class GetModuleInfoOneDTO {
     private Long relationId;
     //关联名称
     private String relationName;
+    //模板明细
+    private List<GetModuleDetailInfoDTO> moduleDetial;
 }

+ 0 - 16
precman-service/src/main/java/com/diagbot/dto/GetQuestiongAndModuleRelationsDTO.java

@@ -1,16 +0,0 @@
-package com.diagbot.dto;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description:
- * @author: wangyu
- * @time: 2019/4/25 10:21
- */
-@Getter
-@Setter
-public class GetQuestiongAndModuleRelationsDTO {
-    //返回关联信息
-    private StringBuffer relationInfos;
-}

+ 36 - 102
precman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -11,7 +11,6 @@ import com.diagbot.dto.GetAllDeptAndDisInfoDTO;
 import com.diagbot.dto.GetModuleDetailInfoDTO;
 import com.diagbot.dto.GetModuleInfoOneDTO;
 import com.diagbot.dto.GetModuleTypeDTO;
-import com.diagbot.dto.GetQuestiongAndModuleRelationsDTO;
 import com.diagbot.dto.ModuleInfoListDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.ModuleDetail;
@@ -20,8 +19,6 @@ import com.diagbot.entity.QuestionInfo;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.ModuleInfoTypeEnum;
 import com.diagbot.enums.ModuleTypeEnum;
-import com.diagbot.enums.QuestionTypeEnum;
-import com.diagbot.enums.TagTypeEnum;
 import com.diagbot.service.impl.ModuleInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
@@ -33,11 +30,9 @@ import com.diagbot.util.UserUtils;
 import com.diagbot.vo.AddModuleInfoVO;
 import com.diagbot.vo.ConceptTypeVO;
 import com.diagbot.vo.GetAllDeptAndDisInfoVO;
-import com.diagbot.vo.GetModuleDetailInfoVO;
 import com.diagbot.vo.GetModuleInfoOneVO;
 import com.diagbot.vo.GetModuleInfoVO;
 import com.diagbot.vo.GetModuleTypeVO;
-import com.diagbot.vo.GetQuestiongAndModuleRelationsVO;
 import com.diagbot.vo.UpdateModuleInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -155,7 +150,8 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .set("type", updateModuleInfoVO.getType())
                 .set("module_type",updateModuleInfoVO.getModuleType())
                 .set("modifier", userId)
-                .set("gmt_modified", DateUtil.now());
+                .set("gmt_modified", DateUtil.now())
+                .set("remark",updateModuleInfoVO.getRemark());
         if(updateModuleInfoVO.getRelationId() != null){
             moduleInfoUpdateWrapper.set("relation_id", updateModuleInfoVO.getRelationId());
         }
@@ -213,35 +209,47 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
     }
 
     /**
-     * 模板维护修改获取已添加标签信息
+     * 模板维护页面获取模板列表
      *
-     * @param getModuleDetailInfoVO
+     * @param getModuleInfoOneVO
      * @return
      */
-    public List<GetModuleDetailInfoDTO> getModuleDetailInfo(GetModuleDetailInfoVO getModuleDetailInfoVO) {
+    public GetModuleInfoOneDTO getModuleInfoOne(GetModuleInfoOneVO getModuleInfoOneVO) {
+        GetModuleInfoOneDTO getModuleInfoOneDTO = new GetModuleInfoOneDTO();
+        List<Long> deptId = new ArrayList<>();
+        //获取模板信息
+        QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
+        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", getModuleInfoOneVO.getModuleId());
+        ModuleInfo moduleInfo = this.getOne(moduleInfoQueryWrapper);
+        //获取模板类型名称
+        if(moduleInfo.getModuleType().intValue() == 1){
+            deptId.add(moduleInfo.getRelationId());
+        }
+        //获取科室名称
+        ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
+        conceptTypeVO.setType(1);
+        RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
+        RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
+        Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
+        //获取模板类型
+        BeanUtil.copyProperties(moduleInfo, getModuleInfoOneDTO);
+        getModuleInfoOneDTO.setAscriptionName(ModuleTypeEnum.getName(Integer.parseInt(moduleInfo.getType())));
+        getModuleInfoOneDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(getModuleInfoOneDTO.getModuleType().intValue()));
+        if(getModuleInfoOneDTO.getModuleType().intValue() == 1){
+            getModuleInfoOneDTO.setRelationName(deptInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
+        }
+
+        //获取模板明细
         List<GetModuleDetailInfoDTO> getModuleDetailInfoDTOList = new ArrayList<>();
         GetModuleDetailInfoDTO getModuleDetailInfoDTO = null;
-        //获取模板明细
         QueryWrapper<ModuleDetail> moduleDetailQueryWrapper = new QueryWrapper<>();
         moduleDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("module_id", getModuleDetailInfoVO.getModuleId())
+                .eq("module_id", getModuleInfoOneVO.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());
-
-        if(getModuleDetailInfoVO.getType().intValue() == QuestionTypeEnum.Pacs.getKey()){//如果是辅检,调用knowledgeman获取辅检信息
-            ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
-            conceptTypeVO.setType(2);
-            RespDTO<List<ConceptBaseDTO>> pacsCeptInfo = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-            Map<Long,ConceptBaseDTO> pacsCeptMap = pacsCeptInfo.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
-            //循环给出参赋值
-            for (ModuleDetail moduleDetail : moduleDetailList) {
-                getModuleDetailInfoDTO = new GetModuleDetailInfoDTO();
-                BeanUtil.copyProperties(moduleDetail, getModuleDetailInfoDTO);
-                getModuleDetailInfoDTO.setTagName(pacsCeptMap.get(moduleDetail.getQuestionId()).getName());
-            }
-        }else {
             //获取标签信息
             QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
             questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -249,11 +257,11 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
             List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
             Map<Long, QuestionInfo> questionInfoMap = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getId, questionInfo -> questionInfo));
             //获取模板信息
-            QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
+            QueryWrapper<ModuleInfo> getRelationModuleWapper = new QueryWrapper<>();
             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));
+            List<ModuleInfo> moduleInfoList = this.list(getRelationModuleWapper);
+            Map<Long, ModuleInfo> moduleInfoMap = moduleInfoList.stream().collect(Collectors.toMap(ModuleInfo::getId, m -> moduleInfo));
             //循环给出参赋值
             for (ModuleDetail moduleDetail : moduleDetailList) {
                 getModuleDetailInfoDTO = new GetModuleDetailInfoDTO();
@@ -266,41 +274,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 }
                 getModuleDetailInfoDTOList.add(getModuleDetailInfoDTO);
             }
-        }
-        return getModuleDetailInfoDTOList;
-    }
-
-    /**
-     * 模板维护页面获取模板列表
-     *
-     * @param getModuleInfoOneVO
-     * @return
-     */
-    public GetModuleInfoOneDTO getModuleInfoOne(GetModuleInfoOneVO getModuleInfoOneVO) {
-        GetModuleInfoOneDTO getModuleInfoOneDTO = new GetModuleInfoOneDTO();
-        List<Long> deptId = new ArrayList<>();
-        //获取模板信息
-        QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id", getModuleInfoOneVO.getModuleId());
-        ModuleInfo moduleInfo = this.getOne(moduleInfoQueryWrapper);
-        //获取模板类型名称
-        if(moduleInfo.getModuleType().intValue() == 1){
-            deptId.add(moduleInfo.getRelationId());
-        }
-        //获取科室名称
-        ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
-        conceptTypeVO.setType(1);
-        RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-        RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
-        Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
-        //获取模板类型
-        BeanUtil.copyProperties(moduleInfo, getModuleInfoOneDTO);
-        getModuleInfoOneDTO.setAscriptionName(ModuleTypeEnum.getName(Integer.parseInt(moduleInfo.getType())));
-        getModuleInfoOneDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(getModuleInfoOneDTO.getModuleType().intValue()));
-        if(getModuleInfoOneDTO.getModuleType().intValue() == 1){
-            getModuleInfoOneDTO.setRelationName(deptInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
-        }
+        getModuleInfoOneDTO.setModuleDetial(getModuleDetailInfoDTOList);
         return getModuleInfoOneDTO;
     }
 
@@ -382,44 +356,4 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .eq("type",type);
         return this.list(moduleInfoQueryWrapper);
     }
-
-    /**
-     * 返回标签关联模板信息
-     *
-     * @param getQuestiongAndModuleRelationsVO
-     * @return
-     */
-    public GetQuestiongAndModuleRelationsDTO getQuestiongAndModuleRelations(GetQuestiongAndModuleRelationsVO getQuestiongAndModuleRelationsVO){
-        StringBuffer errMsg = new StringBuffer();
-        List<ModuleDetail> moduleDetails = moduleDetailFacade.list(new QueryWrapper<ModuleDetail>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("question_id", getQuestiongAndModuleRelationsVO.getQuestionId()));
-        if (ListUtil.isNotEmpty(moduleDetails)) {
-            List<Long> moduleIds = moduleDetails.stream().map(row -> row.getModuleId()).collect(Collectors.toList());
-            List<String> moduleNames = this.list(new QueryWrapper<ModuleInfo>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .in("id", moduleIds))
-                    .stream().map(row ->  row.getName()).collect(Collectors.toList());
-            for (String mouduleName: moduleNames) {
-                errMsg.append("该标签已关联").append("【" + mouduleName + "】").append("<br/>");
-            }
-        }
-        StringBuffer titalMsg = new StringBuffer();
-        StringBuffer questionMsg = new StringBuffer();
-        List<QuestionInfo> info = questionFacade.getParentQuestion(getQuestiongAndModuleRelationsVO.getQuestionId());
-        for (QuestionInfo bean : info) {
-            if (bean.getTagType() != null && bean.getTagType() == TagTypeEnum.T10.getKey()) {
-                List<QuestionInfo> info2 = questionFacade.getParentQuestion(bean.getId());
-                List<String> msg = info2.stream().map(row -> "【" + row.getTagName() + "】").collect(Collectors.toList());
-                questionMsg.append(String.join("", msg));
-            } else {
-                questionMsg.append("【"+bean.getTagName()+"】");
-            }
-        }
-        titalMsg.append("该标签已关联父级:").append(questionMsg).append("<br/>").append(errMsg);
-        GetQuestiongAndModuleRelationsDTO getQuestiongAndModuleRelationsDTO = new GetQuestiongAndModuleRelationsDTO();
-        getQuestiongAndModuleRelationsDTO.setRelationInfos(titalMsg.append("是否删除?"));
-        return getQuestiongAndModuleRelationsDTO;
-    }
-
 }

+ 0 - 20
precman-service/src/main/java/com/diagbot/vo/GetModuleDetailInfoVO.java

@@ -1,20 +0,0 @@
-package com.diagbot.vo;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * @Description:
- * @author: wangyu
- * @time: 2018/12/27 16:55
- */
-@Getter
-@Setter
-public class GetModuleDetailInfoVO {
-    @NotNull(message = "请输入模板id")
-    private Long moduleId;
-    //模板类型
-    private Integer type;
-}

+ 0 - 16
precman-service/src/main/java/com/diagbot/vo/GetQuestiongAndModuleRelationsVO.java

@@ -1,16 +0,0 @@
-package com.diagbot.vo;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description:
- * @author: wangyu
- * @time: 2019/4/25 10:22
- */
-@Getter
-@Setter
-public class GetQuestiongAndModuleRelationsVO {
-    //疾病id
-    private Long questionId;
-}

+ 2 - 0
precman-service/src/main/java/com/diagbot/vo/UpdateModuleInfoVO.java

@@ -26,4 +26,6 @@ public class UpdateModuleInfoVO {
     private Long moduleType;
     //关联id
     private Long relationId;
+    //备注
+    private String remark;
 }

+ 5 - 26
precman-service/src/main/java/com/diagbot/web/ModuleInfoController.java

@@ -4,21 +4,17 @@ package com.diagbot.web;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.GetAllDeptAndDisInfoDTO;
-import com.diagbot.dto.GetModuleDetailInfoDTO;
 import com.diagbot.dto.GetModuleInfoOneDTO;
 import com.diagbot.dto.GetModuleTypeDTO;
-import com.diagbot.dto.GetQuestiongAndModuleRelationsDTO;
 import com.diagbot.dto.ModuleInfoListDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.ModuleInfoFacade;
 import com.diagbot.vo.AddModuleInfoVO;
 import com.diagbot.vo.DeleteModuleVO;
 import com.diagbot.vo.GetAllDeptAndDisInfoVO;
-import com.diagbot.vo.GetModuleDetailInfoVO;
 import com.diagbot.vo.GetModuleInfoOneVO;
 import com.diagbot.vo.GetModuleInfoVO;
 import com.diagbot.vo.GetModuleTypeVO;
-import com.diagbot.vo.GetQuestiongAndModuleRelationsVO;
 import com.diagbot.vo.UpdateModuleInfoVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -72,12 +68,13 @@ public class ModuleInfoController {
     @ApiOperation(value = "模板修改[by:wangyu]",
             notes = "id: 模板id,必填<br>" +
                     "name: 模板名称,必填<br>" +
-                    "type: 模板类型,必填<br>" +
+                    "type: 模板类型(症状,诊疗情况,其他),必填<br>" +
                     "questionId: 标签id,必填<br>" +
                     "flag: 特殊标示类型<br>" +
                     "relationModule: 关联模板id<br>"+
-                    "moduleType: 模板类型,必填<br>" +
-                    "relationId: 关联id,moduleType为0不用传,moduleType为1传科室id,moduleType为2传疾病id")
+                    "moduleType: 模板类型(科室,通用),必填<br>" +
+                    "relationId: 关联id,moduleType为0不用传,moduleType为1传科室id<br>" +
+                    "remark: 备注")
     @PostMapping("/updateModuleInfo")
     @SysLogger("updateModuleInfo")
     @Transactional
@@ -108,16 +105,6 @@ public class ModuleInfoController {
         return RespDTO.onSuc(date);
     }
 
-    @ApiOperation(value = "获取模板明细信息——修改时获取已添加过的标签[by:wangyu]",
-            notes = "moduleId: 模板id<br>" +
-                    "type: 模板归属<br>")
-    @PostMapping("/getModuleDetailInfo")
-    @SysLogger("getModuleDetailInfo")
-    public RespDTO<List<GetModuleDetailInfoDTO>> getModuleDetailInfo(@Valid @RequestBody GetModuleDetailInfoVO getModuleDetailInfoVO) {
-        List<GetModuleDetailInfoDTO> date = moduleInfoFacade.getModuleDetailInfo(getModuleDetailInfoVO);
-        return RespDTO.onSuc(date);
-    }
-
     @ApiOperation(value = "获取单个模板信息(修改用)[by:wangyu]",
             notes = "" +
                     "moduleId: 模板id<br>")
@@ -138,7 +125,7 @@ public class ModuleInfoController {
         return RespDTO.onSuc(date);
     }
 
-    @ApiOperation(value = "获取科室和疾病所有信息(主页面下拉用)[by:wangyu]",
+    @ApiOperation(value = "获取科室所有信息(主页面下拉用)[by:wangyu]",
             notes = "")
     @PostMapping("/getAllDeptAndDisInfo")
     @SysLogger("getAllDeptAndDisInfo")
@@ -147,12 +134,4 @@ public class ModuleInfoController {
         return RespDTO.onSuc(date);
     }
 
-    @ApiOperation(value = "获取标签和模板关联信息(删除标签时校验用)[by:wangyu]",
-            notes = "questionId: 标签id")
-    @PostMapping("/getQuestiongAndModuleRelations")
-    @SysLogger("getQuestiongAndModuleRelations")
-    public RespDTO<GetQuestiongAndModuleRelationsDTO> getQuestiongAndModuleRelations(@RequestBody GetQuestiongAndModuleRelationsVO getQuestiongAndModuleRelationsVO) {
-        GetQuestiongAndModuleRelationsDTO date = moduleInfoFacade.getQuestiongAndModuleRelations(getQuestiongAndModuleRelationsVO);
-        return RespDTO.onSuc(date);
-    }
 }