Przeglądaj źródła

Merge branch 'develop' into his/xm5ycdss

# Conflicts:
#	src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
shiyue 4 lat temu
rodzic
commit
7d9d9c98e2
100 zmienionych plików z 7159 dodań i 513 usunięć
  1. 64 1
      src/main/java/com/diagbot/aggregate/AssemblePushAggregate.java
  2. 168 9
      src/main/java/com/diagbot/client/CdssCoreClient.java
  3. 221 9
      src/main/java/com/diagbot/client/hystrix/CdssCoreHystrix.java
  4. 61 11
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  5. 62 12
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  6. 2 0
      src/main/java/com/diagbot/dto/BillMsg.java
  7. 17 0
      src/main/java/com/diagbot/dto/ConceptScaleDTO.java
  8. 107 0
      src/main/java/com/diagbot/dto/ConceptScaleDetailDTO.java
  9. 18 0
      src/main/java/com/diagbot/dto/ConceptScaleSubDTO.java
  10. 42 0
      src/main/java/com/diagbot/dto/GetAllForRelationDTO.java
  11. 17 0
      src/main/java/com/diagbot/dto/IndexBatchDTO.java
  12. 43 0
      src/main/java/com/diagbot/dto/KlConceptDetailDTO.java
  13. 63 0
      src/main/java/com/diagbot/dto/KlConceptStaticDTO.java
  14. 27 0
      src/main/java/com/diagbot/dto/KlRuleByIdParDTO.java
  15. 31 0
      src/main/java/com/diagbot/dto/KlRuleByIdSubDTO.java
  16. 65 0
      src/main/java/com/diagbot/dto/KlRuleInfoDTO.java
  17. 38 0
      src/main/java/com/diagbot/dto/KllisDetailDTO.java
  18. 4 0
      src/main/java/com/diagbot/dto/LisDetailDTO.java
  19. 18 0
      src/main/java/com/diagbot/dto/NurseInfoDTO.java
  20. 1 1
      src/main/java/com/diagbot/dto/PushBaseDTO.java
  21. 5 0
      src/main/java/com/diagbot/dto/PushDTO.java
  22. 18 0
      src/main/java/com/diagbot/dto/PushScaleDTO.java
  23. 16 0
      src/main/java/com/diagbot/dto/RetrievalDTO.java
  24. 19 0
      src/main/java/com/diagbot/dto/ScaleInfoDTO.java
  25. 5 0
      src/main/java/com/diagbot/dto/StaticKnowledgeDTO.java
  26. 9 0
      src/main/java/com/diagbot/dto/StaticKnowledgeIndexDTO.java
  27. 28 0
      src/main/java/com/diagbot/dto/StaticKnowledgeIndexPageDTO.java
  28. 23 0
      src/main/java/com/diagbot/dto/TcmDTO.java
  29. 23 0
      src/main/java/com/diagbot/dto/TcmdiseaseInfoDTO.java
  30. 23 0
      src/main/java/com/diagbot/dto/TcmsyndromeInfoDTO.java
  31. 22 0
      src/main/java/com/diagbot/entity/ConceptInfo.java
  32. 14 2
      src/main/java/com/diagbot/entity/DeptConfig.java
  33. 13 2
      src/main/java/com/diagbot/entity/DiseaseConfig.java
  34. 17 3
      src/main/java/com/diagbot/entity/DrugConfig.java
  35. 18 0
      src/main/java/com/diagbot/entity/KlRuleMenuWrapper.java
  36. 218 0
      src/main/java/com/diagbot/entity/KlRulePlan.java
  37. 17 2
      src/main/java/com/diagbot/entity/LisConfig.java
  38. 207 0
      src/main/java/com/diagbot/entity/NurseConfig.java
  39. 13 2
      src/main/java/com/diagbot/entity/OperationConfig.java
  40. 13 2
      src/main/java/com/diagbot/entity/PacsConfig.java
  41. 207 0
      src/main/java/com/diagbot/entity/ScaleConfig.java
  42. 208 0
      src/main/java/com/diagbot/entity/TcmdiseaseConfig.java
  43. 208 0
      src/main/java/com/diagbot/entity/TcmsyndromeConfig.java
  44. 13 2
      src/main/java/com/diagbot/entity/TransfusionConfig.java
  45. 9 2
      src/main/java/com/diagbot/enums/ConceptTypeEnum.java
  46. 64 0
      src/main/java/com/diagbot/enums/OtherIndexEnum.java
  47. 24 0
      src/main/java/com/diagbot/facade/CacheFacade.java
  48. 188 16
      src/main/java/com/diagbot/facade/ConceptInfoFacade.java
  49. 96 57
      src/main/java/com/diagbot/facade/DeptConfigFacade.java
  50. 96 56
      src/main/java/com/diagbot/facade/DiseaseConfigFacade.java
  51. 105 55
      src/main/java/com/diagbot/facade/DrugConfigFacade.java
  52. 263 0
      src/main/java/com/diagbot/facade/KlConceptStaticFacade.java
  53. 28 0
      src/main/java/com/diagbot/facade/KlDictionaryInfoFacade.java
  54. 65 0
      src/main/java/com/diagbot/facade/KlRuleFacade.java
  55. 28 0
      src/main/java/com/diagbot/facade/KlRulePlanFacade.java
  56. 153 75
      src/main/java/com/diagbot/facade/LisConfigFacade.java
  57. 37 0
      src/main/java/com/diagbot/facade/MrFacade.java
  58. 492 0
      src/main/java/com/diagbot/facade/NurseConfigFacade.java
  59. 96 56
      src/main/java/com/diagbot/facade/OperationConfigFacade.java
  60. 96 56
      src/main/java/com/diagbot/facade/PacsConfigFacade.java
  61. 1 1
      src/main/java/com/diagbot/facade/PlanDetailFacade.java
  62. 3 3
      src/main/java/com/diagbot/facade/PlanFacade.java
  63. 75 15
      src/main/java/com/diagbot/facade/PushFacade.java
  64. 20 0
      src/main/java/com/diagbot/facade/RetrievalFacade.java
  65. 492 0
      src/main/java/com/diagbot/facade/ScaleConfigFacade.java
  66. 496 0
      src/main/java/com/diagbot/facade/TcmdiseaseConfigFacade.java
  67. 495 0
      src/main/java/com/diagbot/facade/TcmsyndromeConfigFacade.java
  68. 96 56
      src/main/java/com/diagbot/facade/TransfusionConfigFacade.java
  69. 37 0
      src/main/java/com/diagbot/mapper/NurseConfigMapper.java
  70. 24 0
      src/main/java/com/diagbot/mapper/ScaleConfigMapper.java
  71. 38 0
      src/main/java/com/diagbot/mapper/TcmdiseaseConfigMapper.java
  72. 37 0
      src/main/java/com/diagbot/mapper/TcmsyndromeConfigMapper.java
  73. 9 2
      src/main/java/com/diagbot/service/MrService.java
  74. 36 0
      src/main/java/com/diagbot/service/NurseConfigService.java
  75. 24 0
      src/main/java/com/diagbot/service/ScaleConfigService.java
  76. 38 0
      src/main/java/com/diagbot/service/TcmdiseaseConfigService.java
  77. 36 0
      src/main/java/com/diagbot/service/TcmsyndromeConfigService.java
  78. 64 0
      src/main/java/com/diagbot/service/impl/MrServiceImpl.java
  79. 46 0
      src/main/java/com/diagbot/service/impl/NurseConfigServiceImpl.java
  80. 35 0
      src/main/java/com/diagbot/service/impl/ScaleConfigServiceImpl.java
  81. 47 0
      src/main/java/com/diagbot/service/impl/TcmdiseaseConfigServiceImpl.java
  82. 47 0
      src/main/java/com/diagbot/service/impl/TcmsyndromeConfigServiceImpl.java
  83. 20 5
      src/main/java/com/diagbot/util/CoreUtil.java
  84. 280 0
      src/main/java/com/diagbot/util/RedisUtil.java
  85. 3 0
      src/main/java/com/diagbot/vo/ChangeStatusVO.java
  86. 18 0
      src/main/java/com/diagbot/vo/GetDetailVO.java
  87. 47 0
      src/main/java/com/diagbot/vo/KlConceptDetailVO.java
  88. 33 0
      src/main/java/com/diagbot/vo/KlConceptStaticPageVO.java
  89. 51 0
      src/main/java/com/diagbot/vo/KlConceptStaticVO.java
  90. 18 0
      src/main/java/com/diagbot/vo/KlRuleByIdVO.java
  91. 18 0
      src/main/java/com/diagbot/vo/KlRuleInfoClearVO.java
  92. 30 0
      src/main/java/com/diagbot/vo/KlRuleInfoSaveSubVO.java
  93. 36 0
      src/main/java/com/diagbot/vo/KlRuleInfoSaveVO.java
  94. 30 0
      src/main/java/com/diagbot/vo/KlRuleInfoVO.java
  95. 20 0
      src/main/java/com/diagbot/vo/KlRuleMenuVO.java
  96. 19 0
      src/main/java/com/diagbot/vo/KlRuleSatartOrdisaVO.java
  97. 20 0
      src/main/java/com/diagbot/vo/KllisDetailVO.java
  98. 18 0
      src/main/java/com/diagbot/vo/NurseConfigListVO.java
  99. 36 0
      src/main/java/com/diagbot/vo/NurseConfigPageVO.java
  100. 0 0
      src/main/java/com/diagbot/vo/PushJoinVO.java

+ 64 - 1
src/main/java/com/diagbot/aggregate/AssemblePushAggregate.java

@@ -2,11 +2,14 @@ package com.diagbot.aggregate;
 
 import com.diagbot.dto.PushBaseDTO;
 import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.PushScaleDTO;
 import com.diagbot.facade.DiseaseConfigFacade;
 import com.diagbot.facade.DrugConfigFacade;
 import com.diagbot.facade.LisConfigFacade;
+import com.diagbot.facade.NurseConfigFacade;
 import com.diagbot.facade.OperationConfigFacade;
 import com.diagbot.facade.PacsConfigFacade;
+import com.diagbot.facade.ScaleConfigFacade;
 import com.diagbot.util.ListUtil;
 import com.google.common.collect.Lists;
 import io.github.lvyahui8.spring.annotation.DataConsumer;
@@ -40,6 +43,10 @@ public class AssemblePushAggregate {
     private DrugConfigFacade drugConfigFacade;
     @Autowired
     private OperationConfigFacade operationConfigFacade;
+    @Autowired
+    private ScaleConfigFacade scaleConfigFacade;
+    @Autowired
+    private NurseConfigFacade nurseConfigFacade;
 
     @DataProvider("assemblePushAll")
     public PushDTO assemblePushAll(
@@ -49,7 +56,9 @@ public class AssemblePushAggregate {
             @DataConsumer("retPacs") List<PushBaseDTO> retPacs,
             @DataConsumer("retDiagMap") Map<String, List<PushBaseDTO>> retDiagMap,
             @DataConsumer("retOperation") List<PushBaseDTO> retOperation,
-            @DataConsumer("retDrug") List<PushBaseDTO> retDrug) {
+            @DataConsumer("retDrug") List<PushBaseDTO> retDrug,
+            @DataConsumer("retScale") List<PushScaleDTO> retScale,
+            @DataConsumer("retNurse") List<PushBaseDTO> retNurse) {
         //检验
         if (ListUtil.isNotEmpty(retLis)) {
             data.setLis(retLis);
@@ -70,6 +79,14 @@ public class AssemblePushAggregate {
         if (ListUtil.isNotEmpty(retDrug)) {
             data.setMedicines(retDrug);
         }
+        //量表
+        if (ListUtil.isNotEmpty(retScale)) {
+            data.setScale(retScale);
+        }
+        //护理
+        if (ListUtil.isNotEmpty(retNurse)) {
+            data.setNurse(retNurse);
+        }
         return data;
     }
 
@@ -196,4 +213,50 @@ public class AssemblePushAggregate {
         }
         return retDrug;
     }
+
+    @DataProvider("retScale")
+    public List<PushScaleDTO> retScale(@InvokeParameter("pushDTO") PushDTO data,
+                                      @InvokeParameter("hospitalId") Long hospitalId) {
+        //量表
+        List<PushScaleDTO> retScale = new ArrayList<>();
+        if (ListUtil.isNotEmpty(data.getScale())) {
+            retScale = data.getScale();
+            List<String> uniqueNameList = retScale.stream()
+                    .map(i -> i.getName())
+                    .collect(Collectors.toList());
+            Map<String, Map<String, Long>> uniqueNameMap
+                    = scaleConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
+            if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
+                retScale.forEach(item -> {
+                    if (uniqueNameMap.get(item.getName()) != null) {
+                        item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
+                    }
+                });
+            }
+        }
+        return retScale;
+    }
+
+    @DataProvider("retNurse")
+    public List<PushBaseDTO> retNurse(@InvokeParameter("pushDTO") PushDTO data,
+                                      @InvokeParameter("hospitalId") Long hospitalId) {
+        //量表
+        List<PushBaseDTO> retNurse = new ArrayList<>();
+        if (ListUtil.isNotEmpty(data.getNurse())) {
+            retNurse = data.getNurse();
+            List<String> uniqueNameList = retNurse.stream()
+                    .map(i -> i.getName())
+                    .collect(Collectors.toList());
+            Map<String, Map<String, Long>> uniqueNameMap
+                    = nurseConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
+            if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
+                retNurse.forEach(item -> {
+                    if (uniqueNameMap.get(item.getName()) != null) {
+                        item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
+                    }
+                });
+            }
+        }
+        return retNurse;
+    }
 }

+ 168 - 9
src/main/java/com/diagbot/client/CdssCoreClient.java

@@ -1,25 +1,33 @@
 package com.diagbot.client;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.hystrix.CdssCoreHystrix;
+import com.diagbot.dto.ConceptDetailDTO;
+import com.diagbot.dto.ConceptScaleDTO;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.GetAllForRelationDTO;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.IndicationDTO;
+import com.diagbot.dto.KlConceptStaticDTO;
+import com.diagbot.dto.KlRuleByIdParDTO;
+import com.diagbot.dto.KlRuleInfoDTO;
+import com.diagbot.dto.KllisDetailDTO;
 import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.PushPlanDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.RetrievalDTO;
+import com.diagbot.dto.StaticKnowledgeDTO;
 import com.diagbot.dto.StaticKnowledgeIndexDTO;
-import com.diagbot.vo.ConceptVO;
-import com.diagbot.vo.HasStaticKnowledgeVO;
-import com.diagbot.vo.IndicationPushVO;
-import com.diagbot.vo.PushPlanVO;
-import com.diagbot.vo.PushVO;
-import com.diagbot.vo.RetrievalVO;
-import com.diagbot.vo.StaticKnowledgeIndexVO;
+import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
+import com.diagbot.entity.KlRuleMenuWrapper;
+import com.diagbot.vo.*;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.validation.Valid;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: CDSS核心类客户端
@@ -75,7 +83,158 @@ public interface CdssCoreClient {
      * @return
      */
     @PostMapping("/retrieval/getConceptNames")
-    RespDTO<List<String>> getConceptNames(@Valid @RequestBody ConceptVO conceptVO);
-}
+    RespDTO<List<IndexBatchDTO>> getConceptNames(@Valid @RequestBody ConceptVO conceptVO);
 
 
+    /**
+     * 化验小项术语批量查询获取范围
+     *
+     * @param kllisDetailVO
+     * @return
+     */
+    @PostMapping("/retrieval/getLisDetaisByNames")
+    RespDTO<Map<String, KllisDetailDTO>> getLisDetaisByNames(@RequestBody KllisDetailVO kllisDetailVO);
+
+    /**
+     * 取上级静态知识
+     *
+     * @param staticKnowledgeNameVO
+     * @return
+     */
+    @PostMapping("/staticKnowledge/getSuperName")
+    RespDTO<StaticKnowledgeNameVO> getSuperName(@Valid @RequestBody StaticKnowledgeNameVO staticKnowledgeNameVO);
+
+    /**
+     * 取上级静态知识(批量)
+     *
+     * @param staticKnowledgeNameVO
+     * @return
+     */
+    @PostMapping("/staticKnowledge/getSuperNameBatch")
+    RespDTO<List<StaticKnowledgeNameVO>> getSuperNameBatch(@Valid @RequestBody List<StaticKnowledgeNameVO> staticKnowledgeNameVO);
+
+    /**
+     * 根据名称和类型获取静态知识内容
+     *
+     * @param scaleStaticAllVO
+     * @return
+     */
+    @PostMapping("/kl/conceptStatic/getStaticKnowledge")
+    RespDTO<StaticKnowledgeDTO> getStaticKnowledge(@Valid @RequestBody ScaleStaticAllVO scaleStaticAllVO);
+
+    /**
+     * 分页查询
+     *
+     * @param klConceptStaticPageVO
+     * @return
+     */
+    @PostMapping("/kl/conceptStatic/getPage")
+    RespDTO<Page<KlConceptStaticDTO>> getPage(@Valid @RequestBody KlConceptStaticPageVO klConceptStaticPageVO);
+
+
+    /**
+     * 静态知识检索(分页返回)
+     *
+     * @param staticKnowledgeIndexPageVO
+     * @return
+     */
+    @PostMapping("/kl/conceptStatic/staticIndexPage")
+    RespDTO<Page<StaticKnowledgeIndexPageDTO>> staticIndexPage(@Valid @RequestBody StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO);
+
+    /**
+     * 保存静态知识
+     *
+     * @param klConceptStaticVO
+     * @return
+     */
+    @PostMapping("/kl/conceptStatic/saveOrUpdateRecord")
+    RespDTO<Boolean> saveOrUpdateRecord(@Valid @RequestBody KlConceptStaticVO klConceptStaticVO);
+
+    /**
+     * 静态知识启用禁用
+     *
+     * @param changeStatusVO
+     * @return
+     */
+    @PostMapping("/kl/conceptStatic/changeStatus")
+    RespDTO<Boolean> changeStatus(@Valid @RequestBody ChangeStatusVO changeStatusVO);
+
+    /**
+     * 根据id获取静态知识
+     *
+     * @param idVO
+     * @return
+     */
+    @PostMapping("/kl/conceptStatic/getRecordById")
+    RespDTO<KlConceptStaticDTO> getRecordById(@Valid @RequestBody IdVO idVO);
+
+    /**
+     * 静态知识是否已存在
+     *
+     * @param klConceptStaticVO
+     * @return
+     */
+    @PostMapping("/kl/conceptStatic/isExist")
+    RespDTO<Boolean> isExist(@Valid @RequestBody KlConceptStaticVO klConceptStaticVO);
+
+    /**
+     * 推理结果匹配静态知识
+     *
+     * @param getDetailVO
+     * @return
+     */
+    @PostMapping("/kl/conceptStatic/getDetailByConcept")
+    RespDTO<Map<String, List<ConceptDetailDTO>>> getDetailByConcept(@Valid @RequestBody GetDetailVO getDetailVO);
+
+    /**
+     * 推理结果匹配量表
+     *
+     * @param getDetailVO
+     * @return
+     */
+    @PostMapping("/kl/conceptStatic/getScaleDetailByConcept")
+    RespDTO<Map<String, ConceptScaleDTO>> getScaleDetailByConcept(@RequestBody @Valid GetDetailVO getDetailVO);
+
+    /**
+     * 获取规则下拉菜单信息
+     *
+     * @param klRuleMenuVO
+     * @return
+     */
+    @PostMapping("/klRulePlan/getMenu")
+    RespDTO<List<KlRuleMenuWrapper>> getMenus(@RequestBody KlRuleMenuVO klRuleMenuVO);
+
+    //"分页获取规则维护列表
+    @PostMapping("/klRule/getKlRuleInfoPage")
+    RespDTO<Page<KlRuleInfoDTO>> getKlRuleInfoPages(@RequestBody KlRuleInfoVO klRuleInfoVO);
+
+
+    //根据规则Id获取规则详情
+    @PostMapping("/klRule/getByIdRuleInfo")
+    RespDTO<KlRuleByIdParDTO> getByIdRuleInfoAll(@RequestBody @Valid KlRuleByIdVO klRuleByIdVO);
+
+    //保存规则详情[
+    @PostMapping("/klRule/saveRuleInfo")
+    RespDTO<Boolean> saveRuleInfoAll(@RequestBody @Valid KlRuleInfoSaveVO klRuleInfoSaveVO);
+
+    //刪除规则详情
+    @PostMapping("/klRule/clearRuleInfo")
+    RespDTO<Boolean> clearRuleInfoAll(@RequestBody @Valid KlRuleInfoClearVO klRuleInfoClearVO);
+
+    //停用规则
+    @PostMapping("/klRule/disableRuleInfo")
+    RespDTO<Boolean> disableRuleInfos(@RequestBody @Valid KlRuleSatartOrdisaVO klRuleSatartOrdisaVO);
+
+    //启用规则
+    @PostMapping("/klRule/startRuleInfo")
+    RespDTO<Boolean> startRuleInfos(@RequestBody @Valid KlRuleSatartOrdisaVO klRuleSatartOrdisaVO);
+
+    @PostMapping("/kl/dictionary/getDictionaryInfo")
+    RespDTO<Map<Long, List<DictionaryInfoDTO>>> getDictionaryAll();
+
+    @PostMapping("/klDisease/searchConcept")
+    RespDTO<List<GetAllForRelationDTO>> searchConcept(@Valid @RequestBody SearchConceptVO searchConceptVO);
+
+    @PostMapping("/cache/clearRuleInfoAll")
+    RespDTO<Boolean> clearRuleAll();
+}

+ 221 - 9
src/main/java/com/diagbot/client/hystrix/CdssCoreHystrix.java

@@ -1,25 +1,33 @@
 package com.diagbot.client.hystrix;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.ConceptDetailDTO;
+import com.diagbot.dto.ConceptScaleDTO;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.GetAllForRelationDTO;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.IndicationDTO;
+import com.diagbot.dto.KlConceptStaticDTO;
+import com.diagbot.dto.KlRuleByIdParDTO;
+import com.diagbot.dto.KlRuleInfoDTO;
+import com.diagbot.dto.KllisDetailDTO;
 import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.PushPlanDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.RetrievalDTO;
+import com.diagbot.dto.StaticKnowledgeDTO;
 import com.diagbot.dto.StaticKnowledgeIndexDTO;
