瀏覽代碼

Merge branch 'his/common' of http://192.168.2.236:10080/gaodm/cdss into his/common

lipc 3 年之前
父節點
當前提交
d2b1832431
共有 100 個文件被更改,包括 5718 次插入5725 次删除
  1. 66 0
      doc/002.20210629术语关联改版/cdss_init.sql
  2. 113 245
      src/main/java/com/diagbot/aggregate/AssembleAggregate.java
  3. 112 31
      src/main/java/com/diagbot/aggregate/AssemblePushAggregate.java
  4. 172 10
      src/main/java/com/diagbot/client/CdssCoreClient.java
  5. 227 9
      src/main/java/com/diagbot/client/hystrix/CdssCoreHystrix.java
  6. 40 73
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  7. 42 75
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  8. 17 0
      src/main/java/com/diagbot/dto/ConceptScaleDTO.java
  9. 107 0
      src/main/java/com/diagbot/dto/ConceptScaleDetailDTO.java
  10. 18 0
      src/main/java/com/diagbot/dto/ConceptScaleSubDTO.java
  11. 2 1
      src/main/java/com/diagbot/dto/DiseaseInfoDTO.java
  12. 1 0
      src/main/java/com/diagbot/dto/DrugInfoDTO.java
  13. 46 0
      src/main/java/com/diagbot/dto/GetAllForRelationDTO.java
  14. 19 0
      src/main/java/com/diagbot/dto/IndexBatchDTO.java
  15. 43 0
      src/main/java/com/diagbot/dto/KlConceptDetailDTO.java
  16. 63 0
      src/main/java/com/diagbot/dto/KlConceptStaticDTO.java
  17. 27 0
      src/main/java/com/diagbot/dto/KlRuleByIdParDTO.java
  18. 32 0
      src/main/java/com/diagbot/dto/KlRuleByIdSubDTO.java
  19. 65 0
      src/main/java/com/diagbot/dto/KlRuleInfoDTO.java
  20. 38 0
      src/main/java/com/diagbot/dto/KllisDetailDTO.java
  21. 1 0
      src/main/java/com/diagbot/dto/LisDetailDTO.java
  22. 19 0
      src/main/java/com/diagbot/dto/NurseInfoDTO.java
  23. 1 0
      src/main/java/com/diagbot/dto/OperationInfoDTO.java
  24. 5 1
      src/main/java/com/diagbot/dto/PushBaseDTO.java
  25. 5 0
      src/main/java/com/diagbot/dto/PushDTO.java
  26. 18 0
      src/main/java/com/diagbot/dto/PushScaleDTO.java
  27. 17 0
      src/main/java/com/diagbot/dto/RetrievalConceptDTO.java
  28. 32 16
      src/main/java/com/diagbot/dto/RetrievalDTO.java
  29. 20 0
      src/main/java/com/diagbot/dto/ScaleInfoDTO.java
  30. 5 0
      src/main/java/com/diagbot/dto/StaticKnowledgeDTO.java
  31. 5 0
      src/main/java/com/diagbot/dto/StaticKnowledgeIndexDTO.java
  32. 28 0
      src/main/java/com/diagbot/dto/StaticKnowledgeIndexPageDTO.java
  33. 23 0
      src/main/java/com/diagbot/dto/TcmDTO.java
  34. 24 0
      src/main/java/com/diagbot/dto/TcmdiseaseInfoDTO.java
  35. 24 0
      src/main/java/com/diagbot/dto/TcmsyndromeInfoDTO.java
  36. 20 0
      src/main/java/com/diagbot/dto/TermConceptDTO.java
  37. 47 0
      src/main/java/com/diagbot/entity/AnesthesiaConfig.java
  38. 33 103
      src/main/java/com/diagbot/entity/DeptConfig.java
  39. 34 94
      src/main/java/com/diagbot/entity/DiseaseConfig.java
  40. 36 105
      src/main/java/com/diagbot/entity/DrugConfig.java
  41. 18 0
      src/main/java/com/diagbot/entity/KlRuleMenuWrapper.java
  42. 218 0
      src/main/java/com/diagbot/entity/KlRulePlan.java
  43. 36 104
      src/main/java/com/diagbot/entity/LisConfig.java
  44. 303 0
      src/main/java/com/diagbot/entity/MappingConfig.java
  45. 138 0
      src/main/java/com/diagbot/entity/NurseConfig.java
  46. 33 90
      src/main/java/com/diagbot/entity/OperationConfig.java
  47. 31 88
      src/main/java/com/diagbot/entity/PacsConfig.java
  48. 139 0
      src/main/java/com/diagbot/entity/ScaleConfig.java
  49. 139 0
      src/main/java/com/diagbot/entity/TcmdiseaseConfig.java
  50. 135 0
      src/main/java/com/diagbot/entity/TcmsyndromeConfig.java
  51. 32 94
      src/main/java/com/diagbot/entity/TransfusionConfig.java
  52. 49 0
      src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java
  53. 10 2
      src/main/java/com/diagbot/enums/ConceptTypeEnum.java
  54. 66 0
      src/main/java/com/diagbot/enums/MatchSourceEnum.java
  55. 64 0
      src/main/java/com/diagbot/enums/OtherIndexEnum.java
  56. 24 0
      src/main/java/com/diagbot/facade/CacheFacade.java
  57. 83 32
      src/main/java/com/diagbot/facade/ConceptInfoFacade.java
  58. 41 9
      src/main/java/com/diagbot/facade/DataPageDockFacade.java
  59. 0 491
      src/main/java/com/diagbot/facade/DeptConfigFacade.java
  60. 0 494
      src/main/java/com/diagbot/facade/DiseaseConfigFacade.java
  61. 0 686
      src/main/java/com/diagbot/facade/DrugConfigFacade.java
  62. 279 0
      src/main/java/com/diagbot/facade/KlConceptStaticFacade.java
  63. 28 0
      src/main/java/com/diagbot/facade/KlDictionaryInfoFacade.java
  64. 65 0
      src/main/java/com/diagbot/facade/KlRuleFacade.java
  65. 28 0
      src/main/java/com/diagbot/facade/KlRulePlanFacade.java
  66. 0 603
      src/main/java/com/diagbot/facade/LisConfigFacade.java
  67. 1762 0
      src/main/java/com/diagbot/facade/MappingConfigFacade.java
  68. 0 491
      src/main/java/com/diagbot/facade/OperationConfigFacade.java
  69. 0 486
      src/main/java/com/diagbot/facade/PacsConfigFacade.java
  70. 1 1
      src/main/java/com/diagbot/facade/PlanDetailFacade.java
  71. 3 3
      src/main/java/com/diagbot/facade/PlanFacade.java
  72. 66 16
      src/main/java/com/diagbot/facade/PushFacade.java
  73. 21 28
      src/main/java/com/diagbot/facade/RetrievalFacade.java
  74. 28 0
      src/main/java/com/diagbot/facade/TermMatchingFacade.java
  75. 0 486
      src/main/java/com/diagbot/facade/TransfusionConfigFacade.java
  76. 0 37
      src/main/java/com/diagbot/mapper/DeptConfigMapper.java
  77. 0 38
      src/main/java/com/diagbot/mapper/DiseaseConfigMapper.java
  78. 0 37
      src/main/java/com/diagbot/mapper/DrugConfigMapper.java
  79. 0 45
      src/main/java/com/diagbot/mapper/LisConfigMapper.java
  80. 45 0
      src/main/java/com/diagbot/mapper/MappingConfigMapper.java
  81. 0 36
      src/main/java/com/diagbot/mapper/OperationConfigMapper.java
  82. 0 36
      src/main/java/com/diagbot/mapper/PacsConfigMapper.java
  83. 0 36
      src/main/java/com/diagbot/mapper/TransfusionConfigMapper.java
  84. 0 36
      src/main/java/com/diagbot/service/DeptConfigService.java
  85. 0 37
      src/main/java/com/diagbot/service/DiseaseConfigService.java
  86. 0 36
      src/main/java/com/diagbot/service/DrugConfigService.java
  87. 0 43
      src/main/java/com/diagbot/service/LisConfigService.java
  88. 45 0
      src/main/java/com/diagbot/service/MappingConfigService.java
  89. 9 2
      src/main/java/com/diagbot/service/MrService.java
  90. 0 36
      src/main/java/com/diagbot/service/OperationConfigService.java
  91. 0 36
      src/main/java/com/diagbot/service/PacsConfigService.java
  92. 0 36
      src/main/java/com/diagbot/service/TransfusionConfigService.java
  93. 0 44
      src/main/java/com/diagbot/service/impl/DeptConfigServiceImpl.java
  94. 0 44
      src/main/java/com/diagbot/service/impl/DiseaseConfigServiceImpl.java
  95. 0 44
      src/main/java/com/diagbot/service/impl/DrugConfigServiceImpl.java
  96. 0 54
      src/main/java/com/diagbot/service/impl/LisConfigServiceImpl.java
  97. 58 0
      src/main/java/com/diagbot/service/impl/MappingConfigServiceImpl.java
  98. 74 1
      src/main/java/com/diagbot/service/impl/MrServiceImpl.java
  99. 0 44
      src/main/java/com/diagbot/service/impl/OperationConfigServiceImpl.java
  100. 0 0
      src/main/java/com/diagbot/service/impl/PacsConfigServiceImpl.java

+ 66 - 0
doc/002.20210629术语关联改版/cdss_init.sql

@@ -0,0 +1,66 @@
+use `cdss`;
+DROP TABLE IF EXISTS `tran_dept_config`;
+DROP TABLE IF EXISTS `tran_drug_config`;
+DROP TABLE IF EXISTS `tran_disease_config`;
+DROP TABLE IF EXISTS `tran_lis_config`;
+DROP TABLE IF EXISTS `tran_pacs_config`;
+DROP TABLE IF EXISTS `tran_scale_config`;
+DROP TABLE IF EXISTS `tran_nurse_config`;
+DROP TABLE IF EXISTS `tran_operation_config`;
+DROP TABLE IF EXISTS `tran_transfusion_config`;
+DROP TABLE IF EXISTS `tran_tcmdisease_config`;
+DROP TABLE IF EXISTS `tran_tcmsyndrome_config`;
+
+/*
+ Navicat Premium Data Transfer
+
+ Source Server         : 192.168.2.236
+ Source Server Type    : MySQL
+ Source Server Version : 50731
+ Source Host           : 192.168.2.236:3306
+ Source Schema         : cdss
+
+ Target Server Type    : MySQL
+ Target Server Version : 50731
+ File Encoding         : 65001
+
+ Date: 29/06/2021 13:55:24
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for tran_mapping_config
+-- ----------------------------
+-- 已执行脚本
+-- DROP TABLE IF EXISTS `tran_mapping_config`;
+-- CREATE TABLE `tran_mapping_config`  (
+--   `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+--   `is_deleted` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+--   `gmt_create` datetime(0) NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+--   `gmt_modified` datetime(0) NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+--   `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+--   `modifier` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+--   `hospital_id` bigint(20) NOT NULL COMMENT '医院id',
+--   `type` int(4) NOT NULL COMMENT '医学术语类型( 1-检验套餐、2-检验细项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医疾病、13-中医证候、14-麻醉)',
+--   `his_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '医院术语名称',
+--   `his_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '医院术语编码',
+--   `his_detail_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '医院术语细项名称(检验细项)',
+--   `concept_id` bigint(20) NULL DEFAULT NULL COMMENT '医学标准术语id',
+--   `form_concept_id` bigint(20) NULL DEFAULT NULL COMMENT '药品剂型id',
+--   `is_match` int(4) NOT NULL DEFAULT 0 COMMENT '是否匹配(0-未匹配、1-已匹配)',
+--   `source` int(4) NULL DEFAULT NULL COMMENT '数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)',
+--   `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+--   PRIMARY KEY (`id`) USING BTREE,
+--   INDEX `idx_his_detail_name`(`hospital_id`, `type`, `his_name`, `his_detail_name`) USING BTREE,
+--   INDEX `idx_his_name`(`hospital_id`, `type`, `his_name`) USING BTREE,
+--   INDEX `idx_concept_id`(`hospital_id`, `concept_id`) USING BTREE,
+--   INDEX `idx_hospital_id`(`hospital_id`) USING BTREE,
+--   INDEX `idx_detail_name`(`his_name`, `his_detail_name`) USING BTREE,
+--   INDEX `idx_deleted_type`(`type`) USING BTREE,
+--   INDEX `idx_type`(`hospital_id`, `type`, `is_deleted`) USING BTREE
+-- ) ENGINE = InnoDB AUTO_INCREMENT = 797881 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '医学术语映射表' ROW_FORMAT = Dynamic;
+--
+-- SET FOREIGN_KEY_CHECKS = 1;
+--

+ 113 - 245
src/main/java/com/diagbot/aggregate/AssembleAggregate.java

@@ -3,15 +3,11 @@ package com.diagbot.aggregate;
 import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.biz.push.entity.Pacs;
-import com.diagbot.facade.DeptConfigFacade;
-import com.diagbot.facade.DiseaseConfigFacade;
-import com.diagbot.facade.DrugConfigFacade;
-import com.diagbot.facade.LisConfigFacade;
-import com.diagbot.facade.OperationConfigFacade;
-import com.diagbot.facade.PacsConfigFacade;
-import com.diagbot.facade.TransfusionConfigFacade;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.facade.MappingConfigFacade;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.ReflectUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.Drug;
 import com.diagbot.vo.ItemExt;
@@ -24,6 +20,8 @@ import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.lang.reflect.Method;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -37,110 +35,98 @@ import java.util.stream.Collectors;
 @Component
 public class AssembleAggregate {
     @Autowired
-    private LisConfigFacade lisConfigFacade;
-    @Autowired
-    private PacsConfigFacade pacsConfigFacade;
-    @Autowired
-    private DiseaseConfigFacade diseaseConfigFacade;
-    @Autowired
-    private DrugConfigFacade drugConfigFacade;
-    @Autowired
-    private OperationConfigFacade operationConfigFacade;
-    @Autowired
-    private DeptConfigFacade deptConfigFacade;
-    @Autowired
-    private TransfusionConfigFacade transfusionConfigFacade;
+    private MappingConfigFacade mappingConfigFacade;
 
     @DataProvider("assembleDataAll")
     public SearchData assembleDataAll(
             @InvokeParameter("searchData") SearchData searchData,
-            @DataConsumer("lisConfigMap") Map<String, Map<String, Map<String, Long>>> lisConfigMap,
-            @DataConsumer("pacsConfigMap") Map<String, Map<String, Long>> pacsConfigMap,
-            @DataConsumer("diagConfigMap") Map<String, Map<String, Long>> diagConfigMap,
-            @DataConsumer("drugConfigMap") Map<String, Map<String, Map<String, Long>>> drugConfigMap,
-            @DataConsumer("operationConfigMap") Map<String, Map<String, Long>> operationConfigMap,
-            @DataConsumer("deptConfigMap") Map<String, Map<String, Long>> deptConfigMap,
-            @DataConsumer("transfusionConfigMap") Map<String, Map<String, Long>> transfusionConfigMap) {
+            @DataConsumer("lisConfigMap") Map<String, Map<String, Map<String, List<String>>>> lisConfigMap,
+            @DataConsumer("pacsConfigMap") Map<String, Map<String, Map<String, List<String>>>> pacsConfigMap,
+            @DataConsumer("diagConfigMap") Map<String, Map<String, Map<String, List<String>>>> diagConfigMap,
+            @DataConsumer("drugConfigMap") Map<String, Map<String, Map<String, List<String>>>> drugConfigMap,
+            @DataConsumer("operationConfigMap") Map<String, Map<String, Map<String, List<String>>>> operationConfigMap,
+            @DataConsumer("deptConfigMap") Map<String, Map<String, Map<String, List<String>>>> deptConfigMap,
+            @DataConsumer("transfusionConfigMap") Map<String, Map<String, Map<String, List<String>>>> transfusionConfigMap) {
         //检验
         if (MapUtils.isNotEmpty(lisConfigMap)) {
             if (ListUtil.isNotEmpty(searchData.getLis())) {
-                List<Lis> convertLis = lisConvert(searchData.getLis(), lisConfigMap);
+                List<Lis> convertLis = addUniqueName(searchData.getLis(), lisConfigMap, ConceptTypeEnum.LisPack.getKey());
                 searchData.setLis(convertLis);
             }
             if (ListUtil.isNotEmpty(searchData.getLisOrder())) {
-                List<Lis> convertLis = lisConvert(searchData.getLisOrder(), lisConfigMap);
+                List<Lis> convertLis = addUniqueName(searchData.getLisOrder(), lisConfigMap, ConceptTypeEnum.LisPack.getKey());
                 searchData.setLisOrder(convertLis);
             }
         }
         //检查
         if (MapUtils.isNotEmpty(pacsConfigMap)) {
             if (ListUtil.isNotEmpty(searchData.getPacs())) {
-                List<Pacs> convertPacs = pacsConvert(searchData.getPacs(), pacsConfigMap);
+                List<Pacs> convertPacs = addUniqueName(searchData.getPacs(), pacsConfigMap, ConceptTypeEnum.Pacs.getKey());
                 searchData.setPacs(convertPacs);
             }
             if (ListUtil.isNotEmpty(searchData.getPacsOrder())) {
-                List<Pacs> convertPacs = pacsConvert(searchData.getPacsOrder(), pacsConfigMap);
+                List<Pacs> convertPacs = addUniqueName(searchData.getPacsOrder(), pacsConfigMap, ConceptTypeEnum.Pacs.getKey());
                 searchData.setPacsOrder(convertPacs);
             }
         }
         //诊断
         if (MapUtils.isNotEmpty(diagConfigMap)) {
             if (ListUtil.isNotEmpty(searchData.getDiag())) {
-                List<Item> convertItem = itemConvert(searchData.getDiag(), diagConfigMap);
+                List<Item> convertItem = addUniqueName(searchData.getDiag(), diagConfigMap, ConceptTypeEnum.Disease.getKey());
                 searchData.setDiag(convertItem);
             }
             if (ListUtil.isNotEmpty(searchData.getDiagOrder())) {
-                List<Item> convertItem = itemConvert(searchData.getDiagOrder(), diagConfigMap);
+                List<Item> convertItem = addUniqueName(searchData.getDiagOrder(), diagConfigMap, ConceptTypeEnum.Disease.getKey());
                 searchData.setDiagOrder(convertItem);
             }
             if (searchData.getDiseaseName() != null
                     && StringUtil.isNotBlank(searchData.getDiseaseName().getName())) {
-                List<Item> convertItem = itemConvert(Lists.newArrayList(searchData.getDiseaseName()), diagConfigMap);
+                List<Item> convertItem = addUniqueName(Lists.newArrayList(searchData.getDiseaseName()), diagConfigMap, ConceptTypeEnum.Disease.getKey());
                 searchData.setDiseaseName(convertItem.get(0));
             }
         }
         //药品
         if (MapUtils.isNotEmpty(drugConfigMap)) {
             if (ListUtil.isNotEmpty(searchData.getDrug())) {
-                List<Drug> convertItem = drugConvert(searchData.getDrug(), drugConfigMap);
+                List<Drug> convertItem = addUniqueName(searchData.getDrug(), drugConfigMap, ConceptTypeEnum.Drug.getKey());
                 searchData.setDrug(convertItem);
             }
             if (ListUtil.isNotEmpty(searchData.getDrugOrder())) {
-                List<Drug> convertItem = drugConvert(searchData.getDrugOrder(), drugConfigMap);
+                List<Drug> convertItem = addUniqueName(searchData.getDrugOrder(), drugConfigMap, ConceptTypeEnum.Drug.getKey());
                 searchData.setDrugOrder(convertItem);
             }
         }
         //手术
         if (MapUtils.isNotEmpty(operationConfigMap)) {
             if (ListUtil.isNotEmpty(searchData.getOperation())) {
-                List<Item> convertItem = itemConvert(searchData.getOperation(), operationConfigMap);
+                List<Item> convertItem = addUniqueName(searchData.getOperation(), operationConfigMap, ConceptTypeEnum.Operation.getKey());
                 searchData.setOperation(convertItem);
             }
             if (ListUtil.isNotEmpty(searchData.getOperationOrder())) {
-                List<Item> convertItem = itemConvert(searchData.getOperationOrder(), operationConfigMap);
+                List<Item> convertItem = addUniqueName(searchData.getOperationOrder(), operationConfigMap, ConceptTypeEnum.Operation.getKey());
                 searchData.setOperationOrder(convertItem);
             }
             if (searchData.getOperationName() != null
                     && StringUtil.isNotBlank(searchData.getOperationName().getName())) {
-                List<Item> convertItem = itemConvert(Lists.newArrayList(searchData.getOperationName()), operationConfigMap);
+                List<Item> convertItem = addUniqueName(Lists.newArrayList(searchData.getOperationName()), operationConfigMap, ConceptTypeEnum.Operation.getKey());
                 searchData.setOperationName(convertItem.get(0));
             }
         }
         //科室
         if (MapUtils.isNotEmpty(deptConfigMap)) {
             if (ListUtil.isNotEmpty(searchData.getDept())) {
-                List<Item> convertItem = itemConvert(searchData.getDept(), deptConfigMap);
+                List<Item> convertItem = addUniqueName(searchData.getDept(), deptConfigMap, ConceptTypeEnum.Dept.getKey());
                 searchData.setDept(convertItem);
             }
         }
         //输血
         if (MapUtils.isNotEmpty(transfusionConfigMap)) {
             if (ListUtil.isNotEmpty(searchData.getTransfusion())) {
-                List<ItemExt> convertItem = itemExtConvert(searchData.getTransfusion(), transfusionConfigMap);
+                List<ItemExt> convertItem = addUniqueName(searchData.getTransfusion(), transfusionConfigMap, ConceptTypeEnum.Transfusion.getKey());
                 searchData.setTransfusion(convertItem);
             }
             if (ListUtil.isNotEmpty(searchData.getTransfusionOrder())) {
-                List<ItemExt> convertItem = itemExtConvert(searchData.getTransfusionOrder(), transfusionConfigMap);
+                List<ItemExt> convertItem = addUniqueName(searchData.getTransfusionOrder(), transfusionConfigMap, ConceptTypeEnum.Transfusion.getKey());
                 searchData.setTransfusionOrder(convertItem);
             }
         }
@@ -148,7 +134,7 @@ public class AssembleAggregate {
     }
 
     @DataProvider("lisConfigMap")
-    public Map<String, Map<String, Map<String, Long>>> lisConfigMap(@InvokeParameter("searchData") SearchData searchData) {
+    public Map<String, Map<String, Map<String, List<String>>>> lisConfigMap(@InvokeParameter("searchData") SearchData searchData) {
         //化验公表转换
         List<String> lisHisNameList = Lists.newArrayList();
         //lis
@@ -172,16 +158,17 @@ public class AssembleAggregate {
                 .distinct()
                 .collect(Collectors.toList());
 
-        Map<String, Map<String, Map<String, Long>>> lisConfigMap = new HashMap<>();
+        Map<String, Map<String, Map<String, List<String>>>> lisConfigMap = new HashMap<>();
+
         if (ListUtil.isNotEmpty(lisHisNameList)) {
             lisConfigMap
-                    = lisConfigFacade.getConfigMap(searchData.getHospitalId(), lisHisNameList, null);
+                    = mappingConfigFacade.groupByHisNameWithName(lisHisNameList, ConceptTypeEnum.LisPack.getKey(), searchData.getHospitalId());
         }
         return lisConfigMap;
     }
 
     @DataProvider("pacsConfigMap")
-    public Map<String, Map<String, Long>> pacsConfigMap(@InvokeParameter("searchData") SearchData searchData) {
+    public Map<String, Map<String, Map<String, List<String>>>> pacsConfigMap(@InvokeParameter("searchData") SearchData searchData) {
         //辅检公表转换
         List<String> pacsHisNameList = Lists.newArrayList();
         //pacs
@@ -205,16 +192,16 @@ public class AssembleAggregate {
                 .distinct()
                 .collect(Collectors.toList());
 
-        Map<String, Map<String, Long>> pacsConfigMap = new HashMap<>();
+        Map<String, Map<String, Map<String, List<String>>>> pacsConfigMap = new HashMap<>();
         if (ListUtil.isNotEmpty(pacsHisNameList)) {
             pacsConfigMap
-                    = pacsConfigFacade.getConfigMap(searchData.getHospitalId(), pacsHisNameList, null);
+                    = mappingConfigFacade.groupByHisNameWithName(pacsHisNameList, ConceptTypeEnum.Pacs.getKey(), searchData.getHospitalId());
         }
         return pacsConfigMap;
     }
 
     @DataProvider("diagConfigMap")
-    public Map<String, Map<String, Long>> diagConfigMap(@InvokeParameter("searchData") SearchData searchData) {
+    public Map<String, Map<String, Map<String, List<String>>>> diagConfigMap(@InvokeParameter("searchData") SearchData searchData) {
         //诊断公表转换
         List<String> diagHisNameList = Lists.newArrayList();
         //diag
@@ -243,16 +230,16 @@ public class AssembleAggregate {
                 .distinct()
                 .collect(Collectors.toList());
 
-        Map<String, Map<String, Long>> configMap = new HashMap<>();
+        Map<String, Map<String, Map<String, List<String>>>> configMap = new HashMap<>();
         if (ListUtil.isNotEmpty(diagHisNameList)) {
             configMap
-                    = diseaseConfigFacade.getConfigMap(searchData.getHospitalId(), diagHisNameList, null);
+                    = mappingConfigFacade.groupByHisNameWithName(diagHisNameList, ConceptTypeEnum.Disease.getKey(), searchData.getHospitalId());
         }
         return configMap;
     }
 
     @DataProvider("drugConfigMap")
-    public Map<String, Map<String, Map<String, Long>>> drugConfigMap(@InvokeParameter("searchData") SearchData searchData) {
+    public Map<String, Map<String, Map<String, List<String>>>> drugConfigMap(@InvokeParameter("searchData") SearchData searchData) {
         //药品公表转换
         List<String> drugHisNameList = Lists.newArrayList();
         //drug
@@ -276,16 +263,16 @@ public class AssembleAggregate {
                 .distinct()
                 .collect(Collectors.toList());
 
-        Map<String, Map<String, Map<String, Long>>> configMap = new HashMap<>();
+        Map<String, Map<String, Map<String, List<String>>>> configMap = new HashMap<>();
         if (ListUtil.isNotEmpty(drugHisNameList)) {
             configMap
-                    = drugConfigFacade.getConfigMap(searchData.getHospitalId(), drugHisNameList, null);
+                    = mappingConfigFacade.groupByHisNameWithName(drugHisNameList, ConceptTypeEnum.Drug.getKey(), searchData.getHospitalId());
         }
         return configMap;
     }
 
     @DataProvider("operationConfigMap")
-    public Map<String, Map<String, Long>> operationConfigMap(@InvokeParameter("searchData") SearchData searchData) {
+    public Map<String, Map<String, Map<String, List<String>>>> operationConfigMap(@InvokeParameter("searchData") SearchData searchData) {
         //手术公表转换
         List<String> operationHisNameList = Lists.newArrayList();
         //operation
@@ -314,16 +301,16 @@ public class AssembleAggregate {
                 .distinct()
                 .collect(Collectors.toList());
 
-        Map<String, Map<String, Long>> configMap = new HashMap<>();
+        Map<String, Map<String, Map<String, List<String>>>> configMap = new HashMap<>();
         if (ListUtil.isNotEmpty(operationHisNameList)) {
             configMap
-                    = operationConfigFacade.getConfigMap(searchData.getHospitalId(), operationHisNameList, null);
+                    = mappingConfigFacade.groupByHisNameWithName(operationHisNameList, ConceptTypeEnum.Operation.getKey(), searchData.getHospitalId());
         }
         return configMap;
     }
 
     @DataProvider("deptConfigMap")
-    public Map<String, Map<String, Long>> deptConfigMap(@InvokeParameter("searchData") SearchData searchData) {
+    public Map<String, Map<String, Map<String, List<String>>>> deptConfigMap(@InvokeParameter("searchData") SearchData searchData) {
         //科室公表转换
         List<String> deptHisNameList = Lists.newArrayList();
         //dept
@@ -339,17 +326,17 @@ public class AssembleAggregate {
                 .distinct()
                 .collect(Collectors.toList());
 
-        Map<String, Map<String, Long>> configMap = new HashMap<>();
+        Map<String, Map<String, Map<String, List<String>>>> configMap = new HashMap<>();
 
         if (ListUtil.isNotEmpty(deptHisNameList)) {
             configMap
-                    = deptConfigFacade.getConfigMap(searchData.getHospitalId(), deptHisNameList, null);
+                    = mappingConfigFacade.groupByHisNameWithName(deptHisNameList, ConceptTypeEnum.Dept.getKey(), searchData.getHospitalId());
         }
         return configMap;
     }
 
     @DataProvider("transfusionConfigMap")
-    public Map<String, Map<String, Long>> transfusionConfigMap(@InvokeParameter("searchData") SearchData searchData) {
+    public Map<String, Map<String, Map<String, List<String>>>> transfusionConfigMap(@InvokeParameter("searchData") SearchData searchData) {
         //输血公表转换
         List<String> transfusionHisNameList = Lists.newArrayList();
         //transfusion
@@ -373,218 +360,99 @@ public class AssembleAggregate {
                 .distinct()
                 .collect(Collectors.toList());
 
-        Map<String, Map<String, Long>> configMap = new HashMap<>();
+        Map<String, Map<String, Map<String, List<String>>>> configMap = new HashMap<>();
 
         if (ListUtil.isNotEmpty(transfusionHisNameList)) {
             configMap
-                    = transfusionConfigFacade.getConfigMap(searchData.getHospitalId(), transfusionHisNameList, null);
+                    = mappingConfigFacade.groupByHisNameWithName(transfusionHisNameList, ConceptTypeEnum.Transfusion.getKey(), searchData.getHospitalId());
         }
         return configMap;
     }
 
     /**
-     * 化验公表转换
+     * 标准名称转换
      *
-     * @param lis
+     * @param list
      * @param configMap
+     * @param type
+     * @param <T>
      * @return
      */
-    public List<Lis> lisConvert(List<Lis> lis, Map<String, Map<String, Map<String, Long>>> configMap) {
-        if (ListUtil.isEmpty(lis)) {
-            return lis;
+    public <T> List<T> addUniqueName(List<T> list, Map<String, Map<String, Map<String, List<String>>>> configMap, Integer type) {
+        List<T> retList = new ArrayList<>();
+        if (ListUtil.isEmpty(list)) {
+            return list;
         }
         if (configMap == null || configMap.size() == 0) {
-            return lis;
+            return list;
         }
-        List<Lis> convertLis = Lists.newLinkedList();
 
-        lis.forEach(lisRecord -> {
-            if (StringUtil.isBlank(lisRecord.getName())
-                    || StringUtil.isNotBlank(lisRecord.getUniqueName())) {
-                convertLis.add(lisRecord);
-            } else {
-                Map<String, Long> uniqueNameMap = new HashMap<>();
-                if (StringUtil.isBlank(lisRecord.getDetailName())) {
-                    lisRecord.setDetailName("");
-                }
-                if (configMap.get(lisRecord.getName()) != null
-                        && configMap.get(lisRecord.getName()).containsKey(lisRecord.getDetailName())) {
-                    uniqueNameMap = configMap.get(lisRecord.getName()).get(lisRecord.getDetailName());
+        try {
+            for (T item : list) {
+                String name = ReflectUtil.getProperty(item, "name");
+                if (StringUtil.isBlank(name)) {
+                    retList.add(item);
+                    continue;
                 }
-                if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
-                    for (String uniqueName : uniqueNameMap.keySet()) {
-                        Lis convertLisRecord = new Lis();
-                        BeanUtil.copyProperties(lisRecord, convertLisRecord);
-                        convertLisRecord.setUniqueName(uniqueName);
-                        convertLis.add(convertLisRecord);
-                    }
-                } else {
-                    convertLis.add(lisRecord);
-                }
-            }
-        });
-        return convertLis;
-    }
 
-    /**
-     * 辅检公表转换
-     *
-     * @param pacs
-     * @param configMap
-     * @return
-     */
-    public List<Pacs> pacsConvert(List<Pacs> pacs, Map<String, Map<String, Long>> configMap) {
-        if (ListUtil.isEmpty(pacs)) {
-            return pacs;
-        }
-        if (configMap == null || configMap.size() == 0) {
-            return pacs;
-        }
-        List<Pacs> convertPacs = Lists.newLinkedList();
-
-        pacs.forEach(pacsRecord -> {
-            if (StringUtil.isBlank(pacsRecord.getName())
-                    || StringUtil.isNotBlank(pacsRecord.getUniqueName())) {
-                convertPacs.add(pacsRecord);
-            } else {
-                Map<String, Long> uniqueNameMap = new HashMap<>();
-                if (configMap.get(pacsRecord.getName()) != null) {
-                    uniqueNameMap = configMap.get(pacsRecord.getName());
+                String uniqueName = ReflectUtil.getProperty(item, "uniqueName");
+                if (StringUtil.isNotBlank(uniqueName)) {
+                    retList.add(item);
+                    continue;
                 }
-                if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
-                    for (String uniqueName : uniqueNameMap.keySet()) {
-                        Pacs convertPacsRecord = new Pacs();
-                        BeanUtil.copyProperties(pacsRecord, convertPacsRecord);
-                        convertPacsRecord.setUniqueName(uniqueName);
-                        convertPacs.add(convertPacsRecord);
+
+                String hisDetailName = "";
+                if(type.equals(ConceptTypeEnum.LisPack.getKey())) {
+                    hisDetailName = ReflectUtil.getProperty(item, "detailName");
+                    if (StringUtil.isBlank(hisDetailName)) {
+                        hisDetailName = "";
                     }
-                } else {
-                    convertPacs.add(pacsRecord);
                 }
-            }
-        });
-        return convertPacs;
-    }
 
-    /**
-     * 药品公表转换
-     *
-     * @param drug
-     * @param configMap
-     * @return
-     */
-    public List<Drug> drugConvert(List<Drug> drug, Map<String, Map<String, Map<String, Long>>> configMap) {
-        if (ListUtil.isEmpty(drug)) {
-            return drug;
-        }
-        if (configMap == null || configMap.size() == 0) {
-            return drug;
-        }
-        List<Drug> convertDrug = Lists.newLinkedList();
+                if (configMap.containsKey(name)) {
+                    Map<String, Map<String, List<String>>> subMap = configMap.get(name);
+                    if (subMap.containsKey(hisDetailName)) {
+                        if (type.equals(ConceptTypeEnum.Drug.getKey())) {
+                            for (Map.Entry<String, List<String>> thirdEntry : subMap.get(hisDetailName).entrySet()) {
+                                if (ListUtil.isNotEmpty(thirdEntry.getValue())) {
+                                    for (String form : thirdEntry.getValue()) {
+                                        T o = (T) item.getClass().newInstance();
+                                        BeanUtil.copyProperties(item, o);
+                                        Method setUniqueName = o.getClass().getMethod("setUniqueName", String.class);
+                                        setUniqueName.invoke(o, thirdEntry.getKey());
+                                        Method setForm = o.getClass().getMethod("setForm", String.class);
+                                        setForm.invoke(o, form);
+                                        retList.add(o);
+                                    }
+                                } else {
+                                    T o = (T) item.getClass().newInstance();
+                                    BeanUtil.copyProperties(item, o);
+                                    Method setUniqueName = o.getClass().getMethod("setUniqueName", String.class);
+                                    setUniqueName.invoke(o, thirdEntry.getKey());
+                                    retList.add(o);
+                                }
+                            }
 
-        drug.forEach(drugRecord -> {
-            if (StringUtil.isBlank(drugRecord.getName())
-                    || StringUtil.isNotBlank(drugRecord.getUniqueName())) {
-                convertDrug.add(drugRecord);
-            } else {
-                Map<String, Map<String, Long>> uniqueNameMap = new HashMap<>();
-                if (configMap.get(drugRecord.getName()) != null) {
-                    uniqueNameMap = configMap.get(drugRecord.getName());
-                }
-                if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
-                    for (String form : uniqueNameMap.keySet()) {
-                        Map<String, Long> s = uniqueNameMap.get(form);
-                        for (String uniqueName: s.keySet()){
-                            Drug convertDrugRecord = new Drug();
-                            BeanUtil.copyProperties(drugRecord, convertDrugRecord);
-                            convertDrugRecord.setUniqueName(uniqueName);
-                            convertDrugRecord.setForm(form);
-                            convertDrug.add(convertDrugRecord);
+                        } else {
+                            List<String> standNames = new ArrayList<>(subMap.get(hisDetailName).keySet());
+                            for (String stdName : standNames) {
+                                T o = (T) item.getClass().newInstance();
+                                BeanUtil.copyProperties(item, o);
+                                Method setUniqueName = o.getClass().getMethod("setUniqueName", String.class);
+                                setUniqueName.invoke(o, stdName);
+                                retList.add(o);
+                            }
                         }
+                    } else {
+                        retList.add(item);
                     }
                 } else {
-                    convertDrug.add(drugRecord);
+                    retList.add(item);
                 }
             }
-        });
-        return convertDrug;
-    }
-
-    /**
-     * 手术、诊断、科室转换
-     *
-     * @param items
-     * @param configMap
-     * @return
-     */
-    public List<Item> itemConvert(List<Item> items, Map<String, Map<String, Long>> configMap) {
-        if (ListUtil.isEmpty(items)) {
-            return items;
+        } catch (Exception e) {
+            e.printStackTrace();
         }
-        if (configMap == null || configMap.size() == 0) {
-            return items;
-        }
-        List<Item> convertItem = Lists.newLinkedList();
-        items.forEach(item -> {
-            if (StringUtil.isBlank(item.getName())
-                    || StringUtil.isNotBlank(item.getUniqueName())) {
-                convertItem.add(item);
-            } else {
-                Map<String, Long> uniqueNameMap = new HashMap<>();
-                if (configMap.get(item.getName()) != null) {
-                    uniqueNameMap = configMap.get(item.getName());
-                }
-                if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
-                    for (String uniqueName : uniqueNameMap.keySet()) {
-                        Item convertItemRecord = new Item();
-                        BeanUtil.copyProperties(item, convertItemRecord);
-                        convertItemRecord.setUniqueName(uniqueName);
-                        convertItem.add(convertItemRecord);
-                    }
-                } else {
-                    convertItem.add(item);
-                }
-            }
-        });
-        return convertItem;
-    }
-
-    /**
-     * 输血转换
-     *
-     * @param items
-     * @param configMap
-     * @return
-     */
-    public List<ItemExt> itemExtConvert(List<ItemExt> items, Map<String, Map<String, Long>> configMap) {
-        if (ListUtil.isEmpty(items)) {
-            return items;
-        }
-        if (configMap == null || configMap.size() == 0) {
-            return items;
-        }
-        List<ItemExt> convertItem = Lists.newLinkedList();
-        items.forEach(item -> {
-            if (StringUtil.isBlank(item.getName())
-                    || StringUtil.isNotBlank(item.getUniqueName())) {
-                convertItem.add(item);
-            } else {
-                Map<String, Long> uniqueNameMap = new HashMap<>();
-                if (configMap.get(item.getName()) != null) {
-                    uniqueNameMap = configMap.get(item.getName());
-                }
-                if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
-                    for (String uniqueName : uniqueNameMap.keySet()) {
-                        ItemExt convertItemRecord = new ItemExt();
-                        BeanUtil.copyProperties(item, convertItemRecord);
-                        convertItemRecord.setUniqueName(uniqueName);
-                        convertItem.add(convertItemRecord);
-                    }
-                } else {
-                    convertItem.add(item);
-                }
-            }
-        });
-        return convertItem;
+        return retList;
     }
 }

+ 112 - 31
src/main/java/com/diagbot/aggregate/AssemblePushAggregate.java

@@ -2,11 +2,9 @@ package com.diagbot.aggregate;
 
 import com.diagbot.dto.PushBaseDTO;
 import com.diagbot.dto.PushDTO;
-import com.diagbot.facade.DiseaseConfigFacade;
-import com.diagbot.facade.DrugConfigFacade;
-import com.diagbot.facade.LisConfigFacade;
-import com.diagbot.facade.OperationConfigFacade;
-import com.diagbot.facade.PacsConfigFacade;
+import com.diagbot.dto.PushScaleDTO;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.facade.MappingConfigFacade;
 import com.diagbot.util.ListUtil;
 import com.google.common.collect.Lists;
 import io.github.lvyahui8.spring.annotation.DataConsumer;
@@ -17,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -31,15 +30,7 @@ import java.util.stream.Collectors;
 public class AssemblePushAggregate {
 
     @Autowired
-    private LisConfigFacade lisConfigFacade;
-    @Autowired
-    private PacsConfigFacade pacsConfigFacade;
-    @Autowired
-    private DiseaseConfigFacade diseaseConfigFacade;
-    @Autowired
-    private DrugConfigFacade drugConfigFacade;
-    @Autowired
-    private OperationConfigFacade operationConfigFacade;
+    private MappingConfigFacade mappingConfigFacade;
 
     @DataProvider("assemblePushAll")
     public PushDTO assemblePushAll(
@@ -49,7 +40,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 +63,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;
     }
 
@@ -83,15 +84,19 @@ public class AssemblePushAggregate {
             List<String> uniqueNameList = retLis.stream()
                     .map(i -> i.getName())
                     .collect(Collectors.toList());
-            Map<String, Map<String, Long>> uniqueNameMap
-                    = lisConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
+            Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
+                    = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.LisPack.getKey(), hospitalId);
+
             if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
                 retLis.forEach(item -> {
                     if (uniqueNameMap.get(item.getName()) != null) {
-                        item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
+                        item.setHisNameList(uniqueNameMap.get(item.getName())
+                                .values().stream()
+                                .map(i -> i.keySet())
+                                .flatMap(Collection::stream)
+                                .collect(Collectors.toList()));
                     }
                 });
-
             }
         }
         return retLis;
@@ -107,12 +112,17 @@ public class AssemblePushAggregate {
             List<String> uniqueNameList = retPacs.stream()
                     .map(i -> i.getName())
                     .collect(Collectors.toList());
-            Map<String, Map<String, Long>> uniqueNameMap
-                    = pacsConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
+            Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
+                    = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Pacs.getKey(), hospitalId);
+
             if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
                 retPacs.forEach(item -> {
                     if (uniqueNameMap.get(item.getName()) != null) {
-                        item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
+                        item.setHisNameList(uniqueNameMap.get(item.getName())
+                                .values().stream()
+                                .map(i -> i.keySet())
+                                .flatMap(Collection::stream)
+                                .collect(Collectors.toList()));
                     }
                 });
             }
@@ -135,13 +145,18 @@ public class AssemblePushAggregate {
                 }
             }
             if (ListUtil.isNotEmpty(uniqueNameList)) {
-                Map<String, Map<String, Long>> uniqueNameMap
-                        = diseaseConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
+                Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
+                        = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Disease.getKey(), hospitalId);
+
                 for (Map.Entry<String, List<PushBaseDTO>> entry : retMap.entrySet()) {
                     if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
                         entry.getValue().forEach(item -> {
                             if (uniqueNameMap.get(item.getName()) != null) {
-                                item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
+                                item.setHisNameList(uniqueNameMap.get(item.getName())
+                                        .values().stream()
+                                        .map(i -> i.keySet())
+                                        .flatMap(Collection::stream)
+                                        .collect(Collectors.toList()));
                             }
                         });
                     }
@@ -161,12 +176,17 @@ public class AssemblePushAggregate {
             List<String> uniqueNameList = retOperation.stream()
                     .map(i -> i.getName())
                     .collect(Collectors.toList());
-            Map<String, Map<String, Long>> uniqueNameMap
-                    = operationConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
+            Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
+                    = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Operation.getKey(), hospitalId);
+
             if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
                 retOperation.forEach(item -> {
                     if (uniqueNameMap.get(item.getName()) != null) {
-                        item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
+                        item.setHisNameList(uniqueNameMap.get(item.getName())
+                                .values().stream()
+                                .map(i -> i.keySet())
+                                .flatMap(Collection::stream)
+                                .collect(Collectors.toList()));
                     }
                 });
             }
@@ -184,16 +204,77 @@ public class AssemblePushAggregate {
             List<String> uniqueNameList = retDrug.stream()
                     .map(i -> i.getName())
                     .collect(Collectors.toList());
-            Map<String, Map<String, Long>> uniqueNameMap
-                    = drugConfigFacade.getUniqueNameConfigMapWithoutForm(hospitalId, null, uniqueNameList);
+            Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
+                    = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Drug.getKey(), hospitalId);
+
             if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
                 retDrug.forEach(item -> {
                     if (uniqueNameMap.get(item.getName()) != null) {
-                        item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
+                        item.setHisNameList(uniqueNameMap.get(item.getName())
+                                .values().stream()
+                                .map(i -> i.keySet())
+                                .flatMap(Collection::stream)
+                                .collect(Collectors.toList()));
                     }
                 });
             }
         }
         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, Map<String, List<String>>>> uniqueNameMap
+                    = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Scale.getKey(), hospitalId);
+
+            if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
+                retScale.forEach(item -> {
+                    if (uniqueNameMap.get(item.getName()) != null) {
+                        item.setHisNameList(uniqueNameMap.get(item.getName())
+                                .values().stream()
+                                .map(i -> i.keySet())
+                                .flatMap(Collection::stream)
+                                .collect(Collectors.toList()));
+                    }
+                });
+            }
+        }
+        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, Map<String, List<String>>>> uniqueNameMap
+                    = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Nurse.getKey(), hospitalId);
+
+            if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
+                retNurse.forEach(item -> {
+                    if (uniqueNameMap.get(item.getName()) != null) {
+                        item.setHisNameList(uniqueNameMap.get(item.getName())
+                                .values().stream()
+                                .map(i -> i.keySet())
+                                .flatMap(Collection::stream)
+                                .collect(Collectors.toList()));
+                    }
+                });
+            }
+        }
+        return retNurse;
+    }
 }

+ 172 - 10
src/main/java/com/diagbot/client/CdssCoreClient.java

@@ -1,26 +1,34 @@
 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.vo.StaticKnowledgeNameVO;
+import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
+import com.diagbot.dto.TermConceptDTO;
+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核心类客户端
@@ -60,6 +68,15 @@ public interface CdssCoreClient {
     @PostMapping("/retrieval/staticKnowledgeIndex")
     RespDTO<List<StaticKnowledgeIndexDTO>> staticKnowledgeIndex(@RequestBody @Valid StaticKnowledgeIndexVO staticKnowledgeIndexVO);
 
+    /**
+     * 术语关联医学术语检索
+     *
+     * @param filterVO
+     * @return
+     */
+    @PostMapping("/retrieval/filter")
+    RespDTO<List<IndexBatchDTO>> filter(@Valid @RequestBody FilterVO filterVO);
+
     /**
      * 更新是否有静态知识状态
      *
@@ -76,7 +93,17 @@ 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);
 
     /**
      * 取上级静态知识
@@ -95,5 +122,140 @@ public interface CdssCoreClient {
      */
     @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("/klDisease/addConceptClass")
+    RespDTO<List<GetAllForRelationDTO>> addConceptClass(@Valid @RequestBody SearchConceptVO searchConceptVO);
+
+    //规则维护术语查询
+    @PostMapping("/klDisease/searchConceptRuleClass")
+    RespDTO<List<GetAllForRelationDTO>> searchConceptRuleClass(@Valid @RequestBody SearchConceptVO searchConceptVO);
+
+    @PostMapping("/cache/clearRuleInfoAll")
+    RespDTO<Boolean> clearRuleAll();
+
+    @PostMapping("/term/termMatching")
+    public RespDTO<List<TermConceptDTO>> getTermMatching(@Valid @RequestBody TermMatchingVO termMatchingVO);
+}

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