-import com.diagbot.vo.ConceptVO;
-import com.diagbot.vo.HasStaticKnowledgeVO;
-import com.diagbot.vo.IndicationPushVO;
-import com.diagbot.vo.PushPlanVO;
-import com.diagbot.vo.PushVO;
-import com.diagbot.vo.RetrievalVO;
-import com.diagbot.vo.StaticKnowledgeIndexVO;
+import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
+import com.diagbot.entity.KlRuleMenuWrapper;
+import com.diagbot.vo.*;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.validation.Valid;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 病历质控客户端(请求失败熔断)
@@ -94,8 +102,212 @@ public class CdssCoreHystrix implements CdssCoreClient {
      * @return
      */
     @Override
-    public RespDTO<List<String>> getConceptNames(@Valid @RequestBody ConceptVO conceptVO) {
+    public RespDTO<List<IndexBatchDTO>> getConceptNames(@Valid @RequestBody ConceptVO conceptVO) {
         log.error("【hystrix】调用{}异常", "getConceptNames");
         return null;
     }
-}
+
+    /**
+     * 化验小项术语批量查询获取范围
+     *
+     * @param kllisDetailVO
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, KllisDetailDTO>> getLisDetaisByNames(@RequestBody KllisDetailVO kllisDetailVO) {
+        log.error("【hystrix】调用{}异常", "getConceptNames");
+        return null;
+    }
+
+    /**
+     * 取上级静态知识
+     *
+     * @param staticKnowledgeNameVO
+     * @return
+     */
+    @Override
+    public RespDTO<StaticKnowledgeNameVO> getSuperName(@Valid @RequestBody StaticKnowledgeNameVO staticKnowledgeNameVO) {
+        log.error("【hystrix】调用{}异常", "getSuperName");
+        return null;
+    }
+
+    /**
+     * 取上级静态知识(批量)
+     *
+     * @param staticKnowledgeNameVO
+     * @return
+     */
+    @Override
+    public RespDTO<List<StaticKnowledgeNameVO>> getSuperNameBatch(@Valid @RequestBody List<StaticKnowledgeNameVO> staticKnowledgeNameVO) {
+        log.error("【hystrix】调用{}异常", "getSuperNameBatch");
+        return null;
+    }
+
+    /**
+     * 根据名称和类型获取静态知识内容
+     *
+     * @param scaleStaticAllVO
+     * @return
+     */
+    @Override
+    public RespDTO<StaticKnowledgeDTO> getStaticKnowledge(@Valid @RequestBody ScaleStaticAllVO scaleStaticAllVO) {
+        log.error("【hystrix】调用{}异常", "getStaticKnowledge");
+        return null;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param klConceptStaticPageVO
+     * @return
+     */
+    @Override
+    public RespDTO<Page<KlConceptStaticDTO>> getPage(@Valid @RequestBody KlConceptStaticPageVO klConceptStaticPageVO) {
+        log.error("【hystrix】调用{}异常", "getPage");
+        return null;
+    }
+
+    /**
+     * 静态知识检索(分页返回)
+     *
+     * @param staticKnowledgeIndexPageVO
+     * @return
+     */
+    @Override
+    public RespDTO<Page<StaticKnowledgeIndexPageDTO>> staticIndexPage(@Valid @RequestBody StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO) {
+        log.error("【hystrix】调用{}异常", "staticIndexPage");
+        return null;
+    }
+
+    /**
+     * 保存静态知识
+     *
+     * @param klConceptStaticVO
+     * @return
+     */
+    @Override
+    public RespDTO<Boolean> saveOrUpdateRecord(@Valid @RequestBody KlConceptStaticVO klConceptStaticVO) {
+        log.error("【hystrix】调用{}异常", "saveOrUpdateRecord");
+        return null;
+    }
+
+    /**
+     * 静态知识启用禁用
+     *
+     * @param changeStatusVO
+     * @return
+     */
+    @Override
+    public RespDTO<Boolean> changeStatus(@Valid @RequestBody ChangeStatusVO changeStatusVO) {
+        log.error("【hystrix】调用{}异常", "changeStatus");
+        return null;
+    }
+
+    /**
+     * 根据id获取静态知识
+     *
+     * @param idVO
+     * @return
+     */
+    @Override
+    public RespDTO<KlConceptStaticDTO> getRecordById(@Valid @RequestBody IdVO idVO) {
+        log.error("【hystrix】调用{}异常", "getRecordById");
+        return null;
+    }
+
+    /**
+     * 静态知识是否已存在
+     *
+     * @param klConceptStaticVO
+     * @return
+     */
+    @Override
+    public RespDTO<Boolean> isExist(@Valid @RequestBody KlConceptStaticVO klConceptStaticVO) {
+        log.error("【hystrix】调用{}异常", "isExist");
+        return null;
+    }
+
+    /**
+     * 推理结果匹配静态知识
+     *
+     * @param getDetailVO
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, List<ConceptDetailDTO>>> getDetailByConcept(@Valid @RequestBody GetDetailVO getDetailVO) {
+        log.error("【hystrix】调用{}异常", "getDetailByConcept");
+        return null;
+    }
+
+    /**
+     * 推理结果匹配量表
+     *
+     * @param getDetailVO
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, ConceptScaleDTO>> getScaleDetailByConcept(@RequestBody @Valid GetDetailVO getDetailVO) {
+        log.error("【hystrix】调用{}异常", "getScaleDetailByConcept");
+        return null;
+    }
+
+    @Override
+    public RespDTO<List<KlRuleMenuWrapper>> getMenus(KlRuleMenuVO klRuleMenuVO) {
+        log.error("【hystrix】调用{}异常", "getMenus");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Page<KlRuleInfoDTO>> getKlRuleInfoPages(KlRuleInfoVO klRuleInfoVO) {
+        log.error("【hystrix】调用{}异常", "getKlRuleInfoPages");
+        return null;
+    }
+
+    @Override
+    public RespDTO<KlRuleByIdParDTO> getByIdRuleInfoAll(@Valid KlRuleByIdVO klRuleByIdVO) {
+        log.error("【hystrix】调用{}异常", "getByIdRuleInfoAll");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> saveRuleInfoAll(@Valid KlRuleInfoSaveVO klRuleInfoSaveVO) {
+        log.error("【hystrix】调用{}异常", "saveRuleInfoAll");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> clearRuleInfoAll(@Valid KlRuleInfoClearVO klRuleInfoClearVO) {
+        log.error("【hystrix】调用{}异常", "clearRuleInfoAll");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> disableRuleInfos(@Valid KlRuleSatartOrdisaVO klRuleSatartOrdisaVO) {
+        log.error("【hystrix】调用{}异常", "disableRuleInfos");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> startRuleInfos(@Valid KlRuleSatartOrdisaVO klRuleSatartOrdisaVO) {
+        log.error("【hystrix】调用{}异常", "startRuleInfos");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Map<Long, List<DictionaryInfoDTO>>> getDictionaryAll() {
+        log.error("【hystrix】调用{}异常", "getDictionaryAll");
+        return null;
+    }
+
+    @Override
+    public RespDTO<List<GetAllForRelationDTO>> searchConcept(@Valid SearchConceptVO searchConceptVO) {
+        log.error("【hystrix】调用{}异常", "searchConcept");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> clearRuleAll() {
+        log.error("【hystrix】调用{}异常", "clearRuleAll");
+        return null;
+    }
+}

+ 61 - 11
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -106,6 +106,42 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 //.antMatchers("/tran/transfusionConfig/importExcel").permitAll()
                 //.antMatchers("/tran/transfusionConfig/exportExcel").permitAll()
                 .antMatchers("/tran/transfusionConfig/exportExcelModule").permitAll()
+                //.antMatchers("/tran/scaleConfig/isExistRecord").permitAll()
+                //.antMatchers("/tran/scaleConfig/saveOrUpdateRecord").permitAll()
+                //.antMatchers("/tran/scaleConfig/saveOrUpdateRecords").permitAll()
+                //.antMatchers("/tran/scaleConfig/deleteRecord").permitAll()
+                //.antMatchers("/tran/scaleConfig/deleteRecords").permitAll()
+                .antMatchers("/tran/scaleConfig/getPage").permitAll()
+                //.antMatchers("/tran/scaleConfig/importExcel").permitAll()
+                //.antMatchers("/tran/scaleConfig/exportExcel").permitAll()
+                .antMatchers("/tran/scaleConfig/exportExcelModule").permitAll()
+                //.antMatchers("/tran/nurseConfig/isExistRecord").permitAll()
+                //.antMatchers("/tran/nurseConfig/saveOrUpdateRecord").permitAll()
+                //.antMatchers("/tran/nurseConfig/saveOrUpdateRecords").permitAll()
+                //.antMatchers("/tran/nurseConfig/deleteRecord").permitAll()
+                //.antMatchers("/tran/nurseConfig/deleteRecords").permitAll()
+                .antMatchers("/tran/nurseConfig/getPage").permitAll()
+                //.antMatchers("/tran/nurseConfig/importExcel").permitAll()
+                //.antMatchers("/tran/nurseConfig/exportExcel").permitAll()
+                .antMatchers("/tran/nurseConfig/exportExcelModule").permitAll()
+                //.antMatchers("/tran/tcmdiseaseConfig/isExistRecord").permitAll()
+                //.antMatchers("/tran/tcmdiseaseConfig/saveOrUpdateRecord").permitAll()
+                //.antMatchers("/tran/tcmdiseaseConfig/saveOrUpdateRecords").permitAll()
+                //.antMatchers("/tran/tcmdiseaseConfig/deleteRecord").permitAll()
+                //.antMatchers("/tran/tcmdiseaseConfig/deleteRecords").permitAll()
+                .antMatchers("/tran/tcmdiseaseConfig/getPage").permitAll()
+                //.antMatchers("/tran/tcmdiseaseConfig/importExcel").permitAll()
+                //.antMatchers("/tran/tcmdiseaseConfig/exportExcel").permitAll()
+                .antMatchers("/tran/tcmdiseaseConfig/exportExcelModule").permitAll()
+                //.antMatchers("/tran/tcmsyndromeConfig/isExistRecord").permitAll()
+                //.antMatchers("/tran/tcmsyndromeConfig/saveOrUpdateRecord").permitAll()
+                //.antMatchers("/tran/tcmsyndromeConfig/saveOrUpdateRecords").permitAll()
+                //.antMatchers("/tran/tcmsyndromeConfig/deleteRecord").permitAll()
+                //.antMatchers("/tran/tcmsyndromeConfig/deleteRecords").permitAll()
+                .antMatchers("/tran/tcmsyndromeConfig/getPage").permitAll()
+                //.antMatchers("/tran/tcmsyndromeConfig/importExcel").permitAll()
+                //.antMatchers("/tran/tcmsyndromeConfig/exportExcel").permitAll()
+                .antMatchers("/tran/tcmsyndromeConfig/exportExcelModule").permitAll()
                 //.antMatchers("/tran/hospitalInfo/saveRecord").permitAll()
                 .antMatchers("/tran/hospitalInfo/getHospitalInfo").permitAll()
                 .antMatchers("/tran/hospitalInfo/getAllHospitalInfo").permitAll()
@@ -115,6 +151,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/sys/disclaimerInfo/getDisclaimerInfo").permitAll()
                 .antMatchers("/sys/mr/createMr").permitAll()
                 .antMatchers("/sys/mr/getMr").permitAll()
+                .antMatchers("/sys/mr/getTcmMr").permitAll()
+                .antMatchers("/sys/mr/getIndicationMr").permitAll()
                 .antMatchers("/sys/plan/getSysPlanInfoDatas").permitAll()
                 .antMatchers("/sys/mrqc/analyze_run").permitAll()
                 .antMatchers("/sys/tokenPermission/delPermission").permitAll()
@@ -122,6 +160,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/sys/push/push").permitAll()
                 .antMatchers("/sys/push/pushApi").permitAll()
                 .antMatchers("/sys/push/indicationPush").permitAll()
+                .antMatchers("/sys/push/indicationExtPush").permitAll()
                 .antMatchers("/sys/push/pushPlan").permitAll()
                 .antMatchers("/demo/templateInfo/updateByIdUsNames").permitAll()
                 .antMatchers("/demo/templateInfo/saveTemplateInfo").permitAll()
@@ -136,16 +175,17 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 //.antMatchers("/sys/plan/revStopPlans").permitAll()
                 .antMatchers("/sys/tokenHospital/getTokenHospital").permitAll()
                 .antMatchers("/demo/retrieval/index").permitAll()
-                .antMatchers("/graph/conceptInfo/staticKnowledgeIndex").permitAll()
-                .antMatchers("/graph/conceptInfo/staticKnowledgeIndexWithoutInfo").permitAll()
-                .antMatchers("/graph/conceptInfo/getStaticKnowledge").permitAll()
-                .antMatchers("/graph/conceptInfo/getStaticKnowledgeForHIS").permitAll()
-                .antMatchers("/graph/conceptInfo/getPage").permitAll()
-                //.antMatchers("/graph/conceptInfo/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/graph/conceptInfo/changeStatus").permitAll()
-                .antMatchers("/graph/conceptInfo/isExist").permitAll()
-                .antMatchers("/graph/conceptInfo/getRecordById").permitAll()
-                .antMatchers("/graph/conceptInfo/updateHasInfoStatusBatch").permitAll()
+                .antMatchers("/kl/conceptInfo/staticKnowledgeIndex").permitAll()
+                .antMatchers("/kl/conceptInfo/staticKnowledgeIndexWithoutInfo").permitAll()
+                .antMatchers("/kl/conceptInfo/getStaticKnowledge").permitAll()
+                .antMatchers("/kl/conceptInfo/getStaticKnowledgeForHIS").permitAll()
+                .antMatchers("/kl/conceptInfo/getPage").permitAll()
+                .antMatchers("/kl/conceptInfo/staticIndexPage").permitAll()
+                //.antMatchers("/kl/conceptInfo/saveOrUpdateRecord").permitAll()
+                //.antMatchers("/kl/conceptInfo/changeStatus").permitAll()
+                .antMatchers("/kl/conceptInfo/isExist").permitAll()
+                .antMatchers("/kl/conceptInfo/getRecordById").permitAll()
+                .antMatchers("/kl/conceptInfo/updateHasInfoStatusBatch").permitAll()
                 .antMatchers("/sys/planDetail/getPlanDetailDatas").permitAll()
                 //.antMatchers("/sys/planDetail/savePlanDetails").permitAll()
                 //.antMatchers("/sys/planDetail/cancelPlanDetails").permitAll()
@@ -161,6 +201,16 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/demo/mrtestInfo/importExcel").permitAll()
                 .antMatchers("/demo/mrtestInfo/exportExcel").permitAll()
                 .antMatchers("/demo/mrtestInfo/mrTestProcess").permitAll()
+                .antMatchers("/kl/dictionary/getDictionarys").permitAll()
+                .antMatchers("/klRulePlan/getMenu").permitAll()
+                .antMatchers("/klRule/getKlRuleInfoPage").permitAll()
+                .antMatchers("/klRule/getByIdRuleInfo").permitAll()
+                .antMatchers("/klRule/saveRuleInfo").permitAll()
+                .antMatchers("/klRule/clearRuleInfo").permitAll()
+                .antMatchers("/klRule/disableRuleInfo").permitAll()
+                .antMatchers("/klRule/startRuleInfo").permitAll()
+                .antMatchers("/klDisease/searchConcept").permitAll()
+                .antMatchers("/cache/clearRuleAll").permitAll()
                 .antMatchers("/dataPage/docking/getDataService").permitAll()
                 .antMatchers("/dataPage/docking/getDataEngine").permitAll()
                 .antMatchers("/**").authenticated();
@@ -194,4 +244,4 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
         log.info("Created jwtTokenEnhancerClient success");
         return converter;
     }
-}
+}

+ 62 - 12
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -35,7 +35,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
         if (matchPermitAllUrl(request)) {
             return;
         }
-        if ("anonymousUser" .equals(authentication.getPrincipal())) {
+        if ("anonymousUser".equals(authentication.getPrincipal())) {
             throw new AccessDeniedException("no right");
         } else {
             String tokenStr = HttpUtils.getHeaders(request).get("Authorization");
@@ -51,7 +51,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 url = authority[0];
                 method = authority[1];
                 if (matchers(url, request)) {
-                    if (method.equals(request.getMethod()) || "ALL" .equals(method)) {
+                    if (method.equals(request.getMethod()) || "ALL".equals(method)) {
                         return;
                     }
                 }
@@ -149,6 +149,42 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 // || matchers("/tran/transfusionConfig/importExcel", request)
                 // || matchers("/tran/transfusionConfig/exportExcel", request)
                 || matchers("/tran/transfusionConfig/exportExcelModule", request)
+                //|| matchers("/tran/scaleConfig/isExistRecord", request)
+                //|| matchers("/tran/scaleConfig/saveOrUpdateRecord", request)
+                //|| matchers("/tran/scaleConfig/saveOrUpdateRecords", request)
+                // || matchers("/tran/scaleConfig/deleteRecord", request)
+                //|| matchers("/tran/scaleConfig/deleteRecords", request)
+                || matchers("/tran/scaleConfig/getPage", request)
+                // || matchers("/tran/scaleConfig/importExcel", request)
+                // || matchers("/tran/scaleConfig/exportExcel", request)
+                || matchers("/tran/scaleConfig/exportExcelModule", request)
+                //|| matchers("/tran/nurseConfig/isExistRecord", request)
+                //|| matchers("/tran/nurseConfig/saveOrUpdateRecord", request)
+                //|| matchers("/tran/nurseConfig/saveOrUpdateRecords", request)
+                // || matchers("/tran/nurseConfig/deleteRecord", request)
+                //|| matchers("/tran/nurseConfig/deleteRecords", request)
+                || matchers("/tran/nurseConfig/getPage", request)
+                // || matchers("/tran/nurseConfig/importExcel", request)
+                // || matchers("/tran/nurseConfig/exportExcel", request)
+                || matchers("/tran/nurseConfig/exportExcelModule", request)
+                //|| matchers("/tran/tcmdiseaseConfig/isExistRecord", request)
+                //|| matchers("/tran/tcmdiseaseConfig/saveOrUpdateRecord", request)
+                //|| matchers("/tran/tcmdiseaseConfig/saveOrUpdateRecords", request)
+                // || matchers("/tran/tcmdiseaseConfig/deleteRecord", request)
+                //|| matchers("/tran/tcmdiseaseConfig/deleteRecords", request)
+                || matchers("/tran/tcmdiseaseConfig/getPage", request)
+                // || matchers("/tran/tcmdiseaseConfig/importExcel", request)
+                // || matchers("/tran/tcmdiseaseConfig/exportExcel", request)
+                || matchers("/tran/tcmdiseaseConfig/exportExcelModule", request)
+                //|| matchers("/tran/tcmsyndromeConfig/isExistRecord", request)
+                //|| matchers("/tran/tcmsyndromeConfig/saveOrUpdateRecord", request)
+                //|| matchers("/tran/tcmsyndromeConfig/saveOrUpdateRecords", request)
+                // || matchers("/tran/tcmsyndromeConfig/deleteRecord", request)
+                //|| matchers("/tran/tcmsyndromeConfig/deleteRecords", request)
+                || matchers("/tran/tcmsyndromeConfig/getPage", request)
+                // || matchers("/tran/tcmsyndromeConfig/importExcel", request)
+                // || matchers("/tran/tcmsyndromeConfig/exportExcel", request)
+                || matchers("/tran/tcmsyndromeConfig/exportExcelModule", request)
                 //|| matchers("/tran/hospitalInfo/saveRecord", request)
                 || matchers("/tran/hospitalInfo/getHospitalInfo", request)
                 || matchers("/tran/hospitalInfo/getAllHospitalInfo", request)
@@ -158,6 +194,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/sys/disclaimerInfo/getDisclaimerInfo", request)
                 || matchers("/sys/mr/createMr", request)
                 || matchers("/sys/mr/getMr", request)
+                || matchers("/sys/mr/getTcmMr", request)
+                || matchers("/sys/mr/getIndicationMr", request)
                 || matchers("/sys/plan/getSysPlanInfoDatas", request)
                 || matchers("/sys/mrqc/analyze_run", request)
                 || matchers("/sys/tokenPermission/delPermission", request)
@@ -165,6 +203,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/sys/push/push", request)
                 || matchers("/sys/push/pushApi", request)
                 || matchers("/sys/push/indicationPush", request)
+                || matchers("/sys/push/indicationExtPush", request)
                 || matchers("/sys/push/pushPlan", request)
                 || matchers("/demo/templateInfo/updateByIdUsNames", request)
                 || matchers("/demo/templateInfo/saveTemplateInfo", request)
@@ -178,16 +217,17 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 //|| matchers("/sys/plan/revStopPlans", request)
                 || matchers("/sys/tokenHospital/getTokenHospital", request)
                 || matchers("/demo/retrieval/index", request)
-                || matchers("/graph/conceptInfo/staticKnowledgeIndex", request)
-                || matchers("/graph/conceptInfo/staticKnowledgeIndexWithoutInfo", request)
-                || matchers("/graph/conceptInfo/getStaticKnowledge", request)
-                || matchers("/graph/conceptInfo/getStaticKnowledgeForHIS", request)
-                || matchers("/graph/conceptInfo/getPage", request)
-                //|| matchers("/graph/conceptInfo/saveOrUpdateRecord", request)
-                //|| matchers("/graph/conceptInfo/changeStatus", request)
-                || matchers("/graph/conceptInfo/isExist", request)
-                || matchers("/graph/conceptInfo/getRecordById", request)
-                || matchers("/graph/conceptInfo/updateHasInfoStatusBatch", request)
+                || matchers("/kl/conceptInfo/staticKnowledgeIndex", request)
+                || matchers("/kl/conceptInfo/staticKnowledgeIndexWithoutInfo", request)
+                || matchers("/kl/conceptInfo/getStaticKnowledge", request)
+                || matchers("/kl/conceptInfo/getStaticKnowledgeForHIS", request)
+                || matchers("/kl/conceptInfo/getPage", request)
+                || matchers("/kl/conceptInfo/staticIndexPage", request)
+                //|| matchers("/kl/conceptInfo/saveOrUpdateRecord", request)
+                //|| matchers("/kl/conceptInfo/changeStatus", request)
+                || matchers("/kl/conceptInfo/isExist", request)
+                || matchers("/kl/conceptInfo/getRecordById", request)
+                || matchers("/kl/conceptInfo/updateHasInfoStatusBatch", request)
                 || matchers("/sys/planDetail/getPlanDetailDatas", request)
                 /*|| matchers("/sys/planDetail/savePlanDetails", request)
                 || matchers("/sys/planDetail/cancelPlanDetails", request)
@@ -203,6 +243,16 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/demo/mrtestInfo/importExcel", request)
                 || matchers("/demo/mrtestInfo/exportExcel", request)
                 || matchers("/demo/mrtestInfo/mrTestProcess", request)
+                || matchers("/kl/dictionary/getDictionarys", request)
+                || matchers("/klRulePlan/getMenu", request)
+                || matchers("/klRule/getKlRuleInfoPage", request)
+                || matchers("/klRule/getByIdRuleInfo", request)
+                || matchers("/klRule/saveRuleInfo", request)
+                || matchers("/klRule/clearRuleInfo", request)
+                || matchers("/klRule/disableRuleInfo", request)
+                || matchers("/klRule/startRuleInfo", request)
+                || matchers("/klDisease/searchConcept", request)
+                || matchers("/cache/clearRuleAll", request)
                 || matchers("/dataPage/docking/getDataService", request)
                 || matchers("/dataPage/docking/getDataEngine", request)
                 || matchers("/", request)) {

+ 2 - 0
src/main/java/com/diagbot/dto/BillMsg.java

@@ -14,6 +14,8 @@ public class BillMsg {
     private String msg;
     // 开单名称
     private String orderName;
+    // 明细名称
+    private String orderDetailName;
     // 开单标准名称
     private String orderStandName;
     // 匹配的内容

+ 17 - 0
src/main/java/com/diagbot/dto/ConceptScaleDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/12 13:50
+ */
+@Getter
+@Setter
+public class ConceptScaleDTO {
+    List<ConceptScaleSubDTO> scaleDetails;
+}

+ 107 - 0
src/main/java/com/diagbot/dto/ConceptScaleDetailDTO.java

@@ -0,0 +1,107 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/12 13:54
+ */
+@Getter
+@Setter
+public class ConceptScaleDetailDTO {
+    /**
+     * 下级
+     */
+    private List<ConceptScaleSubDTO> subList = new ArrayList<>();
+
+    private Long id;
+    /**
+     * -1:表示顶级,其他值表示上级id
+     */
+    private Long parentId;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 0表格1有分数2无分数
+     */
+    private Integer textType;
+
+    /**
+     * 结果类型(1算分;2显示选择结果)
+     */
+    private Integer resultType;
+
+    /**
+     * 选择类型(1单选2多选)
+     */
+    private Integer selectType;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+
+    /**
+     * 系数
+     */
+    private BigDecimal factor;
+
+    /**
+     * 常数
+     */
+    private BigDecimal constant;
+
+
+    /**
+     * 1:显示,0:不显示,2隐藏
+     */
+    private Integer status;
+
+    /**
+     * 组别互斥(同组互斥)
+     */
+    private Integer groupNum;
+
+    /**
+     * 结果
+     */
+    private String result;
+
+    /**
+     * 推送信息
+     */
+    private String pushInfo;
+
+    private Integer match ;
+}

+ 18 - 0
src/main/java/com/diagbot/dto/ConceptScaleSubDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/25 13:46
+ */
+@Getter
+@Setter
+public class ConceptScaleSubDTO {
+    private Integer groupNum;
+    private List<ConceptScaleDetailDTO> detailList;
+}

+ 42 - 0
src/main/java/com/diagbot/dto/GetAllForRelationDTO.java

@@ -0,0 +1,42 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-17 15:23
+ */
+@Setter
+@Getter
+public class GetAllForRelationDTO {
+    /**
+     * 概念id
+     */
+    @ApiModelProperty(value="概念id")
+    private Long conceptId;
+
+    /**
+     * 概念名称
+     */
+    @ApiModelProperty(value="概念名称")
+    private String conceptName;
+
+    /**
+     * 概念id
+     */
+    @ApiModelProperty(value="概念id")
+    private Integer libType;
+
+    /**
+     * 概念名称(类型)
+     */
+    @ApiModelProperty(value="概念名称(类型)")
+    private String conceptNameType;
+
+
+
+}
+

+ 17 - 0
src/main/java/com/diagbot/dto/IndexBatchDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/7 10:27
+ */
+@Getter
+@Setter
+public class IndexBatchDTO {
+    private Long id;
+    private String name;
+    private String code;
+}

+ 43 - 0
src/main/java/com/diagbot/dto/KlConceptDetailDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/24 13:39
+ */
+@Getter
+@Setter
+public class KlConceptDetailDTO {
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 提示明细标题
+     */
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    private String text;
+
+    /**
+     * 提示明细序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
+     */
+    private String contentType;
+}

+ 63 - 0
src/main/java/com/diagbot/dto/KlConceptStaticDTO.java

@@ -0,0 +1,63 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/24 13:38
+ */
+@Getter
+@Setter
+public class KlConceptStaticDTO {
+    /**
+     * 术语id
+     */
+    private Long id;
+    /**
+     * 术语名称
+     */
+    private String name;
+    /**
+     * 关联标题
+     */
+    private String title;
+    /**
+     * 术语类型(词性)
+     */
+    private Integer type;
+    /**
+     * 术语类型(词性)
+     */
+    private String typeName;
+    /**
+     * 临床路径名称
+     */
+    private String clinicalPathwayName;
+    /**
+     * 注意事项名称
+     */
+    private String noticeName;
+    /**
+     * 修改时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Date gmtModified;
+    /**
+     * 修改人
+     */
+    private String modifier;
+    /**
+     * 启用状态
+     */
+    private Integer status;
+    /**
+     * 明细
+     */
+    List<KlConceptDetailDTO> details;
+}

+ 27 - 0
src/main/java/com/diagbot/dto/KlRuleByIdParDTO.java

@@ -0,0 +1,27 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-08 13:18
+ */
+@Setter
+@Getter
+public class KlRuleByIdParDTO {
+    private Long parId;
+    private String parDescription;//规则名称
+    private Integer parRuleType;//规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+    private Long parConceptId;//提示概念id
+    private String parlibName;
+    private Integer parHasSub;//是否有子条件(0:无,1:有)
+    private String parMsg;//附加信息
+    private Integer parStatus;//启用状态(0:禁用,1:启用)
+    private String parLenName;
+    private String parLenCode;
+    private List<KlRuleByIdSubDTO>  klRuleByIdSub;
+}

+ 31 - 0
src/main/java/com/diagbot/dto/KlRuleByIdSubDTO.java

@@ -0,0 +1,31 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-08 13:16
+ */
+@Setter
+@Getter
+public class KlRuleByIdSubDTO {
+    private Long subId;//基础规则id
+    private String subDescription;//基础规则名称
+    private Long subConceptId;//医学标准术语id
+    private String subLibName;//医学标准术语
+    private String subLenName;//基础规则术语类型
+    private String subLenCode;//基础规则术语编码
+    private Integer subType;//基础规则类型(1:开单外等于术语本身;2:开单外存在比较;3:开单外不等于术语本身;4:过敏原;5:开单项;6:检查结果正则表达式)
+    private Integer groupType;
+    private String subMinOperator;//最小域比较符
+    private String subMinValue;//最小域值
+    private String subMinUnit;//最小域单位
+    private String subMaxOperator;//最大域比较符
+    private String subMaxValue;//最大域值
+    private String subMaxUnit;//最大域单位
+    private String subEqOperator;//等于域比较符
+    private String subEqValue;//等于域值
+    private String subEqUnit;//等于域单位
+}

+ 65 - 0
src/main/java/com/diagbot/dto/KlRuleInfoDTO.java

@@ -0,0 +1,65 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-05 13:44
+ */
+@Setter
+@Getter
+public class KlRuleInfoDTO {
+
+    /**
+     * 主键
+     */
+    private Long parId;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 提示概念id
+     */
+    private Long parConceptId;
+
+    private String parConceptName;
+
+
+    private String parLibTypeName;
+    /**
+     * 描述
+     */
+    private String parDescription;
+
+    /**
+     * 规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+     */
+    private Integer parRuleType;
+
+    /**
+     * 是否有子条件(0:无,1:有)
+     */
+    private Integer parHasSub;
+
+    /**
+     * 启用状态(0:禁用,1:启用)
+     */
+    private Integer parStatus;
+
+    /**
+     * 附加信息
+     */
+    private String parMsg;
+}

+ 38 - 0
src/main/java/com/diagbot/dto/KllisDetailDTO.java

@@ -0,0 +1,38 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/4/16 14:34
+ */
+@Getter
+@Setter
+public class KllisDetailDTO {
+    /**
+     * 名称
+     */
+    private String libName;
+    /**
+     * 编号
+     */
+    private Long id;
+    /**
+     * 下限
+     */
+    private Double minValue;
+    /**
+     * 上限
+     */
+    private Double maxValue;
+    /**
+     * 单位
+     */
+    private String unit;
+    /**
+     * 参考范围:0-范围内,1-范围外
+     */
+    private Integer type;
+}

+ 4 - 0
src/main/java/com/diagbot/dto/LisDetailDTO.java

@@ -43,4 +43,8 @@ public class LisDetailDTO {
      * 非数值类型参考值
      */
     private String referenceValue;
+    /**
+     * 参考范围:0-范围内,1-范围外
+     */
+    private Integer range;
 }

+ 18 - 0
src/main/java/com/diagbot/dto/NurseInfoDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/23 10:55
+ */
+@Getter
+@Setter
+public class NurseInfoDTO {
+    /**
+     * 护理名称
+     */
+    private String name;
+}

+ 1 - 1
src/main/java/com/diagbot/dto/PushBaseDTO.java

@@ -21,4 +21,4 @@ public class PushBaseDTO {
      * 是否有静态知识
      */
     private Integer hasInfo = 0;
-}
+}

+ 5 - 0
src/main/java/com/diagbot/dto/PushDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import com.google.common.collect.Lists;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -30,10 +31,14 @@ public class PushDTO {
     private List<PushBaseDTO> medicines = new ArrayList<>();
     // 并发症
     private List<PushBaseDTO> complications = new ArrayList<>();
+    // 护理
+    private List<PushBaseDTO> nurse = Lists.newArrayList();
     //诊断
     private Map<String, List<PushBaseDTO>> dis;
     //一般治疗
     private List<TreatDTO> treat = new ArrayList<>();
+    //推送量表
+    private List<PushScaleDTO> scale = Lists.newArrayList();
 
     // 记录调试信息
     private Map<String, Object> debug = new LinkedHashMap<>();

+ 18 - 0
src/main/java/com/diagbot/dto/PushScaleDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/26 13:31
+ */
+@Getter
+@Setter
+public class PushScaleDTO extends PushBaseDTO {
+    /**
+     * 是否有评估量表
+     */
+    private Integer hasScale = 0;
+}

+ 16 - 0
src/main/java/com/diagbot/dto/RetrievalDTO.java

@@ -45,4 +45,20 @@ public class RetrievalDTO {
      * 输血
      */
     private List<String> transfusionNames;
+    /**
+     * 量表
+     */
+    private List<ScaleInfoDTO> scalenames;
+    /**
+     * 护理
+     */
+    private List<NurseInfoDTO> nursenames;
+    /**
+     * 中医诊断
+     */
+    private List<TcmdiseaseInfoDTO> tcmdiseaseNames;
+    /**
+     * 中医证候
+     */
+    private List<TcmsyndromeInfoDTO> tcmsyndromeNames;
 }

+ 19 - 0
src/main/java/com/diagbot/dto/ScaleInfoDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/13 14:06
+ */
+@Getter
+@Setter
+public class ScaleInfoDTO {
+    /**
+     * 量表名称
+     */
+    private String name;
+}
+

+ 5 - 0
src/main/java/com/diagbot/dto/StaticKnowledgeDTO.java

@@ -42,4 +42,9 @@ public class StaticKnowledgeDTO {
      * 静态知识明细
      */
     private Map<String, List<StaticKnowledgeDetailDTO>> details;
+
+    /**
+     * 量表结构
+     */
+    private ConceptScaleDTO scale;
 }

+ 9 - 0
src/main/java/com/diagbot/dto/StaticKnowledgeIndexDTO.java

@@ -19,6 +19,10 @@ public class StaticKnowledgeIndexDTO {
      * 术语名称
      */
     private String name;
+    /**
+     * 编码
+     */
+    private String code;
     /**
      * 词性
      */
@@ -51,4 +55,9 @@ public class StaticKnowledgeIndexDTO {
      * 是否有治疗方案静态知识
      */
     private Integer hasTreatInfo = 0;
+    /**
+     * 启用禁用
+     */
+    private Integer status;
+
 }

+ 28 - 0
src/main/java/com/diagbot/dto/StaticKnowledgeIndexPageDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/7 13:29
+ */
+@Getter
+@Setter
+public class StaticKnowledgeIndexPageDTO extends StaticKnowledgeIndexDTO {
+    /**
+     * 临床路径名称
+     */
+    private String clinicalPathwayName;
+
+    /**
+     * 注意事项名称
+     */
+    private String noticeName;
+
+    /**
+     * 摘要
+     */
+    private String abstractContent;
+}

+ 23 - 0
src/main/java/com/diagbot/dto/TcmDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import com.diagbot.biz.push.entity.Item;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/14 13:54
+ */
+@Getter
+@Setter
+public class TcmDTO {
+    /**
+     * 中医疾病
+     */
+    private Item tcmdisease;
+    /**
+     * 中医证候
+     */
+    private Item tcmsyndrome;
+}

+ 23 - 0
src/main/java/com/diagbot/dto/TcmdiseaseInfoDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/13 15:37
+ */
+@Getter
+@Setter
+public class TcmdiseaseInfoDTO {
+    /**
+     * 疾病名称
+     */
+    private String name;
+
+    /**
+     * 编码
+     */
+    private String code;
+}

+ 23 - 0
src/main/java/com/diagbot/dto/TcmsyndromeInfoDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/13 15:43
+ */
+@Getter
+@Setter
+public class TcmsyndromeInfoDTO {
+    /**
+     * 疾病名称
+     */
+    private String name;
+
+    /**
+     * 编码
+     */
+    private String code;
+}

+ 22 - 0
src/main/java/com/diagbot/entity/ConceptInfo.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.Objects;
 
 /**
  * <p>
@@ -180,4 +181,25 @@ public class ConceptInfo implements Serializable {
                 ", status=" + status +
                 "}";
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o)
+            return true;
+        if (o == null || getClass() != o.getClass())
+            return false;
+        ConceptInfo conceptInfo = (ConceptInfo) o;
+        return Objects.equals(id, conceptInfo.id)
+                && Objects.equals(isDeleted, conceptInfo.isDeleted)
+                && Objects.equals(name, conceptInfo.name)
+                && Objects.equals(type, conceptInfo.type)
+                && Objects.equals(clinicalPathwayName, conceptInfo.clinicalPathwayName)
+                && Objects.equals(noticeName, conceptInfo.noticeName)
+                && Objects.equals(status, conceptInfo.status);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, name, type, clinicalPathwayName, noticeName, status);
+    }
 }

+ 14 - 2
src/main/java/com/diagbot/entity/DeptConfig.java

@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
 
 import javax.validation.constraints.NotBlank;
 import java.io.Serializable;
@@ -192,10 +193,12 @@ public class DeptConfig implements Serializable {
 
     @Override
     public boolean equals(Object o) {
-        if (this == o)
+        if (this == o) {
             return true;
-        if (o == null || getClass() != o.getClass())
+        }
+        if (o == null || getClass() != o.getClass()) {
             return false;
+        }
         DeptConfig deptConfig = (DeptConfig) o;
         return Objects.equals(id, deptConfig.id)
                 && Objects.equals(isDeleted, deptConfig.isDeleted)
@@ -210,4 +213,13 @@ public class DeptConfig implements Serializable {
     public int hashCode() {
         return Objects.hash(id, isDeleted, hospitalId, hisName, hisCode, uniqueName, uniqueCode);
     }
+
+    public static boolean nonNull(DeptConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.hisCode)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.uniqueCode)));
+    }
 }

+ 13 - 2
src/main/java/com/diagbot/entity/DiseaseConfig.java

@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
 
 import javax.validation.constraints.NotBlank;
 import java.io.Serializable;
@@ -177,10 +178,12 @@ public class DiseaseConfig implements Serializable {
 
     @Override
     public boolean equals(Object o) {
-        if (this == o)
+        if (this == o) {
             return true;
-        if (o == null || getClass() != o.getClass())
+        }
+        if (o == null || getClass() != o.getClass()) {
             return false;
+        }
         DiseaseConfig diseaseConfig = (DiseaseConfig) o;
         return Objects.equals(id, diseaseConfig.id)
                 && Objects.equals(isDeleted, diseaseConfig.isDeleted)
@@ -194,4 +197,12 @@ public class DiseaseConfig implements Serializable {
     public int hashCode() {
         return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, icdCode);
     }
+
+    public static boolean nonNull(DiseaseConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.icdCode)));
+    }
 }

+ 17 - 3
src/main/java/com/diagbot/entity/DrugConfig.java

@@ -1,12 +1,14 @@
 package com.diagbot.entity;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
 
 import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Size;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Objects;
@@ -86,6 +88,7 @@ public class DrugConfig implements Serializable {
      * 剂型
      */
     @Excel(name = "药品剂型", width = 60, orderNum = "3", isImportField = "true")
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String form;
 
     public Long getId() {
@@ -195,10 +198,12 @@ public class DrugConfig implements Serializable {
 
     @Override
     public boolean equals(Object o) {
-        if (this == o)
+        if (this == o) {
             return true;
-        if (o == null || getClass() != o.getClass())
+        }
+        if (o == null || getClass() != o.getClass()) {
             return false;
+        }
         DrugConfig drugConfig = (DrugConfig) o;
         return Objects.equals(id, drugConfig.id)
                 && Objects.equals(isDeleted, drugConfig.isDeleted)
@@ -213,4 +218,13 @@ public class DrugConfig implements Serializable {
     public int hashCode() {
         return Objects.hash(id, isDeleted, hospitalId, hisName, form, uniqueName, uniqueCode);
     }
+
+    public static boolean nonNull(DrugConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.uniqueCode)
+                && StringUtil.isBlank(o.form)));
+    }
 }

+ 18 - 0
src/main/java/com/diagbot/entity/KlRuleMenuWrapper.java

@@ -0,0 +1,18 @@
+package com.diagbot.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-09 10:20
+ */
+@Getter
+@Setter
+public class KlRuleMenuWrapper extends KlRulePlan {
+    private List<KlRuleMenuWrapper> subMenuList = new ArrayList<>();
+}

+ 218 - 0
src/main/java/com/diagbot/entity/KlRulePlan.java

@@ -0,0 +1,218 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-03-09
+ */
+public class KlRulePlan implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 资源ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+    private String planCode;
+
+    /**
+     * 规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+     */
+    private Long ruleType;
+
+    /**
+     * -1:表示顶级,其他值表示上级菜单的id
+     */
+    private Long parentId;
+
+    /**
+     * 基础规则类型
+     */
+    private String name;
+
+    private Integer type;
+    private Integer number;
+    /**
+     * 类型编码
+     */
+    private String code;
+
+    private Integer firstPlace;
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    private String remark;
+
+    public String getPlanCode() {
+        return planCode;
+    }
+
+    public void setPlanCode(String planCode) {
+        this.planCode = planCode;
+    }
+
+    public Integer getFirstPlace() {
+        return firstPlace;
+    }
+
+    public void setFirstPlace(Integer firstPlace) {
+        this.firstPlace = firstPlace;
+    }
+
+    public Integer getNumber() {
+        return number;
+    }
+
+    public void setNumber(Integer number) {
+        this.number = number;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public Long getRuleType() {
+        return ruleType;
+    }
+
+    public void setRuleType(Long ruleType) {
+        this.ruleType = ruleType;
+    }
+    public Long getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(Long parentId) {
+        this.parentId = parentId;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+    public Integer getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(Integer orderNo) {
+        this.orderNo = orderNo;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "KlRulePlan{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", ruleType=" + ruleType +
+                ", parentId=" + parentId +
+                ", name=" + name +
+                ", type=" + type +
+                ", code=" + code +
+                ", orderNo=" + orderNo +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 17 - 2
src/main/java/com/diagbot/entity/LisConfig.java

@@ -1,9 +1,12 @@
 package com.diagbot.entity;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
 import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
@@ -72,6 +75,7 @@ public class LisConfig implements Serializable {
      * 检验细项
      */
     @Excel(name = "检验细项", width = 40, orderNum = "2", isImportField = "true")
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String hisDetailName;
 
     /**
@@ -194,10 +198,12 @@ public class LisConfig implements Serializable {
 
     @Override
     public boolean equals(Object o) {
-        if (this == o)
+        if (this == o) {
             return true;
-        if (o == null || getClass() != o.getClass())
+        }
+        if (o == null || getClass() != o.getClass()) {
             return false;
+        }
         LisConfig lisConfig = (LisConfig) o;
         return Objects.equals(id, lisConfig.id)
                 && Objects.equals(isDeleted, lisConfig.isDeleted)
@@ -212,4 +218,13 @@ public class LisConfig implements Serializable {
     public int hashCode() {
         return Objects.hash(id, isDeleted, hospitalId, hisName, hisDetailName, uniqueName, uniqueCode);
     }
+
+    public static boolean nonNull(LisConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.hisDetailName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.uniqueCode)));
+    }
 }

+ 207 - 0
src/main/java/com/diagbot/entity/NurseConfig.java

@@ -0,0 +1,207 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 护理映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-26
+ */
+@TableName("tran_nurse_config")
+public class NurseConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院项目名称
+     */
+    @Excel(name = "医院护理名称", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院护理名称")
+    private String hisName;
+
+    /**
+     * 标准名称
+     */
+    @Excel(name = "标准护理名称", width = 40, orderNum = "3", isImportField = "true")
+    @NotBlank(message = "请输入标准护理名称")
+    private String uniqueName;
+
+    /**
+     * 标准编码
+     */
+    private String uniqueCode;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    @Override
+    public String toString() {
+        return "NurseConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        NurseConfig nurseConfig = (NurseConfig) o;
+        return Objects.equals(id, nurseConfig.id)
+                && Objects.equals(isDeleted, nurseConfig.isDeleted)
+                && Objects.equals(hospitalId, nurseConfig.hospitalId)
+                && Objects.equals(hisName, nurseConfig.hisName)
+                && Objects.equals(uniqueName, nurseConfig.uniqueName)
+                && Objects.equals(uniqueCode, nurseConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+    }
+
+    public static boolean nonNull(NurseConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.uniqueCode)));
+    }
+}

+ 13 - 2
src/main/java/com/diagbot/entity/OperationConfig.java

@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
 
 import javax.validation.constraints.NotBlank;
 import java.io.Serializable;
@@ -177,10 +178,12 @@ public class OperationConfig implements Serializable {
 
     @Override
     public boolean equals(Object o) {
-        if (this == o)
+        if (this == o) {
             return true;
-        if (o == null || getClass() != o.getClass())
+        }
+        if (o == null || getClass() != o.getClass()) {
             return false;
+        }
         OperationConfig operationConfig = (OperationConfig) o;
         return Objects.equals(id, operationConfig.id)
                 && Objects.equals(isDeleted, operationConfig.isDeleted)
@@ -194,4 +197,12 @@ public class OperationConfig implements Serializable {
     public int hashCode() {
         return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
     }
+
+    public static boolean nonNull(OperationConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.uniqueCode)));
+    }
 }

+ 13 - 2
src/main/java/com/diagbot/entity/PacsConfig.java

@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
 
 import javax.validation.constraints.NotBlank;
 import java.io.Serializable;
@@ -177,10 +178,12 @@ public class PacsConfig implements Serializable {
 
     @Override
     public boolean equals(Object o) {
-        if (this == o)
+        if (this == o) {
             return true;
-        if (o == null || getClass() != o.getClass())
+        }
+        if (o == null || getClass() != o.getClass()) {
             return false;
+        }
         PacsConfig pacsConfig = (PacsConfig) o;
         return Objects.equals(id, pacsConfig.id)
                 && Objects.equals(isDeleted, pacsConfig.isDeleted)
@@ -194,4 +197,12 @@ public class PacsConfig implements Serializable {
     public int hashCode() {
         return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
     }
+
+    public static boolean nonNull(PacsConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.uniqueCode)));
+    }
 }

+ 207 - 0
src/main/java/com/diagbot/entity/ScaleConfig.java

@@ -0,0 +1,207 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 量表映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-13
+ */
+@TableName("tran_scale_config")
+public class ScaleConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院项目名称
+     */
+    @Excel(name = "医院量表名称", width = 60, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院量表名称")
+    private String hisName;
+
+    /**
+     * 标准名称
+     */
+    @Excel(name = "标准量表名称", width = 60, orderNum = "3", isImportField = "true")
+    @NotBlank(message = "请输入标准量表名称")
+    private String uniqueName;
+
+    /**
+     * 标准编码
+     */
+    private String uniqueCode;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    @Override
+    public String toString() {
+        return "ScaleConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        ScaleConfig scaleConfig = (ScaleConfig) o;
+        return Objects.equals(id, scaleConfig.id)
+                && Objects.equals(isDeleted, scaleConfig.isDeleted)
+                && Objects.equals(hospitalId, scaleConfig.hospitalId)
+                && Objects.equals(hisName, scaleConfig.hisName)
+                && Objects.equals(uniqueName, scaleConfig.uniqueName)
+                && Objects.equals(uniqueCode, scaleConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+    }
+
+    public static boolean nonNull(ScaleConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.uniqueCode)));
+    }
+}

+ 208 - 0
src/main/java/com/diagbot/entity/TcmdiseaseConfig.java

@@ -0,0 +1,208 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 中医疾病映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-05-13
+ */
+@TableName("tran_tcmdisease_config")
+public class TcmdiseaseConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院项目名称
+     */
+    @Excel(name = "中医疾病名称", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院中医疾病名称")
+    private String hisName;
+
+    /**
+     * 标准名称
+     */
+    @Excel(name = "标准中医疾病名称", width = 40, orderNum = "3", isImportField = "true")
+    @NotBlank(message = "请输入标准中医疾病名称")
+    private String uniqueName;
+
+    /**
+     * 标准编码
+     */
+    @Excel(name = "中医疾病代码", width = 40, orderNum = "2", isImportField = "true")
+    private String uniqueCode;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    @Override
+    public String toString() {
+        return "TcmdiseaseConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        TcmdiseaseConfig tcmdiseaseConfig = (TcmdiseaseConfig) o;
+        return Objects.equals(id, tcmdiseaseConfig.id)
+                && Objects.equals(isDeleted, tcmdiseaseConfig.isDeleted)
+                && Objects.equals(hospitalId, tcmdiseaseConfig.hospitalId)
+                && Objects.equals(hisName, tcmdiseaseConfig.hisName)
+                && Objects.equals(uniqueName, tcmdiseaseConfig.uniqueName)
+                && Objects.equals(uniqueCode, tcmdiseaseConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+    }
+
+    public static boolean nonNull(TcmdiseaseConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.uniqueCode)));
+    }
+}