@@ -1,26 +1,34 @@
 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.vo.StaticKnowledgeNameVO;
+import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
+import com.diagbot.dto.TermConceptDTO;
+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: 病历质控客户端(请求失败熔断)
@@ -76,6 +84,18 @@ public class CdssCoreHystrix implements CdssCoreClient {
         return null;
     }
 
+    /**
+     * 术语关联医学术语检索
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public RespDTO<List<IndexBatchDTO>> filter(@Valid @RequestBody FilterVO filterVO) {
+        log.error("【hystrix】调用{}异常", "filter");
+        return null;
+    }
+
     /**
      * 更新是否有静态知识状态
      *
@@ -95,7 +115,19 @@ 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;
     }
@@ -123,4 +155,190 @@ public class CdssCoreHystrix implements CdssCoreClient {
         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<List<GetAllForRelationDTO>> addConceptClass(@Valid SearchConceptVO searchConceptVO) {
+        log.error("【hystrix】调用{}异常", "addConceptClass");
+        return null;
+    }
+
+    @Override
+    public RespDTO<List<GetAllForRelationDTO>> searchConceptRuleClass(@Valid SearchConceptVO searchConceptVO) {
+        log.error("【hystrix】调用{}异常", "searchConceptRuleClass");
+        return null;
+    }
+
+    @Override
+    public RespDTO<Boolean> clearRuleAll() {
+        log.error("【hystrix】调用{}异常", "clearRuleAll");
+        return null;
+    }
+
+    @Override
+    public RespDTO<List<TermConceptDTO>> getTermMatching(@Valid TermMatchingVO termMatchingVO) {
+        log.error("【hystrix】调用{}异常", "getTermMatching");
+        return null;
+    }
 }

+ 40 - 73
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -43,69 +43,21 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 //.antMatchers("/sys/user/getUserOrgMenu").permitAll()
                 .antMatchers("/oauth/token").permitAll()
                 .antMatchers("/oauth/check_token").permitAll()
-                //.antMatchers("/tran/lisConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/lisConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/lisConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/lisConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/lisConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/lisConfig/getPage").permitAll()
-                //.antMatchers("/tran/lisConfig/importExcel").permitAll()
-                //.antMatchers("/tran/lisConfig/exportExcel").permitAll()
-                .antMatchers("/tran/lisConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/pacsConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/pacsConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/pacsConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/pacsConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/pacsConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/pacsConfig/getPage").permitAll()
-                //.antMatchers("/tran/pacsConfig/importExcel").permitAll()
-                //.antMatchers("/tran/pacsConfig/exportExcel").permitAll()
-                .antMatchers("/tran/pacsConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/diseaseConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/diseaseConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/diseaseConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/diseaseConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/diseaseConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/diseaseConfig/getPage").permitAll()
-                //.antMatchers("/tran/diseaseConfig/importExcel").permitAll()
-                //.antMatchers("/tran/diseaseConfig/exportExcel").permitAll()
-                .antMatchers("/tran/diseaseConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/drugConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/drugConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/drugConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/drugConfig/deleteRecord").permitAll()
-                // .antMatchers("/tran/drugConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/drugConfig/getPage").permitAll()
-                //.antMatchers("/tran/drugConfig/importExcel").permitAll()
-                // .antMatchers("/tran/drugConfig/exportExcel").permitAll()
-                .antMatchers("/tran/drugConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/operationConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/operationConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/operationConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/operationConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/operationConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/operationConfig/getPage").permitAll()
-                //.antMatchers("/tran/operationConfig/importExcel").permitAll()
-                //.antMatchers("/tran/operationConfig/exportExcel").permitAll()
-                .antMatchers("/tran/operationConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/deptConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/deptConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/deptConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/deptConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/deptConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/deptConfig/getPage").permitAll()
-                //.antMatchers("/tran/deptConfig/importExcel").permitAll()
-                //.antMatchers("/tran/deptConfig/exportExcel").permitAll()
-                .antMatchers("/tran/deptConfig/exportExcelModule").permitAll()
-                //.antMatchers("/tran/transfusionConfig/isExistRecord").permitAll()
-                //.antMatchers("/tran/transfusionConfig/saveOrUpdateRecord").permitAll()
-                //.antMatchers("/tran/transfusionConfig/saveOrUpdateRecords").permitAll()
-                //.antMatchers("/tran/transfusionConfig/deleteRecord").permitAll()
-                //.antMatchers("/tran/transfusionConfig/deleteRecords").permitAll()
-                .antMatchers("/tran/transfusionConfig/getPage").permitAll()
-                //.antMatchers("/tran/transfusionConfig/importExcel").permitAll()
-                //.antMatchers("/tran/transfusionConfig/exportExcel").permitAll()
-                .antMatchers("/tran/transfusionConfig/exportExcelModule").permitAll()
+                .antMatchers("/tran/mappingConfig/exportExcelModule").permitAll()
+                .antMatchers("/tran/mappingConfig/dataVerify").permitAll()
+                .antMatchers("/tran/mappingConfig/precDataMatch").permitAll()
+                .antMatchers("/tran/mappingConfig/precData").permitAll()
+                .antMatchers("/tran/mappingConfig/precDataMatch_remote").permitAll()
+                .antMatchers("/tran/mappingConfig/importExcel").permitAll()
+                .antMatchers("/tran/mappingConfig/exportExcel").permitAll()
+                .antMatchers("/tran/mappingConfig/exportExcel_remote").permitAll()
+                .antMatchers("/tran/mappingConfig/getPage").permitAll()
+                .antMatchers("/tran/mappingConfig/getRecord").permitAll()
+                .antMatchers("/tran/mappingConfig/getRelatedMapping").permitAll()
+                .antMatchers("/tran/mappingConfig/isExistRecord").permitAll()
+                .antMatchers("/tran/mappingConfig/saveOrUpdateRecord").permitAll()
+                .antMatchers("/tran/mappingConfig/deleteRecord").permitAll()
+                .antMatchers("/tran/mappingConfig/deleteRecords").permitAll()
                 //.antMatchers("/tran/hospitalInfo/saveRecord").permitAll()
                 .antMatchers("/tran/hospitalInfo/getHospitalInfo").permitAll()
                 .antMatchers("/tran/hospitalInfo/getAllHospitalInfo").permitAll()
@@ -115,6 +67,7 @@ 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()
@@ -138,16 +91,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()
@@ -163,6 +117,19 @@ 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("/klDisease/addConceptClass").permitAll()
+                .antMatchers("/klDisease/searchConceptRuleClass").permitAll()
+                .antMatchers("/cache/clearRuleAll").permitAll()
+                .antMatchers("/term/termMatching").permitAll()
                 .antMatchers("/dataPage/docking/getDataService").permitAll()
                 .antMatchers("/dataPage/docking/getStaticKnowledge").permitAll()
                 .antMatchers("/dataPage/docking/getDataEngine").permitAll()

+ 42 - 75
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;
                     }
                 }
@@ -86,69 +86,21 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 //|| matchers("/sys/user/getUserOrgMenu", request)
                 || matchers("/oauth/token", request)
                 || matchers("/oauth/check_token", request)
-                //|| matchers("/tran/lisConfig/isExistRecord", request)
-                //|| matchers("/tran/lisConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/lisConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/lisConfig/deleteRecord", request)
-                //|| matchers("/tran/lisConfig/deleteRecords", request)
-                || matchers("/tran/lisConfig/getPage", request)
-                // || matchers("/tran/lisConfig/importExcel", request)
-                // || matchers("/tran/lisConfig/exportExcel", request)
-                || matchers("/tran/lisConfig/exportExcelModule", request)
-                // || matchers("/tran/pacsConfig/isExistRecord", request)
-                //|| matchers("/tran/pacsConfig/saveOrUpdateRecord", request)
-                // || matchers("/tran/pacsConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/pacsConfig/deleteRecord", request)
-                //|| matchers("/tran/pacsConfig/deleteRecords", request)
-                || matchers("/tran/pacsConfig/getPage", request)
-                // || matchers("/tran/pacsConfig/importExcel", request)
-                //|| matchers("/tran/pacsConfig/exportExcel", request)
-                || matchers("/tran/pacsConfig/exportExcelModule", request)
-                //|| matchers("/tran/diseaseConfig/isExistRecord", request)
-                //|| matchers("/tran/diseaseConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/diseaseConfig/saveOrUpdateRecords", request)
-                //|| matchers("/tran/diseaseConfig/deleteRecord", request)
-                //|| matchers("/tran/diseaseConfig/deleteRecords", request)
-                || matchers("/tran/diseaseConfig/getPage", request)
-                //|| matchers("/tran/diseaseConfig/importExcel", request)
-                //|| matchers("/tran/diseaseConfig/exportExcel", request)
-                || matchers("/tran/diseaseConfig/exportExcelModule", request)
-                //|| matchers("/tran/drugConfig/isExistRecord", request)
-                //|| matchers("/tran/drugConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/drugConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/drugConfig/deleteRecord", request)
-                //|| matchers("/tran/drugConfig/deleteRecords", request)
-                || matchers("/tran/drugConfig/getPage", request)
-                //|| matchers("/tran/drugConfig/importExcel", request)
-                //|| matchers("/tran/drugConfig/exportExcel", request)
-                || matchers("/tran/drugConfig/exportExcelModule", request)
-                // || matchers("/tran/operationConfig/isExistRecord", request)
-                // || matchers("/tran/operationConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/operationConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/operationConfig/deleteRecord", request)
-                //|| matchers("/tran/operationConfig/deleteRecords", request)
-                || matchers("/tran/operationConfig/getPage", request)
-                //|| matchers("/tran/operationConfig/importExcel", request)
-                //|| matchers("/tran/operationConfig/exportExcel", request)
-                || matchers("/tran/operationConfig/exportExcelModule", request)
-                // || matchers("/tran/deptConfig/isExistRecord", request)
-                // || matchers("/tran/deptConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/deptConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/deptConfig/deleteRecord", request)
-                //|| matchers("/tran/deptConfig/deleteRecords", request)
-                || matchers("/tran/deptConfig/getPage", request)
-                // || matchers("/tran/deptConfig/importExcel", request)
-                // || matchers("/tran/deptConfig/exportExcel", request)
-                || matchers("/tran/deptConfig/exportExcelModule", request)
-                // || matchers("/tran/transfusionConfig/isExistRecord", request)
-                // || matchers("/tran/transfusionConfig/saveOrUpdateRecord", request)
-                //|| matchers("/tran/transfusionConfig/saveOrUpdateRecords", request)
-                // || matchers("/tran/transfusionConfig/deleteRecord", request)
-                //|| matchers("/tran/transfusionConfig/deleteRecords", request)
-                || matchers("/tran/transfusionConfig/getPage", request)
-                // || matchers("/tran/transfusionConfig/importExcel", request)
-                // || matchers("/tran/transfusionConfig/exportExcel", request)
-                || matchers("/tran/transfusionConfig/exportExcelModule", request)
+                || matchers("/tran/mappingConfig/exportExcelModule", request)
+                || matchers("/tran/mappingConfig/dataVerify", request)
+                || matchers("/tran/mappingConfig/precDataMatch", request)
+                || matchers("/tran/mappingConfig/precData", request)
+                || matchers("/tran/mappingConfig/precDataMatch_remote", request)
+                || matchers("/tran/mappingConfig/importExcel", request)
+                || matchers("/tran/mappingConfig/exportExcel", request)
+                || matchers("/tran/mappingConfig/exportExcel_remote", request)
+                || matchers("/tran/mappingConfig/getPage", request)
+                || matchers("/tran/mappingConfig/getRecord", request)
+                || matchers("/tran/mappingConfig/getRelatedMapping", request)
+                || matchers("/tran/mappingConfig/isExistRecord", request)
+                || matchers("/tran/mappingConfig/saveOrUpdateRecord", request)
+                || matchers("/tran/mappingConfig/deleteRecord", request)
+                || matchers("/tran/mappingConfig/deleteRecords", request)
                 //|| matchers("/tran/hospitalInfo/saveRecord", request)
                 || matchers("/tran/hospitalInfo/getHospitalInfo", request)
                 || matchers("/tran/hospitalInfo/getAllHospitalInfo", request)
@@ -158,6 +110,7 @@ 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)
@@ -180,16 +133,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)
@@ -205,6 +159,19 @@ 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("/klDisease/addConceptClass", request)
+                || matchers("/klDisease/searchConceptRuleClass", request)
+                || matchers("/cache/clearRuleAll", request)
+                || matchers("/term/termMatching", request)
                 || matchers("/dataPage/docking/getDataService", request)
                 || matchers("/dataPage/docking/getStaticKnowledge", request)
                 || matchers("/dataPage/docking/getDataEngine", request)

+ 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;
+}

+ 2 - 1
src/main/java/com/diagbot/dto/DiseaseInfoDTO.java

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class DiseaseInfoDTO {
+    private Long id;
     /**
      * 疾病名称
      */
@@ -19,5 +20,5 @@ public class DiseaseInfoDTO {
     /**
      * ICD10编码
      */
-    private String icd10Code;
+    private String code;
 }

+ 1 - 0
src/main/java/com/diagbot/dto/DrugInfoDTO.java

@@ -13,6 +13,7 @@ import java.util.List;
 @Getter
 @Setter
 public class DrugInfoDTO {
+    private Long id;
     /**
      * 药品名称
      */

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

@@ -0,0 +1,46 @@
+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;
+
+    /**
+     * 说明
+     */
+    @ApiModelProperty(value="说明(remark)")
+    private String remark;
+
+}
+

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

@@ -0,0 +1,19 @@
+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;
+    private String synonyms;
+    private Integer type;
+}

+ 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;
+}

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

@@ -0,0 +1,32 @@
+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;//等于域单位
+    private String subMsg;
+}

+ 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;
+}

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

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class LisDetailDTO {
+    private Long id;
     /**
      * 大项(套餐)
      */

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

@@ -0,0 +1,19 @@
+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 Long id;
+    /**
+     * 护理名称
+     */
+    private String name;
+}

+ 1 - 0
src/main/java/com/diagbot/dto/OperationInfoDTO.java

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class OperationInfoDTO {
+    private Long id;
     /**
      * 手术或操作名称
      */

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

@@ -21,4 +21,8 @@ public class PushBaseDTO {
      * 是否有静态知识
      */
     private Integer hasInfo = 0;
-}
+    /**
+     * 静态知识页面显示类型
+     */
+    private Integer type;
+}

+ 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;
+}

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

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-06-15 16:58
+ */
+@Setter
+@Getter
+public class RetrievalConceptDTO {
+    private Long id;
+    private String name;
+    private String code;
+}

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

@@ -14,35 +14,51 @@ import java.util.List;
 @Setter
 public class RetrievalDTO {
     /**
-     * 化验大项
+     * 化验大项 辅检 诊断 药品 手术或操作 科室 输血 量表 护理 中医诊断 中医证候
      */
-    private List<String> lisNames;
+    private List<RetrievalConceptDTO> nameList;
     /**
      * 化验小项
      */
     private List<LisDetailDTO> lisDetailNames;
     /**
      * 辅检
-     */
-    private List<String> pacsNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> pacsNames;
+    *//**
      * 诊断
-     */
+     *//*
     private List<DiseaseInfoDTO> diseaseNames;
-    /**
+    *//**
      * 药品
-     */
+     *//*
     private List<DrugInfoDTO> drugNames;
-    /**
+    *//**
      * 手术或操作
-     */
+     *//*
     private List<OperationInfoDTO> operationNames;
-    /**
+    *//**
      * 科室
-     */
-    private List<String> deptNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> deptNames;
+    *//**
      * 输血
-     */
-    private List<String> transfusionNames;
+     *//*
+    private List<RetrievalConceptDTO> transfusionNames;
+    *//**
+     * 量表
+     *//*
+    private List<ScaleInfoDTO> scalenames;
+    *//**
+     * 护理
+     *//*
+    private List<NurseInfoDTO> nursenames;
+    *//**
+     * 中医诊断
+     *//*
+    private List<TcmdiseaseInfoDTO> tcmdiseaseNames;
+    *//**
+     * 中医证候
+     *//*
+    private List<TcmsyndromeInfoDTO> tcmsyndromeNames;*/
 }

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

@@ -0,0 +1,20 @@
+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 Long id;
+    /**
+     * 量表名称
+     */
+    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;
 }

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

@@ -55,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;
+}

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

@@ -0,0 +1,24 @@
+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 Long id;
+    /**
+     * 疾病名称
+     */
+    private String name;
+
+    /**
+     * 编码
+     */
+    private String code;
+}

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

@@ -0,0 +1,24 @@
+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 Long id;
+    /**
+     * 疾病名称
+     */
+    private String name;
+
+    /**
+     * 编码
+     */
+    private String code;
+}

+ 20 - 0
src/main/java/com/diagbot/dto/TermConceptDTO.java

@@ -0,0 +1,20 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-06-15 16:44
+ */
+@Setter
+@Getter
+public class TermConceptDTO {
+    private Long id;
+    private String name;
+    private String code;
+    //数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+    private Integer source;
+}
+

+ 47 - 0
src/main/java/com/diagbot/entity/AnesthesiaConfig.java

@@ -0,0 +1,47 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/10 19:16
+ */
+@Getter
+@Setter
+public class AnesthesiaConfig {
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院科室名称
+     */
+    @Excel(name = "医院麻醉名称", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院麻醉名称")
+    private String hisName;
+
+    /**
+     * 标准科室名称
+     */
+    @Excel(name = "标准麻醉名称", width = 40, orderNum = "2", isImportField = "true")
+    @NotBlank(message = "请输入标准麻醉名称")
+    private String uniqueName;
+
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
+
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
+}

+ 33 - 103
src/main/java/com/diagbot/entity/DeptConfig.java

@@ -1,12 +1,11 @@
 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 lombok.Getter;
+import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
 import java.util.Date;
 import java.util.Objects;
 
@@ -18,15 +17,12 @@ import java.util.Objects;
  * @author zhaops
  * @since 2020-08-12
  */
-@TableName("tran_dept_config")
-public class DeptConfig implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
+@Getter
+@Setter
+public class DeptConfig {
     /**
      * 主键
      */
-    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
@@ -82,96 +78,19 @@ public class DeptConfig implements Serializable {
     /**
      * 对应项编码
      */
-    //@Excel(name = "对应项编码", width = 40, orderNum = "3")
-    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 getHisCode() {
-        return hisCode;
-    }
-
-    public void setHisCode(String hisCode) {
-        this.hisCode = hisCode;
-    }
+    private String code;
 
-    public String getUniqueName() {
-        return uniqueName;
-    }
-
-    public void setUniqueName(String uniqueName) {
-        this.uniqueName = uniqueName;
-    }
-
-    public String getUniqueCode() {
-        return uniqueCode;
-    }
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
 
-    public void setUniqueCode(String uniqueCode) {
-        this.uniqueCode = uniqueCode;
-    }
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
 
     @Override
     public String toString() {
@@ -186,16 +105,18 @@ public class DeptConfig implements Serializable {
                 ", hisName=" + hisName +
                 ", hisCode=" + hisCode +
                 ", uniqueName=" + uniqueName +
-                ", uniqueCode=" + uniqueCode +
+                ", code=" + code +
                 "}";
     }
 
     @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)
@@ -203,11 +124,20 @@ public class DeptConfig implements Serializable {
                 && Objects.equals(hisName, deptConfig.hisName)
                 && Objects.equals(hisCode, deptConfig.hisCode)
                 && Objects.equals(uniqueName, deptConfig.uniqueName)
-                && Objects.equals(uniqueCode, deptConfig.uniqueCode);
+                && Objects.equals(code, deptConfig.code);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(id, isDeleted, hospitalId, hisName, hisCode, uniqueName, uniqueCode);
+        return Objects.hash(id, isDeleted, hospitalId, hisName, hisCode, uniqueName, code);
+    }
+
+    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.code)));
     }
 }

+ 34 - 94
src/main/java/com/diagbot/entity/DiseaseConfig.java

@@ -1,12 +1,11 @@
 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 lombok.Getter;
+import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
 import java.util.Date;
 import java.util.Objects;
 
@@ -18,15 +17,12 @@ import java.util.Objects;
  * @author zhaops
  * @since 2020-07-28
  */
-@TableName("tran_disease_config")
-public class DiseaseConfig implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
+@Getter
+@Setter
+public class DiseaseConfig {
     /**
      * 主键
      */
-    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
@@ -77,87 +73,19 @@ public class DiseaseConfig implements Serializable {
      * ICD-10编码
      */
     @Excel(name = "ICD-10编码", width = 40, orderNum = "2", isImportField = "true")
-    private String icdCode;
-
-    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;
-    }
+    private String code;
 
-    public void setHisName(String hisName) {
-        this.hisName = hisName;
-    }
-
-    public String getUniqueName() {
-        return uniqueName;
-    }
-
-    public void setUniqueName(String uniqueName) {
-        this.uniqueName = uniqueName;
-    }
-
-    public String getIcdCode() {
-        return icdCode;
-    }
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
 
-    public void setIcdCode(String icdCode) {
-        this.icdCode = icdCode;
-    }
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
 
     @Override
     public String toString() {
@@ -171,27 +99,39 @@ public class DiseaseConfig implements Serializable {
                 ", hospitalId=" + hospitalId +
                 ", hisName=" + hisName +
                 ", uniqueName=" + uniqueName +
-                ", icdCode=" + icdCode +
+                ", code=" + code +
+                ", isMatch=" + isMatch +
+                ", source=" + source +
                 "}";
     }
 
     @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)
                 && Objects.equals(hospitalId, diseaseConfig.hospitalId)
                 && Objects.equals(hisName, diseaseConfig.hisName)
                 && Objects.equals(uniqueName, diseaseConfig.uniqueName)
-                && Objects.equals(icdCode, diseaseConfig.icdCode);
+                && Objects.equals(code, diseaseConfig.code);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, icdCode);
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, code);
+    }
+
+    public static boolean nonNull(DiseaseConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.code)));
     }
 }

+ 36 - 105
src/main/java/com/diagbot/entity/DrugConfig.java

@@ -1,13 +1,13 @@
 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.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.diagbot.util.StringUtil;
+import lombok.Getter;
+import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Size;
-import java.io.Serializable;
 import java.util.Date;
 import java.util.Objects;
 
@@ -19,15 +19,12 @@ import java.util.Objects;
  * @author zhaops
  * @since 2020-07-28
  */
-@TableName("tran_drug_config")
-public class DrugConfig implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
+@Getter
+@Setter
+public class DrugConfig {
     /**
      * 主键
      */
-    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
@@ -65,7 +62,6 @@ public class DrugConfig implements Serializable {
      */
     @Excel(name = "医院药品名称", width = 40, orderNum = "1", isImportField = "true")
     @NotBlank(message = "请输入医院药品名称")
-    //@Size(max = 80, min = 1,message = "医院药品名称长度需要在1-80字符长度之间")
     private String hisName;
 
     /**
@@ -73,108 +69,32 @@ public class DrugConfig implements Serializable {
      */
     @Excel(name = "标准药品名称", width = 40, orderNum = "2", isImportField = "true")
     @NotBlank(message = "请输入标准药品名称")
-    //@Size(max = 80, min = 1,message = "标准药品名称长度需要在1-80字符长度之间")
     private String uniqueName;
 
     /**
      * 标准编码
      */
-    //@Excel(name = "对应项编码", width = 40, orderNum = "3")
-    private String uniqueCode;
+    private String code;
 
     /**
      * 剂型
      */
     @Excel(name = "药品剂型", width = 60, orderNum = "3", isImportField = "true")
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String form;
 
-    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;
-    }
-
-    public String getForm() {
-        return form;
-    }
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
 
-    public void setForm(String form) {
-        this.form = form;
-    }
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
 
     @Override
     public String toString() {
@@ -188,17 +108,19 @@ public class DrugConfig implements Serializable {
                 ", hospitalId=" + hospitalId +
                 ", hisName=" + hisName +
                 ", uniqueName=" + uniqueName +
-                ", uniqueCode=" + uniqueCode +
+                ", code=" + code +
                 ", form=" + form +
                 "}";
     }
 
     @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)
@@ -206,11 +128,20 @@ public class DrugConfig implements Serializable {
                 && Objects.equals(hisName, drugConfig.hisName)
                 && Objects.equals(form, drugConfig.form)
                 && Objects.equals(uniqueName, drugConfig.uniqueName)
-                && Objects.equals(uniqueCode, drugConfig.uniqueCode);
+                && Objects.equals(code, drugConfig.code);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(id, isDeleted, hospitalId, hisName, form, uniqueName, uniqueCode);
+        return Objects.hash(id, isDeleted, hospitalId, hisName, form, uniqueName, code);
+    }
+
+    public static boolean nonNull(DrugConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.code)
+                && 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 +
+                "}";
+    }
+}

+ 36 - 104
src/main/java/com/diagbot/entity/LisConfig.java

@@ -1,13 +1,13 @@
 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 lombok.Data;
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.diagbot.util.StringUtil;
+import lombok.Getter;
+import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
 import java.util.Date;
 import java.util.Objects;
 
@@ -19,16 +19,12 @@ import java.util.Objects;
  * @author zhaops
  * @since 2020-07-28
  */
-@Data
-@TableName("tran_lis_config")
-public class LisConfig implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
+@Getter
+@Setter
+public class LisConfig {
     /**
      * 主键
      */
-    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
@@ -72,6 +68,7 @@ public class LisConfig implements Serializable {
      * 检验细项
      */
     @Excel(name = "检验细项", width = 40, orderNum = "2", isImportField = "true")
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String hisDetailName;
 
     /**
@@ -85,95 +82,19 @@ public class LisConfig implements Serializable {
      * 对应项目编码
      */
     //@Excel(name = "对应项目编码", width = 40, orderNum = "3")
-    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 getHisDetailName() {
-        return hisDetailName;
-    }
-
-    public void setHisDetailName(String hisDetailName) {
-        this.hisDetailName = hisDetailName;
-    }
+    private String code;
 
-    public String getUniqueName() {
-        return uniqueName;
-    }
-
-    public void setUniqueName(String uniqueName) {
-        this.uniqueName = uniqueName;
-    }
-
-    public String getUniqueCode() {
-        return uniqueCode;
-    }
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
 
-    public void setUniqueCode(String uniqueCode) {
-        this.uniqueCode = uniqueCode;
-    }
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
 
     @Override
     public String toString() {
@@ -188,16 +109,18 @@ public class LisConfig implements Serializable {
                 ", hisName=" + hisName +
                 ", hisDetailName=" + hisDetailName +
                 ", uniqueName=" + uniqueName +
-                ", uniqueCode=" + uniqueCode +
+                ", code=" + code +
                 "}";
     }
 
     @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)
@@ -205,11 +128,20 @@ public class LisConfig implements Serializable {
                 && Objects.equals(hisName, lisConfig.hisName)
                 && Objects.equals(hisDetailName, lisConfig.hisDetailName)
                 && Objects.equals(uniqueName, lisConfig.uniqueName)
-                && Objects.equals(uniqueCode, lisConfig.uniqueCode);
+                && Objects.equals(code, lisConfig.code);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(id, isDeleted, hospitalId, hisName, hisDetailName, uniqueName, uniqueCode);
+        return Objects.hash(id, isDeleted, hospitalId, hisName, hisDetailName, uniqueName, code);
+    }
+
+    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.code)));
     }
 }

+ 303 - 0
src/main/java/com/diagbot/entity/MappingConfig.java

@@ -0,0 +1,303 @@
+package com.diagbot.entity;
+
+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 java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 医学术语映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-06-09
+ */
+@Data
+@TableName("tran_mapping_config")
+public class MappingConfig 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;
+
+    /**
+     * 医学术语类型( 1-检验套餐、2-检验细项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医疾病、13-中医证候、14-麻醉)
+     */
+    private Integer type;
+
+    /**
+     * 医院术语名称
+     */
+    private String hisName;
+
+    /**
+     * 医院术语编码
+     */
+    private String hisCode;
+
+    /**
+     * 医院术语细项名称(检验细项)
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private String hisDetailName;
+
+    /**
+     * 医学标准术语id
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private Long conceptId;
+
+    /**
+     * 药品剂型id
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private Long formConceptId;
+
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    private Integer isMatch;
+
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    private Integer source;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    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 Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getHisCode() {
+        return hisCode;
+    }
+
+    public void setHisCode(String hisCode) {
+        this.hisCode = hisCode;
+    }
+
+    public String getHisDetailName() {
+        return hisDetailName;
+    }
+
+    public void setHisDetailName(String hisDetailName) {
+        this.hisDetailName = hisDetailName;
+    }
+
+    public Long getConceptId() {
+        return conceptId;
+    }
+
+    public void setConceptId(Long conceptId) {
+        this.conceptId = conceptId;
+    }
+
+    public Long getFormConceptId() {
+        return formConceptId;
+    }
+
+    public void setFormConceptId(Long formConceptId) {
+        this.formConceptId = formConceptId;
+    }
+
+    public Integer getIsMatch() {
+        return isMatch;
+    }
+
+    public void setIsMatch(Integer isMatch) {
+        this.isMatch = isMatch;
+    }
+
+    public Integer getSource() {
+        return source;
+    }
+
+    public void setSource(Integer source) {
+        this.source = source;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "MappingConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", type=" + type +
+                ", hisName=" + hisName +
+                ", hisCode=" + hisCode +
+                ", hisDetailName=" + hisDetailName +
+                ", conceptId=" + conceptId +
+                ", formConceptId=" + formConceptId +
+                ", isMatch=" + isMatch +
+                ", source=" + source +
+                ", remark=" + remark +
+                "}";
+    }
+
+    /*@Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        MappingConfig mappingConfig = (MappingConfig) o;
+        return Objects.equals(id, mappingConfig.id)
+                && Objects.equals(isDeleted, mappingConfig.isDeleted)
+                && Objects.equals(hospitalId, mappingConfig.hospitalId)
+                && Objects.equals(type, mappingConfig.type)
+                && Objects.equals(hisName, mappingConfig.hisName)
+                && Objects.equals(hisCode, mappingConfig.hisCode)
+                && Objects.equals(hisDetailName, mappingConfig.hisDetailName)
+                && Objects.equals(conceptId, mappingConfig.conceptId)
+                && Objects.equals(formConceptId, mappingConfig.formConceptId)
+                && Objects.equals(isMatch, mappingConfig.isMatch)
+                //&& Objects.equals(source, mappingConfig.source)
+                ;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, type, hisName, hisCode, hisDetailName, conceptId, formConceptId, isMatch);
+    }*/
+
+    public static boolean nonNull(MappingConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && o.type == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.hisCode)
+                && StringUtil.isBlank(o.hisDetailName)
+                && o.conceptId == null
+                && o.formConceptId == null
+                && o.isMatch == null
+                && o.source == null));
+    }
+}

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

@@ -0,0 +1,138 @@
+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 lombok.Getter;
+import lombok.Setter;
+
+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
+ */
+@Getter
+@Setter
+public class NurseConfig{
+    /**
+     * 主键
+     */
+    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 code;
+
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
+
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
+
+    @Override
+    public String toString() {
+        return "NurseConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", code=" + code +
+                "}";
+    }
+
+    @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(code, nurseConfig.code);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, code);
+    }
+
+    public static boolean nonNull(NurseConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.code)));
+    }
+}

+ 33 - 90
src/main/java/com/diagbot/entity/OperationConfig.java

@@ -4,6 +4,9 @@ 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 lombok.Getter;
+import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
 import java.io.Serializable;
@@ -18,15 +21,12 @@ import java.util.Objects;
  * @author zhaops
  * @since 2020-07-28
  */
-@TableName("tran_operation_config")
-public class OperationConfig implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
+@Getter
+@Setter
+public class OperationConfig{
     /**
      * 主键
      */
-    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
@@ -76,88 +76,21 @@ public class OperationConfig implements Serializable {
     /**
      * 对应项编码
      */
-    //@Excel(name = "对应项编码", width = 40, orderNum = "2")
-    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;
-    }
+    @Excel(name = "手术和操作代码", width = 40, orderNum = "2", isImportField = "true")
+    private String code;
 
-    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;
-    }
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
 
-    public String getUniqueCode() {
-        return uniqueCode;
-    }
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
 
-    public void setUniqueCode(String uniqueCode) {
-        this.uniqueCode = uniqueCode;
-    }
 
     @Override
     public String toString() {
@@ -171,27 +104,37 @@ public class OperationConfig implements Serializable {
                 ", hospitalId=" + hospitalId +
                 ", hisName=" + hisName +
                 ", uniqueName=" + uniqueName +
-                ", uniqueCode=" + uniqueCode +
+                ", code=" + code +
                 "}";
     }
 
     @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)
                 && Objects.equals(hospitalId, operationConfig.hospitalId)
                 && Objects.equals(hisName, operationConfig.hisName)
                 && Objects.equals(uniqueName, operationConfig.uniqueName)
-                && Objects.equals(uniqueCode, operationConfig.uniqueCode);
+                && Objects.equals(code, operationConfig.code);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, code);
+    }
+
+    public static boolean nonNull(OperationConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.code)));
     }
 }

+ 31 - 88
src/main/java/com/diagbot/entity/PacsConfig.java

@@ -4,6 +4,9 @@ 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 lombok.Getter;
+import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
 import java.io.Serializable;
@@ -18,15 +21,12 @@ import java.util.Objects;
  * @author zhaops
  * @since 2020-07-28
  */
-@TableName("tran_pacs_config")
+@Getter
+@Setter
 public class PacsConfig implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
     /**
      * 主键
      */
-    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
@@ -77,87 +77,20 @@ public class PacsConfig implements Serializable {
      * 对应项编码
      */
     //@Excel(name = "对应项编码", width = 40, orderNum = "2")
-    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;
-    }
+    private String code;
 
-    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;
-    }
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
 
-    public String getUniqueCode() {
-        return uniqueCode;
-    }
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
 
-    public void setUniqueCode(String uniqueCode) {
-        this.uniqueCode = uniqueCode;
-    }
 
     @Override
     public String toString() {
@@ -171,27 +104,37 @@ public class PacsConfig implements Serializable {
                 ", hospitalId=" + hospitalId +
                 ", hisName=" + hisName +
                 ", uniqueName=" + uniqueName +
-                ", uniqueCode=" + uniqueCode +
+                ", code=" + code +
                 "}";
     }
 
     @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)
                 && Objects.equals(hospitalId, pacsConfig.hospitalId)
                 && Objects.equals(hisName, pacsConfig.hisName)
                 && Objects.equals(uniqueName, pacsConfig.uniqueName)
-                && Objects.equals(uniqueCode, pacsConfig.uniqueCode);
+                && Objects.equals(code, pacsConfig.code);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, code);
+    }
+
+    public static boolean nonNull(PacsConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.code)));
     }
 }

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

@@ -0,0 +1,139 @@
+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 lombok.Getter;
+import lombok.Setter;
+
+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
+ */
+@Getter
+@Setter
+public class ScaleConfig{
+    /**
+     * 主键
+     */
+    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 code;
+
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
+
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
+
+
+    @Override
+    public String toString() {
+        return "ScaleConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", code=" + code +
+                "}";
+    }
+
+    @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(code, scaleConfig.code);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, code);
+    }
+
+    public static boolean nonNull(ScaleConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.code)));
+    }
+}

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

@@ -0,0 +1,139 @@
+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 lombok.Getter;
+import lombok.Setter;
+
+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
+ */
+@Getter
+@Setter
+public class TcmdiseaseConfig{
+    /**
+     * 主键
+     */
+    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 code;
+
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
+
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
+
+    @Override
+    public String toString() {
+        return "TcmdiseaseConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", code=" + code +
+                "}";
+    }
+
+    @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(code, tcmdiseaseConfig.code);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, code);
+    }
+
+    public static boolean nonNull(TcmdiseaseConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.code)));
+    }
+}

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

@@ -0,0 +1,135 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.util.StringUtil;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 中医证候映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-05-13
+ */
+@Getter
+@Setter
+public class TcmsyndromeConfig {
+    /**
+     * 主键
+     */
+    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 code;
+
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
+
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
+
+    @Override
+    public String toString() {
+        return "TcmsyndromeConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", code=" + code +
+                "}";
+    }
+
+    @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(code, tcmsyndromeConfig.code);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, code);
+    }
+
+    public static boolean nonNull(TcmsyndromeConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.code)));
+    }
+}

+ 32 - 94
src/main/java/com/diagbot/entity/TransfusionConfig.java

@@ -1,12 +1,11 @@
 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 lombok.Getter;
+import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
 import java.util.Date;
 import java.util.Objects;
 
@@ -18,15 +17,12 @@ import java.util.Objects;
  * @author zhaops
  * @since 2020-08-31
  */
-@TableName("tran_transfusion_config")
-public class TransfusionConfig implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
+@Getter
+@Setter
+public class TransfusionConfig {
     /**
      * 主键
      */
-    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
@@ -77,87 +73,19 @@ public class TransfusionConfig implements Serializable {
      * 对应项编码
      */
     //@Excel(name = "对应项编码", width = 40, orderNum = "2")
-    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;
-    }
+    private String code;
 
-    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;
-    }
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    private Integer isMatch;
 
-    public void setUniqueCode(String uniqueCode) {
-        this.uniqueCode = uniqueCode;
-    }
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
 
     @Override
     public String toString() {
@@ -171,27 +99,37 @@ public class TransfusionConfig implements Serializable {
                 ", hospitalId=" + hospitalId +
                 ", hisName=" + hisName +
                 ", uniqueName=" + uniqueName +
-                ", uniqueCode=" + uniqueCode +
+                ", code=" + code +
                 "}";
     }
 
     @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)
                 && Objects.equals(hospitalId, transfusionConfig.hospitalId)
                 && Objects.equals(hisName, transfusionConfig.hisName)
                 && Objects.equals(uniqueName, transfusionConfig.uniqueName)
-                && Objects.equals(uniqueCode, transfusionConfig.uniqueCode);
+                && Objects.equals(code, transfusionConfig.code);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, code);
+    }
+
+    public static boolean nonNull(TransfusionConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.code)));
     }
 }

+ 49 - 0
src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java

@@ -0,0 +1,49 @@
+package com.diagbot.entity.wrapper;
+
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.util.StringUtil;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/10 19:27
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class MappingConfigWrapper extends MappingConfig {
+    private String uniqueName;
+    private String form;
+    private String code;
+
+   /* @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        MappingConfigWrapper mappingConfigWrapper = (MappingConfigWrapper) o;
+        return super.equals(o)
+                && Objects.equals(uniqueName, mappingConfigWrapper.uniqueName)
+                && Objects.equals(form, mappingConfigWrapper.form)
+                && Objects.equals(code, mappingConfigWrapper.code);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(uniqueName, form, code) + super.hashCode();
+    }*/
+
+    public static boolean nonNull(MappingConfigWrapper o) {
+        return !(o == null
+                || (StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.form)
+                && StringUtil.isBlank(o.code)))
+                || MappingConfig.nonNull(o);
+    }
+}

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

@@ -9,15 +9,23 @@ 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, "检查子项");
+    Symptom(9,"症状"),
+    //PacsSubName(9, "检查子项"),
+    Scale(10, "量表"),
+    Nurse(11, "护理"),
+    Tcmdisease(12,"中医疾病"),
+    Tcmsyndrome(13,"中医证候"),
+    Anesthesia(14, "麻醉"),
+    Form(15, "药品剂型");
 
     @Setter
     private int key;

+ 66 - 0
src/main/java/com/diagbot/enums/MatchSourceEnum.java

@@ -0,0 +1,66 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/15 13:20
+ */
+public enum MatchSourceEnum implements KeyedNamed {
+    StandWord(1, "标准词"),
+    SynonymsWord(2, "同义词"),
+    Code(3,"编码"),
+    History(4,"历史数据"),
+    SimilarWord(5,"相似词");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    MatchSourceEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static MatchSourceEnum getEnum(int key) {
+        for (MatchSourceEnum item : MatchSourceEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static MatchSourceEnum getEnum(String name) {
+        for (MatchSourceEnum item : MatchSourceEnum.values()) {
+            if (item.name.equals(name)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        MatchSourceEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    public static Integer getKey(String name) {
+        MatchSourceEnum item = getEnum(name);
+        return item != null ? item.key : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 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;
+    }
+}

+ 83 - 32
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;
@@ -14,6 +15,7 @@ import com.diagbot.dto.StaticKnowledgeHISDTO;
 import com.diagbot.dto.StaticKnowledgeIndexDTO;
 import com.diagbot.entity.ConceptDetail;
 import com.diagbot.entity.ConceptInfo;
+import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.StatusEnum;
 import com.diagbot.exception.CommonErrorCode;
@@ -33,6 +35,7 @@ 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;
@@ -42,7 +45,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
@@ -67,15 +69,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
     @Qualifier("conceptDetailServiceImpl")
     private ConceptDetailService conceptDetailService;
     @Autowired
-    private LisConfigFacade lisConfigFacade;
-    @Autowired
-    private PacsConfigFacade pacsConfigFacade;
-    @Autowired
-    private DrugConfigFacade drugConfigFacade;
-    @Autowired
-    private DiseaseConfigFacade diseaseConfigFacade;
-    @Autowired
-    private OperationConfigFacade operationConfigFacade;
+    private MappingConfigFacade mappingConfigFacade;
 
     /**
      * 返回带静态知识的检索结果
@@ -612,57 +606,95 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         List<String> nameList = null;
         switch (staticKnowledgeHISVO.getType()) {
             case 1:
-                Map<String, Map<String, Long>> disConfigMap
-                        = diseaseConfigFacade.getConfigMap(hospitalId,
-                        ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
+                Map<String, Map<String, Map<String, List<String>>>> disConfigMap
+                        = mappingConfigFacade.groupByHisNameWithName(ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }),
+                        ConceptTypeEnum.Disease.getKey(), hospitalId);
                 if (disConfigMap != null
                         && disConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
-                    nameList = new ArrayList<>(disConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
+                    nameList = disConfigMap.get(staticKnowledgeHISVO.getHisName())
+                            .get("")
+                            .keySet()
+                            .stream().collect(Collectors.toList());
                 }
                 break;
             case 2:
-                Map<String, Map<String, Long>> drugConfigMap
-                        = drugConfigFacade.getConfigMapWithoutForm(hospitalId,
-                        ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
+                Map<String, Map<String, Map<String, List<String>>>> drugConfigMap
+                        = mappingConfigFacade.groupByHisNameWithName(ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }),
+                        ConceptTypeEnum.Drug.getKey(), hospitalId);
                 if (drugConfigMap != null
                         && drugConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
-                    nameList = new ArrayList<>(drugConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
+                    nameList = drugConfigMap.get(staticKnowledgeHISVO.getHisName())
+                            .get("")
+                            .keySet()
+                            .stream().collect(Collectors.toList());
                 }
                 break;
             case 3:
             case 4:
-                Map<String, Map<String, Map<String, Long>>> lisConfigMap
-                        = lisConfigFacade.getConfigMap(hospitalId,
-                        ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
+                Map<String, Map<String, Map<String, List<String>>>> lisConfigMap
+                        = mappingConfigFacade.groupByHisNameWithName(ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }),
+                        ConceptTypeEnum.LisPack.getKey(), hospitalId);
                 if (lisConfigMap != null) {
                     if (StringUtil.isBlank(staticKnowledgeHISVO.getHisDetailName())) {
                         staticKnowledgeHISVO.setHisDetailName("");
                     }
                     if (lisConfigMap.containsKey(staticKnowledgeHISVO.getHisName())) {
                         if (lisConfigMap.get(staticKnowledgeHISVO.getHisName()).containsKey(staticKnowledgeHISVO.getHisDetailName())) {
-                            nameList = new ArrayList<>(lisConfigMap.get(staticKnowledgeHISVO.getHisName())
-                                    .get(staticKnowledgeHISVO.getHisDetailName()).keySet());
+                            nameList = lisConfigMap.get(staticKnowledgeHISVO.getHisName())
+                                    .get(staticKnowledgeHISVO.getHisDetailName())
+                                    .keySet()
+                                    .stream().collect(Collectors.toList());
                         }
                     }
                 }
                 break;
             case 5:
             case 6:
-                Map<String, Map<String, Long>> pacsConfigMap
-                        = pacsConfigFacade.getConfigMap(hospitalId,
-                        ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
+                Map<String, Map<String, Map<String, List<String>>>> pacsConfigMap
+                        = mappingConfigFacade.groupByHisNameWithName(ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }),
+                        ConceptTypeEnum.Pacs.getKey(), hospitalId);
                 if (pacsConfigMap != null
                         && pacsConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
-                    nameList = new ArrayList<>(pacsConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
+                    nameList = pacsConfigMap.get(staticKnowledgeHISVO.getHisName())
+                            .get("")
+                            .keySet()
+                            .stream().collect(Collectors.toList());
                 }
                 break;
             case 7:
-                Map<String, Map<String, Long>> operationConfigMap
-                        = operationConfigFacade.getConfigMap(hospitalId,
-                        ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
+                Map<String, Map<String, Map<String, List<String>>>> operationConfigMap
+                        = mappingConfigFacade.groupByHisNameWithName(ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }),
+                        ConceptTypeEnum.Operation.getKey(), hospitalId);
                 if (operationConfigMap != null &&
                         operationConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
-                    nameList = new ArrayList<>(operationConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
+                    nameList = operationConfigMap.get(staticKnowledgeHISVO.getHisName())
+                            .get("")
+                            .keySet()
+                            .stream().collect(Collectors.toList());
+                }
+                break;
+            case 8:
+                Map<String, Map<String, Map<String, List<String>>>> scaleConfigMap
+                        = mappingConfigFacade.groupByHisNameWithName(ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }),
+                        ConceptTypeEnum.Scale.getKey(), hospitalId);
+                if (scaleConfigMap != null &&
+                        scaleConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
+                    nameList = scaleConfigMap.get(staticKnowledgeHISVO.getHisName())
+                            .get("")
+                            .keySet()
+                            .stream().collect(Collectors.toList());
+                }
+                break;
+            case 9:
+                Map<String, Map<String, Map<String, List<String>>>> nurseConfigMap
+                        = mappingConfigFacade.groupByHisNameWithName(ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }),
+                        ConceptTypeEnum.Nurse.getKey(), hospitalId);
+                if (nurseConfigMap != null &&
+                        nurseConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
+                    nameList = nurseConfigMap.get(staticKnowledgeHISVO.getHisName())
+                            .get("")
+                            .keySet()
+                            .stream().collect(Collectors.toList());
                 }
                 break;
             default:
@@ -684,6 +716,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);
@@ -990,4 +1023,22 @@ 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;
+    }
+
+    public List<GetAllForRelationDTO> addConceptClass(SearchConceptVO searchConceptVO) {
+        RespDTO<List<GetAllForRelationDTO>> relationDTORespDTO = cdssCoreClient.addConceptClass(searchConceptVO);
+        RespDTOUtil.respNGDeal(relationDTORespDTO, "术语集合新增失败");
+        return relationDTORespDTO.data;
+    }
+
+    public List<GetAllForRelationDTO> searchConceptRuleClass(SearchConceptVO searchConceptVO) {
+        RespDTO<List<GetAllForRelationDTO>> relationDTORespDTO = cdssCoreClient.searchConceptRuleClass(searchConceptVO);
+        RespDTOUtil.respNGDeal(relationDTORespDTO, "查询规则维护术语查询术语失败");
+        return relationDTORespDTO.data;
+    }
+}

+ 41 - 9
src/main/java/com/diagbot/facade/DataPageDockFacade.java

@@ -50,6 +50,19 @@ public class DataPageDockFacade {
         if(StringUtil.isNotEmpty(staticKnowledgeHISVO.getHisDetailName())){
             url+="&hisDetailName="+staticKnowledgeHISVO.getHisDetailName();
         }
+        try{
+            TranDatadockingLog tranDatadockingLog=new TranDatadockingLog();
+            tranDatadockingLog.setHospitalId(staticKnowledgeHISVO.getHospitalId());
+            tranDatadockingLog.setParamIn(JSON.toJSONString(staticKnowledgeHISVO));
+            tranDatadockingLog.setParamOut(url);
+            tranDatadockingLog.setRemark("页面推送模式,静态知识:"+staticKnowledgeHISVO.getType());
+
+            tranDatadockingLog.setTransTime(new Date());
+
+            dataDockingLogFacade.save(tranDatadockingLog);
+        }catch (Exception e){
+            log.error("页面推送模式,增加日志异常",e.getMessage());
+        }
         return RespDTO.onSuc(url);
     }
 
@@ -75,11 +88,12 @@ public class DataPageDockFacade {
         // 将基本参数保存到redis
         String mrId = mrFacade.createMr(pushJoinVO);
         //开单合理性推理时,验证下是否有推送,无推送时,不给url,code为“-1”
-        if(dataPageDockVO.getPlanCode().equals("order_rational")){
+        if(dataPageDockVO.getPlanCode().equals("order_rational") || dataPageDockVO.getPlanCode().equals("reference_pacs") || dataPageDockVO.getPlanCode().equals("reference_lis")){
             IndicationPushVO indicationPushVO=new IndicationPushVO();
             //初始化开单合理性入参
             BeanUtil.copyProperties(dataPageDockVO,indicationPushVO);
-            indicationPushVO.setRuleType("1,2,3,4");
+            //ruleType(1:危急值提醒,2:开单合理项,3:高危药品、手术,4:其他提醒)
+            indicationPushVO.setRuleType("2,3,4");
             IndicationDTO indicationDTO = pushFacade.indicationPush(indicationPushVO);
             if (indicationDTO != null) {
                 if (ListUtil.isNotEmpty(indicationDTO.getBillMsgList()) || ListUtil.isNotEmpty(indicationDTO.getHighRiskList())
@@ -95,9 +109,9 @@ public class DataPageDockFacade {
         }
 
         if("hor".equals(dataPageDockVO.getShowType())){
-            url=dataPageUrl+"/cdssHorizontal.html?pushMrId='"+pushMrId+"'&mrId="+mrId+"&hospitalId="+dataPageDockVO.getHospitalId()+"&planCode="+dataPageDockVO.getPlanCode();
+            url=dataPageUrl+"/cdssHorizontal.html?pushMrId="+pushMrId+"&mrId="+mrId+"&hospitalId="+dataPageDockVO.getHospitalId()+"&planCode="+dataPageDockVO.getPlanCode();
         }else{
-            url=dataPageUrl+"/cdss.html?pushMrId='"+pushMrId+"'&mrId="+mrId+"&hospitalId="+dataPageDockVO.getHospitalId()+"&planCode="+dataPageDockVO.getPlanCode();
+            url=dataPageUrl+"/cdss.html?pushMrId="+pushMrId+"&mrId="+mrId+"&hospitalId="+dataPageDockVO.getHospitalId()+"&planCode="+dataPageDockVO.getPlanCode();
         }
 
         try{
@@ -117,6 +131,11 @@ public class DataPageDockFacade {
         return RespDTO.onSuc(url);
     }
 
+    /**
+     * @Description:病历推理
+     * @Author:liuqq
+     * @time: ${DATE} ${TIME}
+     **/
     public PushDTO getEnginePush(DataEngineVO dataEngineVO) {
         PushVO pushVO = new PushVO();
         BeanUtil.copyProperties(dataEngineVO, pushVO);
@@ -139,15 +158,17 @@ public class DataPageDockFacade {
 
         return pushDTO;
     }
+
     /**
-     * @Description: 开单合理性
+     * @Description: 开单合理性及检查、检查报告检阅
      * @Author:liuqq
      * @time: ${DATE} ${TIME}
      **/
-    public IndicationDTO getEngineIndicationPush(DataEngineVO dataEngineVO) {
+    public RespDTO getEngineIndicationPush(DataEngineVO dataEngineVO) {
         IndicationPushVO indicationPushVO=new IndicationPushVO();
         BeanUtil.copyProperties(dataEngineVO, indicationPushVO);
-
+        //ruleType(1:危急值提醒,2:开单合理项,3:高危药品、手术,4:其他提醒)
+        indicationPushVO.setRuleType("2,3,4");
         IndicationDTO indicationDTO=pushFacade.indicationPush(indicationPushVO);
         indicationDTO.setDebug(null);
 
@@ -155,7 +176,7 @@ public class DataPageDockFacade {
             TranDatadockingLog tranDatadockingLog=new TranDatadockingLog();
             tranDatadockingLog.setHospitalId(dataEngineVO.getHospitalId());
             tranDatadockingLog.setParamIn(JSON.toJSONString(dataEngineVO));
-            tranDatadockingLog.setParamOut(JSON.toJSONString(indicationDTO));
+            tranDatadockingLog.setParamOut(JSON.toJSONString(dataEngineVO));
             tranDatadockingLog.setRemark("数据引擎模式,"+dataEngineVO.getPlanCode());
 
             tranDatadockingLog.setTransTime(new Date());
@@ -164,7 +185,18 @@ public class DataPageDockFacade {
         }catch (Exception e){
             log.error("数据引擎模式,增加日志异常",e.getMessage());
         }
-        return indicationDTO;
+
+        if (indicationDTO != null) {
+            if (ListUtil.isNotEmpty(indicationDTO.getBillMsgList()) || ListUtil.isNotEmpty(indicationDTO.getHighRiskList())
+                    || ListUtil.isNotEmpty(indicationDTO.getCriticalValList()) || ListUtil.isNotEmpty(indicationDTO.getOtherList()))
+            {
+                return RespDTO.onSuc(indicationDTO);
+            }else{
+                return RespDTO.onError("无开单合理性提醒!");
+            }
+        }else{
+            return RespDTO.onError("无开单合理性提醒!");
+        }
     }
 
 

+ 0 - 491
src/main/java/com/diagbot/facade/DeptConfigFacade.java

@@ -1,491 +0,0 @@
-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.RespDTO;
-import com.diagbot.entity.DeptConfig;
-import com.diagbot.enums.ConceptTypeEnum;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.DeptConfigService;
-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.DeptConfigListVO;
-import com.diagbot.vo.DeptConfigPageVO;
-import com.diagbot.vo.IdListVO;
-import com.diagbot.vo.IdVO;
-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: 2020/8/12 14:25
- */
-@Component
-public class DeptConfigFacade {
-    @Autowired
-    private DeptConfigService deptConfigService;
-    @Autowired
-    private CdssCoreClient cdssCoreClient;
-
-    /**
-     * 判断是否已存在
-     *
-     * @param deptConfig
-     * @return
-     */
-    public Boolean isExistRecord(DeptConfig deptConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        QueryWrapper<DeptConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", deptConfig.getHisName())
-                .eq("unique_name", deptConfig.getUniqueName());
-        DeptConfig oldRecord = deptConfigService.getOne(queryWrapper, false);
-        if (deptConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (deptConfig.getId() != null
-                && oldRecord != null
-                && !deptConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        return false;
-    }
-
-    /**
-     * 保存记录-单条
-     *
-     * @param deptConfig
-     * @return
-     */
-    public Boolean saveOrUpdateRecord(DeptConfig deptConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-        deptConfig.setHospitalId(Long.valueOf(hospitalId));
-        deptConfig.setModifier(userId);
-        deptConfig.setGmtModified(now);
-        QueryWrapper<DeptConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", deptConfig.getHisName())
-                .eq("unique_name", deptConfig.getUniqueName());
-        DeptConfig oldRecord = deptConfigService.getOne(queryWrapper, false);
-        if (deptConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (deptConfig.getId() != null
-                && oldRecord != null
-                && !deptConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        //新增数据
-        if (deptConfig.getId() == null) {
-            deptConfig.setCreator(userId);
-            deptConfig.setGmtCreate(now);
-        }
-        if (deptConfig.getIsDeleted() == null) {
-            deptConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-        }
-        deptConfigService.saveOrUpdate(deptConfig);
-        return true;
-    }
-
-    /**
-     * 保存记录-批量
-     *
-     * @param deptConfigListVO
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(DeptConfigListVO deptConfigListVO) {
-        if (ListUtil.isEmpty(deptConfigListVO.getDeptConfigList())) {
-            return false;
-        }
-        return saveOrUpdateRecords(deptConfigListVO.getDeptConfigList());
-    }
-
-    /**
-     * 批量保存
-     *
-     * @param deptConfigList
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(List<DeptConfig> deptConfigList) {
-        if (ListUtil.isEmpty(deptConfigList)) {
-            return false;
-        }
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //数据不完整的不保存
-        //过滤外部名称或公表名为空的数据
-        deptConfigList = deptConfigList
-                .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);
-        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);
-            }
-            if (deptConfig.getIsDeleted() == null) {
-                deptConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        deptConfigService.saveOrUpdateBatch(deptConfigList);
-        return true;
-    }
-
-    /**
-     * 删除记录-单条
-     *
-     * @param idVO
-     * @return
-     */
-    public Boolean deleteRecord(IdVO idVO) {
-        UpdateWrapper<DeptConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("id", idVO.getId())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        deptConfigService.removeById(idVO.getId());
-        return true;
-    }
-
-    /**
-     * 删除记录-批量
-     *
-     * @param idListVO
-     * @return
-     */
-    public Boolean deleteRecords(IdListVO idListVO) {
-        if (ListUtil.isEmpty(idListVO.getIds())) {
-            return false;
-        }
-        UpdateWrapper<DeptConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.in("id", idListVO.getIds())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        deptConfigService.removeByIds(idListVO.getIds());
-        return true;
-    }
-
-    /**
-     * 分页查询
-     *
-     * @param deptConfigPageVO
-     * @return
-     */
-    public IPage<DeptConfig> getPage(DeptConfigPageVO deptConfigPageVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        deptConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
-        return deptConfigService.getPage(deptConfigPageVO);
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param file
-     */
-    public void importExcel(MultipartFile file) {
-        List<DeptConfig> deptConfigList = ExcelUtils.importExcel(file, 0, 1, DeptConfig.class);
-        if (ListUtil.isNotEmpty(deptConfigList)) {
-            importExcelRecords(deptConfigList);
-        } else {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param deptConfigList
-     * @return
-     */
-    public Boolean importExcelRecords(List<DeptConfig> deptConfigList) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //1、数据完整性校验
-        //2、去除前后空格
-        //过滤空数据,保留重复数据,方便计行
-        deptConfigList = deptConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getHisCode())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
-                .collect(Collectors.toList());
-        if (ListUtil.isEmpty(deptConfigList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-
-        List<String> emptyNumList = Lists.newLinkedList();
-        for (int i = 0; i < deptConfigList.size(); i++) {
-            if (StringUtil.isBlank(deptConfigList.get(i).getHisName())
-                    || StringUtil.isBlank(deptConfigList.get(i).getUniqueName())) {
-                emptyNumList.add(String.valueOf(i + 2));
-            }
-            if (StringUtil.isNotBlank(deptConfigList.get(i).getHisName())) {
-                deptConfigList.get(i).setHisName(deptConfigList.get(i).getHisName().trim());
-            }
-            if (StringUtil.isNotBlank(deptConfigList.get(i).getHisCode())) {
-                deptConfigList.get(i).setHisCode(deptConfigList.get(i).getHisCode().trim());
-            }
-            if (StringUtil.isNotBlank(deptConfigList.get(i).getUniqueName())) {
-                deptConfigList.get(i).setUniqueName(deptConfigList.get(i).getUniqueName().trim());
-            }
-            if (StringUtil.isNotBlank(deptConfigList.get(i).getUniqueCode())) {
-                deptConfigList.get(i).setUniqueCode(deptConfigList.get(i).getUniqueCode().trim());
-            } else {
-                deptConfigList.get(i).setUniqueCode(null);
-            }
-        }
-
-        if (ListUtil.isNotEmpty(emptyNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
-                    + emptyNumList.stream().collect(Collectors.joining("、"))
-                    + "。导入取消,请修改后再试。\n");
-        }
-
-        // 验证数据是否已存在,已存在的先删除
-        // 没id的删除重新插入,有id的更新
-        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);
-            }
-            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));
-            }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计空行)标准术语在数据库中不存在:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
-
-        //重复数据过滤
-        deptConfigList = deptConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
-
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        deptConfigService.saveOrUpdateBatch(deptConfigList);
-        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<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())) {
-                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<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>>
-     *
-     * @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<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>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
-        for (Map.Entry<String, List<DeptConfig>> 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<DeptConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
-                .orderByDesc("gmt_modified");
-        List<DeptConfig> records = deptConfigService.list(queryWrapper);
-        String fileName = "科室映射.xls";
-        ExcelUtils.exportExcel(records, null, "sheet1", DeptConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 数据导入模板导出
-     *
-     * @param response
-     */
-    public void exportExcelModule(HttpServletResponse response) {
-        String fileName = "科室映射模板.xls";
-        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", DeptConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 科室搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<String> getDepts(RetrievalVO retrievalVO) {
-        List<DeptConfig> records = deptConfigService.getDeptsIndex(retrievalVO);
-        List<String> deptNames
-                = records.stream().map(r -> r.getHisName()).distinct().collect(Collectors.toList());
-        return deptNames;
-    }
-}

+ 0 - 494
src/main/java/com/diagbot/facade/DiseaseConfigFacade.java

@@ -1,494 +0,0 @@
-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.DiseaseInfoDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.DiseaseConfig;
-import com.diagbot.enums.ConceptTypeEnum;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.DiseaseConfigService;
-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.DiseaseConfigListVO;
-import com.diagbot.vo.DiseaseConfigPageVO;
-import com.diagbot.vo.IdListVO;
-import com.diagbot.vo.IdVO;
-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: 2020/7/29 15:05
- */
-@Component
-public class DiseaseConfigFacade {
-    @Autowired
-    private DiseaseConfigService diseaseConfigService;
-    @Autowired
-    private CdssCoreClient cdssCoreClient;
-
-    /**
-     * 判断是否已存在
-     *
-     * @param diseaseConfig
-     * @return
-     */
-    public Boolean isExistRecord(DiseaseConfig diseaseConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        QueryWrapper<DiseaseConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", diseaseConfig.getHisName())
-                .eq("unique_name", diseaseConfig.getUniqueName());
-        DiseaseConfig oldRecord = diseaseConfigService.getOne(queryWrapper, false);
-        if (diseaseConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法添加");
-        }
-        if (diseaseConfig.getId() != null
-                && oldRecord != null
-                && !diseaseConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        return false;
-    }
-
-    /**
-     * 保存记录-单条
-     *
-     * @param diseaseConfig
-     * @return
-     */
-    public Boolean saveOrUpdateRecord(DiseaseConfig diseaseConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-        diseaseConfig.setHospitalId(Long.valueOf(hospitalId));
-        diseaseConfig.setModifier(userId);
-        diseaseConfig.setGmtModified(now);
-        QueryWrapper<DiseaseConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", diseaseConfig.getHisName())
-                .eq("unique_name", diseaseConfig.getUniqueName());
-        DiseaseConfig oldRecord = diseaseConfigService.getOne(queryWrapper, false);
-        if (diseaseConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法添加");
-        }
-        if (diseaseConfig.getId() != null
-                && oldRecord != null
-                && !diseaseConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        //新增数据
-        if (diseaseConfig.getId() == null) {
-            diseaseConfig.setCreator(userId);
-            diseaseConfig.setGmtCreate(now);
-        }
-        if (diseaseConfig.getIsDeleted() == null) {
-            diseaseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-        }
-        diseaseConfigService.saveOrUpdate(diseaseConfig);
-        return true;
-    }
-
-    /**
-     * 保存记录-批量
-     *
-     * @param diseaseConfigListVO
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(DiseaseConfigListVO diseaseConfigListVO) {
-        if (ListUtil.isEmpty(diseaseConfigListVO.getDiseaseConfigList())) {
-            return false;
-        }
-        return saveOrUpdateRecords(diseaseConfigListVO.getDiseaseConfigList());
-    }
-
-    /**
-     * 批量保存
-     *
-     * @param diseaseConfigList
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(List<DiseaseConfig> diseaseConfigList) {
-        if (ListUtil.isEmpty(diseaseConfigList)) {
-            return false;
-        }
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //数据不完整的不保存
-        //过滤外部名称或公表名为空的数据
-        diseaseConfigList = diseaseConfigList
-                .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);
-        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);
-            }
-            if (diseaseConfig.getIsDeleted() == null) {
-                diseaseConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        diseaseConfigService.saveOrUpdateBatch(diseaseConfigList);
-        return true;
-    }
-
-    /**
-     * 删除记录-单条
-     *
-     * @param idVO
-     * @return
-     */
-    public Boolean deleteRecord(IdVO idVO) {
-        UpdateWrapper<DiseaseConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("id", idVO.getId())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        diseaseConfigService.removeById(idVO.getId());
-        return true;
-    }
-
-    /**
-     * 删除记录-批量
-     *
-     * @param idListVO
-     * @return
-     */
-    public Boolean deleteRecords(IdListVO idListVO) {
-        if (ListUtil.isEmpty(idListVO.getIds())) {
-            return false;
-        }
-        UpdateWrapper<DiseaseConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.in("id", idListVO.getIds())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        diseaseConfigService.removeByIds(idListVO.getIds());
-        return true;
-    }
-
-    /**
-     * 分页查询
-     *
-     * @param diseaseConfigPageVO
-     * @return
-     */
-    public IPage<DiseaseConfig> getPage(DiseaseConfigPageVO diseaseConfigPageVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        diseaseConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
-        return diseaseConfigService.getPage(diseaseConfigPageVO);
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param file
-     */
-    public void importExcel(MultipartFile file) {
-        List<DiseaseConfig> diseaseConfigList = ExcelUtils.importExcel(file, 0, 1, DiseaseConfig.class);
-        if (ListUtil.isNotEmpty(diseaseConfigList)) {
-            importExcelRecords(diseaseConfigList);
-        } else {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param diseaseConfigList
-     * @return
-     */
-    public Boolean importExcelRecords(List<DiseaseConfig> diseaseConfigList) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-
-        //1、数据完整性校验
-        //2、去除前后空格
-        //过滤空数据,保留重复数据,方便计行
-        diseaseConfigList = diseaseConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getIcdCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
-                .collect(Collectors.toList());
-        if (ListUtil.isEmpty(diseaseConfigList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-        List<String> emptyNumList = Lists.newLinkedList();
-        for (int i = 0; i < diseaseConfigList.size(); i++) {
-            if (StringUtil.isBlank(diseaseConfigList.get(i).getHisName())
-                    || StringUtil.isBlank(diseaseConfigList.get(i).getUniqueName())) {
-                emptyNumList.add(String.valueOf(i + 2));
-            }
-            if (StringUtil.isNotBlank(diseaseConfigList.get(i).getHisName())) {
-                diseaseConfigList.get(i).setHisName(diseaseConfigList.get(i).getHisName().trim());
-            }
-            if (StringUtil.isNotBlank(diseaseConfigList.get(i).getUniqueName())) {
-                diseaseConfigList.get(i).setUniqueName(diseaseConfigList.get(i).getUniqueName().trim());
-            }
-            if (StringUtil.isNotBlank(diseaseConfigList.get(i).getIcdCode())) {
-                diseaseConfigList.get(i).setIcdCode(diseaseConfigList.get(i).getIcdCode().trim());
-            } else {
-                diseaseConfigList.get(i).setIcdCode(null);
-            }
-        }
-
-        if (ListUtil.isNotEmpty(emptyNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
-                    + emptyNumList.stream().collect(Collectors.joining("、"))
-                    + "。导入取消,请修改后再试。\n");
-        }
-
-
-        // 验证数据是否已存在,已存在的先删除
-        // 没id的删除重新插入,有id的更新
-        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);
-            }
-            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));
-            }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计空行)标准术语在数据库中不存在:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
-
-        //重复数据过滤
-        diseaseConfigList = diseaseConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
-
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        diseaseConfigService.saveOrUpdateBatch(diseaseConfigList);
-        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<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())) {
-                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<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>>
-     *
-     * @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<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>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
-        for (Map.Entry<String, List<DiseaseConfig>> 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<DiseaseConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
-                .orderByDesc("gmt_modified");
-        List<DiseaseConfig> records = diseaseConfigService.list(queryWrapper);
-        String fileName = "疾病映射.xls";
-        ExcelUtils.exportExcel(records, null, "sheet1", DiseaseConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 数据导入模板导出
-     *
-     * @param response
-     */
-    public void exportExcelModule(HttpServletResponse response) {
-        String fileName = "疾病映射模板.xls";
-        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", DiseaseConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 疾病搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<DiseaseInfoDTO> getDiseases(RetrievalVO retrievalVO) {
-        List<DiseaseInfoDTO> diseaseNames = new ArrayList<>();
-        List<DiseaseConfig> diseaseConfigList = diseaseConfigService.getDiseasesIndex(retrievalVO);
-        for (DiseaseConfig diseaseConfig : diseaseConfigList) {
-            DiseaseInfoDTO diseaseInfoDTO = new DiseaseInfoDTO();
-            diseaseInfoDTO.setIcd10Code(diseaseConfig.getIcdCode());
-            diseaseInfoDTO.setName(diseaseConfig.getHisName());
-            diseaseNames.add(diseaseInfoDTO);
-        }
-        return diseaseNames;
-    }
-}

+ 0 - 686
src/main/java/com/diagbot/facade/DrugConfigFacade.java

@@ -1,686 +0,0 @@
-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.DictionaryInfoDTO;
-import com.diagbot.dto.DrugInfoDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.DrugConfig;
-import com.diagbot.enums.ConceptTypeEnum;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.DrugConfigService;
-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.DrugConfigListVO;
-import com.diagbot.vo.DrugConfigPageVO;
-import com.diagbot.vo.IdListVO;
-import com.diagbot.vo.IdVO;
-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: 2020/7/29 15:04
- */
-@Component
-public class DrugConfigFacade {
-    @Autowired
-    private DrugConfigService drugConfigService;
-    @Autowired
-    private CdssCoreClient cdssCoreClient;
-    @Autowired
-    private DictionaryFacade dictionaryFacade;
-
-    /**
-     * 判断是否已存在
-     *
-     * @param drugConfig
-     * @return
-     */
-    public Boolean isExistRecord(DrugConfig drugConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", drugConfig.getHisName())
-                .eq("unique_name", drugConfig.getUniqueName());
-        if (StringUtil.isBlank(drugConfig.getForm())) {
-            queryWrapper.and(i -> i.isNull("form")
-                    .or()
-                    .eq("form", ""));
-        } else {
-            queryWrapper.eq("form", drugConfig.getForm());
-        }
-        DrugConfig oldRecord = drugConfigService.getOne(queryWrapper, false);
-        if (drugConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (drugConfig.getId() != null
-                && oldRecord != null
-                && !drugConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        return false;
-    }
-
-    /**
-     * 保存记录-单条
-     *
-     * @param drugConfig
-     * @return
-     */
-    public Boolean saveOrUpdateRecord(DrugConfig drugConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-        drugConfig.setHospitalId(Long.valueOf(hospitalId));
-        drugConfig.setModifier(userId);
-        drugConfig.setGmtModified(now);
-        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", drugConfig.getHisName())
-                .eq("unique_name", drugConfig.getUniqueName());
-        if (StringUtil.isBlank(drugConfig.getForm())) {
-            queryWrapper.and(i -> i.isNull("form")
-                    .or()
-                    .eq("form", ""));
-        } else {
-            queryWrapper.eq("form", drugConfig.getForm());
-        }
-        DrugConfig oldRecord = drugConfigService.getOne(queryWrapper, false);
-        if (drugConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (drugConfig.getId() != null
-                && oldRecord != null
-                && !drugConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        //新增数据
-        if (drugConfig.getId() == null) {
-            drugConfig.setCreator(userId);
-            drugConfig.setGmtCreate(now);
-        }
-        if (drugConfig.getIsDeleted() == null) {
-            drugConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-        }
-        drugConfigService.saveOrUpdate(drugConfig);
-        return true;
-    }
-
-    /**
-     * 保存记录-批量
-     *
-     * @param drugConfigListVO
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(DrugConfigListVO drugConfigListVO) {
-        if (ListUtil.isEmpty(drugConfigListVO.getDrugConfigList())) {
-            return false;
-        }
-        return saveOrUpdateRecords(drugConfigListVO.getDrugConfigList());
-    }
-
-    /**
-     * 批量保存
-     *
-     * @param drugConfigList
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(List<DrugConfig> drugConfigList) {
-        if (ListUtil.isEmpty(drugConfigList)) {
-            return false;
-        }
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //数据不完整的不保存
-        //过滤外部名称或公表名为空的数据
-        drugConfigList = drugConfigList
-                .stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
-                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
-                .collect(Collectors.toList());
-        List<String> hisNames = drugConfigList
-                .stream()
-                .map(i -> i.getHisName())
-                .collect(Collectors.toList());
-        List<String> uniqueNames = drugConfigList
-                .stream()
-                .map(i -> i.getUniqueName())
-                .collect(Collectors.toList());
-
-        // 验证数据是否已存在,已存在的先删除
-        // 没id的删除重新插入,有id的更新
-        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);
-            }
-            if (drugConfig.getIsDeleted() == null) {
-                drugConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
-
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        drugConfigService.saveOrUpdateBatch(drugConfigList);
-        return true;
-    }
-
-    /**
-     * 删除记录-单条
-     *
-     * @param idVO
-     * @return
-     */
-    public Boolean deleteRecord(IdVO idVO) {
-        UpdateWrapper<DrugConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("id", idVO.getId())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        drugConfigService.removeById(idVO.getId());
-        return true;
-    }
-
-    /**
-     * 删除记录-批量
-     *
-     * @param idListVO
-     * @return
-     */
-    public Boolean deleteRecords(IdListVO idListVO) {
-        if (ListUtil.isEmpty(idListVO.getIds())) {
-            return false;
-        }
-        UpdateWrapper<DrugConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.in("id", idListVO.getIds())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        drugConfigService.removeByIds(idListVO.getIds());
-        return true;
-    }
-
-    /**
-     * 分页查询
-     *
-     * @param drugConfigPageVO
-     * @return
-     */
-    public IPage<DrugConfig> getPage(DrugConfigPageVO drugConfigPageVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        drugConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
-        return drugConfigService.getPage(drugConfigPageVO);
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param file
-     */
-    public void importExcel(MultipartFile file) {
-        List<DrugConfig> drugConfigList = ExcelUtils.importExcel(file, 1, 1, DrugConfig.class);
-        if (ListUtil.isNotEmpty(drugConfigList)) {
-            importExcelRecords(drugConfigList);
-        } else {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param drugConfigList
-     * @return
-     */
-    public Boolean importExcelRecords(List<DrugConfig> drugConfigList) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //1、数据完整性校验
-        //2、去除前后空格
-        //过滤空数据,保留重复数据,方便计行
-        drugConfigList = drugConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getForm())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
-                .collect(Collectors.toList());
-        if (ListUtil.isEmpty(drugConfigList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-        List<String> emptyNumList = Lists.newLinkedList();
-        //药品剂型
-        List<DictionaryInfoDTO> dicTypeMappingList = dictionaryFacade.getListByGroupType(9);
-        List<String> formList = dicTypeMappingList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getName()))
-                .map(i -> i.getName())
-                .distinct()
-                .collect(Collectors.toList());
-        List<String> formErrNumList = Lists.newLinkedList();
-        for (int i = 0; i < drugConfigList.size(); i++) {
-            if (StringUtil.isBlank(drugConfigList.get(i).getHisName())
-                    || StringUtil.isBlank(drugConfigList.get(i).getUniqueName())) {
-                emptyNumList.add(String.valueOf(i + 3));
-            }
-            if (StringUtil.isNotBlank(drugConfigList.get(i).getHisName())) {
-                drugConfigList.get(i).setHisName(drugConfigList.get(i).getHisName().trim());
-            }
-            if (StringUtil.isNotBlank(drugConfigList.get(i).getUniqueName())) {
-                drugConfigList.get(i).setUniqueName(drugConfigList.get(i).getUniqueName().trim());
-            }
-            if (StringUtil.isNotBlank(drugConfigList.get(i).getForm())) {
-                if (!formList.contains(drugConfigList.get(i).getForm())) {
-                    formErrNumList.add(String.valueOf(i + 3));
-                } else {
-                    drugConfigList.get(i).setForm(drugConfigList.get(i).getForm().trim());
-                }
-            }
-            if (StringUtil.isNotBlank(drugConfigList.get(i).getUniqueCode())) {
-                drugConfigList.get(i).setUniqueCode(drugConfigList.get(i).getUniqueCode().trim());
-            } else {
-                drugConfigList.get(i).setUniqueCode(null);
-            }
-        }
-
-        if (ListUtil.isNotEmpty(emptyNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
-                    + emptyNumList.stream().collect(Collectors.joining("、"))
-                    + "。导入取消,请修改后再试。\n");
-        }
-        if (ListUtil.isNotEmpty(formErrNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)药品剂型与数据库药品剂型不匹配:"
-                    + formErrNumList.stream().collect(Collectors.joining("、"))
-                    + "。导入取消,请修改后再试。\n");
-        }
-
-        List<String> hisNames = drugConfigList
-                .stream()
-                .map(i -> i.getHisName())
-                .collect(Collectors.toList());
-        List<String> uniqueNames = drugConfigList
-                .stream()
-                .map(i -> i.getUniqueName())
-                .collect(Collectors.toList());
-
-        // 验证数据是否已存在,已存在的先删除
-        // 没id的删除重新插入,有id的更新
-        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);
-            }
-            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 + 3));
-            }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计空行)标准术语在数据库中不存在:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
-
-        //重复数据过滤
-        drugConfigList = drugConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
-
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        drugConfigService.saveOrUpdateBatch(drugConfigList);
-        return true;
-    }
-
-    /**
-     * 获取映射关系-公表名
-     *
-     * @param hospitalId
-     * @param hisNames
-     * @param uniqueNames
-     * @return Map<hisName   ,   Map   <   form   ,   Map   <   uniqueName   ,   id>>>
-     */
-    public Map<String, Map<String, Map<String, Long>>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
-        Map<String, Map<String, Map<String, 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, 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())) {
-                        formMap.put(subEntry.getKey(),
-                                EntityUtil.makeMapWithKeyValue(subEntry.getValue(), "uniqueName", "id"));
-                    }
-                }
-                retMap.put(entry.getKey(), formMap);
-            }
-        }
-        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>>>
-     *
-     * @param hospitalId
-     * @param hisNames
-     * @param uniqueNames
-     * @return
-     */
-    public Map<String, Map<String, Map<String, Long>>> getUniqueNameConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
-        Map<String, Map<String, Map<String, 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;
-        }
-        records.forEach(i -> {
-            if (StringUtil.isBlank(i.getForm())) {
-                i.setForm("");
-            }
-        });
-        Map<String, List<DrugConfig>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
-        for (Map.Entry<String, List<DrugConfig>> entry : uniqueNameMap.entrySet()) {
-            if (ListUtil.isNotEmpty(entry.getValue())) {
-                Map<String, Map<String, Long>> formMap = new HashMap<>();
-                Map<String, List<DrugConfig>> subMap
-                        = EntityUtil.makeEntityListMap(entry.getValue(), "form");
-                for (Map.Entry<String, List<DrugConfig>> subEntry : subMap.entrySet()) {
-                    if (ListUtil.isNotEmpty(subEntry.getValue())) {
-                        formMap.put(subEntry.getKey(),
-                                EntityUtil.makeMapWithKeyValue(subEntry.getValue(), "hisName", "id"));
-                    }
-                }
-                retMap.put(entry.getKey(), formMap);
-            }
-        }
-        return retMap;
-    }
-
-    /**
-     * 获取映射关系-公表名
-     *
-     * @param hospitalId
-     * @param hisNames
-     * @param uniqueNames
-     * @return Map<hisName   ,   Map   <   uniqueName   ,   id>>
-     */
-    public Map<String, Map<String, Long>> getConfigMapWithoutForm(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
-        Map<String, Map<String, 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())) {
-                retMap.put(entry.getKey(),
-                        EntityUtil.makeMapWithKeyValue(records, "uniqueName", "id"));
-            }
-        }
-        return retMap;
-    }
-
-    /**
-     * 获取映射关系
-     * Map<uniqueName,Map<hisName,id>>
-     *
-     * @param hospitalId
-     * @param hisNames
-     * @param uniqueNames
-     * @return
-     */
-    public Map<String, Map<String, Long>> getUniqueNameConfigMapWithoutForm(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
-        Map<String, Map<String, 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;
-        }
-        records.forEach(i -> {
-            if (StringUtil.isBlank(i.getForm())) {
-                i.setForm("");
-            }
-        });
-        Map<String, List<DrugConfig>> uniqueNameMap
-                = EntityUtil.makeEntityListMap(records, "uniqueName");
-        for (Map.Entry<String, List<DrugConfig>> entry : uniqueNameMap.entrySet()) {
-            if (ListUtil.isNotEmpty(entry.getValue())) {
-                retMap.put(entry.getKey(),
-                        EntityUtil.makeMapWithKeyValue(records, "hisName", "id"));
-            }
-        }
-        return retMap;
-    }
-
-    /**
-     * 数据导出
-     *
-     * @param response
-     */
-    public void exportExcel(HttpServletResponse response) {
-        QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
-                .orderByDesc("gmt_modified");
-        List<DrugConfig> records = drugConfigService.list(queryWrapper);
-        String fileName = "药品映射.xls";
-        ExcelUtils.exportExcel(records, getFrom(), "sheet1", DrugConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 数据导入模板导出
-     *
-     * @param response
-     */
-    public void exportExcelModule(HttpServletResponse response) {
-        String fileName = "药品映射模板.xls";
-        ExcelUtils.exportExcel(new ArrayList<>(), getFrom(), "sheet1", DrugConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 剂型说明
-     *
-     * @return
-     */
-    private String getFrom() {
-        String from = "药品模板——药品剂型填写说明[不填";
-        //药品剂型
-        List<DictionaryInfoDTO> dicTypeMappingList = dictionaryFacade.getListByGroupType(9);
-        List<String> formList = dicTypeMappingList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getName()))
-                .map(i -> i.getName())
-                .distinct()
-                .collect(Collectors.toList());
-        if (ListUtil.isNotEmpty(formList)) {
-            for (String s : formList) {
-                if (StringUtil.isNotBlank(s)) {
-                    from += "、" + s;
-                }
-            }
-        }
-        from += "]";
-        return from;
-    }
-
-    /**
-     * 药品搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<DrugInfoDTO> getMedicines(RetrievalVO retrievalVO) {
-        List<DrugInfoDTO> drugNames = new ArrayList<>();
-        List<DrugConfig> drugConfigList = drugConfigService.getMedicinesIndex(retrievalVO);
-        for (DrugConfig drugConfig : drugConfigList) {
-            DrugInfoDTO drugInfoDTO = new DrugInfoDTO();
-            drugInfoDTO.setName(drugConfig.getHisName());
-            drugNames.add(drugInfoDTO);
-        }
-        return drugNames;
-    }
-}

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

@@ -0,0 +1,279 @@
+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.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+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;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+        }
+
+        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 {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+        }
+    }
+
+    /**
+     * 医院端获取静态知识(对接)
+     *
+     * @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;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+        }
+        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;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+        }
+        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;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+        }
+        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;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+        }
+        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;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+        }
+        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;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+        }
+        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;
+    }
+}

+ 0 - 603
src/main/java/com/diagbot/facade/LisConfigFacade.java

@@ -1,603 +0,0 @@
-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.LisDetailDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.LisConfig;
-import com.diagbot.enums.ConceptTypeEnum;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.LisConfigService;
-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.LisConfigListVO;
-import com.diagbot.vo.LisConfigPageVO;
-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: 2020/7/29 15:03
- */
-@Component
-public class LisConfigFacade {
-    @Autowired
-    private LisConfigService lisConfigService;
-    @Autowired
-    private CdssCoreClient cdssCoreClient;
-
-    /**
-     * 判断是否已存在
-     *
-     * @param lisConfig
-     * @return
-     */
-    public Boolean isExistRecord(LisConfig lisConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", lisConfig.getHisName())
-                .eq("unique_name", lisConfig.getUniqueName());
-        if (StringUtil.isBlank(lisConfig.getHisDetailName())) {
-            queryWrapper.and(i -> i.isNull("his_detail_name")
-                    .or()
-                    .eq("his_detail_name", ""));
-        } else {
-            queryWrapper
-                    .eq("his_detail_name", lisConfig.getHisDetailName());
-        }
-        LisConfig oldRecord = lisConfigService.getOne(queryWrapper, false);
-        if (lisConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (lisConfig.getId() != null
-                && oldRecord != null
-                && !lisConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        return false;
-    }
-
-    /**
-     * 保存记录-单条
-     *
-     * @param lisConfig
-     * @return
-     */
-    public Boolean saveOrUpdateRecord(LisConfig lisConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-        lisConfig.setHospitalId(Long.valueOf(hospitalId));
-        lisConfig.setModifier(userId);
-        lisConfig.setGmtModified(now);
-        QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", lisConfig.getHisName())
-                .eq("unique_name", lisConfig.getUniqueName());
-        if (StringUtil.isBlank(lisConfig.getHisDetailName())) {
-            queryWrapper.and(i -> i.isNull("his_detail_name")
-                    .or()
-                    .eq("his_detail_name", ""));
-        } else {
-            queryWrapper
-                    .eq("his_detail_name", lisConfig.getHisDetailName());
-        }
-        LisConfig oldRecord = lisConfigService.getOne(queryWrapper, false);
-        if (lisConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (lisConfig.getId() != null
-                && oldRecord != null
-                && !lisConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        //新增数据
-        if (lisConfig.getId() == null) {
-            lisConfig.setCreator(userId);
-            lisConfig.setGmtCreate(now);
-        }
-        if (lisConfig.getIsDeleted() == null) {
-            lisConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-        }
-        lisConfigService.saveOrUpdate(lisConfig);
-        return true;
-    }
-
-    /**
-     * 保存记录-批量
-     *
-     * @param lisConfigListVO
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(LisConfigListVO lisConfigListVO) {
-        if (ListUtil.isEmpty(lisConfigListVO.getLisConfigList())) {
-            return false;
-        }
-        return saveOrUpdateRecords(lisConfigListVO.getLisConfigList());
-    }
-
-    /**
-     * 批量保存
-     *
-     * @param lisConfigList
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(List<LisConfig> lisConfigList) {
-        if (ListUtil.isEmpty(lisConfigList)) {
-            return false;
-        }
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //数据不完整的不保存
-        //过滤套餐或公表名为空的数据
-        lisConfigList = lisConfigList
-                .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, Map<String, List<Long>>>> configMap
-                = getConfigMapWithIds(Long.valueOf(hospitalId), null, null);
-        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());
-            }
-        });
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-
-        lisConfigService.saveOrUpdateBatch(lisConfigList);
-        return true;
-    }
-
-    /**
-     * 删除记录-单条
-     *
-     * @param idVO
-     * @return
-     */
-    public Boolean deleteRecord(IdVO idVO) {
-        UpdateWrapper<LisConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("id", idVO.getId())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        lisConfigService.removeById(idVO.getId());
-        return true;
-    }
-
-    /**
-     * 删除记录-批量
-     *
-     * @param idListVO
-     * @return
-     */
-    public Boolean deleteRecords(IdListVO idListVO) {
-        if (ListUtil.isEmpty(idListVO.getIds())) {
-            return false;
-        }
-        UpdateWrapper<LisConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.in("id", idListVO.getIds())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        lisConfigService.removeByIds(idListVO.getIds());
-        return true;
-    }
-
-    /**
-     * 分页查询
-     *
-     * @param lisConfigPageVO
-     * @return
-     */
-    public IPage<LisConfig> getPage(LisConfigPageVO lisConfigPageVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        lisConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
-        return lisConfigService.getPage(lisConfigPageVO);
-    }
-
-    /**
-     * 化验数据导入
-     *
-     * @param file
-     */
-    public void importExcel(MultipartFile file) {
-        //从Excel读取数据
-        List<LisConfig> lisConfigList = ExcelUtils.importExcel(file, 0, 1, LisConfig.class);
-        if (ListUtil.isNotEmpty(lisConfigList)) {
-            importExcelRecords(lisConfigList);
-        } else {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param lisConfigList
-     * @return
-     */
-    public Boolean importExcelRecords(List<LisConfig> lisConfigList) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //1、数据完整性校验
-        //2、去除前后空格
-        //过滤空数据,保留重复数据,方便计行
-        lisConfigList = lisConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getHisDetailName())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
-                .collect(Collectors.toList());
-        if (ListUtil.isEmpty(lisConfigList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-        List<String> emptyNumList = Lists.newLinkedList();
-        for (int i = 0; i < lisConfigList.size(); i++) {
-            if (StringUtil.isBlank(lisConfigList.get(i).getHisName())
-                    || StringUtil.isBlank(lisConfigList.get(i).getUniqueName())) {
-                emptyNumList.add(String.valueOf(i + 2));
-            }
-            if (StringUtil.isNotBlank(lisConfigList.get(i).getHisName())) {
-                lisConfigList.get(i).setHisName(lisConfigList.get(i).getHisName().trim());
-            }
-            if (StringUtil.isNotBlank(lisConfigList.get(i).getHisDetailName())) {
-                lisConfigList.get(i).setHisDetailName(lisConfigList.get(i).getHisDetailName().trim());
-            }
-            if (StringUtil.isNotBlank(lisConfigList.get(i).getUniqueName())) {
-                lisConfigList.get(i).setUniqueName(lisConfigList.get(i).getUniqueName().trim());
-            }
-            if (StringUtil.isNotBlank(lisConfigList.get(i).getUniqueCode())) {
-                lisConfigList.get(i).setUniqueCode(lisConfigList.get(i).getUniqueCode().trim());
-            } else {
-                lisConfigList.get(i).setUniqueCode(null);
-            }
-        }
-
-        if (ListUtil.isNotEmpty(emptyNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
-                    + emptyNumList.stream().collect(Collectors.joining("、"))
-                    + "。导入取消,请修改后再试。\n");
-        }
-
-        List<String> hisNames = lisConfigList
-                .stream()
-                .map(i -> i.getHisName())
-                .collect(Collectors.toList());
-        List<String> uniqueNames = lisConfigList
-                .stream()
-                .map(i -> i.getUniqueName())
-                .collect(Collectors.toList());
-
-        // 验证数据是否已存在,已存在的先删除
-        // 没id的删除重新插入,有id的更新
-        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<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));
-            }
-        }
-        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;
-    }
-
-
-    /**
-     * 获取映射关系-id
-     * Map<hisName,Map<hisDetailName,Map<uniqueName,id>>>
-     *
-     * @param hospitalId
-     * @param hisNames
-     * @param uniqueNames
-     * @return
-     */
-    public Map<String, Map<String, Map<String, Long>>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
-        Map<String, Map<String, Map<String, 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, 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())) {
-                        detailNameMap.put(detailEntry.getKey(),
-                                EntityUtil.makeMapWithKeyValue(detailEntry.getValue(), "uniqueName", "id"));
-                    }
-                }
-                retMap.put(entry.getKey(), detailNameMap);
-            }
-        }
-        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;
-    }
-
-
-    /**
-     * 获取映射关系
-     * 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<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>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
-        for (Map.Entry<String, List<LisConfig>> 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<LisConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
-                .orderByDesc("gmt_modified");
-        List<LisConfig> records = lisConfigService.list(queryWrapper);
-        String fileName = "检验映射.xls";
-        ExcelUtils.exportExcel(records, null, "sheet1", LisConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 数据导入模板导出
-     *
-     * @param response
-     */
-    public void exportExcelModule(HttpServletResponse response) {
-        String fileName = "检验映射模板.xls";
-        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", LisConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 化验大项
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<String> getLisPacks(RetrievalVO retrievalVO) {
-        List<LisConfig> records = lisConfigService.getLisPacksIndex(retrievalVO);
-        List<String> lisNames
-                = records.stream().map(r -> r.getHisName()).distinct().collect(Collectors.toList());
-        return lisNames;
-    }
-
-    /**
-     * 化验小项
-     *
-     * @param retrievalVO
-     * @return
-     */
-    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);
-        }
-        return lisDetailNames;
-    }
-}

File diff suppressed because it is too large
+ 1762 - 0
src/main/java/com/diagbot/facade/MappingConfigFacade.java


+ 0 - 491
src/main/java/com/diagbot/facade/OperationConfigFacade.java

@@ -1,491 +0,0 @@
-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.OperationInfoDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.OperationConfig;
-import com.diagbot.enums.ConceptTypeEnum;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.OperationConfigService;
-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.OperationConfigListVO;
-import com.diagbot.vo.OperationConfigPageVO;
-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: 2020/7/29 15:05
- */
-@Component
-public class OperationConfigFacade {
-    @Autowired
-    private OperationConfigService operationConfigService;
-    @Autowired
-    private CdssCoreClient cdssCoreClient;
-
-    /**
-     * 判断是否已存在
-     *
-     * @param operationConfig
-     * @return
-     */
-    public Boolean isExistRecord(OperationConfig operationConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        QueryWrapper<OperationConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", operationConfig.getHisName())
-                .eq("unique_name", operationConfig.getUniqueName());
-        OperationConfig oldRecord = operationConfigService.getOne(queryWrapper, false);
-        if (operationConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (operationConfig.getId() != null
-                && oldRecord != null
-                && !operationConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        return false;
-    }
-
-    /**
-     * 保存记录-单条
-     *
-     * @param operationConfig
-     * @return
-     */
-    public Boolean saveOrUpdateRecord(OperationConfig operationConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-        operationConfig.setHospitalId(Long.valueOf(hospitalId));
-        operationConfig.setModifier(userId);
-        operationConfig.setGmtModified(now);
-        QueryWrapper<OperationConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", operationConfig.getHisName())
-                .eq("unique_name", operationConfig.getUniqueName());
-        OperationConfig oldRecord = operationConfigService.getOne(queryWrapper, false);
-        if (operationConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (operationConfig.getId() != null
-                && oldRecord != null
-                && !operationConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        //新增数据
-        if (operationConfig.getId() == null) {
-            operationConfig.setCreator(userId);
-            operationConfig.setGmtCreate(now);
-        }
-        if (operationConfig.getIsDeleted() == null) {
-            operationConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-        }
-        operationConfigService.saveOrUpdate(operationConfig);
-        return true;
-    }
-
-    /**
-     * 保存记录-批量
-     *
-     * @param operationConfigListVO
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(OperationConfigListVO operationConfigListVO) {
-        if (ListUtil.isEmpty(operationConfigListVO.getOperationConfigList())) {
-            return false;
-        }
-        return saveOrUpdateRecords(operationConfigListVO.getOperationConfigList());
-    }
-
-    /**
-     * 批量保存
-     *
-     * @param operationConfigList
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(List<OperationConfig> operationConfigList) {
-        if (ListUtil.isEmpty(operationConfigList)) {
-            return false;
-        }
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //数据不完整的不保存
-        //过滤外部名称或公表名为空的数据
-        operationConfigList = operationConfigList
-                .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);
-        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);
-            }
-            if (operationConfig.getIsDeleted() == null) {
-                operationConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        operationConfigService.saveOrUpdateBatch(operationConfigList);
-        return true;
-    }
-
-    /**
-     * 删除记录-单条
-     *
-     * @param idVO
-     * @return
-     */
-    public Boolean deleteRecord(IdVO idVO) {
-        UpdateWrapper<OperationConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("id", idVO.getId())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        operationConfigService.removeById(idVO.getId());
-        return true;
-    }
-
-    /**
-     * 删除记录-批量
-     *
-     * @param idListVO
-     * @return
-     */
-    public Boolean deleteRecords(IdListVO idListVO) {
-        if (ListUtil.isEmpty(idListVO.getIds())) {
-            return false;
-        }
-        UpdateWrapper<OperationConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.in("id", idListVO.getIds())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        operationConfigService.removeByIds(idListVO.getIds());
-        return true;
-    }
-
-    /**
-     * 分页查询
-     *
-     * @param operationConfigPageVO
-     * @return
-     */
-    public IPage<OperationConfig> getPage(OperationConfigPageVO operationConfigPageVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        operationConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
-        return operationConfigService.getPage(operationConfigPageVO);
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param file
-     */
-    public void importExcel(MultipartFile file) {
-        List<OperationConfig> operationConfigList = ExcelUtils.importExcel(file, 0, 1, OperationConfig.class);
-        if (ListUtil.isNotEmpty(operationConfigList)) {
-            importExcelRecords(operationConfigList);
-        } else {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param operationConfigList
-     * @return
-     */
-    public Boolean importExcelRecords(List<OperationConfig> operationConfigList) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //1、数据完整性校验
-        //2、去除前后空格
-        //过滤空数据,保留重复数据,方便计行
-        operationConfigList = operationConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
-                .collect(Collectors.toList());
-        if (ListUtil.isEmpty(operationConfigList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-        List<String> emptyNumList = Lists.newLinkedList();
-        for (int i = 0; i < operationConfigList.size(); i++) {
-            if (StringUtil.isBlank(operationConfigList.get(i).getHisName())
-                    || StringUtil.isBlank(operationConfigList.get(i).getUniqueName())) {
-                emptyNumList.add(String.valueOf(i + 2));
-            }
-            if (StringUtil.isNotBlank(operationConfigList.get(i).getHisName())) {
-                operationConfigList.get(i).setHisName(operationConfigList.get(i).getHisName().trim());
-            }
-            if (StringUtil.isNotBlank(operationConfigList.get(i).getUniqueName())) {
-                operationConfigList.get(i).setUniqueName(operationConfigList.get(i).getUniqueName().trim());
-            }
-            if (StringUtil.isNotBlank(operationConfigList.get(i).getUniqueCode())) {
-                operationConfigList.get(i).setUniqueCode(operationConfigList.get(i).getUniqueCode().trim());
-            } else {
-                operationConfigList.get(i).setUniqueCode(null);
-            }
-        }
-
-        if (ListUtil.isNotEmpty(emptyNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
-                    + emptyNumList.stream().collect(Collectors.joining("、"))
-                    + "。导入取消,请修改后再试。\n");
-        }
-
-        // 验证数据是否已存在,已存在的先删除
-        // 没id的删除重新插入,有id的更新
-        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);
-            }
-            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));
-            }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计空行)标准术语在数据库中不存在:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
-
-        //重复数据过滤
-        operationConfigList = operationConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
-
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        operationConfigService.saveOrUpdateBatch(operationConfigList);
-        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<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())) {
-                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<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>>
-     *
-     * @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<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>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
-        for (Map.Entry<String, List<OperationConfig>> 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<OperationConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
-                .orderByDesc("gmt_modified");
-        List<OperationConfig> records = operationConfigService.list(queryWrapper);
-        String fileName = "手术映射.xls";
-        ExcelUtils.exportExcel(records, null, "sheet1", OperationConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 数据导入模板导出
-     *
-     * @param response
-     */
-    public void exportExcelModule(HttpServletResponse response) {
-        String fileName = "手术映射模板.xls";
-        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", OperationConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 手术搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<OperationInfoDTO> getOperations(RetrievalVO retrievalVO) {
-        List<OperationInfoDTO> operationNames = new ArrayList<>();
-        List<OperationConfig> operationConfigList = operationConfigService.getOperationsIndex(retrievalVO);
-        for (OperationConfig operationConfig: operationConfigList){
-            OperationInfoDTO operationInfoDTO = new OperationInfoDTO();
-            operationInfoDTO.setName(operationConfig.getHisName());
-            operationNames.add(operationInfoDTO);
-        }
-        return operationNames;
-    }
-}

+ 0 - 486
src/main/java/com/diagbot/facade/PacsConfigFacade.java

@@ -1,486 +0,0 @@
-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.RespDTO;
-import com.diagbot.entity.PacsConfig;
-import com.diagbot.enums.ConceptTypeEnum;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.PacsConfigService;
-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.PacsConfigListVO;
-import com.diagbot.vo.PacsConfigPageVO;
-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: 2020/7/29 15:03
- */
-@Component
-public class PacsConfigFacade {
-    @Autowired
-    private PacsConfigService pacsConfigService;
-    @Autowired
-    private CdssCoreClient cdssCoreClient;
-
-    /**
-     * 判断是否已存在
-     *
-     * @param pacsConfig
-     * @return
-     */
-    public Boolean isExistRecord(PacsConfig pacsConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", pacsConfig.getHisName())
-                .eq("unique_name", pacsConfig.getUniqueName());
-        PacsConfig oldRecord = pacsConfigService.getOne(queryWrapper, false);
-        if (pacsConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (pacsConfig.getId() != null
-                && oldRecord != null
-                && !pacsConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        return false;
-    }
-
-    /**
-     * 保存记录-单条
-     *
-     * @param pacsConfig
-     * @return
-     */
-    public Boolean saveOrUpdateRecord(PacsConfig pacsConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-        pacsConfig.setHospitalId(Long.valueOf(hospitalId));
-        pacsConfig.setModifier(userId);
-        pacsConfig.setGmtModified(now);
-        QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", pacsConfig.getHisName())
-                .eq("unique_name", pacsConfig.getUniqueName());
-        PacsConfig oldRecord = pacsConfigService.getOne(queryWrapper, false);
-        if (pacsConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (pacsConfig.getId() != null
-                && oldRecord != null
-                && !pacsConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        //新增数据
-        if (pacsConfig.getId() == null) {
-            pacsConfig.setCreator(userId);
-            pacsConfig.setGmtCreate(now);
-        }
-        if (pacsConfig.getIsDeleted() == null) {
-            pacsConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-        }
-        pacsConfigService.saveOrUpdate(pacsConfig);
-        return true;
-    }
-
-    /**
-     * 保存记录-批量
-     *
-     * @param pacsConfigListVO
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(PacsConfigListVO pacsConfigListVO) {
-        if (ListUtil.isEmpty(pacsConfigListVO.getPacsConfigList())) {
-            return false;
-        }
-        return saveOrUpdateRecords(pacsConfigListVO.getPacsConfigList());
-    }
-
-    /**
-     * 批量保存
-     *
-     * @param pacsConfigList
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(List<PacsConfig> pacsConfigList) {
-        if (ListUtil.isEmpty(pacsConfigList)) {
-            return false;
-        }
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //数据不完整的不保存
-        //过滤外部名称或公表名为空的数据
-        pacsConfigList = pacsConfigList
-                .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);
-        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);
-            }
-            if (pacsConfig.getIsDeleted() == null) {
-                pacsConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        pacsConfigService.saveOrUpdateBatch(pacsConfigList);
-        return true;
-    }
-
-    /**
-     * 删除记录-单条
-     *
-     * @param idVO
-     * @return
-     */
-    public Boolean deleteRecord(IdVO idVO) {
-        UpdateWrapper<PacsConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("id", idVO.getId())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        pacsConfigService.removeById(idVO.getId());
-        return true;
-    }
-
-    /**
-     * 删除记录-批量
-     *
-     * @param idListVO
-     * @return
-     */
-    public Boolean deleteRecords(IdListVO idListVO) {
-        if (ListUtil.isEmpty(idListVO.getIds())) {
-            return false;
-        }
-        UpdateWrapper<PacsConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.in("id", idListVO.getIds())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        pacsConfigService.removeByIds(idListVO.getIds());
-        return true;
-    }
-
-    /**
-     * 分页查询
-     *
-     * @param pacsConfigPageVO
-     * @return
-     */
-    public IPage<PacsConfig> getPage(PacsConfigPageVO pacsConfigPageVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        pacsConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
-        return pacsConfigService.getPage(pacsConfigPageVO);
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param file
-     */
-    public void importExcel(MultipartFile file) {
-        List<PacsConfig> pacsConfigList = ExcelUtils.importExcel(file, 0, 1, PacsConfig.class);
-        if (ListUtil.isNotEmpty(pacsConfigList)) {
-            importExcelRecords(pacsConfigList);
-        } else {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param pacsConfigList
-     * @return
-     */
-    public Boolean importExcelRecords(List<PacsConfig> pacsConfigList) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //1、数据完整性校验
-        //2、去除前后空格
-        //过滤空数据,保留重复数据,方便计行
-        pacsConfigList = pacsConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
-                .collect(Collectors.toList());
-        if (ListUtil.isEmpty(pacsConfigList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-        List<String> emptyNumList = Lists.newLinkedList();
-        for (int i = 0; i < pacsConfigList.size(); i++) {
-            if (StringUtil.isBlank(pacsConfigList.get(i).getHisName())
-                    || StringUtil.isBlank(pacsConfigList.get(i).getUniqueName())) {
-                emptyNumList.add(String.valueOf(i + 2));
-            }
-            if (StringUtil.isNotBlank(pacsConfigList.get(i).getHisName())) {
-                pacsConfigList.get(i).setHisName(pacsConfigList.get(i).getHisName().trim());
-            }
-            if (StringUtil.isNotBlank(pacsConfigList.get(i).getUniqueName())) {
-                pacsConfigList.get(i).setUniqueName(pacsConfigList.get(i).getUniqueName().trim());
-            }
-            if (StringUtil.isNotBlank(pacsConfigList.get(i).getUniqueCode())) {
-                pacsConfigList.get(i).setUniqueCode(pacsConfigList.get(i).getUniqueCode().trim());
-            } else {
-                pacsConfigList.get(i).setUniqueCode(null);
-            }
-        }
-
-        if (ListUtil.isNotEmpty(emptyNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
-                    + emptyNumList.stream().collect(Collectors.joining("、"))
-                    + "。导入取消,请修改后再试。\n");
-        }
-
-        // 验证数据是否已存在,已存在的先删除
-        // 没id的删除重新插入,有id的更新
-        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);
-            }
-            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));
-            }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计空行)标准术语在数据库中不存在:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
-
-        //重复数据过滤
-        pacsConfigList = pacsConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
-
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        pacsConfigService.saveOrUpdateBatch(pacsConfigList);
-        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<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())) {
-                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<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>>
-     *
-     * @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<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>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
-        for (Map.Entry<String, List<PacsConfig>> 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<PacsConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
-                .orderByDesc("gmt_modified");
-        List<PacsConfig> records = pacsConfigService.list(queryWrapper);
-        String fileName = "检查映射.xls";
-        ExcelUtils.exportExcel(records, null, "sheet1", PacsConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 数据导入模板导出
-     *
-     * @param response
-     */
-    public void exportExcelModule(HttpServletResponse response) {
-        String fileName = "检查映射模板.xls";
-        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", PacsConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 辅检
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<String> getPACSs(RetrievalVO retrievalVO) {
-        List<PacsConfig> records = pacsConfigService.getPACSsIndex(retrievalVO);
-        List<String> pacsNames
-                = records.stream().map(r -> r.getHisName()).distinct().collect(Collectors.toList());
-        return pacsNames;
-    }
-}

+ 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();

+ 66 - 16
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,18 +11,17 @@ 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;
 import com.diagbot.vo.SearchData;
 import com.google.common.collect.Lists;
-import org.apache.commons.collections4.ListUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -44,8 +45,6 @@ public class PushFacade {
     @Autowired
     private CdssCoreClient cdssCoreClient;
     @Autowired
-    private ConceptInfoFacade conceptInfoFacade;
-    @Autowired
     private DictionaryFacade dictionaryFacade;
     @Autowired
     MrFacade mrFacade;
@@ -149,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());
@@ -171,16 +168,31 @@ 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;
+            }
+            //1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作、8-量表、9-护理、10-政策法规
+            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())) {
                         entry.getValue().forEach(item -> {
+                            item.setType(1);
                             if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get("1"))) {
                                 item.setHasInfo(1);
                             }
@@ -190,6 +202,7 @@ public class PushFacade {
             }
             if (ListUtil.isNotEmpty(pushDTO.getLis())) {
                 pushDTO.getLis().forEach(item -> {
+                    item.setType(3);
                     if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get("3"))) {
                         item.setHasInfo(1);
                     }
@@ -197,18 +210,15 @@ public class PushFacade {
             }
             if (ListUtil.isNotEmpty(pushDTO.getPacs())) {
                 pushDTO.getPacs().forEach(item -> {
+                    item.setType(5);
                     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())) {
                 pushDTO.getMedicines().forEach(item -> {
+                    item.setType(2);
                     if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get("2"))) {
                         item.setHasInfo(1);
                     }
@@ -216,11 +226,46 @@ public class PushFacade {
             }
             if (ListUtil.isNotEmpty(pushDTO.getOperations())) {
                 pushDTO.getOperations().forEach(item -> {
+                    item.setType(7);
                     if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get("7"))) {
                         item.setHasInfo(1);
                     }
                 });
             }
+            if (ListUtil.isNotEmpty(pushDTO.getScale())) {
+                pushDTO.getScale().forEach(item -> {
+                    item.setType(8);
+                    if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get("8"))) {
+                        item.setHasInfo(1);
+                    }
+                });
+            }
+            if (ListUtil.isNotEmpty(pushDTO.getNurse())) {
+                pushDTO.getNurse().forEach(item -> {
+                    item.setType(9);
+                    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;
     }
@@ -238,14 +283,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;
             }
@@ -253,7 +303,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"))

+ 21 - 28
src/main/java/com/diagbot/facade/RetrievalFacade.java

@@ -2,6 +2,7 @@ package com.diagbot.facade;
 
 import com.diagbot.client.CdssCoreClient;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.RetrievalConceptDTO;
 import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -12,6 +13,9 @@ import com.diagbot.vo.RetrievalVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @Description:
  * @Author:zhaops
@@ -24,19 +28,7 @@ public class RetrievalFacade {
     @Autowired
     private HospitalInfoFacade hospitalInfoFacade;
     @Autowired
-    private LisConfigFacade lisConfigFacade;
-    @Autowired
-    private PacsConfigFacade pacsConfigFacade;
-    @Autowired
-    private DiseaseConfigFacade diseaseConfigFacade;
-    @Autowired
-    private DrugConfigFacade drugConfigFacade;
-    @Autowired
-    private OperationConfigFacade operationConfigFacade;
-    @Autowired
-    private DeptConfigFacade deptConfigFacade;
-    @Autowired
-    private TransfusionConfigFacade transfusionConfigFacade;
+    private MappingConfigFacade mappingConfigFacade;
 
     /**
      * 检索
@@ -64,30 +56,31 @@ public class RetrievalFacade {
                 throw new CommonException(CommonErrorCode.NOT_EXISTS, "该医院ID不存在或者未启用!");
             } else {
                 switch (retrievalVO.getType()) {
-                    case 1:
-                        retrievalDTO.setLisNames(lisConfigFacade.getLisPacks(retrievalVO));
-                        break;
                     case 2:
-                        retrievalDTO.setLisDetailNames(lisConfigFacade.getLis(retrievalVO));
+                        retrievalDTO.setLisDetailNames(mappingConfigFacade.getHisDetailNames(retrievalVO));
                         break;
+                    case 1:
                     case 3:
-                        retrievalDTO.setPacsNames(pacsConfigFacade.getPACSs(retrievalVO));
-                        break;
                     case 4:
-                        retrievalDTO.setDiseaseNames(diseaseConfigFacade.getDiseases(retrievalVO));
-                        break;
                     case 5:
-                        retrievalDTO.setDrugNames(drugConfigFacade.getMedicines(retrievalVO));
-                        break;
                     case 6:
-                        retrievalDTO.setOperationNames(operationConfigFacade.getOperations(retrievalVO));
-                        break;
                     case 7:
-                        retrievalDTO.setDeptNames(deptConfigFacade.getDepts(retrievalVO));
-                        break;
                     case 8:
-                        retrievalDTO.setTransfusionNames(transfusionConfigFacade.getTransfusion(retrievalVO));
+                    case 10:
+                    case 11:
+                    case 12:
+                    case 13:
+                    case 14:
+                        List<RetrievalConceptDTO> hisNameList = new ArrayList<>();
+                        List<String> hisNames = mappingConfigFacade.getHisNames(retrievalVO);
+                        for (String str : hisNames) {
+                            RetrievalConceptDTO data = new RetrievalConceptDTO();
+                            data.setName(str);
+                            hisNameList.add(data);
+                        }
+                        retrievalDTO.setNameList(hisNameList);
                         break;
+
                 }
             }
         }

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

@@ -0,0 +1,28 @@
+package com.diagbot.facade;
+
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.TermConceptDTO;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.TermMatchingVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-06-15 16:46
+ */
+@Component
+public class TermMatchingFacade {
+    @Autowired
+    CdssCoreClient cdssCoreClient;
+
+    public List<TermConceptDTO> getTermMatchingAll(TermMatchingVO termMatchingVO) {
+        RespDTO<List<TermConceptDTO>> termMatching = cdssCoreClient.getTermMatching(termMatchingVO);
+        RespDTOUtil.respNGDealCover(termMatching, "术语匹配搜索失败");
+        return termMatching.data;
+    }
+}

+ 0 - 486
src/main/java/com/diagbot/facade/TransfusionConfigFacade.java

@@ -1,486 +0,0 @@
-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.RespDTO;
-import com.diagbot.entity.TransfusionConfig;
-import com.diagbot.enums.ConceptTypeEnum;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.TransfusionConfigService;
-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.TransfusionConfigListVO;
-import com.diagbot.vo.TransfusionConfigPageVO;
-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: 2020/8/31 11:03
- */
-@Component
-public class TransfusionConfigFacade {
-    @Autowired
-    private TransfusionConfigService transfusionConfigService;
-    @Autowired
-    private CdssCoreClient cdssCoreClient;
-
-    /**
-     * 判断是否已存在
-     *
-     * @param transfusionConfig
-     * @return
-     */
-    public Boolean isExistRecord(TransfusionConfig transfusionConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        QueryWrapper<TransfusionConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", transfusionConfig.getHisName())
-                .eq("unique_name", transfusionConfig.getUniqueName());
-        TransfusionConfig oldRecord = transfusionConfigService.getOne(queryWrapper, false);
-        if (transfusionConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (transfusionConfig.getId() != null
-                && oldRecord != null
-                && !transfusionConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        return false;
-    }
-
-    /**
-     * 保存记录-单条
-     *
-     * @param transfusionConfig
-     * @return
-     */
-    public Boolean saveOrUpdateRecord(TransfusionConfig transfusionConfig) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-        transfusionConfig.setHospitalId(Long.valueOf(hospitalId));
-        transfusionConfig.setModifier(userId);
-        transfusionConfig.setGmtModified(now);
-        QueryWrapper<TransfusionConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", Long.valueOf(hospitalId))
-                .eq("his_name", transfusionConfig.getHisName())
-                .eq("unique_name", transfusionConfig.getUniqueName());
-        TransfusionConfig oldRecord = transfusionConfigService.getOne(queryWrapper, false);
-        if (transfusionConfig.getId() == null
-                && oldRecord != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        if (transfusionConfig.getId() != null
-                && oldRecord != null
-                && !transfusionConfig.getId().equals(oldRecord.getId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
-        }
-        //新增数据
-        if (transfusionConfig.getId() == null) {
-            transfusionConfig.setCreator(userId);
-            transfusionConfig.setGmtCreate(now);
-        }
-        if (transfusionConfig.getIsDeleted() == null) {
-            transfusionConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-        }
-        transfusionConfigService.saveOrUpdate(transfusionConfig);
-        return true;
-    }
-
-    /**
-     * 保存记录-批量
-     *
-     * @param transfusionConfigListVO
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(TransfusionConfigListVO transfusionConfigListVO) {
-        if (ListUtil.isEmpty(transfusionConfigListVO.getTransfusionConfigList())) {
-            return false;
-        }
-        return saveOrUpdateRecords(transfusionConfigListVO.getTransfusionConfigList());
-    }
-
-    /**
-     * 批量保存
-     *
-     * @param transfusionConfigList
-     * @return
-     */
-    public Boolean saveOrUpdateRecords(List<TransfusionConfig> transfusionConfigList) {
-        if (ListUtil.isEmpty(transfusionConfigList)) {
-            return false;
-        }
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //数据不完整的不保存
-        //过滤外部名称或公表名为空的数据
-        transfusionConfigList = transfusionConfigList
-                .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);
-        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);
-            }
-            if (transfusionConfig.getIsDeleted() == null) {
-                transfusionConfig.setIsDeleted(IsDeleteEnum.N.getKey());
-            }
-        });
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        transfusionConfigService.saveOrUpdateBatch(transfusionConfigList);
-        return true;
-    }
-
-    /**
-     * 删除记录-单条
-     *
-     * @param idVO
-     * @return
-     */
-    public Boolean deleteRecord(IdVO idVO) {
-        UpdateWrapper<TransfusionConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("id", idVO.getId())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        transfusionConfigService.removeById(idVO.getId());
-        return true;
-    }
-
-    /**
-     * 删除记录-批量
-     *
-     * @param idListVO
-     * @return
-     */
-    public Boolean deleteRecords(IdListVO idListVO) {
-        if (ListUtil.isEmpty(idListVO.getIds())) {
-            return false;
-        }
-        UpdateWrapper<TransfusionConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.in("id", idListVO.getIds())
-                .set("is_deleted", IsDeleteEnum.Y.getKey());
-        transfusionConfigService.removeByIds(idListVO.getIds());
-        return true;
-    }
-
-    /**
-     * 分页查询
-     *
-     * @param transfusionConfigPageVO
-     * @return
-     */
-    public IPage<TransfusionConfig> getPage(TransfusionConfigPageVO transfusionConfigPageVO) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        transfusionConfigPageVO.setHospitalId(Long.valueOf(hospitalId));
-        return transfusionConfigService.getPage(transfusionConfigPageVO);
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param file
-     */
-    public void importExcel(MultipartFile file) {
-        List<TransfusionConfig> transfusionConfigList = ExcelUtils.importExcel(file, 0, 1, TransfusionConfig.class);
-        if (ListUtil.isNotEmpty(transfusionConfigList)) {
-            importExcelRecords(transfusionConfigList);
-        } else {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-    }
-
-    /**
-     * 数据导入
-     *
-     * @param transfusionConfigList
-     * @return
-     */
-    public Boolean importExcelRecords(List<TransfusionConfig> transfusionConfigList) {
-        String hospitalId = SysUserUtils.getCurrentHospitalID();
-        String userId = SysUserUtils.getCurrentPrincipleID();
-        Date now = DateUtil.now();
-
-        //1、数据完整性校验
-        //2、去除前后空格
-        //过滤空数据,保留重复数据,方便计行
-        transfusionConfigList = transfusionConfigList.stream()
-                .filter(i -> StringUtil.isNotBlank(i.getHisName())
-                        || StringUtil.isNotBlank(i.getUniqueCode())
-                        || StringUtil.isNotBlank(i.getUniqueName()))
-                .collect(Collectors.toList());
-        if (ListUtil.isEmpty(transfusionConfigList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
-        }
-        List<String> emptyNumList = Lists.newLinkedList();
-        for (int i = 0; i < transfusionConfigList.size(); i++) {
-            if (StringUtil.isBlank(transfusionConfigList.get(i).getHisName())
-                    || StringUtil.isBlank(transfusionConfigList.get(i).getUniqueName())) {
-                emptyNumList.add(String.valueOf(i + 2));
-            }
-            if (StringUtil.isNotBlank(transfusionConfigList.get(i).getHisName())) {
-                transfusionConfigList.get(i).setHisName(transfusionConfigList.get(i).getHisName().trim());
-            }
-            if (StringUtil.isNotBlank(transfusionConfigList.get(i).getUniqueName())) {
-                transfusionConfigList.get(i).setUniqueName(transfusionConfigList.get(i).getUniqueName().trim());
-            }
-            if (StringUtil.isNotBlank(transfusionConfigList.get(i).getUniqueCode())) {
-                transfusionConfigList.get(i).setUniqueCode(transfusionConfigList.get(i).getUniqueCode().trim());
-            } else {
-                transfusionConfigList.get(i).setUniqueCode(null);
-            }
-        }
-
-        if (ListUtil.isNotEmpty(emptyNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
-                    + emptyNumList.stream().collect(Collectors.joining("、"))
-                    + "。导入取消,请修改后再试。\n");
-        }
-
-        // 验证数据是否已存在,已存在的先删除
-        // 没id的删除重新插入,有id的更新
-        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);
-            }
-            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));
-            }
-        }
-        if (ListUtil.isNotEmpty(errorNumList)) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "以下行数(不计空行)标准术语在数据库中不存在:"
-                            + errorNumList.stream().collect(Collectors.joining("、"))
-                            + "。导入取消,请修改后再试。");
-        }
-
-        //重复数据过滤
-        transfusionConfigList = transfusionConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
-
-        //删除已存在映射关系
-        IdListVO idListVO = new IdListVO();
-        idListVO.setIds(deleteIds);
-        deleteRecords(idListVO);
-        transfusionConfigService.saveOrUpdateBatch(transfusionConfigList);
-        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<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())) {
-                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<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>>
-     *
-     * @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<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>> uniqueNameMap = EntityUtil.makeEntityListMap(records, "uniqueName");
-        for (Map.Entry<String, List<TransfusionConfig>> 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<TransfusionConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
-                .orderByDesc("gmt_modified");
-        List<TransfusionConfig> records = transfusionConfigService.list(queryWrapper);
-        String fileName = "输血映射.xls";
-        ExcelUtils.exportExcel(records, null, "sheet1", TransfusionConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 数据导入模板导出
-     *
-     * @param response
-     */
-    public void exportExcelModule(HttpServletResponse response) {
-        String fileName = "输血映射模板.xls";
-        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", TransfusionConfig.class, fileName, response, 12.8f);
-    }
-
-    /**
-     * 输血搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<String> getTransfusion(RetrievalVO retrievalVO) {
-        List<TransfusionConfig> records = transfusionConfigService.getTransfusionIndex(retrievalVO);
-        List<String> transfusionNames
-                = records.stream().map(r -> r.getHisName()).distinct().collect(Collectors.toList());
-        return transfusionNames;
-    }
-}

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

@@ -1,37 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.DeptConfig;
-import com.diagbot.entity.DrugConfig;
-import com.diagbot.vo.DeptConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 科室映射表 Mapper 接口
- * </p>
- *
- * @author zhaops
- * @since 2020-08-12
- */
-public interface DeptConfigMapper extends BaseMapper<DeptConfig> {
-    /**
-     * 分页查询
-     *
-     * @param deptConfigPageVO
-     * @return
-     */
-    IPage<DeptConfig> getPage(@Param("deptConfigPageVO") DeptConfigPageVO deptConfigPageVO);
-
-    /**
-     * 科室搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<DeptConfig> getDeptsIndex (RetrievalVO retrievalVO);
-}

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

@@ -1,38 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.DiseaseConfig;
-import com.diagbot.entity.PacsConfig;
-import com.diagbot.vo.DiseaseConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 诊断映射表 Mapper 接口
- * </p>
- *
- * @author zhaops
- * @since 2020-07-28
- */
-public interface DiseaseConfigMapper extends BaseMapper<DiseaseConfig> {
-
-    /**
-     * 分页查询
-     *
-     * @param diseaseConfigPageVO
-     * @return
-     */
-    IPage<DiseaseConfig> getPage(@Param("diseaseConfigPageVO") DiseaseConfigPageVO diseaseConfigPageVO);
-
-    /**
-     * 疾病搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<DiseaseConfig> getDiseasesIndex (RetrievalVO retrievalVO);
-}

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

@@ -1,37 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.DiseaseConfig;
-import com.diagbot.entity.DrugConfig;
-import com.diagbot.vo.DrugConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 药品映射表 Mapper 接口
- * </p>
- *
- * @author zhaops
- * @since 2020-07-28
- */
-public interface DrugConfigMapper extends BaseMapper<DrugConfig> {
-    /**
-     * 分页查询
-     *
-     * @param drugConfigPageVO
-     * @return
-     */
-    IPage<DrugConfig> getPage(@Param("drugConfigPageVO") DrugConfigPageVO drugConfigPageVO);
-
-    /**
-     * 药品搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<DrugConfig> getMedicinesIndex (RetrievalVO retrievalVO);
-}

+ 0 - 45
src/main/java/com/diagbot/mapper/LisConfigMapper.java

@@ -1,45 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.LisConfig;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.diagbot.vo.LisConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 化验公表映射 Mapper 接口
- * </p>
- *
- * @author zhaops
- * @since 2020-07-28
- */
-public interface LisConfigMapper extends BaseMapper<LisConfig> {
-
-    /**
-     * 分页查询
-     *
-     * @param lisConfigPageVO
-     * @return
-     */
-    IPage<LisConfig> getPage(@Param("lisConfigPageVO") LisConfigPageVO lisConfigPageVO);
-
-    /**
-     * 化验大项
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<LisConfig> getLisPacksIndex (RetrievalVO retrievalVO);
-
-    /**
-     * 化验小项
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<LisConfig> getLisIndex (RetrievalVO retrievalVO);
-}

+ 45 - 0
src/main/java/com/diagbot/mapper/MappingConfigMapper.java

@@ -0,0 +1,45 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.entity.wrapper.MappingConfigWrapper;
+import com.diagbot.vo.MappingConfigPageVO;
+import com.diagbot.vo.RetrievalVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 医学术语映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-06-09
+ */
+public interface MappingConfigMapper extends BaseMapper<MappingConfig> {
+    /**
+     * 分页查询
+     *
+     * @param mappingConfigPageVO
+     * @return
+     */
+    IPage<MappingConfigWrapper> getPage(@Param("mappingConfigPageVO") MappingConfigPageVO mappingConfigPageVO);
+
+    /**
+     * 医院术语检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    List<MappingConfig> hisNameIndex(RetrievalVO retrievalVO);
+
+    /**
+     * 医院术语-细项检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    List<MappingConfig> hisDetailNameIndex(RetrievalVO retrievalVO);
+}

+ 0 - 36
src/main/java/com/diagbot/mapper/OperationConfigMapper.java

@@ -1,36 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.OperationConfig;
-import com.diagbot.vo.OperationConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 手术映射表 Mapper 接口
- * </p>
- *
- * @author zhaops
- * @since 2020-07-28
- */
-public interface OperationConfigMapper extends BaseMapper<OperationConfig> {
-    /**
-     * 分页查询
-     *
-     * @param operationConfigPageVO
-     * @return
-     */
-    IPage<OperationConfig> getPage(@Param("operationConfigPageVO") OperationConfigPageVO operationConfigPageVO);
-
-    /**
-     * 手术搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<OperationConfig> getOperationsIndex(RetrievalVO retrievalVO);
-}

+ 0 - 36
src/main/java/com/diagbot/mapper/PacsConfigMapper.java

@@ -1,36 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.PacsConfig;
-import com.diagbot.vo.PacsConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 检查公表映射 Mapper 接口
- * </p>
- *
- * @author zhaops
- * @since 2020-07-28
- */
-public interface PacsConfigMapper extends BaseMapper<PacsConfig> {
-    /**
-     * 分页查询
-     *
-     * @param pacsConfigPageVO
-     * @return
-     */
-    IPage<PacsConfig> getPage(@Param("pacsConfigPageVO") PacsConfigPageVO pacsConfigPageVO);
-
-    /**
-     * 辅检
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<PacsConfig> getPACSsIndex (RetrievalVO retrievalVO);
-}

+ 0 - 36
src/main/java/com/diagbot/mapper/TransfusionConfigMapper.java

@@ -1,36 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.TransfusionConfig;
-import com.diagbot.vo.RetrievalVO;
-import com.diagbot.vo.TransfusionConfigPageVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 输血映射表 Mapper 接口
- * </p>
- *
- * @author zhaops
- * @since 2020-08-31
- */
-public interface TransfusionConfigMapper extends BaseMapper<TransfusionConfig> {
-    /**
-     * 分页查询
-     *
-     * @param transfusionConfigPageVO
-     * @return
-     */
-    IPage<TransfusionConfig> getPage(@Param("transfusionConfigPageVO") TransfusionConfigPageVO transfusionConfigPageVO);
-
-    /**
-     * 输血搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<TransfusionConfig> getTransfusionIndex(RetrievalVO retrievalVO);
-}

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

@@ -1,36 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.DeptConfig;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.vo.DeptConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 科室映射表 服务类
- * </p>
- *
- * @author zhaops
- * @since 2020-08-12
- */
-public interface DeptConfigService extends IService<DeptConfig> {
-    /**
-     * 分页查询
-     *
-     * @param deptConfigPageVO
-     * @return
-     */
-    IPage<DeptConfig> getPage(@Param("deptConfigPageVO") DeptConfigPageVO deptConfigPageVO);
-
-    /**
-     * 科室搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<DeptConfig> getDeptsIndex (RetrievalVO retrievalVO);
-}

+ 0 - 37
src/main/java/com/diagbot/service/DiseaseConfigService.java

@@ -1,37 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.DiseaseConfig;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.PacsConfig;
-import com.diagbot.vo.DiseaseConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 诊断映射表 服务类
- * </p>
- *
- * @author zhaops
- * @since 2020-07-28
- */
-public interface DiseaseConfigService extends IService<DiseaseConfig> {
-    /**
-     * 分页查询
-     *
-     * @param diseaseConfigPageVO
-     * @return
-     */
-    IPage<DiseaseConfig> getPage(@Param("diseaseConfigPageVO") DiseaseConfigPageVO diseaseConfigPageVO);
-
-    /**
-     * 疾病搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<DiseaseConfig> getDiseasesIndex (RetrievalVO retrievalVO);
-}

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

@@ -1,36 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.DrugConfig;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.vo.DrugConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 药品映射表 服务类
- * </p>
- *
- * @author zhaops
- * @since 2020-07-28
- */
-public interface DrugConfigService extends IService<DrugConfig> {
-    /**
-     * 分页查询
-     *
-     * @param drugConfigPageVO
-     * @return
-     */
-    IPage<DrugConfig> getPage(@Param("drugConfigPageVO") DrugConfigPageVO drugConfigPageVO);
-
-    /**
-     * 药品搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<DrugConfig> getMedicinesIndex (RetrievalVO retrievalVO);
-}

+ 0 - 43
src/main/java/com/diagbot/service/LisConfigService.java

@@ -1,43 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.LisConfig;
-import com.diagbot.vo.LisConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 化验公表映射 服务类
- * </p>
- *
- * @author zhaops
- * @since 2020-07-28
- */
-public interface LisConfigService extends IService<LisConfig> {
-
-    /**
-     * 分页查询
-     *
-     * @param lisConfigPageVO
-     * @return
-     */
-    IPage<LisConfig> getPage(@Param("lisConfigPageVO") LisConfigPageVO lisConfigPageVO);
-
-    /**
-     * 化验大项
-     * @param retrievalVO
-     * @return
-     */
-    List<LisConfig> getLisPacksIndex (RetrievalVO retrievalVO);
-
-    /**
-     * 化验小项
-     * @param retrievalVO
-     * @return
-     */
-    List<LisConfig> getLisIndex (RetrievalVO retrievalVO);
-}

+ 45 - 0
src/main/java/com/diagbot/service/MappingConfigService.java

@@ -0,0 +1,45 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.entity.wrapper.MappingConfigWrapper;
+import com.diagbot.vo.MappingConfigPageVO;
+import com.diagbot.vo.RetrievalVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 医学术语映射表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-06-09
+ */
+public interface MappingConfigService extends IService<MappingConfig> {
+    /**
+     * 分页查询
+     *
+     * @param mappingConfigPageVO
+     * @return
+     */
+    IPage<MappingConfigWrapper> getPage(@Param("mappingConfigPageVO") MappingConfigPageVO mappingConfigPageVO);
+
+    /**
+     * 医院术语检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    List<MappingConfig> hisNameIndex(RetrievalVO retrievalVO);
+
+    /**
+     * 医院术语-细项检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    List<MappingConfig> hisDetailNameIndex(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);
+
     /**
      * 删除病历信息
      */

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

@@ -1,36 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.OperationConfig;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.vo.OperationConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 手术映射表 服务类
- * </p>
- *
- * @author zhaops
- * @since 2020-07-28
- */
-public interface OperationConfigService extends IService<OperationConfig> {
-    /**
-     * 分页查询
-     *
-     * @param operationConfigPageVO
-     * @return
-     */
-    IPage<OperationConfig> getPage(@Param("operationConfigPageVO") OperationConfigPageVO operationConfigPageVO);
-
-    /**
-     * 手术搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<OperationConfig> getOperationsIndex(RetrievalVO retrievalVO);
-}

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

@@ -1,36 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.PacsConfig;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.vo.PacsConfigPageVO;
-import com.diagbot.vo.RetrievalVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 检查公表映射 服务类
- * </p>
- *
- * @author zhaops
- * @since 2020-07-28
- */
-public interface PacsConfigService extends IService<PacsConfig> {
-    /**
-     * 分页查询
-     *
-     * @param pacsConfigPageVO
-     * @return
-     */
-    IPage<PacsConfig> getPage(@Param("pacsConfigPageVO") PacsConfigPageVO pacsConfigPageVO);
-
-    /**
-     * 辅检
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<PacsConfig> getPACSsIndex (RetrievalVO retrievalVO);
-}

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

@@ -1,36 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.TransfusionConfig;
-import com.diagbot.vo.RetrievalVO;
-import com.diagbot.vo.TransfusionConfigPageVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 输血映射表 服务类
- * </p>
- *
- * @author zhaops
- * @since 2020-08-31
- */
-public interface TransfusionConfigService extends IService<TransfusionConfig> {
-    /**
-     * 分页查询
-     *
-     * @param transfusionConfigPageVO
-     * @return
-     */
-    IPage<TransfusionConfig> getPage(@Param("transfusionConfigPageVO") TransfusionConfigPageVO transfusionConfigPageVO);
-
-    /**
-     * 输血搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    List<TransfusionConfig> getTransfusionIndex(RetrievalVO retrievalVO);
-}

+ 0 - 44
src/main/java/com/diagbot/service/impl/DeptConfigServiceImpl.java

@@ -1,44 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.entity.DeptConfig;
-import com.diagbot.mapper.DeptConfigMapper;
-import com.diagbot.service.DeptConfigService;
-import com.diagbot.vo.DeptConfigPageVO;
-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 2020-08-12
- */
-@Service
-public class DeptConfigServiceImpl extends ServiceImpl<DeptConfigMapper, DeptConfig> implements DeptConfigService {
-    /**
-     * 分页查询
-     *
-     * @param deptConfigPageVO
-     * @return
-     */
-    public IPage<DeptConfig> getPage(@Param("deptConfigPageVO") DeptConfigPageVO deptConfigPageVO) {
-        return baseMapper.getPage(deptConfigPageVO);
-    }
-
-    /**
-     * 科室搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<DeptConfig> getDeptsIndex(RetrievalVO retrievalVO) {
-        return baseMapper.getDeptsIndex(retrievalVO);
-    }
-}

+ 0 - 44
src/main/java/com/diagbot/service/impl/DiseaseConfigServiceImpl.java

@@ -1,44 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.entity.DiseaseConfig;
-import com.diagbot.mapper.DiseaseConfigMapper;
-import com.diagbot.service.DiseaseConfigService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.vo.DiseaseConfigPageVO;
-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 2020-07-28
- */
-@Service
-public class DiseaseConfigServiceImpl extends ServiceImpl<DiseaseConfigMapper, DiseaseConfig> implements DiseaseConfigService {
-    /**
-     * 分页查询
-     *
-     * @param diseaseConfigPageVO
-     * @return
-     */
-    public IPage<DiseaseConfig> getPage(@Param("diseaseConfigPageVO") DiseaseConfigPageVO diseaseConfigPageVO){
-        return baseMapper.getPage(diseaseConfigPageVO);
-    }
-
-    /**
-     * 疾病搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<DiseaseConfig> getDiseasesIndex (RetrievalVO retrievalVO){
-        return baseMapper.getDiseasesIndex(retrievalVO);
-    }
-}

+ 0 - 44
src/main/java/com/diagbot/service/impl/DrugConfigServiceImpl.java

@@ -1,44 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.entity.DrugConfig;
-import com.diagbot.mapper.DrugConfigMapper;
-import com.diagbot.service.DrugConfigService;
-import com.diagbot.vo.DrugConfigPageVO;
-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 2020-07-28
- */
-@Service
-public class DrugConfigServiceImpl extends ServiceImpl<DrugConfigMapper, DrugConfig> implements DrugConfigService {
-    /**
-     * 分页查询
-     *
-     * @param drugConfigPageVO
-     * @return
-     */
-    public IPage<DrugConfig> getPage(@Param("drugConfigPageVO") DrugConfigPageVO drugConfigPageVO) {
-        return baseMapper.getPage(drugConfigPageVO);
-    }
-
-    /**
-     * 药品搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<DrugConfig> getMedicinesIndex(RetrievalVO retrievalVO) {
-        return baseMapper.getMedicinesIndex(retrievalVO);
-    }
-}

+ 0 - 54
src/main/java/com/diagbot/service/impl/LisConfigServiceImpl.java

@@ -1,54 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.entity.LisConfig;
-import com.diagbot.mapper.LisConfigMapper;
-import com.diagbot.service.LisConfigService;
-import com.diagbot.vo.LisConfigPageVO;
-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 2020-07-28
- */
-@Service
-public class LisConfigServiceImpl extends ServiceImpl<LisConfigMapper, LisConfig> implements LisConfigService {
-    /**
-     * 分页查询
-     *
-     * @param lisConfigPageVO
-     * @return
-     */
-    public IPage<LisConfig> getPage(@Param("lisConfigPageVO") LisConfigPageVO lisConfigPageVO) {
-        return baseMapper.getPage(lisConfigPageVO);
-    }
-
-    /**
-     * 化验大项
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<LisConfig> getLisPacksIndex(RetrievalVO retrievalVO) {
-        return baseMapper.getLisPacksIndex(retrievalVO);
-    }
-
-    /**
-     * 化验小项
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<LisConfig> getLisIndex(RetrievalVO retrievalVO) {
-        return baseMapper.getLisIndex(retrievalVO);
-    }
-}

+ 58 - 0
src/main/java/com/diagbot/service/impl/MappingConfigServiceImpl.java

@@ -0,0 +1,58 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.entity.wrapper.MappingConfigWrapper;
+import com.diagbot.mapper.MappingConfigMapper;
+import com.diagbot.service.MappingConfigService;
+import com.diagbot.vo.MappingConfigPageVO;
+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-06-09
+ */
+@Service
+public class MappingConfigServiceImpl extends ServiceImpl<MappingConfigMapper, MappingConfig> implements MappingConfigService {
+    /**
+     * 分页查询
+     *
+     * @param mappingConfigPageVO
+     * @return
+     */
+    @Override
+    public IPage<MappingConfigWrapper> getPage(@Param("mappingConfigPageVO") MappingConfigPageVO mappingConfigPageVO) {
+        return baseMapper.getPage(mappingConfigPageVO);
+    }
+
+    /**
+     * 医院术语检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    @Override
+    public List<MappingConfig> hisNameIndex(RetrievalVO retrievalVO) {
+        return baseMapper.hisNameIndex(retrievalVO);
+    }
+
+    /**
+     * 医院术语-细项检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    @Override
+    public List<MappingConfig> hisDetailNameIndex(RetrievalVO retrievalVO) {
+        return baseMapper.hisDetailNameIndex(retrievalVO);
+    }
+}

+ 74 - 1
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.ConceptTypeEnum;
+import com.diagbot.enums.OtherIndexEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.facade.MappingConfigFacade;
 import com.diagbot.idc.VisibleIdCreater;
 import com.diagbot.service.MrService;
 import com.diagbot.util.DateUtil;
@@ -14,7 +21,11 @@ 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.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 病历保存到redis接口实现
@@ -27,6 +38,8 @@ public class MrServiceImpl implements MrService {
     @Autowired
     @Qualifier("redisTemplateForMr")
     private RedisTemplate redisForMr;
+    @Autowired
+    private MappingConfigFacade mappingConfigFacade;
 
     @Autowired
     private VisibleIdCreater visibleIdCreater;
@@ -106,6 +119,66 @@ 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, Map<String, List<String>>>> configMap
+                        = mappingConfigFacade.groupByHisNameWithName(Arrays.asList(new String[] { tcmdisease.getName() }),
+                        ConceptTypeEnum.Tcmdisease.getKey(), hospitalId);
+                if (configMap != null && configMap.get(tcmdisease.getName()) != null) {
+                    tcmdisease.setUniqueName(configMap.get(tcmdisease.getName())
+                            .get("")
+                            .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, Map<String, List<String>>>> configMap
+                        = mappingConfigFacade.groupByHisNameWithName(Arrays.asList(new String[] { tcmsyndrome.getName() }),
+                        ConceptTypeEnum.Tcmsyndrome.getKey(), hospitalId);
+                if (configMap != null && configMap.get(tcmsyndrome.getName()) != null) {
+                    tcmsyndrome.setUniqueName(configMap.get(tcmsyndrome.getName())
+                            .get("")
+                            .keySet()
+                            .stream()
+                            .collect(Collectors.toList())
+                            .get(0));
+                } else {
+                    tcmsyndrome.setUniqueName(tcmsyndrome.getName());
+                }
+                tcmDTO.setTcmsyndrome(tcmsyndrome);
+            }
+        }
+        return tcmDTO;
+    }
+
     /**
      * 删除用户短信验证码信息
      */
@@ -123,4 +196,4 @@ public class MrServiceImpl implements MrService {
         });
         return l > 0;
     }
-}
+}

+ 0 - 44
src/main/java/com/diagbot/service/impl/OperationConfigServiceImpl.java

@@ -1,44 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.entity.OperationConfig;
-import com.diagbot.mapper.OperationConfigMapper;
-import com.diagbot.service.OperationConfigService;
-import com.diagbot.vo.OperationConfigPageVO;
-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 2020-07-28
- */
-@Service
-public class OperationConfigServiceImpl extends ServiceImpl<OperationConfigMapper, OperationConfig> implements OperationConfigService {
-    /**
-     * 分页查询
-     *
-     * @param operationConfigPageVO
-     * @return
-     */
-    public IPage<OperationConfig> getPage(@Param("operationConfigPageVO") OperationConfigPageVO operationConfigPageVO) {
-        return baseMapper.getPage(operationConfigPageVO);
-    }
-
-    /**
-     * 手术搜索
-     *
-     * @param retrievalVO
-     * @return
-     */
-    public List<OperationConfig> getOperationsIndex(RetrievalVO retrievalVO) {
-        return baseMapper.getOperationsIndex(retrievalVO);
-    }
-}

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


Some files were not shown because too many files changed in this diff