+ 208 - 0
src/main/java/com/diagbot/entity/TcmsyndromeConfig.java

@@ -0,0 +1,208 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 中医证候映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-05-13
+ */
+@TableName("tran_tcmsyndrome_config")
+public class TcmsyndromeConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院项目名称
+     */
+    @Excel(name = "医院中医证候名称", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院中医证候名称")
+    private String hisName;
+
+    /**
+     * 标准名称
+     */
+    @Excel(name = "标准中医证候名称", width = 40, orderNum = "3", isImportField = "true")
+    @NotBlank(message = "请输入标准中医证候名称")
+    private String uniqueName;
+
+    /**
+     * 标准编码
+     */
+    @Excel(name = "中医证候代码", width = 40, orderNum = "2", isImportField = "true")
+    private String uniqueCode;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    @Override
+    public String toString() {
+        return "TcmsyndromeConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        TcmsyndromeConfig tcmsyndromeConfig = (TcmsyndromeConfig) o;
+        return Objects.equals(id, tcmsyndromeConfig.id)
+                && Objects.equals(isDeleted, tcmsyndromeConfig.isDeleted)
+                && Objects.equals(hospitalId, tcmsyndromeConfig.hospitalId)
+                && Objects.equals(hisName, tcmsyndromeConfig.hisName)
+                && Objects.equals(uniqueName, tcmsyndromeConfig.uniqueName)
+                && Objects.equals(uniqueCode, tcmsyndromeConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+    }
+
+    public static boolean nonNull(TcmsyndromeConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.uniqueCode)));
+    }
+}

+ 13 - 2
src/main/java/com/diagbot/entity/TransfusionConfig.java

@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.util.StringUtil;
 
 import javax.validation.constraints.NotBlank;
 import java.io.Serializable;
@@ -177,10 +178,12 @@ public class TransfusionConfig implements Serializable {
 
     @Override
     public boolean equals(Object o) {
-        if (this == o)
+        if (this == o) {
             return true;
-        if (o == null || getClass() != o.getClass())
+        }
+        if (o == null || getClass() != o.getClass()) {
             return false;
+        }
         TransfusionConfig transfusionConfig = (TransfusionConfig) o;
         return Objects.equals(id, transfusionConfig.id)
                 && Objects.equals(isDeleted, transfusionConfig.isDeleted)
@@ -194,4 +197,12 @@ public class TransfusionConfig implements Serializable {
     public int hashCode() {
         return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
     }
+
+    public static boolean nonNull(TransfusionConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.uniqueCode)));
+    }
 }

+ 9 - 2
src/main/java/com/diagbot/enums/ConceptTypeEnum.java

@@ -9,15 +9,22 @@ import lombok.Setter;
  * @time: 2020/9/10 15:51
  */
 public enum ConceptTypeEnum implements KeyedNamed {
+    /**
+     *
+     */
     LisPack(1, "检验套餐"),
     Lis(2, "检验细项"),
     Pacs(3, "检查"),
     Disease(4, "诊断"),
     Drug(5, "药品"),
-    Opeartion(6, "手术和操作"),
+    Operation(6, "手术和操作"),
     Dept(7, "科室"),
     Transfusion(8, "输血"),
-    PacsSubName(9, "检查子项");
+    PacsSubName(9, "检查子项"),
+    Scale(10, "量表"),
+    Nurse(11, "护理"),
+    Tcmdisease(12,"中医疾病"),
+    Tcmsyndrome(13,"中医证候");
 
     @Setter
     private int key;

+ 64 - 0
src/main/java/com/diagbot/enums/OtherIndexEnum.java

@@ -0,0 +1,64 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/25 10:41
+ */
+public enum OtherIndexEnum implements KeyedNamed {
+
+    TcmDiag(1, "tcmDiag"),
+    TcmSyndrome(2, "tcmSyndrome");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    OtherIndexEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static OtherIndexEnum getEnum(int key) {
+        for (OtherIndexEnum item : OtherIndexEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static OtherIndexEnum getEnum(String name) {
+        for (OtherIndexEnum item : OtherIndexEnum.values()) {
+            if (item.name.equals(name)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        OtherIndexEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    public static Integer getKey(String name) {
+        OtherIndexEnum item = getEnum(name);
+        return item != null ? item.key : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 24 - 0
src/main/java/com/diagbot/facade/CacheFacade.java

@@ -0,0 +1,24 @@
+package com.diagbot.facade;
+
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.util.RespDTOUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-11 11:16
+ */
+@Component
+public class CacheFacade {
+    @Autowired
+    CdssCoreClient cdssCoreClient;
+
+    public boolean clearRuleInfoAll() {
+        RespDTO<Boolean> resData =  cdssCoreClient.clearRuleAll();
+        RespDTOUtil.respNGDeal(resData, "加载数据失败!");
+        return  resData.data;
+    }
+}

+ 188 - 16
src/main/java/com/diagbot/facade/ConceptInfoFacade.java

@@ -7,6 +7,7 @@ import com.diagbot.client.CdssCoreClient;
 import com.diagbot.dto.ConceptDetailDTO;
 import com.diagbot.dto.ConceptInfoDTO;
 import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.GetAllForRelationDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.StaticKnowledgeDTO;
 import com.diagbot.dto.StaticKnowledgeDetailDTO;
@@ -33,8 +34,10 @@ import com.diagbot.vo.ConceptInfoPageVO;
 import com.diagbot.vo.ConceptInfoVO;
 import com.diagbot.vo.HasStaticKnowledgeVO;
 import com.diagbot.vo.IdVO;
+import com.diagbot.vo.SearchConceptVO;
 import com.diagbot.vo.StaticKnowledgeHISVO;
 import com.diagbot.vo.StaticKnowledgeIndexVO;
+import com.diagbot.vo.StaticKnowledgeNameVO;
 import com.diagbot.vo.StaticKnowledgeVO;
 import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -75,6 +78,10 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
     private DiseaseConfigFacade diseaseConfigFacade;
     @Autowired
     private OperationConfigFacade operationConfigFacade;
+    @Autowired
+    private ScaleConfigFacade scaleConfigFacade;
+    @Autowired
+    private NurseConfigFacade nurseConfigFacade;
 
     /**
      * 返回带静态知识的检索结果
@@ -255,7 +262,39 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         ConceptInfo conceptInfo = this.getOne(conceptInfoQueryWrapper, false);
 
         if (conceptInfo == null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "缺少静态信息");
+            StaticKnowledgeNameVO superName = new StaticKnowledgeNameVO();
+            if (typeName.equals("实验室检查名称")) {
+                StaticKnowledgeNameVO staticKnowledgeNameVO = new StaticKnowledgeNameVO();
+                staticKnowledgeNameVO.setName(staticKnowledgeVO.getName());
+                staticKnowledgeNameVO.setType(staticKnowledgeVO.getType());
+                RespDTO<StaticKnowledgeNameVO> respDTO = cdssCoreClient.getSuperName(staticKnowledgeNameVO);
+                if (RespDTOUtil.respIsOK(respDTO)) {
+                    superName = respDTO.data;
+                }
+            } else if (typeName.equals("辅助检查名称")) {
+                StaticKnowledgeNameVO staticKnowledgeNameVO = new StaticKnowledgeNameVO();
+                staticKnowledgeNameVO.setName(staticKnowledgeVO.getName());
+                staticKnowledgeNameVO.setType(6);
+                RespDTO<StaticKnowledgeNameVO> respDTO = cdssCoreClient.getSuperName(staticKnowledgeNameVO);
+                if (RespDTOUtil.respIsOK(respDTO)) {
+                    superName = respDTO.data;
+                }
+            } else {
+                throw new CommonException(CommonErrorCode.IS_EXISTS, "缺少静态信息");
+            }
+            typeName = dicStaticTypeValNameMap.get(superName.getType().toString());
+            typeName = convertTypeName(typeName, 1, dicList);
+
+            conceptInfoQueryWrapper = new QueryWrapper<>();
+            conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("name", superName.getName())
+                    .eq("status", StatusEnum.Enable.getKey())
+                    .eq("type", typeName);
+            conceptInfo = this.getOne(conceptInfoQueryWrapper, false);
+
+            if (conceptInfo == null) {
+                throw new CommonException(CommonErrorCode.IS_EXISTS, "缺少静态信息");
+            }
         }
 
         BeanUtil.copyProperties(conceptInfo, staticKnowledgeDTO);
@@ -342,11 +381,31 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
 
         List<StaticKnowledgeHISDTO> retList = Lists.newArrayList();
         List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
         Map<String, String> dicStaticTypeValNameMap =
                 EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
-        String typeName = dicStaticTypeValNameMap.get(staticKnowledgeHISVO.getType().toString());
-        List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
-        typeName = convertTypeName(typeName, 1, dicList);
+
+        List<String> typeNames = ListUtil.newArrayList();
+        List<Integer> types = ListUtil.newArrayList();
+        types.add(staticKnowledgeHISVO.getType());
+        if (staticKnowledgeHISVO.getType().equals(3)) {
+            types.add(4);
+        } else if (staticKnowledgeHISVO.getType().equals(4)) {
+            types.add(3);
+        }
+        if (staticKnowledgeHISVO.getType().equals(5)) {
+            types.add(6);
+        } else if (staticKnowledgeHISVO.getType().equals(6)) {
+            types.add(5);
+        }
+
+
+        for (Integer type : types) {
+            String typeName = dicStaticTypeValNameMap.get(type.toString());
+            typeName = convertTypeName(typeName, 1, dicList);
+            typeNames.add(typeName);
+        }
+
         //术语映射
         List<String> uniqueNameList = getUniqueNames(staticKnowledgeHISVO);
         if (ListUtil.isEmpty(uniqueNameList)) {
@@ -356,8 +415,89 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .in("name", uniqueNameList)
                 .eq("status", StatusEnum.Enable.getKey())
-                .eq("type", typeName);
-        List<ConceptInfo> conceptInfoList = this.list(conceptInfoQueryWrapper);
+                .in("type", typeNames);
+        List<ConceptInfo> conceptList = this.list(conceptInfoQueryWrapper);
+        List<ConceptInfo> conceptInfoList = Lists.newLinkedList();
+        if (staticKnowledgeHISVO.getType().equals(3)) {
+            conceptInfoList.addAll(conceptList.stream().filter(i -> i.getType().equals("实验室检查套餐名")).collect(Collectors.toList()));
+            for (ConceptInfo info : conceptList) {
+                if (info.getType().equals("实验室检查名称")
+                        && ListUtil.isEmpty(conceptInfoList.stream().filter(i -> i.getName().equals(info.getName())).collect(Collectors.toList()))) {
+                    conceptInfoList.add(info);
+                }
+            }
+        }
+        if (staticKnowledgeHISVO.getType().equals(4)) {
+            conceptInfoList.addAll(conceptList.stream().filter(i -> i.getType().equals("实验室检查名称")).collect(Collectors.toList()));
+            for (ConceptInfo info : conceptList) {
+                if (info.getType().equals("实验室检查套餐名")
+                        && ListUtil.isEmpty(conceptInfoList.stream().filter(i -> i.getName().equals(info.getName())).collect(Collectors.toList()))) {
+                    conceptInfoList.add(info);
+                }
+            }
+        } else {
+            conceptInfoList.addAll(conceptList);
+        }
+
+        List<String> existUniqueNameList = Lists.newLinkedList();
+
+        if (ListUtil.isNotEmpty(conceptInfoList)) {
+            existUniqueNameList.addAll(conceptInfoList
+                    .stream()
+                    .map(i -> i.getName())
+                    .collect(Collectors.toList()));
+        }
+
+        //未匹配到静态知识
+        List<String> notExistUniqueNameList = Lists.newLinkedList();
+        uniqueNameList.forEach(name -> {
+            if (!existUniqueNameList.contains(name)) {
+                notExistUniqueNameList.add(name);
+            }
+        });
+
+        //获取上级静态知识
+        if (ListUtil.isNotEmpty(notExistUniqueNameList)) {
+            List<StaticKnowledgeNameVO> paramNames = Lists.newLinkedList();
+            List<StaticKnowledgeNameVO> superNames = Lists.newLinkedList();
+            for (String name : notExistUniqueNameList) {
+                StaticKnowledgeNameVO paramName = new StaticKnowledgeNameVO();
+                paramName.setName(name);
+                if (staticKnowledgeHISVO.getType().equals(3)) {
+                    paramName.setType(4);
+                } else if (staticKnowledgeHISVO.getType().equals(5)) {
+                    paramName.setType(6);
+                } else {
+                    paramName.setType(staticKnowledgeHISVO.getType());
+                }
+                paramNames.add(paramName);
+            }
+            RespDTO<List<StaticKnowledgeNameVO>> respDTO = cdssCoreClient.getSuperNameBatch(paramNames);
+            if (RespDTOUtil.respIsOK(respDTO)) {
+                superNames = respDTO.data;
+            }
+            if (ListUtil.isNotEmpty(superNames)) {
+                List<String> superNameList = superNames.stream().map(i -> i.getName()).distinct().collect(Collectors.toList());
+                List<Integer> superTypes = superNames.stream().map(i -> i.getType()).distinct().collect(Collectors.toList());
+                List<String> superTypeNames = Lists.newLinkedList();
+                for (Integer type : superTypes) {
+                    String typeName = dicStaticTypeValNameMap.get(type.toString());
+                    typeName = convertTypeName(typeName, 1, dicList);
+                    superTypeNames.add(typeName);
+                }
+                conceptInfoQueryWrapper = new QueryWrapper<>();
+                conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .in("name", superNameList)
+                        .eq("status", StatusEnum.Enable.getKey())
+                        .in("type", superTypeNames);
+                List<ConceptInfo> superConceptInfoList = this.list(conceptInfoQueryWrapper);
+                if (ListUtil.isNotEmpty(superConceptInfoList)) {
+                    conceptInfoList.addAll(superConceptInfoList);
+                }
+            }
+        }
+
+        conceptInfoList = conceptInfoList.stream().distinct().collect(Collectors.toList());
 
         if (ListUtil.isEmpty(conceptInfoList)) {
             return retList;
@@ -393,7 +533,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                 = EntityUtil.makeEntityListMap(detailList, "conceptId");
         for (StaticKnowledgeHISDTO staticKnowledgeDTO : retList) {
             staticKnowledgeDTO.setHisName(staticKnowledgeHISVO.getHisName());
-            staticKnowledgeDTO.setHisName(staticKnowledgeHISVO.getHisDetailName());
+            staticKnowledgeDTO.setHisDetailName(staticKnowledgeHISVO.getHisDetailName());
             List<StaticKnowledgeDetailDTO> subDetailList = conceptMap.get(staticKnowledgeDTO.getId());
             if (ListUtil.isNotEmpty(subDetailList)) {
                 List<StaticKnowledgeDetailDTO> introduceList = subDetailList
@@ -481,7 +621,8 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                 Map<String, Map<String, Long>> disConfigMap
                         = diseaseConfigFacade.getConfigMap(hospitalId,
                         ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
-                if (disConfigMap != null) {
+                if (disConfigMap != null
+                        && disConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
                     nameList = new ArrayList<>(disConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
                 }
                 break;
@@ -489,7 +630,8 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                 Map<String, Map<String, Long>> drugConfigMap
                         = drugConfigFacade.getConfigMapWithoutForm(hospitalId,
                         ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
-                if (drugConfigMap != null) {
+                if (drugConfigMap != null
+                        && drugConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
                     nameList = new ArrayList<>(drugConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
                 }
                 break;
@@ -511,29 +653,52 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                 }
                 break;
             case 5:
+            case 6:
                 Map<String, Map<String, Long>> pacsConfigMap
                         = pacsConfigFacade.getConfigMap(hospitalId,
                         ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
-                if (pacsConfigMap != null) {
+                if (pacsConfigMap != null
+                        && pacsConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
                     nameList = new ArrayList<>(pacsConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
                 }
                 break;
-            case 6:
+            case 7:
                 Map<String, Map<String, Long>> operationConfigMap
                         = operationConfigFacade.getConfigMap(hospitalId,
                         ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
-                if (operationConfigMap != null) {
+                if (operationConfigMap != null &&
+                        operationConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
                     nameList = new ArrayList<>(operationConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
                 }
                 break;
+            case 8:
+                Map<String, Map<String, Long>> scaleConfigMap
+                        = scaleConfigFacade.getConfigMap(hospitalId,
+                        ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
+                if (scaleConfigMap != null &&
+                        scaleConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
+                    nameList = new ArrayList<>(scaleConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
+                }
+                break;
+            case 9:
+                Map<String, Map<String, Long>> nurseConfigMap
+                        = nurseConfigFacade.getConfigMap(hospitalId,
+                        ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
+                if (nurseConfigMap != null &&
+                        nurseConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
+                    nameList = new ArrayList<>(nurseConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
+                }
+                break;
             default:
                 break;
 
         }
-        nameList = nameList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
+        if (ListUtil.isNotEmpty(nameList)) {
+            nameList = nameList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
+        }
         return nameList;
     }
 
@@ -543,6 +708,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
      * @param conceptInfoPageVO
      * @return
      */
+    @Override
     public IPage<ConceptInfoDTO> getPage(ConceptInfoPageVO conceptInfoPageVO) {
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
         List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
@@ -849,4 +1015,10 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         }
         return true;
     }
+
+    public List<GetAllForRelationDTO> searchConceptByNameAndLibType(SearchConceptVO searchConceptVO) {
+        RespDTO<List<GetAllForRelationDTO>> relationDTORespDTO = cdssCoreClient.searchConcept(searchConceptVO);
+        RespDTOUtil.respNGDeal(relationDTORespDTO, "查询诊断依据相关的类型术语失败");
+        return relationDTORespDTO.data;
+    }
 }

+ 96 - 57
src/main/java/com/diagbot/facade/DeptConfigFacade.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DeptConfig;
 import com.diagbot.enums.ConceptTypeEnum;
@@ -153,15 +154,16 @@ public class DeptConfigFacade {
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
         List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Long>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
         deptConfigList.forEach(deptConfig -> {
             deptConfig.setHospitalId(Long.valueOf(hospitalId));
             deptConfig.setModifier(userId);
             deptConfig.setGmtModified(now);
             if (deptConfig.getId() == null) {
-                if (configMap.containsKey(deptConfig.getHisName())) {
-                    deleteIds.add(configMap.get(deptConfig.getHisName()).get(deptConfig.getUniqueName()));
+                if (configMap.containsKey(deptConfig.getHisName())
+                        && ListUtil.isNotEmpty(configMap.get(deptConfig.getHisName()).get(deptConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(deptConfig.getHisName()).get(deptConfig.getUniqueName()));
                 }
                 deptConfig.setCreator(userId);
                 deptConfig.setGmtCreate(now);
@@ -250,10 +252,7 @@ public class DeptConfigFacade {
         //2、去除前后空格
         //过滤空数据,保留重复数据,方便计行
         deptConfigList = deptConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getHisCode())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .filter(DeptConfig::nonNull)
                 .collect(Collectors.toList());
         if (ListUtil.isEmpty(deptConfigList)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
@@ -289,60 +288,63 @@ public class DeptConfigFacade {
 
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
-        List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Long>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
-        deptConfigList.forEach(deptConfig -> {
-            deptConfig.setHospitalId(Long.valueOf(hospitalId));
-            deptConfig.setModifier(userId);
-            deptConfig.setGmtModified(now);
-            if (deptConfig.getId() == null) {
-                if (configMap.containsKey(deptConfig.getHisName())) {
-                    deleteIds.add(configMap.get(deptConfig.getHisName()).get(deptConfig.getUniqueName()));
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, List<Long>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+            deptConfigList.forEach(deptConfig -> {
+                deptConfig.setHospitalId(Long.valueOf(hospitalId));
+                deptConfig.setModifier(userId);
+                deptConfig.setGmtModified(now);
+                if (deptConfig.getId() == null) {
+                    if (configMap.containsKey(deptConfig.getHisName())
+                            && ListUtil.isNotEmpty(configMap.get(deptConfig.getHisName()).get(deptConfig.getUniqueName()))) {
+                        deleteIds.addAll(configMap.get(deptConfig.getHisName()).get(deptConfig.getUniqueName()));
+                    }
+                    deptConfig.setCreator(userId);
+                    deptConfig.setGmtCreate(now);
                 }
-                deptConfig.setCreator(userId);
-                deptConfig.setGmtCreate(now);
-            }
-            if (deptConfig.getIsDeleted() == null) {
-                deptConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
+                if (deptConfig.getIsDeleted() == null) {
+                    deptConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
 
-        //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
-        List<String> uniqueNames = deptConfigList.stream()
-                .map(i -> i.getUniqueName())
-                .distinct()
-                .collect(Collectors.toList());
-        ConceptVO conceptVO = new ConceptVO();
-        conceptVO.setNames(uniqueNames);
-        conceptVO.setType(ConceptTypeEnum.Dept.getKey());
-        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
-        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
-        List<String> names = respDTO.data;
-        for (int i = 0; i < deptConfigList.size(); i++) {
-            if (!names.contains(deptConfigList.get(i).getUniqueName())) {
-                errorNumList.add(String.valueOf(i + 2));
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            List<String> uniqueNames = deptConfigList.stream()
+                    .map(i -> i.getUniqueName())
+                    .distinct()
+                    .collect(Collectors.toList());
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.Dept.getKey());
+            RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+            List<String> names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < deptConfigList.size(); i++) {
+                if (!names.contains(deptConfigList.get(i).getUniqueName())) {
+                    errorNumList.add(String.valueOf(i + 2));
+                }
+            }
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
             }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
 
-        //重复数据过滤
-        deptConfigList = deptConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
+            //重复数据过滤
+            deptConfigList = deptConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
 
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        deptConfigService.saveOrUpdateBatch(deptConfigList);
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            deptConfigService.saveOrUpdateBatch(deptConfigList);
+        }
         return true;
     }
 
@@ -378,6 +380,43 @@ public class DeptConfigFacade {
         return retMap;
     }
 
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<DeptConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<DeptConfig> records = deptConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<DeptConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<DeptConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<DeptConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "uniqueName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<DeptConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
     /**
      * 获取映射关系
      * Map<uniqueName,Map<hisName,id>>

+ 96 - 56
src/main/java/com/diagbot/facade/DiseaseConfigFacade.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.CdssCoreClient;
 import com.diagbot.dto.DiseaseInfoDTO;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DiseaseConfig;
 import com.diagbot.enums.ConceptTypeEnum;
@@ -154,15 +155,16 @@ public class DiseaseConfigFacade {
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
         List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Long>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
         diseaseConfigList.forEach(diseaseConfig -> {
             diseaseConfig.setHospitalId(Long.valueOf(hospitalId));
             diseaseConfig.setModifier(userId);
             diseaseConfig.setGmtModified(now);
             if (diseaseConfig.getId() == null) {
-                if (configMap.containsKey(diseaseConfig.getHisName())) {
-                    deleteIds.add(configMap.get(diseaseConfig.getHisName()).get(diseaseConfig.getUniqueName()));
+                if (configMap.containsKey(diseaseConfig.getHisName())
+                        && ListUtil.isNotEmpty(configMap.get(diseaseConfig.getHisName()).get(diseaseConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(diseaseConfig.getHisName()).get(diseaseConfig.getUniqueName()));
                 }
                 diseaseConfig.setCreator(userId);
                 diseaseConfig.setGmtCreate(now);
@@ -252,9 +254,7 @@ public class DiseaseConfigFacade {
         //2、去除前后空格
         //过滤空数据,保留重复数据,方便计行
         diseaseConfigList = diseaseConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getIcdCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .filter(DiseaseConfig::nonNull)
                 .collect(Collectors.toList());
         if (ListUtil.isEmpty(diseaseConfigList)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
@@ -287,60 +287,63 @@ public class DiseaseConfigFacade {
 
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
-        List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Long>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
-        diseaseConfigList.forEach(diseaseConfig -> {
-            diseaseConfig.setHospitalId(Long.valueOf(hospitalId));
-            diseaseConfig.setModifier(userId);
-            diseaseConfig.setGmtModified(now);
-            if (diseaseConfig.getId() == null) {
-                if (configMap.containsKey(diseaseConfig.getHisName())) {
-                    deleteIds.add(configMap.get(diseaseConfig.getHisName()).get(diseaseConfig.getUniqueName()));
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, List<Long>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+            diseaseConfigList.forEach(diseaseConfig -> {
+                diseaseConfig.setHospitalId(Long.valueOf(hospitalId));
+                diseaseConfig.setModifier(userId);
+                diseaseConfig.setGmtModified(now);
+                if (diseaseConfig.getId() == null) {
+                    if (configMap.containsKey(diseaseConfig.getHisName())
+                            && ListUtil.isNotEmpty(configMap.get(diseaseConfig.getHisName()).get(diseaseConfig.getUniqueName()))) {
+                        deleteIds.addAll(configMap.get(diseaseConfig.getHisName()).get(diseaseConfig.getUniqueName()));
+                    }
+                    diseaseConfig.setCreator(userId);
+                    diseaseConfig.setGmtCreate(now);
                 }
-                diseaseConfig.setCreator(userId);
-                diseaseConfig.setGmtCreate(now);
-            }
-            if (diseaseConfig.getIsDeleted() == null) {
-                diseaseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
+                if (diseaseConfig.getIsDeleted() == null) {
+                    diseaseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
 
-        //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
-        List<String> uniqueNames = diseaseConfigList.stream()
-                .map(i -> i.getUniqueName())
-                .distinct()
-                .collect(Collectors.toList());
-        ConceptVO conceptVO = new ConceptVO();
-        conceptVO.setNames(uniqueNames);
-        conceptVO.setType(ConceptTypeEnum.Disease.getKey());
-        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
-        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
-        List<String> names = respDTO.data;
-        for (int i = 0; i < diseaseConfigList.size(); i++) {
-            if (!names.contains(diseaseConfigList.get(i).getUniqueName())) {
-                errorNumList.add(String.valueOf(i + 2));
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            List<String> uniqueNames = diseaseConfigList.stream()
+                    .map(i -> i.getUniqueName())
+                    .distinct()
+                    .collect(Collectors.toList());
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.Disease.getKey());
+            RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+            List<String> names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < diseaseConfigList.size(); i++) {
+                if (!names.contains(diseaseConfigList.get(i).getUniqueName())) {
+                    errorNumList.add(String.valueOf(i + 2));
+                }
+            }
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
             }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
 
-        //重复数据过滤
-        diseaseConfigList = diseaseConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
+            //重复数据过滤
+            diseaseConfigList = diseaseConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
 
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        diseaseConfigService.saveOrUpdateBatch(diseaseConfigList);
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            diseaseConfigService.saveOrUpdateBatch(diseaseConfigList);
+        }
         return true;
     }
 
@@ -376,6 +379,43 @@ public class DiseaseConfigFacade {
         return retMap;
     }
 
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<DiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<DiseaseConfig> records = diseaseConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<DiseaseConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<DiseaseConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<DiseaseConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "uniqueName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<DiseaseConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
     /**
      * 获取映射关系
      * Map<uniqueName,Map<hisName,id>>

+ 105 - 55
src/main/java/com/diagbot/facade/DrugConfigFacade.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.CdssCoreClient;
 import com.diagbot.dto.DictionaryInfoDTO;
 import com.diagbot.dto.DrugInfoDTO;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DrugConfig;
 import com.diagbot.enums.ConceptTypeEnum;
@@ -179,8 +180,8 @@ public class DrugConfigFacade {
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
         List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Map<String, Long>>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), hisNames, uniqueNames);
+        Map<String, Map<String, Map<String, List<Long>>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), hisNames, uniqueNames);
         drugConfigList.forEach(drugConfig -> {
             drugConfig.setHospitalId(Long.valueOf(hospitalId));
             drugConfig.setModifier(userId);
@@ -190,7 +191,7 @@ public class DrugConfigFacade {
                 if (configMap.get(drugConfig.getHisName()) != null
                         && configMap.get(drugConfig.getHisName()).get(form) != null
                         && configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()) != null) {
-                    deleteIds.add(configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()));
+                    deleteIds.addAll(configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()));
                 }
                 drugConfig.setCreator(userId);
                 drugConfig.setGmtCreate(now);
@@ -280,10 +281,7 @@ public class DrugConfigFacade {
         //2、去除前后空格
         //过滤空数据,保留重复数据,方便计行
         drugConfigList = drugConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getForm())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .filter(DrugConfig::nonNull)
                 .collect(Collectors.toList());
         if (ListUtil.isEmpty(drugConfigList)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
@@ -344,59 +342,61 @@ public class DrugConfigFacade {
 
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
-        List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Map<String, Long>>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), hisNames, uniqueNames);
-        drugConfigList.forEach(drugConfig -> {
-            drugConfig.setHospitalId(Long.valueOf(hospitalId));
-            drugConfig.setModifier(userId);
-            drugConfig.setGmtModified(now);
-            String form = StringUtil.isBlank(drugConfig.getForm()) ? "" : drugConfig.getForm();
-            if (drugConfig.getId() == null) {
-                if (configMap.get(drugConfig.getHisName()) != null
-                        && configMap.get(drugConfig.getHisName()).get(form) != null
-                        && configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()) != null) {
-                    deleteIds.add(configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()));
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, Map<String, List<Long>>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), hisNames, uniqueNames);
+            drugConfigList.forEach(drugConfig -> {
+                drugConfig.setHospitalId(Long.valueOf(hospitalId));
+                drugConfig.setModifier(userId);
+                drugConfig.setGmtModified(now);
+                String form = StringUtil.isBlank(drugConfig.getForm()) ? "" : drugConfig.getForm();
+                if (drugConfig.getId() == null) {
+                    if (configMap.get(drugConfig.getHisName()) != null
+                            && configMap.get(drugConfig.getHisName()).get(form) != null
+                            && configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()) != null) {
+                        deleteIds.addAll(configMap.get(drugConfig.getHisName()).get(form).get(drugConfig.getUniqueName()));
+                    }
+                    drugConfig.setCreator(userId);
+                    drugConfig.setGmtCreate(now);
                 }
-                drugConfig.setCreator(userId);
-                drugConfig.setGmtCreate(now);
-            }
-            if (drugConfig.getIsDeleted() == null) {
-                drugConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
+                if (drugConfig.getIsDeleted() == null) {
+                    drugConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
 
-        //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
-        ConceptVO conceptVO = new ConceptVO();
-        conceptVO.setNames(uniqueNames);
-        conceptVO.setType(ConceptTypeEnum.Drug.getKey());
-        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
-        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
-        List<String> names = respDTO.data;
-        for (int i = 0; i < drugConfigList.size(); i++) {
-            if (!names.contains(drugConfigList.get(i).getUniqueName())) {
-                errorNumList.add(String.valueOf(i + 2));
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.Drug.getKey());
+            RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+            List<String> names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < drugConfigList.size(); i++) {
+                if (!names.contains(drugConfigList.get(i).getUniqueName())) {
+                    errorNumList.add(String.valueOf(i + 3));
+                }
+            }
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
             }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
 
-        //重复数据过滤
-        drugConfigList = drugConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
+            //重复数据过滤
+            drugConfigList = drugConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
 
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        drugConfigService.saveOrUpdateBatch(drugConfigList);
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            drugConfigService.saveOrUpdateBatch(drugConfigList);
+        }
         return true;
     }
 
@@ -446,6 +446,56 @@ public class DrugConfigFacade {
         return retMap;
     }
 
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return Map<hisName,Map<form,Map<uniqueName,id>>>
+     */
+    public Map<String, Map<String,Map<String, List<Long>>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Map<String, List<Long>>>> retMap = new HashMap<>();
+        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<DrugConfig> records = drugConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<DrugConfig>> hisNameMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<DrugConfig>> entry : hisNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, Map<String, List<Long>>> formMap = new HashMap<>();
+                entry.getValue().forEach(i -> {
+                    if (StringUtil.isBlank(i.getForm())) {
+                        i.setForm("");
+                    }
+                });
+                Map<String, List<DrugConfig>> subMap
+                        = EntityUtil.makeEntityListMap(entry.getValue(), "form");
+                for (Map.Entry<String, List<DrugConfig>> subEntry : subMap.entrySet()) {
+                    if (ListUtil.isNotEmpty(subEntry.getValue())) {
+                        Map<String, List<DrugConfig>> thirdMap = EntityUtil.makeEntityListMap(subEntry.getValue(), "uniqueName");
+                        Map<String, List<Long>> idMap = new HashMap<>();
+                        for (Map.Entry<String, List<DrugConfig>> thirdEntry : thirdMap.entrySet()) {
+                            idMap.put(thirdEntry.getKey(), thirdEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                        }
+                        formMap.put(subEntry.getKey(), idMap);
+                    }
+                }
+                retMap.put(entry.getKey(), formMap);
+            }
+        }
+        return retMap;
+    }
+
     /**
      * 获取映射关系
      * Map<uniqueName,Map<form,Map<hisName,id>>>

+ 263 - 0
src/main/java/com/diagbot/facade/KlConceptStaticFacade.java

@@ -0,0 +1,263 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.KlConceptStaticDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.StaticKnowledgeDTO;
+import com.diagbot.dto.StaticKnowledgeHISDTO;
+import com.diagbot.dto.StaticKnowledgeIndexDTO;
+import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
+import com.diagbot.entity.SysUser;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ChangeStatusVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.KlConceptStaticPageVO;
+import com.diagbot.vo.KlConceptStaticVO;
+import com.diagbot.vo.PushJoinVO;
+import com.diagbot.vo.ScaleStaticAllVO;
+import com.diagbot.vo.SearchData;
+import com.diagbot.vo.StaticKnowledgeHISVO;
+import com.diagbot.vo.StaticKnowledgeIndexPageVO;
+import com.diagbot.vo.StaticKnowledgeIndexVO;
+import com.diagbot.vo.StaticKnowledgeVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/23 15:41
+ */
+@Component
+public class KlConceptStaticFacade {
+
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+    @Autowired
+    private ConceptInfoFacade conceptInfoFacade;
+    @Autowired
+    private SysUserFacade sysUserFacade;
+    @Autowired
+    MrFacade mrFacade;
+    @Autowired
+    private AssembleFacade assembleFacade;
+
+
+    /**
+     * 静态知识检索
+     *
+     * @param staticKnowledgeIndexVO
+     * @return
+     */
+    public List<StaticKnowledgeIndexDTO> staticKnowledgeIndex(StaticKnowledgeIndexVO staticKnowledgeIndexVO) {
+        List<StaticKnowledgeIndexDTO> retList = Lists.newLinkedList();
+
+        RespDTO<List<StaticKnowledgeIndexDTO>> respDTO = cdssCoreClient.staticKnowledgeIndex(staticKnowledgeIndexVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            retList = respDTO.data;
+        }
+
+        if (staticKnowledgeIndexVO.getHasInfo() != null && staticKnowledgeIndexVO.getHasInfo().equals(1)) {
+            retList = retList.stream().filter(i -> i.getStatus().equals(1)).collect(Collectors.toList());
+        }
+        return retList;
+    }
+
+
+    /**
+     * 获取静态知识
+     *
+     * @param staticKnowledgeVO
+     * @return
+     */
+    public StaticKnowledgeDTO getStaticKnowledge(StaticKnowledgeVO staticKnowledgeVO) {
+        ScaleStaticAllVO scaleStaticAllVO = new ScaleStaticAllVO();
+        if (staticKnowledgeVO.getType() == 8) {
+            PushJoinVO mr = mrFacade.getMr(staticKnowledgeVO.getMrId());
+            if (null != mr) {
+                SearchData searchData = new SearchData();
+                BeanUtil.copyProperties(mr, searchData);
+                //入参映射
+                searchData = assembleFacade.assembleData(searchData);
+                BeanUtil.copyProperties(searchData, scaleStaticAllVO);
+            } else {
+                scaleStaticAllVO.setHospitalId(-1L);
+            }
+        } else {
+            scaleStaticAllVO.setHospitalId(-1L);
+        }
+        BeanUtil.copyProperties(staticKnowledgeVO, scaleStaticAllVO);
+        RespDTO<StaticKnowledgeDTO> respDTO = cdssCoreClient.getStaticKnowledge(scaleStaticAllVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            StaticKnowledgeDTO staticKnowledgeDTO = respDTO.data;
+            return staticKnowledgeDTO;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * 医院端获取静态知识(对接)
+     *
+     * @param staticKnowledgeHISVO
+     * @return
+     */
+    public List<StaticKnowledgeHISDTO> getStaticKnowledgeForHIS(StaticKnowledgeHISVO staticKnowledgeHISVO) {
+
+        List<StaticKnowledgeHISDTO> retList = Lists.newArrayList();
+
+        //术语映射
+        List<String> uniqueNameList = conceptInfoFacade.getUniqueNames(staticKnowledgeHISVO);
+        if (ListUtil.isEmpty(uniqueNameList)) {
+            return retList;
+        }
+
+        for (String uniqueName : uniqueNameList) {
+            StaticKnowledgeVO staticKnowledgeVO = new StaticKnowledgeVO();
+            BeanUtil.copyProperties(staticKnowledgeHISVO, staticKnowledgeVO);
+            staticKnowledgeVO.setName(uniqueName);
+            StaticKnowledgeDTO staticKnowledgeDTO = getStaticKnowledge(staticKnowledgeVO);
+            if (staticKnowledgeDTO != null) {
+                StaticKnowledgeHISDTO staticKnowledgeHISDTO = new StaticKnowledgeHISDTO();
+                BeanUtil.copyProperties(staticKnowledgeDTO, staticKnowledgeHISDTO);
+                staticKnowledgeHISDTO.setHisName(staticKnowledgeHISVO.getHisName());
+                staticKnowledgeHISDTO.setHisDetailName(staticKnowledgeHISVO.getHisDetailName());
+                retList.add(staticKnowledgeHISDTO);
+            }
+        }
+        return retList;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param klConceptStaticPageVO
+     * @return
+     */
+    public IPage<KlConceptStaticDTO> getPage(KlConceptStaticPageVO klConceptStaticPageVO) {
+        Page<KlConceptStaticDTO> page = null;
+        RespDTO<Page<KlConceptStaticDTO>> respDTO = cdssCoreClient.getPage(klConceptStaticPageVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            page = respDTO.data;
+        }
+        List<KlConceptStaticDTO> records = page.getRecords();
+        List<Long> userIds = records.stream().map(KlConceptStaticDTO::getModifier)
+                .distinct()
+                .map(Long::parseLong)
+                .collect(Collectors.toList());
+        List<SysUser> users = sysUserFacade.list(new QueryWrapper<SysUser>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .in("id", userIds, false));
+        if (ListUtil.isNotEmpty(users)) {
+            Map<Long, String> userMap = users.stream().collect(Collectors.toMap(SysUser::getId, SysUser::getLinkman));
+            records.forEach(record -> {
+                if (userMap.containsKey(Long.valueOf(record.getModifier()))) {
+                    record.setModifier(userMap.get(Long.valueOf(record.getModifier())));
+                } else {
+                    record.setModifier("");
+                }
+            });
+
+        } else {
+            records.forEach(record -> {
+                record.setModifier("");
+            });
+        }
+        page.setRecords(records);
+        return page;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param staticKnowledgeIndexPageVO
+     * @return
+     */
+    public IPage<StaticKnowledgeIndexPageDTO> staticIndexPage(StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO) {
+        Page<StaticKnowledgeIndexPageDTO> page = null;
+
+        RespDTO<Page<StaticKnowledgeIndexPageDTO>> respDTO = cdssCoreClient.staticIndexPage(staticKnowledgeIndexPageVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            page = respDTO.data;
+        }
+        return page;
+    }
+
+    /**
+     * 保存记录(新增or修改)
+     *
+     * @param klConceptStaticVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(KlConceptStaticVO klConceptStaticVO) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        klConceptStaticVO.setUserId(Long.valueOf(userId));
+
+        Boolean success = false;
+        RespDTO<Boolean> respDTO = cdssCoreClient.saveOrUpdateRecord(klConceptStaticVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            success = respDTO.data;
+        }
+        return success;
+    }
+
+    /**
+     * 启用禁用
+     *
+     * @param changeStatusVO
+     * @return
+     */
+    public Boolean changeStatus(ChangeStatusVO changeStatusVO) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        changeStatusVO.setUserId(Long.valueOf(userId));
+
+        Boolean success = false;
+        RespDTO<Boolean> respDTO = cdssCoreClient.changeStatus(changeStatusVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            success = respDTO.data;
+        }
+        return success;
+    }
+
+    /**
+     * 根据术语id获取静态信息
+     *
+     * @param idVO
+     * @return
+     */
+    public KlConceptStaticDTO getRecordById(IdVO idVO) {
+        KlConceptStaticDTO klConceptStaticDTO = new KlConceptStaticDTO();
+        RespDTO<KlConceptStaticDTO> respDTO = cdssCoreClient.getRecordById(idVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            klConceptStaticDTO = respDTO.data;
+        }
+        return klConceptStaticDTO;
+    }
+
+    /**
+     * 是否已存在
+     *
+     * @param klConceptStaticVO
+     * @return
+     */
+    public Boolean isExist(KlConceptStaticVO klConceptStaticVO) {
+        Boolean exist = false;
+        RespDTO<Boolean> respDTO = cdssCoreClient.isExist(klConceptStaticVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            exist = respDTO.data;
+        }
+        return exist;
+    }
+}

+ 28 - 0
src/main/java/com/diagbot/facade/KlDictionaryInfoFacade.java

@@ -0,0 +1,28 @@
+package com.diagbot.facade;
+
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.util.RespDTOUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-17 13:34
+ */
+@Component
+public class KlDictionaryInfoFacade {
+    @Autowired
+    CdssCoreClient cdssCoreClient;
+
+    public Map<Long, List<DictionaryInfoDTO>> getListByGroupType() {
+        RespDTO<Map<Long, List<DictionaryInfoDTO>>> dictionaryAll = cdssCoreClient.getDictionaryAll();
+        RespDTOUtil.respNGDeal(dictionaryAll, "获取字典表信息数据失败");
+        return dictionaryAll.data;
+    }
+}

+ 65 - 0
src/main/java/com/diagbot/facade/KlRuleFacade.java

@@ -0,0 +1,65 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.KlRuleByIdParDTO;
+import com.diagbot.dto.KlRuleInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.KlRuleByIdVO;
+import com.diagbot.vo.KlRuleInfoClearVO;
+import com.diagbot.vo.KlRuleInfoSaveVO;
+import com.diagbot.vo.KlRuleInfoVO;
+import com.diagbot.vo.KlRuleSatartOrdisaVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author: wangfeng
+ * @time: 2021/3/1 16:20
+ */
+@Component
+public class KlRuleFacade {
+    @Autowired
+    CdssCoreClient cdssCoreClient;
+
+    public Page<KlRuleInfoDTO> getKlRuleInfoPage(KlRuleInfoVO klRuleInfoVO) {
+        RespDTO<Page<KlRuleInfoDTO>> klRuleInfoPages = cdssCoreClient.getKlRuleInfoPages(klRuleInfoVO);
+        RespDTOUtil.respNGDeal(klRuleInfoPages, "获取分页获取规则维护列表数据失败");
+        return klRuleInfoPages.data;
+    }
+
+    public KlRuleByIdParDTO getByIdRuleInfos(KlRuleByIdVO klRuleByIdVO) {
+        RespDTO<KlRuleByIdParDTO> byIdRuleInfoAll = cdssCoreClient.getByIdRuleInfoAll(klRuleByIdVO);
+        RespDTOUtil.respNGDeal(byIdRuleInfoAll, "获取规则详情数据失败");
+        return byIdRuleInfoAll.data;
+    }
+
+    public Boolean saveRuleInfos(KlRuleInfoSaveVO klRuleInfoSaveVO) {
+        klRuleInfoSaveVO.setModifier("0");
+        RespDTO<Boolean> booleanRespDTO = cdssCoreClient.saveRuleInfoAll(klRuleInfoSaveVO);
+        RespDTOUtil.respNGDeal(booleanRespDTO, "保存规则详情数据失败");
+        return booleanRespDTO.data;
+    }
+
+    public Boolean clearRuleInfos(KlRuleInfoClearVO klRuleInfoClearVO) {
+        RespDTO<Boolean> booleanRespDTO = cdssCoreClient.clearRuleInfoAll(klRuleInfoClearVO);
+        RespDTOUtil.respNGDeal(booleanRespDTO, "刪除规则详情数据失败");
+        return booleanRespDTO.data;
+    }
+
+    public Boolean startOrDisableRule(KlRuleSatartOrdisaVO klRuleSatartOrdisaVO) {
+        klRuleSatartOrdisaVO.setModifier("0");
+        RespDTO<Boolean> booleanRespDTO = cdssCoreClient.disableRuleInfos(klRuleSatartOrdisaVO);
+        RespDTOUtil.respNGDeal(booleanRespDTO, "停用规则失败");
+        return booleanRespDTO.data;
+    }
+
+    public Boolean startRuleInfos(KlRuleSatartOrdisaVO klRuleSatartOrdisaVO) {
+        klRuleSatartOrdisaVO.setModifier("0");
+        RespDTO<Boolean> booleanRespDTO = cdssCoreClient.startRuleInfos(klRuleSatartOrdisaVO);
+        RespDTOUtil.respNGDeal(booleanRespDTO, "启用规则失败");
+        return booleanRespDTO.data;
+    }
+}

+ 28 - 0
src/main/java/com/diagbot/facade/KlRulePlanFacade.java

@@ -0,0 +1,28 @@
+package com.diagbot.facade;
+
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.KlRuleMenuWrapper;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.KlRuleMenuVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-09 15:30
+ */
+@Component
+public class KlRulePlanFacade {
+    @Autowired
+    CdssCoreClient cdssCoreClient;
+
+    public List<KlRuleMenuWrapper> getMenu(KlRuleMenuVO klRuleMenuVO) {
+        RespDTO<List<KlRuleMenuWrapper>> menus = cdssCoreClient.getMenus(klRuleMenuVO);
+        RespDTOUtil.respNGDeal(menus, "获取规则下拉菜单信息数据失败");
+        return menus.data;
+    }
+}

+ 153 - 75
src/main/java/com/diagbot/facade/LisConfigFacade.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.IndexBatchDTO;
+import com.diagbot.dto.KllisDetailDTO;
 import com.diagbot.dto.LisDetailDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.LisConfig;
@@ -22,6 +24,7 @@ import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.ConceptVO;
 import com.diagbot.vo.IdListVO;
 import com.diagbot.vo.IdVO;
+import com.diagbot.vo.KllisDetailVO;
 import com.diagbot.vo.LisConfigListVO;
 import com.diagbot.vo.LisConfigPageVO;
 import com.diagbot.vo.RetrievalVO;
@@ -170,8 +173,8 @@ public class LisConfigFacade {
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
         List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Map<String, Long>>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        Map<String, Map<String, Map<String, List<Long>>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
         lisConfigList.forEach(lisConfig -> {
             lisConfig.setHospitalId(Long.valueOf(hospitalId));
             lisConfig.setModifier(userId);
@@ -180,12 +183,12 @@ public class LisConfigFacade {
                 if (configMap.containsKey(lisConfig.getHisName())) {
                     if (lisConfig.getHisDetailName() == null
                             && configMap.get(lisConfig.getHisName()).containsKey("")) {
-                        if (configMap.get(lisConfig.getHisName()).get("").containsKey(lisConfig.getUniqueName())) {
-                            deleteIds.add(configMap.get(lisConfig.getHisName()).get("").get(lisConfig.getUniqueName()));
+                        if (ListUtil.isNotEmpty(configMap.get(lisConfig.getHisName()).get("").get(lisConfig.getUniqueName()))) {
+                            deleteIds.addAll(configMap.get(lisConfig.getHisName()).get("").get(lisConfig.getUniqueName()));
                         }
                     } else if (configMap.get(lisConfig.getHisName()).containsKey(lisConfig.getHisDetailName())) {
-                        if (configMap.get(lisConfig.getHisName()).get(lisConfig.getHisDetailName()).containsKey(lisConfig.getUniqueName())) {
-                            deleteIds.add(configMap
+                        if (ListUtil.isNotEmpty(configMap.get(lisConfig.getHisName()).get(lisConfig.getHisDetailName()).get(lisConfig.getUniqueName()))) {
+                            deleteIds.addAll(configMap
                                     .get(lisConfig.getHisName())
                                     .get(lisConfig.getHisDetailName())
                                     .get(lisConfig.getUniqueName()));
@@ -281,10 +284,7 @@ public class LisConfigFacade {
         //2、去除前后空格
         //过滤空数据,保留重复数据,方便计行
         lisConfigList = lisConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getHisDetailName())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .filter(LisConfig::nonNull)
                 .collect(Collectors.toList());
         if (ListUtil.isEmpty(lisConfigList)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
@@ -328,73 +328,80 @@ public class LisConfigFacade {
 
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
-        List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Map<String, Long>>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), hisNames, uniqueNames);
-        lisConfigList.forEach(lisConfig -> {
-            lisConfig.setHospitalId(Long.valueOf(hospitalId));
-            lisConfig.setModifier(userId);
-            lisConfig.setGmtModified(now);
-            if (lisConfig.getId() == null) {
-                if (configMap.containsKey(lisConfig.getHisName())) {
-                    if (lisConfig.getHisDetailName() == null
-                            && configMap.get(lisConfig.getHisName()).containsKey("")) {
-                        if (configMap.get(lisConfig.getHisName()).get("").containsKey(lisConfig.getUniqueName())) {
-                            deleteIds.add(configMap.get(lisConfig.getHisName()).get("").get(lisConfig.getUniqueName()));
-                        }
-                    } else if (configMap.get(lisConfig.getHisName()).containsKey(lisConfig.getHisDetailName())) {
-                        if (configMap.get(lisConfig.getHisName()).get(lisConfig.getHisDetailName()).containsKey(lisConfig.getUniqueName())) {
-                            deleteIds.add(configMap
-                                    .get(lisConfig.getHisName())
-                                    .get(lisConfig.getHisDetailName())
-                                    .get(lisConfig.getUniqueName()));
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, Map<String, List<Long>>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), hisNames, uniqueNames);
+            lisConfigList.forEach(lisConfig -> {
+                lisConfig.setHospitalId(Long.valueOf(hospitalId));
+                lisConfig.setModifier(userId);
+                lisConfig.setGmtModified(now);
+                if (lisConfig.getId() == null) {
+                    if (configMap.containsKey(lisConfig.getHisName())) {
+                        if (lisConfig.getHisDetailName() == null
+                                && configMap.get(lisConfig.getHisName()).containsKey("")) {
+                            if (ListUtil.isNotEmpty(configMap.get(lisConfig.getHisName()).get("").get(lisConfig.getUniqueName()))) {
+                                deleteIds.addAll(configMap.get(lisConfig.getHisName()).get("").get(lisConfig.getUniqueName()));
+                            }
+                        } else if (configMap.get(lisConfig.getHisName()).containsKey(lisConfig.getHisDetailName())) {
+                            if (ListUtil.isNotEmpty(configMap.get(lisConfig.getHisName()).get(lisConfig.getHisDetailName()).get(lisConfig.getUniqueName()))) {
+                                deleteIds.addAll(configMap
+                                        .get(lisConfig.getHisName())
+                                        .get(lisConfig.getHisDetailName())
+                                        .get(lisConfig.getUniqueName()));
+                            }
                         }
                     }
+                    lisConfig.setCreator(userId);
+                    lisConfig.setGmtCreate(now);
+                }
+                if (lisConfig.getIsDeleted() == null) {
+                    lisConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
+
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.LisPack.getKey());
+            RespDTO<List<IndexBatchDTO>> respLisPackDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respLisPackDTO, "标准术语校验失败");
+            List<String> lisPackNames = respLisPackDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            conceptVO.setType(ConceptTypeEnum.Lis.getKey());
+            RespDTO<List<IndexBatchDTO>> respLisDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respLisDTO, "标准术语校验失败");
+            List<String> lisNames = respLisDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < lisConfigList.size(); i++) {
+                if (StringUtil.isBlank(lisConfigList.get(i).getHisDetailName())) {
+                    if (!lisPackNames.contains(lisConfigList.get(i).getUniqueName())) {
+                        errorNumList.add(String.valueOf(i + 2));
+                    }
+                } else {
+                    if (!lisNames.contains(lisConfigList.get(i).getUniqueName())) {
+                        errorNumList.add(String.valueOf(i + 2));
+                    }
                 }
-                lisConfig.setCreator(userId);
-                lisConfig.setGmtCreate(now);
             }
-            if (lisConfig.getIsDeleted() == null) {
-                lisConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
             }
-        });
 
-        //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
-        ConceptVO conceptVO = new ConceptVO();
-        conceptVO.setNames(uniqueNames);
-        conceptVO.setType(ConceptTypeEnum.LisPack.getKey());
-        RespDTO<List<String>> respLisPackDTO = cdssCoreClient.getConceptNames(conceptVO);
-        RespDTOUtil.respNGDealCover(respLisPackDTO, "标准术语校验失败");
-        List<String> lisPackNames = respLisPackDTO.data;
-        conceptVO.setType(ConceptTypeEnum.Lis.getKey());
-        RespDTO<List<String>> respLisDTO = cdssCoreClient.getConceptNames(conceptVO);
-        RespDTOUtil.respNGDealCover(respLisDTO, "标准术语校验失败");
-        List<String> lisNames = respLisDTO.data;
-        for (int i = 0; i < lisConfigList.size(); i++) {
-            if (!lisPackNames.contains(lisConfigList.get(i).getUniqueName())
-                    && !lisNames.contains(lisConfigList.get(i).getUniqueName())) {
-                errorNumList.add(String.valueOf(i + 2));
-            }
+            //重复数据过滤
+            lisConfigList = lisConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
+
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            lisConfigService.saveOrUpdateBatch(lisConfigList);
         }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
-
-        //重复数据过滤
-        lisConfigList = lisConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
-
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        lisConfigService.saveOrUpdateBatch(lisConfigList);
         return true;
     }
 
@@ -449,6 +456,60 @@ public class LisConfigFacade {
         return retMap;
     }
 
+    /**
+     * 获取映射关系-id
+     * Map<hisName,Map<hisDetailName,Map<uniqueName,id>>>
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Map<String, List<Long>>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Map<String, List<Long>>>> retMap = new HashMap<>();
+        QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<LisConfig> records = lisConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        records.forEach(lisConfig -> {
+            if (lisConfig.getHisDetailName() == null) {
+                lisConfig.setHisDetailName("");
+            }
+        });
+
+        Map<String, List<LisConfig>> hisNameMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<LisConfig>> entry : hisNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, Map<String, List<Long>>> detailNameMap = new HashMap<>();
+                //his名称映射到标准词,1:n
+                Map<String, List<LisConfig>> hisDetailNameMap
+                        = EntityUtil.makeEntityListMap(entry.getValue(), "hisDetailName");
+                for (Map.Entry<String, List<LisConfig>> detailEntry : hisDetailNameMap.entrySet()) {
+                    if (ListUtil.isNotEmpty(detailEntry.getValue())) {
+                        Map<String, List<LisConfig>> thirdMap = EntityUtil.makeEntityListMap(detailEntry.getValue(), "uniqueName");
+                        Map<String, List<Long>> idMap = new HashMap<>();
+                        for (Map.Entry<String, List<LisConfig>> thirdEntry : thirdMap.entrySet()) {
+                            idMap.put(thirdEntry.getKey(), thirdEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                        }
+                        detailNameMap.put(detailEntry.getKey(), idMap);
+                    }
+                }
+                retMap.put(entry.getKey(), detailNameMap);
+            }
+        }
+        return retMap;
+    }
+
 
     /**
      * 获取映射关系
@@ -538,11 +599,28 @@ public class LisConfigFacade {
     public List<LisDetailDTO> getLis(RetrievalVO retrievalVO) {
         List<LisDetailDTO> lisDetailNames = new ArrayList<>();
         List<LisConfig> records = lisConfigService.getLisIndex(retrievalVO);
-        for (LisConfig lisConfig : records) {
-            LisDetailDTO lisDetailDTO = new LisDetailDTO();
-            lisDetailDTO.setName(lisConfig.getHisName());
-            lisDetailDTO.setUniqueName(lisConfig.getHisDetailName());
-            lisDetailNames.add(lisDetailDTO);
+        if (ListUtil.isNotEmpty(records)) {
+            List<String> names = records.stream().map(LisConfig::getUniqueName).distinct().collect(Collectors.toList());
+            KllisDetailVO kllisDetailVO = new KllisDetailVO();
+            kllisDetailVO.setNames(names);
+            RespDTO<Map<String, KllisDetailDTO>> respDTO = cdssCoreClient.getLisDetaisByNames(kllisDetailVO);
+            Map<String, KllisDetailDTO> map = new HashMap<>();
+            if (null != respDTO && null != respDTO.data) {
+                map = respDTO.data;
+            }
+            for (LisConfig lisConfig : records) {
+                LisDetailDTO lisDetailDTO = new LisDetailDTO();
+                lisDetailDTO.setName(lisConfig.getHisName());
+                lisDetailDTO.setUniqueName(lisConfig.getHisDetailName());
+                if (null != map.get(lisConfig.getUniqueName())) {
+                    KllisDetailDTO kllisDetailDTO =  map.get(lisConfig.getUniqueName());
+                    lisDetailDTO.setMaxValue(kllisDetailDTO.getMaxValue());
+                    lisDetailDTO.setMinValue(kllisDetailDTO.getMinValue());
+                    lisDetailDTO.setUnits(kllisDetailDTO.getUnit());
+                    lisDetailDTO.setRange(kllisDetailDTO.getType());
+                }
+                lisDetailNames.add(lisDetailDTO);
+            }
         }
         return lisDetailNames;
     }

+ 37 - 0
src/main/java/com/diagbot/facade/MrFacade.java

@@ -1,8 +1,15 @@
 package com.diagbot.facade;
 
+import com.diagbot.dto.IndicationDTO;
+import com.diagbot.idc.VisibleIdCreater;
 import com.diagbot.service.impl.MrServiceImpl;
+import com.diagbot.util.RedisUtil;
+import com.diagbot.vo.MrVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.concurrent.TimeUnit;
+
 /**
  * @Description: 病历保存到redis装饰层
  * @author: gaodm
@@ -10,4 +17,34 @@ import org.springframework.stereotype.Component;
  */
 @Component
 public class MrFacade extends MrServiceImpl {
+
+    @Autowired
+    RedisUtil redisUtil;
+    @Autowired
+    VisibleIdCreater visibleIdCreater;
+
+    private static final String MSGMR = "msgMr::";
+
+    /**
+     * 创建提醒类结果
+     *
+     * @param indicationDTO
+     * @return
+     */
+    public String createIndicationMr(IndicationDTO indicationDTO) {
+        String mrId = visibleIdCreater.getNextId(9).toString();
+        redisUtil.setEx(MSGMR + mrId, indicationDTO, 15, TimeUnit.MINUTES);
+        return mrId;
+    }
+
+    /**
+     * 获取提醒类结果
+     *
+     * @param mrVO
+     * @return
+     */
+    public IndicationDTO getIndicationMr(MrVO mrVO) {
+        String mrId = MSGMR + mrVO.getMrId();
+        return redisUtil.get(mrId);
+    }
 }

+ 492 - 0
src/main/java/com/diagbot/facade/NurseConfigFacade.java

@@ -0,0 +1,492 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.IndexBatchDTO;
+import com.diagbot.dto.NurseInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.NurseConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.NurseConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.NurseConfigListVO;
+import com.diagbot.vo.NurseConfigPageVO;
+import com.diagbot.vo.RetrievalVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/26 10:31
+ */
+@Component
+public class NurseConfigFacade {
+    @Autowired
+    private NurseConfigService nurseConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param nurseConfig
+     * @return
+     */
+    public Boolean isExistRecord(NurseConfig nurseConfig) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        QueryWrapper<NurseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", Long.valueOf(hospitalId))
+                .eq("his_name", nurseConfig.getHisName())
+                .eq("unique_name", nurseConfig.getUniqueName());
+        NurseConfig oldRecord = nurseConfigService.getOne(queryWrapper, false);
+        if (nurseConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (nurseConfig.getId() != null
+                && oldRecord != null
+                && !nurseConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param nurseConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(NurseConfig nurseConfig) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        nurseConfig.setHospitalId(Long.valueOf(hospitalId));
+        nurseConfig.setModifier(userId);
+        nurseConfig.setGmtModified(now);
+        QueryWrapper<NurseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", Long.valueOf(hospitalId))
+                .eq("his_name", nurseConfig.getHisName())
+                .eq("unique_name", nurseConfig.getUniqueName());
+        NurseConfig oldRecord = nurseConfigService.getOne(queryWrapper, false);
+        if (nurseConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (nurseConfig.getId() != null
+                && oldRecord != null
+                && !nurseConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (nurseConfig.getId() == null) {
+            nurseConfig.setCreator(userId);
+            nurseConfig.setGmtCreate(now);
+        }
+        if (nurseConfig.getIsDeleted() == null) {
+            nurseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        nurseConfigService.saveOrUpdate(nurseConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param nurseConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(NurseConfigListVO nurseConfigListVO) {
+        if (ListUtil.isEmpty(nurseConfigListVO.getNurseConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(nurseConfigListVO.getNurseConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param nurseConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<NurseConfig> nurseConfigList) {
+        if (ListUtil.isEmpty(nurseConfigList)) {
+            return false;
+        }
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        nurseConfigList = nurseConfigList
+                .stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+        nurseConfigList.forEach(nurseConfig -> {
+            nurseConfig.setHospitalId(Long.valueOf(hospitalId));
+            nurseConfig.setModifier(userId);
+            nurseConfig.setGmtModified(now);
+            if (nurseConfig.getId() == null) {
+                if (configMap.containsKey(nurseConfig.getHisName())
+                        &&ListUtil.isNotEmpty(configMap.get(nurseConfig.getHisName()).get(nurseConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(nurseConfig.getHisName()).get(nurseConfig.getUniqueName()));
+                }
+                nurseConfig.setCreator(userId);
+                nurseConfig.setGmtCreate(now);
+            }
+            if (nurseConfig.getIsDeleted() == null) {
+                nurseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        nurseConfigService.saveOrUpdateBatch(nurseConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<NurseConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        nurseConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<NurseConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        nurseConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param nurseConfigPageVO
+     * @return
+     */
+    public IPage<NurseConfig> getPage(NurseConfigPageVO nurseConfigPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        nurseConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
+        return nurseConfigService.getPage(nurseConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     */
+    public void importExcel(MultipartFile file) {
+        List<NurseConfig> nurseConfigList = ExcelUtils.importExcel(file, 0, 1, NurseConfig.class);
+        if (ListUtil.isNotEmpty(nurseConfigList)) {
+            importExcelRecords(nurseConfigList);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param nurseConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<NurseConfig> nurseConfigList) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        nurseConfigList = nurseConfigList.stream()
+                .filter(NurseConfig::nonNull)
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(nurseConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+        List<String> emptyNumList = Lists.newLinkedList();
+        for (int i = 0; i < nurseConfigList.size(); i++) {
+            if (StringUtil.isBlank(nurseConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(nurseConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 2));
+            }
+            if (StringUtil.isNotBlank(nurseConfigList.get(i).getHisName())) {
+                nurseConfigList.get(i).setHisName(nurseConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(nurseConfigList.get(i).getUniqueName())) {
+                nurseConfigList.get(i).setUniqueName(nurseConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(nurseConfigList.get(i).getUniqueCode())) {
+                nurseConfigList.get(i).setUniqueCode(nurseConfigList.get(i).getUniqueCode().trim());
+            } else {
+                nurseConfigList.get(i).setUniqueCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, List<Long>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+            nurseConfigList.forEach(nurseConfig -> {
+                nurseConfig.setHospitalId(Long.valueOf(hospitalId));
+                nurseConfig.setModifier(userId);
+                nurseConfig.setGmtModified(now);
+                if (nurseConfig.getId() == null) {
+                    if (configMap.containsKey(nurseConfig.getHisName())
+                            && ListUtil.isNotEmpty(configMap.get(nurseConfig.getHisName()).get(nurseConfig.getUniqueName()))) {
+                        deleteIds.addAll(configMap.get(nurseConfig.getHisName()).get(nurseConfig.getUniqueName()));
+                    }
+                    nurseConfig.setCreator(userId);
+                    nurseConfig.setGmtCreate(now);
+                }
+                if (nurseConfig.getIsDeleted() == null) {
+                    nurseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
+
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            List<String> uniqueNames = nurseConfigList.stream()
+                    .map(i -> i.getUniqueName())
+                    .distinct()
+                    .collect(Collectors.toList());
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.Nurse.getKey());
+            RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+            List<String> names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < nurseConfigList.size(); i++) {
+                if (!names.contains(nurseConfigList.get(i).getUniqueName())) {
+                    errorNumList.add(String.valueOf(i + 2));
+                }
+            }
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
+            }
+
+            //重复数据过滤
+            nurseConfigList = nurseConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
+
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            nurseConfigService.saveOrUpdateBatch(nurseConfigList);
+        }
+        return true;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<NurseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<NurseConfig> records = nurseConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<NurseConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<NurseConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "uniqueName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<NurseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<NurseConfig> records = nurseConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<NurseConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<NurseConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<NurseConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "uniqueName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<NurseConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系
+     * Map<uniqueName,Map<hisName,id>>
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getUniqueNameConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<NurseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<NurseConfig> records = nurseConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        Map<String, List<NurseConfig>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
+        for (Map.Entry<String, List<NurseConfig>> entry : uniqueNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "hisName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response) {
+        QueryWrapper<NurseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                .orderByDesc("gmt_modified");
+        List<NurseConfig> records = nurseConfigService.list(queryWrapper);
+        String fileName = "护理映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", NurseConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "护理映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", NurseConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 手术搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    public List<NurseInfoDTO> getNurses(RetrievalVO retrievalVO) {
+        List<NurseInfoDTO> nurseNames = new ArrayList<>();
+        List<NurseConfig> nurseConfigList = nurseConfigService.getNursesIndex(retrievalVO);
+        for (NurseConfig nurseConfig: nurseConfigList){
+            NurseInfoDTO nurseInfoDTO = new NurseInfoDTO();
+            nurseInfoDTO.setName(nurseConfig.getHisName());
+            nurseNames.add(nurseInfoDTO);
+        }
+        return nurseNames;
+    }
+}

+ 96 - 56
src/main/java/com/diagbot/facade/OperationConfigFacade.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.OperationInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.OperationConfig;
@@ -154,15 +155,16 @@ public class OperationConfigFacade {
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
         List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Long>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
         operationConfigList.forEach(operationConfig -> {
             operationConfig.setHospitalId(Long.valueOf(hospitalId));
             operationConfig.setModifier(userId);
             operationConfig.setGmtModified(now);
             if (operationConfig.getId() == null) {
-                if (configMap.containsKey(operationConfig.getHisName())) {
-                    deleteIds.add(configMap.get(operationConfig.getHisName()).get(operationConfig.getUniqueName()));
+                if (configMap.containsKey(operationConfig.getHisName())
+                &&ListUtil.isNotEmpty(configMap.get(operationConfig.getHisName()).get(operationConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(operationConfig.getHisName()).get(operationConfig.getUniqueName()));
                 }
                 operationConfig.setCreator(userId);
                 operationConfig.setGmtCreate(now);
@@ -251,9 +253,7 @@ public class OperationConfigFacade {
         //2、去除前后空格
         //过滤空数据,保留重复数据,方便计行
         operationConfigList = operationConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .filter(OperationConfig::nonNull)
                 .collect(Collectors.toList());
         if (ListUtil.isEmpty(operationConfigList)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
@@ -285,60 +285,63 @@ public class OperationConfigFacade {
 
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
-        List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Long>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
-        operationConfigList.forEach(operationConfig -> {
-            operationConfig.setHospitalId(Long.valueOf(hospitalId));
-            operationConfig.setModifier(userId);
-            operationConfig.setGmtModified(now);
-            if (operationConfig.getId() == null) {
-                if (configMap.containsKey(operationConfig.getHisName())) {
-                    deleteIds.add(configMap.get(operationConfig.getHisName()).get(operationConfig.getUniqueName()));
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, List<Long>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+            operationConfigList.forEach(operationConfig -> {
+                operationConfig.setHospitalId(Long.valueOf(hospitalId));
+                operationConfig.setModifier(userId);
+                operationConfig.setGmtModified(now);
+                if (operationConfig.getId() == null) {
+                    if (configMap.containsKey(operationConfig.getHisName())
+                            && ListUtil.isNotEmpty(configMap.get(operationConfig.getHisName()).get(operationConfig.getUniqueName()))) {
+                        deleteIds.addAll(configMap.get(operationConfig.getHisName()).get(operationConfig.getUniqueName()));
+                    }
+                    operationConfig.setCreator(userId);
+                    operationConfig.setGmtCreate(now);
                 }
-                operationConfig.setCreator(userId);
-                operationConfig.setGmtCreate(now);
-            }
-            if (operationConfig.getIsDeleted() == null) {
-                operationConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
+                if (operationConfig.getIsDeleted() == null) {
+                    operationConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
 
-        //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
-        List<String> uniqueNames = operationConfigList.stream()
-                .map(i -> i.getUniqueName())
-                .distinct()
-                .collect(Collectors.toList());
-        ConceptVO conceptVO = new ConceptVO();
-        conceptVO.setNames(uniqueNames);
-        conceptVO.setType(ConceptTypeEnum.Opeartion.getKey());
-        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
-        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
-        List<String> names = respDTO.data;
-        for (int i = 0; i < operationConfigList.size(); i++) {
-            if (!names.contains(operationConfigList.get(i).getUniqueName())) {
-                errorNumList.add(String.valueOf(i + 2));
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            List<String> uniqueNames = operationConfigList.stream()
+                    .map(i -> i.getUniqueName())
+                    .distinct()
+                    .collect(Collectors.toList());
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.Operation.getKey());
+            RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+            List<String> names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < operationConfigList.size(); i++) {
+                if (!names.contains(operationConfigList.get(i).getUniqueName())) {
+                    errorNumList.add(String.valueOf(i + 2));
+                }
+            }
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
             }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
 
-        //重复数据过滤
-        operationConfigList = operationConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
+            //重复数据过滤
+            operationConfigList = operationConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
 
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        operationConfigService.saveOrUpdateBatch(operationConfigList);
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            operationConfigService.saveOrUpdateBatch(operationConfigList);
+        }
         return true;
     }
 
@@ -374,6 +377,43 @@ public class OperationConfigFacade {
         return retMap;
     }
 
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<OperationConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<OperationConfig> records = operationConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<OperationConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<OperationConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<OperationConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "uniqueName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<OperationConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
     /**
      * 获取映射关系
      * Map<uniqueName,Map<hisName,id>>

+ 96 - 56
src/main/java/com/diagbot/facade/PacsConfigFacade.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.PacsConfig;
 import com.diagbot.enums.ConceptTypeEnum;
@@ -153,15 +154,16 @@ public class PacsConfigFacade {
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
         List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Long>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
         pacsConfigList.forEach(pacsConfig -> {
             pacsConfig.setHospitalId(Long.valueOf(hospitalId));
             pacsConfig.setModifier(userId);
             pacsConfig.setGmtModified(now);
             if (pacsConfig.getId() == null) {
-                if (configMap.containsKey(pacsConfig.getHisName())) {
-                    deleteIds.add(configMap.get(pacsConfig.getHisName()).get(pacsConfig.getUniqueName()));
+                if (configMap.containsKey(pacsConfig.getHisName())
+                        && ListUtil.isNotEmpty(configMap.get(pacsConfig.getHisName()).get(pacsConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(pacsConfig.getHisName()).get(pacsConfig.getUniqueName()));
                 }
                 pacsConfig.setCreator(userId);
                 pacsConfig.setGmtCreate(now);
@@ -250,9 +252,7 @@ public class PacsConfigFacade {
         //2、去除前后空格
         //过滤空数据,保留重复数据,方便计行
         pacsConfigList = pacsConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .filter(PacsConfig::nonNull)
                 .collect(Collectors.toList());
         if (ListUtil.isEmpty(pacsConfigList)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
@@ -284,60 +284,63 @@ public class PacsConfigFacade {
 
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
-        List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Long>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
-        pacsConfigList.forEach(pacsConfig -> {
-            pacsConfig.setHospitalId(Long.valueOf(hospitalId));
-            pacsConfig.setModifier(userId);
-            pacsConfig.setGmtModified(now);
-            if (pacsConfig.getId() == null) {
-                if (configMap.containsKey(pacsConfig.getHisName())) {
-                    deleteIds.add(configMap.get(pacsConfig.getHisName()).get(pacsConfig.getUniqueName()));
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, List<Long>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+            pacsConfigList.forEach(pacsConfig -> {
+                pacsConfig.setHospitalId(Long.valueOf(hospitalId));
+                pacsConfig.setModifier(userId);
+                pacsConfig.setGmtModified(now);
+                if (pacsConfig.getId() == null) {
+                    if (configMap.containsKey(pacsConfig.getHisName())
+                            && ListUtil.isNotEmpty(configMap.get(pacsConfig.getHisName()).get(pacsConfig.getUniqueName()))) {
+                        deleteIds.addAll(configMap.get(pacsConfig.getHisName()).get(pacsConfig.getUniqueName()));
+                    }
+                    pacsConfig.setCreator(userId);
+                    pacsConfig.setGmtCreate(now);
                 }
-                pacsConfig.setCreator(userId);
-                pacsConfig.setGmtCreate(now);
-            }
-            if (pacsConfig.getIsDeleted() == null) {
-                pacsConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
+                if (pacsConfig.getIsDeleted() == null) {
+                    pacsConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
 
-        //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
-        List<String> uniqueNames = pacsConfigList.stream()
-                .map(i -> i.getUniqueName())
-                .distinct()
-                .collect(Collectors.toList());
-        ConceptVO conceptVO = new ConceptVO();
-        conceptVO.setNames(uniqueNames);
-        conceptVO.setType(ConceptTypeEnum.Pacs.getKey());
-        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
-        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
-        List<String> names = respDTO.data;
-        for (int i = 0; i < pacsConfigList.size(); i++) {
-            if (!names.contains(pacsConfigList.get(i).getUniqueName())) {
-                errorNumList.add(String.valueOf(i + 2));
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            List<String> uniqueNames = pacsConfigList.stream()
+                    .map(i -> i.getUniqueName())
+                    .distinct()
+                    .collect(Collectors.toList());
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.Pacs.getKey());
+            RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+            List<String> names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < pacsConfigList.size(); i++) {
+                if (!names.contains(pacsConfigList.get(i).getUniqueName())) {
+                    errorNumList.add(String.valueOf(i + 2));
+                }
+            }
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
             }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
 
-        //重复数据过滤
-        pacsConfigList = pacsConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
+            //重复数据过滤
+            pacsConfigList = pacsConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
 
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        pacsConfigService.saveOrUpdateBatch(pacsConfigList);
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            pacsConfigService.saveOrUpdateBatch(pacsConfigList);
+        }
         return true;
     }
 
@@ -373,6 +376,43 @@ public class PacsConfigFacade {
         return retMap;
     }
 
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<PacsConfig> records = pacsConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<PacsConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<PacsConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<PacsConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "uniqueName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<PacsConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
     /**
      * 获取映射关系
      * Map<uniqueName,Map<hisName,id>>

+ 1 - 1
src/main/java/com/diagbot/facade/PlanDetailFacade.java

@@ -49,7 +49,7 @@ public class PlanDetailFacade extends PlanDetailServiceImpl {
                 .eq("hospital_id", hospitalSetVO.getHospitalId())
                 .eq(StringUtil.isNotBlank(hospitalSetVO.getCode()), "code", hospitalSetVO.getCode())
                 .in("plan_id", hospitalSetVO.getPlanId())
-                .orderByAsc("plan_id", "order_no");
+                .orderByAsc("plan_id", "order_no","id");
         List<PlanDetail> sysSetData = list(sysSetInfo);
         List<PlanDetailDTO> sysSetInfoData = BeanUtil.listCopyTo(sysSetData, PlanDetailDTO.class);
         List<PlanDetailDTO> planDetailParent = new ArrayList<>();//父级数据

+ 3 - 3
src/main/java/com/diagbot/facade/PlanFacade.java

@@ -69,7 +69,7 @@ public class PlanFacade extends PlanServiceImpl {
                 planId.add(data.getId());
             }
         }
-        if(ListUtil.isEmpty(planId)){
+        if (ListUtil.isEmpty(planId)) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "该医院没有配置方案,请先配置方案!");
         }
         HospitalSetVO hospitalSetVO = new HospitalSetVO();
@@ -155,8 +155,8 @@ public class PlanFacade extends PlanServiceImpl {
                         planDetailSubNew.add(dataSubNew);
                     }
                     dataNew.setPlanDetailSub(planDetailSubNew);
-                    planDetailParentNew.add(dataNew);
                 }
+                planDetailParentNew.add(dataNew);
             }
         }
 
@@ -302,7 +302,7 @@ public class PlanFacade extends PlanServiceImpl {
                 planId.add(data.getId());
             }
         }
-        if(ListUtil.isEmpty(planId)){
+        if (ListUtil.isEmpty(planId)) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据不存在!");
         }
         HospitalSetVO hospitalSetVO = new HospitalSetVO();

+ 75 - 15
src/main/java/com/diagbot/facade/PushFacade.java

@@ -2,6 +2,8 @@ package com.diagbot.facade;
 
 import com.diagbot.client.CdssCoreClient;
 import com.diagbot.dto.BillMsg;
+import com.diagbot.dto.ConceptDetailDTO;
+import com.diagbot.dto.ConceptScaleDTO;
 import com.diagbot.dto.DictionaryInfoDTO;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.PushBaseDTO;
@@ -9,12 +11,12 @@ import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.PushPlanDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.TreatDTO;
-import com.diagbot.entity.ConceptDetail;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.util.StringUtil;
+import com.diagbot.vo.GetDetailVO;
 import com.diagbot.vo.IndicationPushVO;
 import com.diagbot.vo.PushPlanVO;
 import com.diagbot.vo.PushVO;
@@ -43,9 +45,9 @@ public class PushFacade {
     @Autowired
     private CdssCoreClient cdssCoreClient;
     @Autowired
-    private ConceptInfoFacade conceptInfoFacade;
-    @Autowired
     private DictionaryFacade dictionaryFacade;
+    @Autowired
+    MrFacade mrFacade;
 
     /**
      * 基础推理-症状、查体、化验、辅检、诊断
@@ -100,6 +102,21 @@ public class PushFacade {
         return indicationDTO;
     }
 
+    /**
+     * 提示信息相关推理-危急值、开单合理项、药品禁忌等
+     *
+     * @param indicationPushVO
+     */
+    public String indicationExtPush(IndicationPushVO indicationPushVO) {
+        IndicationDTO indicationDTO = indicationPush(indicationPushVO);
+        if (indicationDTO != null) {
+            if (ListUtil.isNotEmpty(indicationDTO.getBillMsgList()) || ListUtil.isNotEmpty(indicationDTO.getHighRiskList())
+                    || ListUtil.isNotEmpty(indicationDTO.getCriticalValList()) || ListUtil.isNotEmpty(indicationDTO.getOtherList()))
+            return mrFacade.createIndicationMr(indicationDTO);
+        }
+        return "";
+    }
+
     /**
      * 推理持续检验检查计划
      *
@@ -131,8 +148,6 @@ public class PushFacade {
         List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
         Map<Integer, String> dicStaticTypeValNameMap =
                 EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
-        Map<String, Integer> dicStaticTypeNameValMap =
-                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
 
         if (ListUtil.isNotEmpty(pushDTO.getLis())) {
             conceptBaseList.addAll(pushDTO.getLis());
@@ -153,12 +168,25 @@ public class PushFacade {
         if (ListUtil.isNotEmpty(pushDTO.getOperations())) {
             conceptBaseList.addAll(pushDTO.getOperations());
         }
+        if (ListUtil.isNotEmpty(pushDTO.getScale())) {
+            conceptBaseList.addAll(pushDTO.getScale());
+        }
+        if (ListUtil.isNotEmpty(pushDTO.getNurse())) {
+            conceptBaseList.addAll(pushDTO.getNurse());
+        }
         if (ListUtil.isNotEmpty(conceptBaseList)) {
             conceptNameList = conceptBaseList.stream()
                     .map(i -> i.getName())
                     .collect(Collectors.toList());
 
-            Map<String, List<ConceptDetail>> conceptDetailMap = conceptInfoFacade.getDetailByConcept(conceptNameList, Arrays.asList(new Integer[] { 1, 2, 3 }));
+            GetDetailVO getDetailVO = new GetDetailVO();
+            getDetailVO.setNameList(conceptNameList);
+            getDetailVO.setContentTypes(Arrays.asList(new Integer[] { 1, 2, 3 }));
+            RespDTO<Map<String, List<ConceptDetailDTO>>> respDTO = cdssCoreClient.getDetailByConcept(getDetailVO);
+            if (RespDTOUtil.respIsNG(respDTO)) {
+                return pushDTO;
+            }
+            Map<String, List<ConceptDetailDTO>> conceptDetailMap = respDTO.data;
             if (pushDTO.getDis() != null) {
                 for (Map.Entry<String, List<PushBaseDTO>> entry : pushDTO.getDis().entrySet()) {
                     if (ListUtil.isNotEmpty(entry.getValue())) {
@@ -182,11 +210,6 @@ public class PushFacade {
                     if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get("5"))) {
                         item.setHasInfo(1);
                     }
-                    /*if (item.getHasInfo().equals(0)) {
-                        if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get("6))) {
-                            item.setHasInfo(1);
-                        }
-                    }*/
                 });
             }
             if (ListUtil.isNotEmpty(pushDTO.getMedicines())) {
@@ -203,6 +226,38 @@ public class PushFacade {
                     }
                 });
             }
+            if (ListUtil.isNotEmpty(pushDTO.getScale())) {
+                pushDTO.getScale().forEach(item -> {
+                    if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get("8"))) {
+                        item.setHasInfo(1);
+                    }
+                });
+            }
+            if (ListUtil.isNotEmpty(pushDTO.getNurse())) {
+                pushDTO.getNurse().forEach(item -> {
+                    if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get("9"))) {
+                        item.setHasInfo(1);
+                    }
+                });
+            }
+        }
+
+        //量表
+        if (ListUtil.isNotEmpty(pushDTO.getScale())) {
+            GetDetailVO scaleDetailVO = new GetDetailVO();
+            scaleDetailVO.setNameList(pushDTO.getScale().stream().map(PushBaseDTO::getName).distinct().collect(Collectors.toList()));
+            RespDTO<Map<String, ConceptScaleDTO>> respDTO = cdssCoreClient.getScaleDetailByConcept(scaleDetailVO);
+            if (RespDTOUtil.respIsOK(respDTO)) {
+                Map<String, ConceptScaleDTO> conceptScaleMap = respDTO.data;
+                if (ListUtil.isNotEmpty(pushDTO.getScale())) {
+                    pushDTO.getScale().forEach(item -> {
+                        if (conceptScaleMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get("8"))
+                                && conceptScaleMap.get(item.getName() + "_" + dicStaticTypeValNameMap.get("8")) != null) {
+                            item.setHasScale(1);
+                        }
+                    });
+                }
+            }
         }
         return pushDTO;
     }
@@ -220,14 +275,19 @@ public class PushFacade {
         List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
         Map<Integer, String> dicStaticTypeValNameMap =
                 EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
-        Map<String, Integer> dicStaticTypeNameValMap =
-                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
         if (ListUtil.isNotEmpty(retGeneraTreat)) {
             List<String> conceptNameList = retGeneraTreat.stream()
                     .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
                     .map(i -> i.getUniqueName())
                     .collect(Collectors.toList());
-            Map<String, List<ConceptDetail>> conceptDetailMap = conceptInfoFacade.getDetailByConcept(conceptNameList, Arrays.asList(new Integer[] { 4 }));
+            GetDetailVO getDetailVO = new GetDetailVO();
+            getDetailVO.setNameList(conceptNameList);
+            getDetailVO.setContentTypes(Arrays.asList(new Integer[] { 4 }));
+            RespDTO<Map<String, List<ConceptDetailDTO>>> respDTO = cdssCoreClient.getDetailByConcept(getDetailVO);
+            if (RespDTOUtil.respIsNG(respDTO)) {
+                return retGeneraTreat;
+            }
+            Map<String, List<ConceptDetailDTO>> conceptDetailMap = respDTO.data;
             if (conceptDetailMap == null || conceptDetailMap.size() == 0) {
                 return retGeneraTreat;
             }
@@ -235,7 +295,7 @@ public class PushFacade {
                 if (StringUtil.isNotBlank(treatDTO.getUniqueName())) {
                     String key = treatDTO.getUniqueName() + "_" + dicStaticTypeValNameMap.get("1");
                     if (conceptDetailMap.containsKey(key)) {
-                        List<ConceptDetail> conceptDetailList = conceptDetailMap.get(key);
+                        List<ConceptDetailDTO> conceptDetailList = conceptDetailMap.get(key);
                         treatDTO.setGeneraTreat(conceptDetailList
                                 .stream()
                                 .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("4"))

+ 20 - 0
src/main/java/com/diagbot/facade/RetrievalFacade.java

@@ -37,6 +37,14 @@ public class RetrievalFacade {
     private DeptConfigFacade deptConfigFacade;
     @Autowired
     private TransfusionConfigFacade transfusionConfigFacade;
+    @Autowired
+    private ScaleConfigFacade scaleConfigFacade;
+    @Autowired
+    private NurseConfigFacade nurseConfigFacade;
+    @Autowired
+    private TcmdiseaseConfigFacade tcmdiseaseConfigFacade;
+    @Autowired
+    private TcmsyndromeConfigFacade tcmsyndromeConfigFacade;
 
     /**
      * 检索
@@ -88,6 +96,18 @@ public class RetrievalFacade {
                     case 8:
                         retrievalDTO.setTransfusionNames(transfusionConfigFacade.getTransfusion(retrievalVO));
                         break;
+                    case 10:
+                        retrievalDTO.setScalenames(scaleConfigFacade.getScales(retrievalVO));
+                        break;
+                    case 11:
+                        retrievalDTO.setNursenames(nurseConfigFacade.getNurses(retrievalVO));
+                        break;
+                    case 12:
+                        retrievalDTO.setTcmdiseaseNames(tcmdiseaseConfigFacade.getTcmdiseases(retrievalVO));
+                        break;
+                    case 13:
+                        retrievalDTO.setTcmsyndromeNames(tcmsyndromeConfigFacade.getTcmsyndromes(retrievalVO));
+                        break;
                 }
             }
         }

+ 492 - 0
src/main/java/com/diagbot/facade/ScaleConfigFacade.java

@@ -0,0 +1,492 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.IndexBatchDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.ScaleInfoDTO;
+import com.diagbot.entity.ScaleConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.ScaleConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.ScaleConfigListVO;
+import com.diagbot.vo.ScaleConfigPageVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/13 13:31
+ */
+@Component
+public class ScaleConfigFacade {
+    @Autowired
+    private ScaleConfigService scaleConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param scaleConfig
+     * @return
+     */
+    public Boolean isExistRecord(ScaleConfig scaleConfig) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", Long.valueOf(hospitalId))
+                .eq("his_name", scaleConfig.getHisName())
+                .eq("unique_name", scaleConfig.getUniqueName());
+        ScaleConfig oldRecord = scaleConfigService.getOne(queryWrapper, false);
+        if (scaleConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (scaleConfig.getId() != null
+                && oldRecord != null
+                && !scaleConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param scaleConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(ScaleConfig scaleConfig) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        scaleConfig.setHospitalId(Long.valueOf(hospitalId));
+        scaleConfig.setModifier(userId);
+        scaleConfig.setGmtModified(now);
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", Long.valueOf(hospitalId))
+                .eq("his_name", scaleConfig.getHisName())
+                .eq("unique_name", scaleConfig.getUniqueName());
+        ScaleConfig oldRecord = scaleConfigService.getOne(queryWrapper, false);
+        if (scaleConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (scaleConfig.getId() != null
+                && oldRecord != null
+                && !scaleConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (scaleConfig.getId() == null) {
+            scaleConfig.setCreator(userId);
+            scaleConfig.setGmtCreate(now);
+        }
+        if (scaleConfig.getIsDeleted() == null) {
+            scaleConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        scaleConfigService.saveOrUpdate(scaleConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param scaleConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(ScaleConfigListVO scaleConfigListVO) {
+        if (ListUtil.isEmpty(scaleConfigListVO.getScaleConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(scaleConfigListVO.getScaleConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param scaleConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<ScaleConfig> scaleConfigList) {
+        if (ListUtil.isEmpty(scaleConfigList)) {
+            return false;
+        }
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        scaleConfigList = scaleConfigList
+                .stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+        scaleConfigList.forEach(scaleConfig -> {
+            scaleConfig.setHospitalId(Long.valueOf(hospitalId));
+            scaleConfig.setModifier(userId);
+            scaleConfig.setGmtModified(now);
+            if (scaleConfig.getId() == null) {
+                if (configMap.containsKey(scaleConfig.getHisName())
+                        &&ListUtil.isNotEmpty(configMap.get(scaleConfig.getHisName()).get(scaleConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(scaleConfig.getHisName()).get(scaleConfig.getUniqueName()));
+                }
+                scaleConfig.setCreator(userId);
+                scaleConfig.setGmtCreate(now);
+            }
+            if (scaleConfig.getIsDeleted() == null) {
+                scaleConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        scaleConfigService.saveOrUpdateBatch(scaleConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<ScaleConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        scaleConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<ScaleConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        scaleConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param scaleConfigPageVO
+     * @return
+     */
+    public IPage<ScaleConfig> getPage(ScaleConfigPageVO scaleConfigPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        scaleConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
+        return scaleConfigService.getPage(scaleConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     */
+    public void importExcel(MultipartFile file) {
+        List<ScaleConfig> scaleConfigList = ExcelUtils.importExcel(file, 0, 1, ScaleConfig.class);
+        if (ListUtil.isNotEmpty(scaleConfigList)) {
+            importExcelRecords(scaleConfigList);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param scaleConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<ScaleConfig> scaleConfigList) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        scaleConfigList = scaleConfigList.stream()
+                .filter(ScaleConfig::nonNull)
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(scaleConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+        List<String> emptyNumList = Lists.newLinkedList();
+        for (int i = 0; i < scaleConfigList.size(); i++) {
+            if (StringUtil.isBlank(scaleConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(scaleConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 2));
+            }
+            if (StringUtil.isNotBlank(scaleConfigList.get(i).getHisName())) {
+                scaleConfigList.get(i).setHisName(scaleConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(scaleConfigList.get(i).getUniqueName())) {
+                scaleConfigList.get(i).setUniqueName(scaleConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(scaleConfigList.get(i).getUniqueCode())) {
+                scaleConfigList.get(i).setUniqueCode(scaleConfigList.get(i).getUniqueCode().trim());
+            } else {
+                scaleConfigList.get(i).setUniqueCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, List<Long>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+            scaleConfigList.forEach(scaleConfig -> {
+                scaleConfig.setHospitalId(Long.valueOf(hospitalId));
+                scaleConfig.setModifier(userId);
+                scaleConfig.setGmtModified(now);
+                if (scaleConfig.getId() == null) {
+                    if (configMap.containsKey(scaleConfig.getHisName())
+                            && ListUtil.isNotEmpty(configMap.get(scaleConfig.getHisName()).get(scaleConfig.getUniqueName()))) {
+                        deleteIds.addAll(configMap.get(scaleConfig.getHisName()).get(scaleConfig.getUniqueName()));
+                    }
+                    scaleConfig.setCreator(userId);
+                    scaleConfig.setGmtCreate(now);
+                }
+                if (scaleConfig.getIsDeleted() == null) {
+                    scaleConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
+
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            List<String> uniqueNames = scaleConfigList.stream()
+                    .map(i -> i.getUniqueName())
+                    .distinct()
+                    .collect(Collectors.toList());
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.Scale.getKey());
+            RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+            List<String> names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < scaleConfigList.size(); i++) {
+                if (!names.contains(scaleConfigList.get(i).getUniqueName())) {
+                    errorNumList.add(String.valueOf(i + 2));
+                }
+            }
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
+            }
+
+            //重复数据过滤
+            scaleConfigList = scaleConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
+
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            scaleConfigService.saveOrUpdateBatch(scaleConfigList);
+        }
+        return true;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<ScaleConfig> records = scaleConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<ScaleConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<ScaleConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "uniqueName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<ScaleConfig> records = scaleConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<ScaleConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<ScaleConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<ScaleConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "uniqueName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<ScaleConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系
+     * Map<uniqueName,Map<hisName,id>>
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getUniqueNameConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<ScaleConfig> records = scaleConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        Map<String, List<ScaleConfig>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
+        for (Map.Entry<String, List<ScaleConfig>> entry : uniqueNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "hisName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response) {
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                .orderByDesc("gmt_modified");
+        List<ScaleConfig> records = scaleConfigService.list(queryWrapper);
+        String fileName = "量表映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", ScaleConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "量表映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", ScaleConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 手术搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    public List<ScaleInfoDTO> getScales(RetrievalVO retrievalVO) {
+        List<ScaleInfoDTO> scaleNames = new ArrayList<>();
+        List<ScaleConfig> scaleConfigList = scaleConfigService.getScalesIndex(retrievalVO);
+        for (ScaleConfig scaleConfig: scaleConfigList){
+            ScaleInfoDTO scaleInfoDTO = new ScaleInfoDTO();
+            scaleInfoDTO.setName(scaleConfig.getHisName());
+            scaleNames.add(scaleInfoDTO);
+        }
+        return scaleNames;
+    }
+}

+ 496 - 0
src/main/java/com/diagbot/facade/TcmdiseaseConfigFacade.java

@@ -0,0 +1,496 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.IndexBatchDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.TcmdiseaseInfoDTO;
+import com.diagbot.entity.TcmdiseaseConfig;
+import com.diagbot.entity.TcmsyndromeConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.TcmdiseaseConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.TcmdiseaseConfigListVO;
+import com.diagbot.vo.TcmdiseaseConfigPageVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/13 15:07
+ */
+@Component
+public class TcmdiseaseConfigFacade {
+    @Autowired
+    private TcmdiseaseConfigService tcmdiseaseConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param tcmdiseaseConfig
+     * @return
+     */
+    public Boolean isExistRecord(TcmdiseaseConfig tcmdiseaseConfig) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        QueryWrapper<TcmdiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", Long.valueOf(hospitalId))
+                .eq("his_name", tcmdiseaseConfig.getHisName())
+                .eq("unique_name", tcmdiseaseConfig.getUniqueName());
+        TcmdiseaseConfig oldRecord = tcmdiseaseConfigService.getOne(queryWrapper, false);
+        if (tcmdiseaseConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法添加");
+        }
+        if (tcmdiseaseConfig.getId() != null
+                && oldRecord != null
+                && !tcmdiseaseConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param tcmdiseaseConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(TcmdiseaseConfig tcmdiseaseConfig) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        tcmdiseaseConfig.setHospitalId(Long.valueOf(hospitalId));
+        tcmdiseaseConfig.setModifier(userId);
+        tcmdiseaseConfig.setGmtModified(now);
+        QueryWrapper<TcmdiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", Long.valueOf(hospitalId))
+                .eq("his_name", tcmdiseaseConfig.getHisName())
+                .eq("unique_name", tcmdiseaseConfig.getUniqueName());
+        TcmdiseaseConfig oldRecord = tcmdiseaseConfigService.getOne(queryWrapper, false);
+        if (tcmdiseaseConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法添加");
+        }
+        if (tcmdiseaseConfig.getId() != null
+                && oldRecord != null
+                && !tcmdiseaseConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (tcmdiseaseConfig.getId() == null) {
+            tcmdiseaseConfig.setCreator(userId);
+            tcmdiseaseConfig.setGmtCreate(now);
+        }
+        if (tcmdiseaseConfig.getIsDeleted() == null) {
+            tcmdiseaseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        tcmdiseaseConfigService.saveOrUpdate(tcmdiseaseConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param tcmdiseaseConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(TcmdiseaseConfigListVO tcmdiseaseConfigListVO) {
+        if (ListUtil.isEmpty(tcmdiseaseConfigListVO.getTcmdiseaseConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(tcmdiseaseConfigListVO.getTcmdiseaseConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param tcmdiseaseConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<TcmdiseaseConfig> tcmdiseaseConfigList) {
+        if (ListUtil.isEmpty(tcmdiseaseConfigList)) {
+            return false;
+        }
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        tcmdiseaseConfigList = tcmdiseaseConfigList
+                .stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+        tcmdiseaseConfigList.forEach(tcmdiseaseConfig -> {
+            tcmdiseaseConfig.setHospitalId(Long.valueOf(hospitalId));
+            tcmdiseaseConfig.setModifier(userId);
+            tcmdiseaseConfig.setGmtModified(now);
+            if (tcmdiseaseConfig.getId() == null) {
+                if (configMap.containsKey(tcmdiseaseConfig.getHisName())
+                        && ListUtil.isNotEmpty(configMap.get(tcmdiseaseConfig.getHisName()).get(tcmdiseaseConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(tcmdiseaseConfig.getHisName()).get(tcmdiseaseConfig.getUniqueName()));
+                }
+                tcmdiseaseConfig.setCreator(userId);
+                tcmdiseaseConfig.setGmtCreate(now);
+            }
+            if (tcmdiseaseConfig.getIsDeleted() == null) {
+                tcmdiseaseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        tcmdiseaseConfigService.saveOrUpdateBatch(tcmdiseaseConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<TcmdiseaseConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        tcmdiseaseConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<TcmdiseaseConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        tcmdiseaseConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param tcmdiseaseConfigPageVO
+     * @return
+     */
+    public IPage<TcmdiseaseConfig> getPage(TcmdiseaseConfigPageVO tcmdiseaseConfigPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        tcmdiseaseConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
+        return tcmdiseaseConfigService.getPage(tcmdiseaseConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     */
+    public void importExcel(MultipartFile file) {
+        List<TcmdiseaseConfig> tcmdiseaseConfigList = ExcelUtils.importExcel(file, 0, 1, TcmdiseaseConfig.class);
+        if (ListUtil.isNotEmpty(tcmdiseaseConfigList)) {
+            importExcelRecords(tcmdiseaseConfigList);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param tcmdiseaseConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<TcmdiseaseConfig> tcmdiseaseConfigList) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        tcmdiseaseConfigList = tcmdiseaseConfigList.stream()
+                .filter(TcmdiseaseConfig::nonNull)
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(tcmdiseaseConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+        List<String> emptyNumList = Lists.newLinkedList();
+        for (int i = 0; i < tcmdiseaseConfigList.size(); i++) {
+            if (StringUtil.isBlank(tcmdiseaseConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(tcmdiseaseConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 2));
+            }
+            if (StringUtil.isNotBlank(tcmdiseaseConfigList.get(i).getHisName())) {
+                tcmdiseaseConfigList.get(i).setHisName(tcmdiseaseConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(tcmdiseaseConfigList.get(i).getUniqueName())) {
+                tcmdiseaseConfigList.get(i).setUniqueName(tcmdiseaseConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(tcmdiseaseConfigList.get(i).getUniqueCode())) {
+                tcmdiseaseConfigList.get(i).setUniqueCode(tcmdiseaseConfigList.get(i).getUniqueCode().trim());
+            } else {
+                tcmdiseaseConfigList.get(i).setUniqueCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, List<Long>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+            tcmdiseaseConfigList.forEach(tcmdiseaseConfig -> {
+                tcmdiseaseConfig.setHospitalId(Long.valueOf(hospitalId));
+                tcmdiseaseConfig.setModifier(userId);
+                tcmdiseaseConfig.setGmtModified(now);
+                if (tcmdiseaseConfig.getId() == null) {
+                    if (configMap.containsKey(tcmdiseaseConfig.getHisName())
+                            && ListUtil.isNotEmpty(configMap.get(tcmdiseaseConfig.getHisName()).get(tcmdiseaseConfig.getUniqueName()))) {
+                        deleteIds.addAll(configMap.get(tcmdiseaseConfig.getHisName()).get(tcmdiseaseConfig.getUniqueName()));
+                    }
+                    tcmdiseaseConfig.setCreator(userId);
+                    tcmdiseaseConfig.setGmtCreate(now);
+                }
+                if (tcmdiseaseConfig.getIsDeleted() == null) {
+                    tcmdiseaseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
+
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            List<String> uniqueNames = tcmdiseaseConfigList.stream()
+                    .map(i -> i.getUniqueName())
+                    .distinct()
+                    .collect(Collectors.toList());
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.Tcmdisease.getKey());
+            RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+            List<String> names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < tcmdiseaseConfigList.size(); i++) {
+                if (!names.contains(tcmdiseaseConfigList.get(i).getUniqueName())) {
+                    errorNumList.add(String.valueOf(i + 2));
+                }
+            }
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
+            }
+
+            //重复数据过滤
+            tcmdiseaseConfigList = tcmdiseaseConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
+
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            tcmdiseaseConfigService.saveOrUpdateBatch(tcmdiseaseConfigList);
+        }
+        return true;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<TcmdiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<TcmdiseaseConfig> records = tcmdiseaseConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<TcmdiseaseConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<TcmdiseaseConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "uniqueName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<TcmdiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<TcmdiseaseConfig> records = tcmdiseaseConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<TcmdiseaseConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<TcmdiseaseConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<TcmdiseaseConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "uniqueName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<TcmdiseaseConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系
+     * Map<uniqueName,Map<hisName,id>>
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getUniqueNameConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<TcmdiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<TcmdiseaseConfig> records = tcmdiseaseConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        Map<String, List<TcmdiseaseConfig>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
+        for (Map.Entry<String, List<TcmdiseaseConfig>> entry : uniqueNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "hisName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response) {
+        QueryWrapper<TcmdiseaseConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                .orderByDesc("gmt_modified");
+        List<TcmdiseaseConfig> records = tcmdiseaseConfigService.list(queryWrapper);
+        String fileName = "中医疾病映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", TcmdiseaseConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "中医疾病映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", TcmdiseaseConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 中医疾病搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    public List<TcmdiseaseInfoDTO> getTcmdiseases(RetrievalVO retrievalVO) {
+        List<TcmdiseaseInfoDTO> tcmdiseaseNames = new ArrayList<>();
+        List<TcmdiseaseConfig> tcmdiseaseConfigList = tcmdiseaseConfigService.getTcmdiseasesIndex(retrievalVO);
+        for (TcmdiseaseConfig tcmdiseaseConfig : tcmdiseaseConfigList) {
+            TcmdiseaseInfoDTO tcmdiseaseInfoDTO = new TcmdiseaseInfoDTO();
+            tcmdiseaseInfoDTO.setCode(tcmdiseaseConfig.getUniqueCode());
+            tcmdiseaseInfoDTO.setName(tcmdiseaseConfig.getHisName());
+            tcmdiseaseNames.add(tcmdiseaseInfoDTO);
+        }
+        return tcmdiseaseNames;
+    }
+}

+ 495 - 0
src/main/java/com/diagbot/facade/TcmsyndromeConfigFacade.java

@@ -0,0 +1,495 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.IndexBatchDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.TcmsyndromeInfoDTO;
+import com.diagbot.entity.TcmsyndromeConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.TcmsyndromeConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.TcmsyndromeConfigListVO;
+import com.diagbot.vo.TcmsyndromeConfigPageVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/13 15:07
+ */
+@Component
+public class TcmsyndromeConfigFacade {
+    @Autowired
+    private TcmsyndromeConfigService tcmsyndromeConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param tcmsyndromeConfig
+     * @return
+     */
+    public Boolean isExistRecord(TcmsyndromeConfig tcmsyndromeConfig) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        QueryWrapper<TcmsyndromeConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", Long.valueOf(hospitalId))
+                .eq("his_name", tcmsyndromeConfig.getHisName())
+                .eq("unique_name", tcmsyndromeConfig.getUniqueName());
+        TcmsyndromeConfig oldRecord = tcmsyndromeConfigService.getOne(queryWrapper, false);
+        if (tcmsyndromeConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法添加");
+        }
+        if (tcmsyndromeConfig.getId() != null
+                && oldRecord != null
+                && !tcmsyndromeConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param tcmsyndromeConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(TcmsyndromeConfig tcmsyndromeConfig) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        tcmsyndromeConfig.setHospitalId(Long.valueOf(hospitalId));
+        tcmsyndromeConfig.setModifier(userId);
+        tcmsyndromeConfig.setGmtModified(now);
+        QueryWrapper<TcmsyndromeConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", Long.valueOf(hospitalId))
+                .eq("his_name", tcmsyndromeConfig.getHisName())
+                .eq("unique_name", tcmsyndromeConfig.getUniqueName());
+        TcmsyndromeConfig oldRecord = tcmsyndromeConfigService.getOne(queryWrapper, false);
+        if (tcmsyndromeConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法添加");
+        }
+        if (tcmsyndromeConfig.getId() != null
+                && oldRecord != null
+                && !tcmsyndromeConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (tcmsyndromeConfig.getId() == null) {
+            tcmsyndromeConfig.setCreator(userId);
+            tcmsyndromeConfig.setGmtCreate(now);
+        }
+        if (tcmsyndromeConfig.getIsDeleted() == null) {
+            tcmsyndromeConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        tcmsyndromeConfigService.saveOrUpdate(tcmsyndromeConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param tcmsyndromeConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(TcmsyndromeConfigListVO tcmsyndromeConfigListVO) {
+        if (ListUtil.isEmpty(tcmsyndromeConfigListVO.getTcmsyndromeConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(tcmsyndromeConfigListVO.getTcmsyndromeConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param tcmsyndromeConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<TcmsyndromeConfig> tcmsyndromeConfigList) {
+        if (ListUtil.isEmpty(tcmsyndromeConfigList)) {
+            return false;
+        }
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        tcmsyndromeConfigList = tcmsyndromeConfigList
+                .stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+        tcmsyndromeConfigList.forEach(tcmsyndromeConfig -> {
+            tcmsyndromeConfig.setHospitalId(Long.valueOf(hospitalId));
+            tcmsyndromeConfig.setModifier(userId);
+            tcmsyndromeConfig.setGmtModified(now);
+            if (tcmsyndromeConfig.getId() == null) {
+                if (configMap.containsKey(tcmsyndromeConfig.getHisName())
+                        && ListUtil.isNotEmpty(configMap.get(tcmsyndromeConfig.getHisName()).get(tcmsyndromeConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(tcmsyndromeConfig.getHisName()).get(tcmsyndromeConfig.getUniqueName()));
+                }
+                tcmsyndromeConfig.setCreator(userId);
+                tcmsyndromeConfig.setGmtCreate(now);
+            }
+            if (tcmsyndromeConfig.getIsDeleted() == null) {
+                tcmsyndromeConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        tcmsyndromeConfigService.saveOrUpdateBatch(tcmsyndromeConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<TcmsyndromeConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        tcmsyndromeConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<TcmsyndromeConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        tcmsyndromeConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param tcmsyndromeConfigPageVO
+     * @return
+     */
+    public IPage<TcmsyndromeConfig> getPage(TcmsyndromeConfigPageVO tcmsyndromeConfigPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        tcmsyndromeConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
+        return tcmsyndromeConfigService.getPage(tcmsyndromeConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     */
+    public void importExcel(MultipartFile file) {
+        List<TcmsyndromeConfig> tcmsyndromeConfigList = ExcelUtils.importExcel(file, 0, 1, TcmsyndromeConfig.class);
+        if (ListUtil.isNotEmpty(tcmsyndromeConfigList)) {
+            importExcelRecords(tcmsyndromeConfigList);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param tcmsyndromeConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<TcmsyndromeConfig> tcmsyndromeConfigList) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        String userId = SysUserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        tcmsyndromeConfigList = tcmsyndromeConfigList.stream()
+                .filter(TcmsyndromeConfig::nonNull)
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(tcmsyndromeConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+        List<String> emptyNumList = Lists.newLinkedList();
+        for (int i = 0; i < tcmsyndromeConfigList.size(); i++) {
+            if (StringUtil.isBlank(tcmsyndromeConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(tcmsyndromeConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 2));
+            }
+            if (StringUtil.isNotBlank(tcmsyndromeConfigList.get(i).getHisName())) {
+                tcmsyndromeConfigList.get(i).setHisName(tcmsyndromeConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(tcmsyndromeConfigList.get(i).getUniqueName())) {
+                tcmsyndromeConfigList.get(i).setUniqueName(tcmsyndromeConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(tcmsyndromeConfigList.get(i).getUniqueCode())) {
+                tcmsyndromeConfigList.get(i).setUniqueCode(tcmsyndromeConfigList.get(i).getUniqueCode().trim());
+            } else {
+                tcmsyndromeConfigList.get(i).setUniqueCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, List<Long>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+            tcmsyndromeConfigList.forEach(tcmsyndromeConfig -> {
+                tcmsyndromeConfig.setHospitalId(Long.valueOf(hospitalId));
+                tcmsyndromeConfig.setModifier(userId);
+                tcmsyndromeConfig.setGmtModified(now);
+                if (tcmsyndromeConfig.getId() == null) {
+                    if (configMap.containsKey(tcmsyndromeConfig.getHisName())
+                            && ListUtil.isNotEmpty(configMap.get(tcmsyndromeConfig.getHisName()).get(tcmsyndromeConfig.getUniqueName()))) {
+                        deleteIds.addAll(configMap.get(tcmsyndromeConfig.getHisName()).get(tcmsyndromeConfig.getUniqueName()));
+                    }
+                    tcmsyndromeConfig.setCreator(userId);
+                    tcmsyndromeConfig.setGmtCreate(now);
+                }
+                if (tcmsyndromeConfig.getIsDeleted() == null) {
+                    tcmsyndromeConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
+
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            List<String> uniqueNames = tcmsyndromeConfigList.stream()
+                    .map(i -> i.getUniqueName())
+                    .distinct()
+                    .collect(Collectors.toList());
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.Tcmsyndrome.getKey());
+            RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+            List<String> names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < tcmsyndromeConfigList.size(); i++) {
+                if (!names.contains(tcmsyndromeConfigList.get(i).getUniqueName())) {
+                    errorNumList.add(String.valueOf(i + 2));
+                }
+            }
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
+            }
+
+            //重复数据过滤
+            tcmsyndromeConfigList = tcmsyndromeConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
+
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            tcmsyndromeConfigService.saveOrUpdateBatch(tcmsyndromeConfigList);
+        }
+        return true;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<TcmsyndromeConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<TcmsyndromeConfig> records = tcmsyndromeConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<TcmsyndromeConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<TcmsyndromeConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "uniqueName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<TcmsyndromeConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<TcmsyndromeConfig> records = tcmsyndromeConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<TcmsyndromeConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<TcmsyndromeConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<TcmsyndromeConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "uniqueName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<TcmsyndromeConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系
+     * Map<uniqueName,Map<hisName,id>>
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getUniqueNameConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<TcmsyndromeConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<TcmsyndromeConfig> records = tcmsyndromeConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        Map<String, List<TcmsyndromeConfig>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
+        for (Map.Entry<String, List<TcmsyndromeConfig>> entry : uniqueNameMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "hisName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     */
+    public void exportExcel(HttpServletResponse response) {
+        QueryWrapper<TcmsyndromeConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                .orderByDesc("gmt_modified");
+        List<TcmsyndromeConfig> records = tcmsyndromeConfigService.list(queryWrapper);
+        String fileName = "中医证候映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", TcmsyndromeConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "中医证候映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", TcmsyndromeConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 中医证候搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    public List<TcmsyndromeInfoDTO> getTcmsyndromes(RetrievalVO retrievalVO) {
+        List<TcmsyndromeInfoDTO> tcmsyndromeNames = new ArrayList<>();
+        List<TcmsyndromeConfig> tcmsyndromeConfigList = tcmsyndromeConfigService.getTcmsyndromesIndex(retrievalVO);
+        for (TcmsyndromeConfig tcmsyndromeConfig : tcmsyndromeConfigList) {
+            TcmsyndromeInfoDTO tcmsyndromeInfoDTO = new TcmsyndromeInfoDTO();
+            tcmsyndromeInfoDTO.setCode(tcmsyndromeConfig.getUniqueCode());
+            tcmsyndromeInfoDTO.setName(tcmsyndromeConfig.getHisName());
+            tcmsyndromeNames.add(tcmsyndromeInfoDTO);
+        }
+        return tcmsyndromeNames;
+    }
+}

+ 96 - 56
src/main/java/com/diagbot/facade/TransfusionConfigFacade.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.TransfusionConfig;
 import com.diagbot.enums.ConceptTypeEnum;
@@ -153,15 +154,16 @@ public class TransfusionConfigFacade {
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
         List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Long>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
         transfusionConfigList.forEach(transfusionConfig -> {
             transfusionConfig.setHospitalId(Long.valueOf(hospitalId));
             transfusionConfig.setModifier(userId);
             transfusionConfig.setGmtModified(now);
             if (transfusionConfig.getId() == null) {
-                if (configMap.containsKey(transfusionConfig.getHisName())) {
-                    deleteIds.add(configMap.get(transfusionConfig.getHisName()).get(transfusionConfig.getUniqueName()));
+                if (configMap.containsKey(transfusionConfig.getHisName())
+                        && ListUtil.isNotEmpty(configMap.get(transfusionConfig.getHisName()).get(transfusionConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(transfusionConfig.getHisName()).get(transfusionConfig.getUniqueName()));
                 }
                 transfusionConfig.setCreator(userId);
                 transfusionConfig.setGmtCreate(now);
@@ -250,9 +252,7 @@ public class TransfusionConfigFacade {
         //2、去除前后空格
         //过滤空数据,保留重复数据,方便计行
         transfusionConfigList = transfusionConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .filter(TransfusionConfig::nonNull)
                 .collect(Collectors.toList());
         if (ListUtil.isEmpty(transfusionConfigList)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
@@ -284,60 +284,63 @@ public class TransfusionConfigFacade {
 
         // 验证数据是否已存在,已存在的先删除
         // 没id的删除重新插入,有id的更新
-        List<Long> deleteIds = Lists.newLinkedList();
-        Map<String, Map<String, Long>> configMap
-                = getConfigMap(Long.valueOf(hospitalId), null, null);
-        transfusionConfigList.forEach(transfusionConfig -> {
-            transfusionConfig.setHospitalId(Long.valueOf(hospitalId));
-            transfusionConfig.setModifier(userId);
-            transfusionConfig.setGmtModified(now);
-            if (transfusionConfig.getId() == null) {
-                if (configMap.containsKey(transfusionConfig.getHisName())) {
-                    deleteIds.add(configMap.get(transfusionConfig.getHisName()).get(transfusionConfig.getUniqueName()));
+        synchronized (this) {
+            List<Long> deleteIds = Lists.newLinkedList();
+            Map<String, Map<String, List<Long>>> configMap
+                    = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
+            transfusionConfigList.forEach(transfusionConfig -> {
+                transfusionConfig.setHospitalId(Long.valueOf(hospitalId));
+                transfusionConfig.setModifier(userId);
+                transfusionConfig.setGmtModified(now);
+                if (transfusionConfig.getId() == null) {
+                    if (configMap.containsKey(transfusionConfig.getHisName())
+                            && ListUtil.isNotEmpty(configMap.get(transfusionConfig.getHisName()).get(transfusionConfig.getUniqueName()))) {
+                        deleteIds.addAll(configMap.get(transfusionConfig.getHisName()).get(transfusionConfig.getUniqueName()));
+                    }
+                    transfusionConfig.setCreator(userId);
+                    transfusionConfig.setGmtCreate(now);
                 }
-                transfusionConfig.setCreator(userId);
-                transfusionConfig.setGmtCreate(now);
-            }
-            if (transfusionConfig.getIsDeleted() == null) {
-                transfusionConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
+                if (transfusionConfig.getIsDeleted() == null) {
+                    transfusionConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+                }
+            });
 
-        //标准术语校验
-        List<String> errorNumList = Lists.newLinkedList();
-        List<String> uniqueNames = transfusionConfigList.stream()
-                .map(i -> i.getUniqueName())
-                .distinct()
-                .collect(Collectors.toList());
-        ConceptVO conceptVO = new ConceptVO();
-        conceptVO.setNames(uniqueNames);
-        conceptVO.setType(ConceptTypeEnum.Transfusion.getKey());
-        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
-        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
-        List<String> names = respDTO.data;
-        for (int i = 0; i < transfusionConfigList.size(); i++) {
-            if (!names.contains(transfusionConfigList.get(i).getUniqueName())) {
-                errorNumList.add(String.valueOf(i + 2));
+            //标准术语校验
+            List<String> errorNumList = Lists.newLinkedList();
+            List<String> uniqueNames = transfusionConfigList.stream()
+                    .map(i -> i.getUniqueName())
+                    .distinct()
+                    .collect(Collectors.toList());
+            ConceptVO conceptVO = new ConceptVO();
+            conceptVO.setNames(uniqueNames);
+            conceptVO.setType(ConceptTypeEnum.Transfusion.getKey());
+            RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+            RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+            List<String> names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+            for (int i = 0; i < transfusionConfigList.size(); i++) {
+                if (!names.contains(transfusionConfigList.get(i).getUniqueName())) {
+                    errorNumList.add(String.valueOf(i + 2));
+                }
+            }
+            if (ListUtil.isNotEmpty(errorNumList)) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                        "以下行数(不计空行)标准术语在数据库中不存在:"
+                                + errorNumList.stream().collect(Collectors.joining("、"))
+                                + "。导入取消,请修改后再试。");
             }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计入空行)标准术语与数据库术语不匹配:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
 
-        //重复数据过滤
-        transfusionConfigList = transfusionConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
+            //重复数据过滤
+            transfusionConfigList = transfusionConfigList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
 
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        transfusionConfigService.saveOrUpdateBatch(transfusionConfigList);
+            //删除已存在映射关系
+            IdListVO idListVO = new IdListVO();
+            idListVO.setIds(deleteIds);
+            deleteRecords(idListVO);
+            transfusionConfigService.saveOrUpdateBatch(transfusionConfigList);
+        }
         return true;
     }
 
@@ -373,6 +376,43 @@ public class TransfusionConfigFacade {
         return retMap;
     }
 
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getConfigMapWithIds(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<TransfusionConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<TransfusionConfig> records = transfusionConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<TransfusionConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<TransfusionConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<TransfusionConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "uniqueName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<TransfusionConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
     /**
      * 获取映射关系
      * Map<uniqueName,Map<hisName,id>>

+ 37 - 0
src/main/java/com/diagbot/mapper/NurseConfigMapper.java

@@ -0,0 +1,37 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.NurseConfig;
+import com.diagbot.vo.NurseConfigPageVO;
+import com.diagbot.vo.RetrievalVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 护理映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-26
+ */
+public interface NurseConfigMapper extends BaseMapper<NurseConfig> {
+    /**
+     * 分页查询
+     *
+     * @param nurseConfigPageVO
+     * @return
+     */
+    IPage<NurseConfig> getPage(@Param("nurseConfigPageVO") NurseConfigPageVO nurseConfigPageVO);
+
+    /**
+     * 护理搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    List<NurseConfig> getNursesIndex(RetrievalVO retrievalVO);
+
+}

+ 24 - 0
src/main/java/com/diagbot/mapper/ScaleConfigMapper.java

@@ -0,0 +1,24 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.ScaleConfig;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.ScaleConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 量表映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-13
+ */
+public interface ScaleConfigMapper extends BaseMapper<ScaleConfig> {
+    IPage<ScaleConfig> getPage(@Param("scaleConfigPageVO") ScaleConfigPageVO scaleConfigPageVO);
+
+    List<ScaleConfig> getScalesIndex(RetrievalVO retrievalVO);
+}

+ 38 - 0
src/main/java/com/diagbot/mapper/TcmdiseaseConfigMapper.java

@@ -0,0 +1,38 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.TcmdiseaseConfig;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.TcmdiseaseConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 中医疾病映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-05-13
+ */
+public interface TcmdiseaseConfigMapper extends BaseMapper<TcmdiseaseConfig> {
+
+    /**
+     * 分页查询
+     *
+     * @param tcmdiseaseConfigPageVO
+     * @return
+     */
+    IPage<TcmdiseaseConfig> getPage(@Param("tcmdiseaseConfigPageVO") TcmdiseaseConfigPageVO tcmdiseaseConfigPageVO);
+
+    /**
+     * 中医疾病搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    List<TcmdiseaseConfig> getTcmdiseasesIndex(RetrievalVO retrievalVO);
+
+}

+ 37 - 0
src/main/java/com/diagbot/mapper/TcmsyndromeConfigMapper.java

@@ -0,0 +1,37 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.TcmsyndromeConfig;
+import com.diagbot.entity.TcmsyndromeConfig;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.TcmsyndromeConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 中医证候映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-05-13
+ */
+public interface TcmsyndromeConfigMapper extends BaseMapper<TcmsyndromeConfig> {
+    /**
+     * 分页查询
+     *
+     * @param tcmsyndromeConfigPageVO
+     * @return
+     */
+    IPage<TcmsyndromeConfig> getPage(@Param("tcmsyndromeConfigPageVO") TcmsyndromeConfigPageVO tcmsyndromeConfigPageVO);
+
+    /**
+     * 中医证候搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    List<TcmsyndromeConfig> getTcmsyndromesIndex(RetrievalVO retrievalVO);
+}

+ 9 - 2
src/main/java/com/diagbot/service/MrService.java

@@ -1,5 +1,6 @@
 package com.diagbot.service;
 
+import com.diagbot.dto.TcmDTO;
 import com.diagbot.vo.PushJoinVO;
 
 /**
@@ -11,16 +12,22 @@ public interface MrService {
 
     /**
      * 创建病历信息
-     *
      */
     String createMr(PushJoinVO imgVerInfo);
 
     /**
      * 获取病历信息
-     *
      */
     PushJoinVO getMr(String mrId);
 
+    /**
+     * 获取中医病历信息
+     *
+     * @param mrId
+     * @return
+     */
+    TcmDTO getTcmMr(String mrId);
+
     /**
      * 删除病历信息
      */

+ 36 - 0
src/main/java/com/diagbot/service/NurseConfigService.java

@@ -0,0 +1,36 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.NurseConfig;
+import com.diagbot.vo.NurseConfigPageVO;
+import com.diagbot.vo.RetrievalVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 护理映射表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-26
+ */
+public interface NurseConfigService extends IService<NurseConfig> {
+    /**
+     * 分页查询
+     *
+     * @param nurseConfigPageVO
+     * @return
+     */
+    IPage<NurseConfig> getPage(@Param("nurseConfigPageVO") NurseConfigPageVO nurseConfigPageVO);
+
+    /**
+     * 护理搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    List<NurseConfig> getNursesIndex(RetrievalVO retrievalVO);
+}

+ 24 - 0
src/main/java/com/diagbot/service/ScaleConfigService.java

@@ -0,0 +1,24 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.ScaleConfig;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.ScaleConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 量表映射表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-13
+ */
+public interface ScaleConfigService extends IService<ScaleConfig> {
+    IPage<ScaleConfig> getPage(@Param("scaleConfigPageVO") ScaleConfigPageVO scaleConfigPageVO);
+
+    List<ScaleConfig> getScalesIndex(RetrievalVO retrievalVO);
+}

+ 38 - 0
src/main/java/com/diagbot/service/TcmdiseaseConfigService.java

@@ -0,0 +1,38 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.TcmdiseaseInfoDTO;
+import com.diagbot.entity.TcmdiseaseConfig;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.TcmdiseaseConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 中医疾病映射表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-05-13
+ */
+public interface TcmdiseaseConfigService extends IService<TcmdiseaseConfig> {
+
+    /**
+     * 分页查询
+     *
+     * @param tcmdiseaseConfigPageVO
+     * @return
+     */
+    IPage<TcmdiseaseConfig> getPage(@Param("tcmdiseaseConfigPageVO") TcmdiseaseConfigPageVO tcmdiseaseConfigPageVO);
+
+    /**
+     * 中医疾病搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    List<TcmdiseaseConfig> getTcmdiseasesIndex(RetrievalVO retrievalVO);
+}

+ 36 - 0
src/main/java/com/diagbot/service/TcmsyndromeConfigService.java

@@ -0,0 +1,36 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.TcmsyndromeConfig;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.TcmsyndromeConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 中医证候映射表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-05-13
+ */
+public interface TcmsyndromeConfigService extends IService<TcmsyndromeConfig> {
+    /**
+     * 分页查询
+     *
+     * @param tcmsyndromeConfigPageVO
+     * @return
+     */
+    IPage<TcmsyndromeConfig> getPage(@Param("tcmsyndromeConfigPageVO") TcmsyndromeConfigPageVO tcmsyndromeConfigPageVO);
+
+    /**
+     * 中医证候搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    List<TcmsyndromeConfig> getTcmsyndromesIndex(RetrievalVO retrievalVO);
+}

+ 64 - 0
src/main/java/com/diagbot/service/impl/MrServiceImpl.java

@@ -1,5 +1,12 @@
 package com.diagbot.service.impl;
 
+import com.diagbot.biz.push.entity.Item;
+import com.diagbot.dto.TcmDTO;
+import com.diagbot.enums.OtherIndexEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.facade.TcmdiseaseConfigFacade;
+import com.diagbot.facade.TcmsyndromeConfigFacade;
 import com.diagbot.idc.VisibleIdCreater;
 import com.diagbot.service.MrService;
 import com.diagbot.util.DateUtil;
@@ -14,7 +21,10 @@ import org.springframework.data.redis.core.RedisCallback;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
 import java.util.Date;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 病历保存到redis接口实现
@@ -27,6 +37,10 @@ public class MrServiceImpl implements MrService {
     @Autowired
     @Qualifier("redisTemplateForMr")
     private RedisTemplate redisForMr;
+    @Autowired
+    private TcmdiseaseConfigFacade tcmdiseaseConfigFacade;
+    @Autowired
+    private TcmsyndromeConfigFacade tcmsyndromeConfigFacade;
 
     @Autowired
     private VisibleIdCreater visibleIdCreater;
@@ -106,6 +120,56 @@ public class MrServiceImpl implements MrService {
         });
     }
 
+    /**
+     * 获取中医病历信息
+     *
+     * @param mrId
+     * @return
+     */
+    @Override
+    public TcmDTO getTcmMr(String mrId) {
+        TcmDTO tcmDTO = new TcmDTO();
+        PushJoinVO pushJoinVO = getMr(mrId);
+        if (pushJoinVO == null) {
+            return tcmDTO;
+        }
+        Long hospitalId = pushJoinVO.getHospitalId();
+        if (hospitalId == null) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
+        }
+        Map<String, String> otherIndex = pushJoinVO.getOtherIndex();
+        if (otherIndex != null) {
+            Item tcmdisease = new Item();
+            if (otherIndex.containsKey(OtherIndexEnum.getName(OtherIndexEnum.TcmDiag.getKey()))) {
+                tcmdisease.setName(otherIndex.get(OtherIndexEnum.getName(OtherIndexEnum.TcmDiag.getKey())));
+                Map<String, Map<String, Long>> configMap
+                        = tcmdiseaseConfigFacade.getConfigMap(hospitalId,
+                        Arrays.asList(new String[] { tcmdisease.getName() }), null);
+                if (configMap != null && configMap.get(tcmdisease.getName()) != null) {
+                    tcmdisease.setUniqueName(configMap.get(tcmdisease.getName()).keySet().stream().collect(Collectors.toList()).get(0));
+                } else {
+                    tcmdisease.setUniqueName(tcmdisease.getName());
+                }
+                tcmDTO.setTcmdisease(tcmdisease);
+            }
+
+            Item tcmsyndrome = new Item();
+            if (otherIndex.containsKey(OtherIndexEnum.getName(OtherIndexEnum.TcmSyndrome.getKey()))) {
+                tcmsyndrome.setName(otherIndex.get(OtherIndexEnum.getName(OtherIndexEnum.TcmSyndrome.getKey())));
+                Map<String, Map<String, Long>> configMap
+                        = tcmsyndromeConfigFacade.getConfigMap(hospitalId,
+                        Arrays.asList(new String[] { tcmsyndrome.getName() }), null);
+                if (configMap != null && configMap.get(tcmsyndrome.getName()) != null) {
+                    tcmsyndrome.setUniqueName(configMap.get(tcmsyndrome.getName()).keySet().stream().collect(Collectors.toList()).get(0));
+                } else {
+                    tcmsyndrome.setUniqueName(tcmsyndrome.getName());
+                }
+                tcmDTO.setTcmsyndrome(tcmsyndrome);
+            }
+        }
+        return tcmDTO;
+    }
+
     /**
      * 删除用户短信验证码信息
      */

+ 46 - 0
src/main/java/com/diagbot/service/impl/NurseConfigServiceImpl.java

@@ -0,0 +1,46 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.NurseConfig;
+import com.diagbot.mapper.NurseConfigMapper;
+import com.diagbot.service.NurseConfigService;
+import com.diagbot.vo.NurseConfigPageVO;
+import com.diagbot.vo.RetrievalVO;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 护理映射表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-26
+ */
+@Service
+public class NurseConfigServiceImpl extends ServiceImpl<NurseConfigMapper, NurseConfig> implements NurseConfigService {
+    /**
+     * 分页查询
+     *
+     * @param nurseConfigPageVO
+     * @return
+     */
+    @Override
+    public IPage<NurseConfig> getPage(@Param("nurseConfigPageVO") NurseConfigPageVO nurseConfigPageVO) {
+        return baseMapper.getPage(nurseConfigPageVO);
+    }
+
+    /**
+     * 护理搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    @Override
+    public List<NurseConfig> getNursesIndex(RetrievalVO retrievalVO) {
+        return baseMapper.getNursesIndex(retrievalVO);
+    }
+}

+ 35 - 0
src/main/java/com/diagbot/service/impl/ScaleConfigServiceImpl.java

@@ -0,0 +1,35 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.ScaleConfig;
+import com.diagbot.mapper.ScaleConfigMapper;
+import com.diagbot.service.ScaleConfigService;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.ScaleConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 量表映射表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-13
+ */
+@Service
+public class ScaleConfigServiceImpl extends ServiceImpl<ScaleConfigMapper, ScaleConfig> implements ScaleConfigService {
+
+    @Override
+    public IPage<ScaleConfig> getPage(@Param("scaleConfigPageVO") ScaleConfigPageVO scaleConfigPageVO) {
+        return baseMapper.getPage(scaleConfigPageVO);
+    }
+
+    @Override
+    public List<ScaleConfig> getScalesIndex(RetrievalVO retrievalVO) {
+        return baseMapper.getScalesIndex(retrievalVO);
+    }
+}

+ 47 - 0
src/main/java/com/diagbot/service/impl/TcmdiseaseConfigServiceImpl.java

@@ -0,0 +1,47 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.TcmdiseaseInfoDTO;
+import com.diagbot.entity.TcmdiseaseConfig;
+import com.diagbot.mapper.TcmdiseaseConfigMapper;
+import com.diagbot.service.TcmdiseaseConfigService;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.TcmdiseaseConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 中医疾病映射表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-05-13
+ */
+@Service
+public class TcmdiseaseConfigServiceImpl extends ServiceImpl<TcmdiseaseConfigMapper, TcmdiseaseConfig> implements TcmdiseaseConfigService {
+    /**
+     * 分页查询
+     *
+     * @param tcmdiseaseConfigPageVO
+     * @return
+     */
+    @Override
+    public IPage<TcmdiseaseConfig> getPage(@Param("tcmdiseaseConfigPageVO") TcmdiseaseConfigPageVO tcmdiseaseConfigPageVO) {
+        return baseMapper.getPage(tcmdiseaseConfigPageVO);
+    }
+
+    /**
+     * 中医疾病搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    @Override
+    public List<TcmdiseaseConfig> getTcmdiseasesIndex(RetrievalVO retrievalVO) {
+        return baseMapper.getTcmdiseasesIndex(retrievalVO);
+    }
+}

+ 47 - 0
src/main/java/com/diagbot/service/impl/TcmsyndromeConfigServiceImpl.java

@@ -0,0 +1,47 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.TcmsyndromeConfig;
+import com.diagbot.mapper.TcmsyndromeConfigMapper;
+import com.diagbot.service.TcmsyndromeConfigService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.RetrievalVO;
+import com.diagbot.vo.TcmsyndromeConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 中医证候映射表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-05-13
+ */
+@Service
+public class TcmsyndromeConfigServiceImpl extends ServiceImpl<TcmsyndromeConfigMapper, TcmsyndromeConfig> implements TcmsyndromeConfigService {
+    /**
+     * 分页查询
+     *
+     * @param tcmsyndromeConfigPageVO
+     * @return
+     */
+    @Override
+    public IPage<TcmsyndromeConfig> getPage(@Param("tcmsyndromeConfigPageVO") TcmsyndromeConfigPageVO tcmsyndromeConfigPageVO) {
+        return baseMapper.getPage(tcmsyndromeConfigPageVO);
+    }
+
+
+    /**
+     * 中医证候搜索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    @Override
+    public List<TcmsyndromeConfig> getTcmsyndromesIndex(RetrievalVO retrievalVO) {
+        return baseMapper.getTcmsyndromesIndex(retrievalVO);
+    }
+}

+ 20 - 5
src/main/java/com/diagbot/util/CoreUtil.java

@@ -23,8 +23,8 @@ public class CoreUtil {
             if (StringUtil.isEmpty(ageStr)) {
                 return 20.0;
             }
-            // 全是整形数字,当成年龄处理
-            if (numbersOnly(ageStr)) {
+            // 数值,当成年龄处理
+            if (isNumbers(ageStr)) {
                 return Double.parseDouble(ageStr);
             }
             // 20日
@@ -35,12 +35,16 @@ public class CoreUtil {
             if (ageStr.endsWith("岁")) {
                 return Double.parseDouble(ageStr.substring(0, ageStr.length() - 1));
             }
-            // 3岁7个月
+            // 3岁7个月 | 3岁7月
             if (ageSuiYue(ageStr)) {
                 String[] ageArr = new String[2];
                 int indexSui = ageStr.indexOf("岁");
                 ageArr[0] = ageStr.substring(0, indexSui);
-                ageArr[1] = ageStr.substring(indexSui + 1,ageStr.indexOf("个月"));
+                if (ageStr.indexOf("个月") > -1) { // 3岁7个月
+                    ageArr[1] = ageStr.substring(indexSui + 1,ageStr.indexOf("个月"));
+                } else { // 3岁7月
+                    ageArr[1] = ageStr.substring(indexSui + 1,ageStr.indexOf("月"));
+                }
                 return Double.parseDouble(ageArr[0]) + getHalfUp(Double.parseDouble(ageArr[1]) / 12);
             }
             // 1.08月 | .11月 | 3月
@@ -81,6 +85,17 @@ public class CoreUtil {
         return str.matches(regex);
     }
 
+    /**
+     * 判断字符串是否数值(正)
+     *
+     * @param str
+     * @return
+     */
+    public static boolean isNumbers(String str) {
+        String regex = "[0-9]+|([0-9]+\\.)+[0-9]*|[0-9]*(\\.[0-9]+)+";
+        return str.matches(regex);
+    }
+
     /**
      * 判断年龄字符串:xx月
      *
@@ -99,7 +114,7 @@ public class CoreUtil {
      * @return
      */
     public static boolean ageSuiYue(String str) {
-        String regex = "^[0-9]{1,3}岁[0-9]{1,2}个月$";
+        String regex = "^[0-9]{1,3}岁[0-9]{1,2}个{0,1}月$";
         return str.matches(regex);
     }
 

+ 280 - 0
src/main/java/com/diagbot/util/RedisUtil.java

@@ -0,0 +1,280 @@
+package com.diagbot.util;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @description: redis工具类
+ * @author: zhoutg
+ * @time: 2020/8/11 19:52
+ */
+@Component
+public class RedisUtil {
+
+    @Autowired
+    @Qualifier("redisTemplateForMr")
+    RedisTemplate redisTemplate;
+
+    /**
+     * 根据指定key获取value
+     *
+     * @param key 键
+     */
+    public <T> T get(String key) {
+        return (T) redisTemplate.opsForValue().get(key);
+    }
+
+    /**
+     * 根据指定key设置obj
+     *
+     * @param key
+     * @param obj
+     */
+    public void set(String key, Object obj) {
+        redisTemplate.opsForValue().set(key, obj);
+    }
+
+    /**
+     * 批量获取
+     *
+     * @param keys
+     * @return
+     */
+    public <T> List<T> multiGet(Collection<String> keys) {
+        return redisTemplate.opsForValue().multiGet(keys);
+    }
+
+    /**
+     * 批量设置
+     *
+     * @param map
+     * @return
+     */
+    public void multiSet(Map<String, Object> map) {
+        redisTemplate.opsForValue().multiSet(map);
+    }
+
+    /**
+     * 更新指定的数据
+     *
+     * @param key
+     * @param str
+     */
+    public void updateValue(String key, String str) {
+        redisTemplate.opsForValue().set(key, str);
+    }
+
+    /**
+     * 删除key
+     *
+     * @param key
+     */
+    public void delete(String key) {
+        redisTemplate.delete(key);
+    }
+
+    /**
+     * 批量删除key
+     *
+     * @param keys
+     */
+    public void delete(Collection<String> keys) {
+        redisTemplate.delete(keys);
+    }
+
+    /**
+     * 根据前缀删除key
+     *
+     * @param prex
+     */
+    public void deleteByPrex(String prex) {
+        prex = prex + "**";
+        Set<String> keys = getKeyList(prex);
+        if (CollectionUtils.isNotEmpty(keys)) {
+            redisTemplate.delete(keys);
+        }
+    }
+
+    /**
+     * 根据正则key获取value列表
+     *
+     * @param pattern 键
+     */
+    public <T> List<T> getByRegex(String pattern) {
+        Set<String> keys = getKeyList(pattern);
+        return multiGet(keys);
+    }
+
+    /**
+     * 查找匹配的key
+     *
+     * @param pattern
+     * @return
+     */
+    public Set<String> getKeyList(String pattern) {
+        return redisTemplate.keys(pattern);
+    }
+
+    /**
+     * 序列化key
+     *
+     * @param key
+     * @return
+     */
+    public byte[] dump(String key) {
+        return redisTemplate.dump(key);
+    }
+
+    /**
+     * 是否存在key
+     *
+     * @param key
+     * @return
+     */
+    public Boolean hasKey(String key) {
+        return redisTemplate.hasKey(key);
+    }
+
+    /**
+     * 设置过期时间
+     *
+     * @param key
+     * @param timeout
+     * @param unit
+     * @return
+     */
+    public Boolean expire(String key, long timeout, TimeUnit unit) {
+        return redisTemplate.expire(key, timeout, unit);
+    }
+
+    /**
+     * 设置过期时间
+     *
+     * @param key
+     * @param date
+     * @return
+     */
+    public Boolean expireAt(String key, Date date) {
+        return redisTemplate.expireAt(key, date);
+    }
+
+    /**
+     * 移除 key 的过期时间,key 将持久保持
+     *
+     * @param key
+     * @return
+     */
+    public Boolean persist(String key) {
+        return redisTemplate.persist(key);
+    }
+
+    /**
+     * 返回 key 的剩余的过期时间
+     *
+     * @param key
+     * @param unit
+     * @return
+     */
+    public Long getExpire(String key, TimeUnit unit) {
+        return redisTemplate.getExpire(key, unit);
+    }
+
+    /**
+     * 返回 key 的剩余的过期时间
+     *
+     * @param key
+     * @return
+     */
+    public Long getExpire(String key) {
+        return redisTemplate.getExpire(key);
+    }
+
+    /**
+     * 修改 key 的名称
+     *
+     * @param oldKey
+     * @param newKey
+     */
+    public void rename(String oldKey, String newKey) {
+        redisTemplate.rename(oldKey, newKey);
+    }
+
+    /**
+     * 仅当 newkey 不存在时,将 oldKey 改名为 newkey
+     *
+     * @param oldKey
+     * @param newKey
+     * @return
+     */
+    public Boolean renameIfAbsent(String oldKey, String newKey) {
+        return redisTemplate.renameIfAbsent(oldKey, newKey);
+    }
+
+    /**
+     * 设置指定 key 的值
+     *
+     * @param key
+     * @param value
+     */
+    public void set(String key, String value) {
+        redisTemplate.opsForValue().set(key, value);
+    }
+
+    /**
+     * 将值 value 关联到 key ,并将 key 的过期时间设为 timeout
+     *
+     * @param key
+     * @param value
+     * @param timeout 过期时间
+     * @param unit    时间单位, 天:TimeUnit.DAYS 小时:TimeUnit.HOURS 分钟:TimeUnit.MINUTES
+     *                秒:TimeUnit.SECONDS 毫秒:TimeUnit.MILLISECONDS
+     */
+    public void setEx(String key, Object value, long timeout, TimeUnit unit) {
+        redisTemplate.opsForValue().set(key, value, timeout, unit);
+    }
+
+    /**
+     * 只有在 key 不存在时设置 key 的值
+     *
+     * @param key
+     * @param value
+     * @return 之前已经存在返回false, 不存在返回true
+     */
+    public boolean setIfAbsent(String key, String value) {
+        return redisTemplate.opsForValue().setIfAbsent(key, value);
+    }
+
+    /**
+     * map集合的形式添加键值对
+     *
+     * @param key
+     * @param map
+     */
+    public void putHashMap(String key, Map<String, Object> map) {
+        if (MapUtils.isNotEmpty(map)) {
+            redisTemplate.opsForHash().putAll(key, map);
+        }
+    }
+
+    /**
+     * 获取集合中指定field的内容
+     * @param key
+     * @param field
+     * @param <T>
+     * @return
+     */
+    public <T> T getByKeyAndField(String key, String field) {
+        return (T)redisTemplate.opsForHash().get(key, field);
+    }
+}

+ 3 - 0
src/main/java/com/diagbot/vo/ChangeStatusVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -13,4 +14,6 @@ import lombok.Setter;
 public class ChangeStatusVO {
     private Long id;
     private Integer status;
+    @ApiModelProperty(hidden = true)
+    private Long userId;
 }

+ 18 - 0
src/main/java/com/diagbot/vo/GetDetailVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/3/19 13:33
+ */
+@Getter
+@Setter
+public class GetDetailVO {
+    List<String> nameList;
+    List<Integer> contentTypes;
+}

+ 47 - 0
src/main/java/com/diagbot/vo/KlConceptDetailVO.java

@@ -0,0 +1,47 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/24 15:03
+ */
+@Getter
+@Setter
+public class KlConceptDetailVO {
+    /**
+     * 明细id
+     */
+    private Long id;
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 提示明细标题
+     */
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    private String text;
+
+    /**
+     * 提示明细序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
+     */
+    private String contentType;
+}

+ 33 - 0
src/main/java/com/diagbot/vo/KlConceptStaticPageVO.java

@@ -0,0 +1,33 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/24 13:41
+ */
+@Getter
+@Setter
+public class KlConceptStaticPageVO extends Page {
+    /**
+     * 标准术语
+     */
+    private String name;
+    /**
+     * 术语类型
+     */
+    private Integer type;
+    /**
+     * 术语类型
+     */
+    @ApiModelProperty(hidden = true)
+    private String typeName;
+    /**
+     * 启用状态
+     */
+    private Integer status;
+}

+ 51 - 0
src/main/java/com/diagbot/vo/KlConceptStaticVO.java

@@ -0,0 +1,51 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/24 15:03
+ */
+@Getter
+@Setter
+public class KlConceptStaticVO {
+    private Long id;
+    /**
+     * 标准术语
+     */
+    private String name;
+    /**
+     * 术语类型
+     */
+    private Integer type;
+    /**
+     * 术语类型
+     */
+    @ApiModelProperty(hidden = true)
+    private String typeName;
+    /**
+     * 临床路径名称
+     */
+    private String clinicalPathwayName;
+
+    /**
+     * 注意事项名称
+     */
+    private String noticeName;
+
+    /**
+     * 静态知识明细
+     */
+    private List<KlConceptDetailVO> details;
+
+    /**
+     * 操作id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long userId;
+}

+ 18 - 0
src/main/java/com/diagbot/vo/KlRuleByIdVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-08 11:11
+ */
+@Setter
+@Getter
+public class KlRuleByIdVO {
+    @NotNull(message = "请输id")
+    private Long id;
+}

+ 18 - 0
src/main/java/com/diagbot/vo/KlRuleInfoClearVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-08 13:46
+ */
+@Setter
+@Getter
+public class KlRuleInfoClearVO {
+    @NotNull(message = "请输id")
+    private Long id;
+}

+ 30 - 0
src/main/java/com/diagbot/vo/KlRuleInfoSaveSubVO.java

@@ -0,0 +1,30 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-08 13:38
+ */
+@Setter
+@Getter
+public class KlRuleInfoSaveSubVO {
+    private String subDescription;//基础规则名称
+    private Long subConceptId;//医学标准术语id
+/*    private String subLibName;//医学标准术语
+    private String subLenName;//基础规则术语类型
+    private String subLenCode;//基础规则术语编码*/
+    private Integer subType;//基础规则类型(1:开单外等于术语本身;2:开单外存在比较;3:开单外不等于术语本身;4:过敏原;5:开单项;6:检查结果正则表达式)
+    private Integer groupType;
+    private String subMinOperator;//最小域比较符
+    private String subMinValue;//最小域值
+    private String subMinUnit;//最小域单位
+    private String subMaxOperator;//最大域比较符
+    private String subMaxValue;//最大域值
+    private String subMaxUnit;//最大域单位
+    private String subEqOperator;//等于域比较符
+    private String subEqValue;//等于域值
+    private String subEqUnit;//等于域单位
+}

+ 36 - 0
src/main/java/com/diagbot/vo/KlRuleInfoSaveVO.java

@@ -0,0 +1,36 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-08 13:37
+ */
+@Setter
+@Getter
+public class KlRuleInfoSaveVO {
+    private Long parId;
+    @NotBlank(message = "请输入规则名称")
+    private String parDescription;//规则名称
+    @NotNull(message = "请输入规则类型")
+    private Integer parRuleType;//规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+    @NotNull(message = "请输入概念id")
+    private Long parConceptId;//提示概念id
+    @NotNull(message = "请输入概念id")
+    private Integer parHasSub;//是否有子条件(0:无,1:有)
+    private String parMsg;//附加信息
+    @ApiModelProperty(hidden = true)
+    private Integer parStatus = 1;//启用状态(0:禁用,1:启用)
+    /*    private String parlibName;
+        private String parLenName;
+        private String parLenCode;*/
+    private String modifier;
+    private List<KlRuleInfoSaveSubVO> klRuleInfoSaveSub;
+}

+ 30 - 0
src/main/java/com/diagbot/vo/KlRuleInfoVO.java

@@ -0,0 +1,30 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-05 13:44
+ */
+@Setter
+@Getter
+public class KlRuleInfoVO extends Page {
+    /**
+     * 描述
+     */
+    private String parDescription;
+    /**
+     * 规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+     */
+    private Integer parRuleType;
+
+    private String parConceptName;
+    /**
+     * 启用状态(0:禁用,1:启用)
+     */
+    private Integer parStatus;
+
+}

+ 20 - 0
src/main/java/com/diagbot/vo/KlRuleMenuVO.java

@@ -0,0 +1,20 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-09 13:35
+ */
+@Setter
+@Getter
+public class KlRuleMenuVO {
+    /**
+     * 规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+     */
+    private Integer ruleType;
+
+    private String planCode;
+}

+ 19 - 0
src/main/java/com/diagbot/vo/KlRuleSatartOrdisaVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-08 16:32
+ */
+@Setter
+@Getter
+public class KlRuleSatartOrdisaVO {
+    @NotNull(message = "请输id")
+    private Long id;
+    private String modifier;
+}

+ 20 - 0
src/main/java/com/diagbot/vo/KllisDetailVO.java

@@ -0,0 +1,20 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/4/16 14:38
+ */
+@Getter
+@Setter
+public class KllisDetailVO {
+    /**
+     * 名称
+     */
+    private List<String> names;
+}

+ 18 - 0
src/main/java/com/diagbot/vo/NurseConfigListVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import com.diagbot.entity.NurseConfig;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/26 10:26
+ */
+@Getter
+@Setter
+public class NurseConfigListVO {
+    private List<NurseConfig> nurseConfigList;
+}

+ 36 - 0
src/main/java/com/diagbot/vo/NurseConfigPageVO.java

@@ -0,0 +1,36 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/26 10:24
+ */
+@Getter
+@Setter
+public class NurseConfigPageVO extends Page {
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+
+    /**
+     * 医院术语名称
+     */
+    private String hisName;
+
+    /**
+     * 医学标准术语名称
+     */
+    private String uniqueName;
+
+    /**
+     * 标准编码
+     */
+    private String uniqueCode;
+}

+ 0 - 0
src/main/java/com/diagbot/vo/PushJoinVO.java


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików