Pārlūkot izejas kodu

Merge branch 'master' into 122run

# Conflicts:
#	common/src/main/java/com/diagbot/enums/SysTypeEnum.java
#	config-server/src/main/resources/shared/gateway-service-dev.yml
#	config-server/src/main/resources/shared/gateway-service-local.yml
#	config-server/src/main/resources/shared/gateway-service-pro.yml
#	config-server/src/main/resources/shared/gateway-service-test.yml
gaodm 5 gadi atpakaļ
vecāks
revīzija
6d70eaf521
100 mainītis faili ar 4469 papildinājumiem un 563 dzēšanām
  1. 72 39
      aipt-service/src/main/java/com/diagbot/aggregate/PushItemAggregate.java
  2. 1 0
      aipt-service/src/main/java/com/diagbot/aggregate/SearchItemAggregate.java
  3. 1 1
      aipt-service/src/main/java/com/diagbot/aggregate/TreatmentAggregate.java
  4. 102 0
      aipt-service/src/main/java/com/diagbot/aop/CryptAspect.java
  5. 41 41
      aipt-service/src/main/java/com/diagbot/aop/SysLoggerAspect.java
  6. 29 0
      aipt-service/src/main/java/com/diagbot/config/CryptConfiguer.java
  7. 2 0
      aipt-service/src/main/java/com/diagbot/dto/ConceptBaseDTO.java
  8. 5 0
      aipt-service/src/main/java/com/diagbot/dto/ConceptRetrievalDTO.java
  9. 2 0
      aipt-service/src/main/java/com/diagbot/dto/DisDTO.java
  10. 2 0
      aipt-service/src/main/java/com/diagbot/dto/DiseaseIcdDTO.java
  11. 23 22
      aipt-service/src/main/java/com/diagbot/dto/EvaluationDTO.java
  12. 29 28
      aipt-service/src/main/java/com/diagbot/dto/IndexConfigDTO.java
  13. 26 26
      aipt-service/src/main/java/com/diagbot/dto/IndexDTO.java
  14. 4 0
      aipt-service/src/main/java/com/diagbot/dto/RetrievalDTO.java
  15. 3 0
      aipt-service/src/main/java/com/diagbot/dto/ScaleIndexDTO.java
  16. 4 0
      aipt-service/src/main/java/com/diagbot/entity/ConceptDetail.java
  17. 2 0
      aipt-service/src/main/java/com/diagbot/entity/DiseaseIcd.java
  18. 2 0
      aipt-service/src/main/java/com/diagbot/entity/HospitalDept.java
  19. 44 2
      aipt-service/src/main/java/com/diagbot/facade/AssembleFacade.java
  20. 10 1
      aipt-service/src/main/java/com/diagbot/facade/ClinicalFacade.java
  21. 19 10
      aipt-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java
  22. 38 0
      aipt-service/src/main/java/com/diagbot/facade/ConceptDetailTestFacade.java
  23. 22 3
      aipt-service/src/main/java/com/diagbot/facade/ConceptFacade.java
  24. 7 0
      aipt-service/src/main/java/com/diagbot/facade/DisScaleFacade.java
  25. 20 2
      aipt-service/src/main/java/com/diagbot/facade/DisTypeFacade.java
  26. 3 0
      aipt-service/src/main/java/com/diagbot/facade/DiseaseIcdFacade.java
  27. 16 7
      aipt-service/src/main/java/com/diagbot/facade/EvaluationFacade.java
  28. 26 3
      aipt-service/src/main/java/com/diagbot/facade/LisMappingFacade.java
  29. 13 5
      aipt-service/src/main/java/com/diagbot/facade/PartFacade.java
  30. 21 3
      aipt-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java
  31. 318 0
      aipt-service/src/main/java/com/diagbot/facade/TranEnDeFacade.java
  32. 53 51
      aipt-service/src/main/java/com/diagbot/facade/TransferFacade.java
  33. 18 5
      aipt-service/src/main/java/com/diagbot/facade/TreatmentFacade.java
  34. 8 1
      aipt-service/src/main/java/com/diagbot/mapper/ConceptDetailMapper.java
  35. 8 1
      aipt-service/src/main/java/com/diagbot/service/ConceptDetailService.java
  36. 12 1
      aipt-service/src/main/java/com/diagbot/service/impl/ConceptDetailServiceImpl.java
  37. 2 0
      aipt-service/src/main/java/com/diagbot/vo/ConceptBaseVO.java
  38. 35 0
      aipt-service/src/main/java/com/diagbot/vo/ConceptDetailPageVO.java
  39. 2 0
      aipt-service/src/main/java/com/diagbot/vo/ConceptIntroduceVO.java
  40. 2 0
      aipt-service/src/main/java/com/diagbot/vo/ConceptUsualVO.java
  41. 4 0
      aipt-service/src/main/java/com/diagbot/vo/ConnectIntroduceVO.java
  42. 2 1
      aipt-service/src/main/java/com/diagbot/vo/DisScaleVO.java
  43. 2 0
      aipt-service/src/main/java/com/diagbot/vo/DisTypeVO.java
  44. 2 0
      aipt-service/src/main/java/com/diagbot/vo/GetLisMappingVO.java
  45. 2 0
      aipt-service/src/main/java/com/diagbot/vo/GetStaticKnowledgeVO.java
  46. 18 16
      aipt-service/src/main/java/com/diagbot/vo/IndexConfigdiseaseNameVO.java
  47. 37 35
      aipt-service/src/main/java/com/diagbot/vo/IndexDataFindVO.java
  48. 2 0
      aipt-service/src/main/java/com/diagbot/vo/RetrievalVO.java
  49. 2 0
      aipt-service/src/main/java/com/diagbot/vo/ScaleIndexVO.java
  50. 97 0
      aipt-service/src/main/java/com/diagbot/web/ConceptDetailTestController.java
  51. 54 54
      aipt-service/src/main/java/com/diagbot/web/DisScaleController.java
  52. 1 1
      aipt-service/src/main/java/com/diagbot/web/DiseaseIcdController.java
  53. 44 44
      aipt-service/src/main/java/com/diagbot/web/IndexConfigController.java
  54. 18 0
      aipt-service/src/main/resources/mapper/ConceptDetailMapper.xml
  55. 37 0
      common-biz-client/pom.xml
  56. 37 1
      common/pom.xml
  57. 26 0
      common/src/main/java/com/diagbot/annotation/CryptField.java
  58. 2 0
      common/src/main/java/com/diagbot/biz/push/entity/AdverseReaction.java
  59. 3 0
      common/src/main/java/com/diagbot/biz/push/entity/FeatureRate.java
  60. 6 0
      common/src/main/java/com/diagbot/biz/push/entity/MedicalIndication.java
  61. 2 0
      common/src/main/java/com/diagbot/biz/push/entity/Medicition.java
  62. 3 0
      common/src/main/java/com/diagbot/biz/push/entity/MedicitionClass.java
  63. 1 0
      common/src/main/java/com/diagbot/enums/SysTypeEnum.java
  64. 2 2
      common/src/main/java/com/diagbot/util/AopUtil.java
  65. 208 0
      common/src/main/java/com/diagbot/util/CryptPojoUtils.java
  66. 101 0
      common/src/main/java/com/diagbot/util/CryptUtil.java
  67. 3 0
      common/src/main/java/com/diagbot/util/HttpUtils.java
  68. 3 0
      config-server/src/main/resources/shared/application-dev.yml
  69. 3 0
      config-server/src/main/resources/shared/application-local.yml
  70. 3 0
      config-server/src/main/resources/shared/application-pre.yml
  71. 3 0
      config-server/src/main/resources/shared/application-pro.yml
  72. 3 0
      config-server/src/main/resources/shared/application-test.yml
  73. 65 21
      config-server/src/main/resources/shared/gateway-service-dev.yml
  74. 55 15
      config-server/src/main/resources/shared/gateway-service-local.yml
  75. 69 23
      config-server/src/main/resources/shared/gateway-service-pre.yml
  76. 65 21
      config-server/src/main/resources/shared/gateway-service-pro.yml
  77. 59 22
      config-server/src/main/resources/shared/gateway-service-test.yml
  78. 96 0
      config-server/src/main/resources/shared/mrman-service-dev.yml
  79. 96 0
      config-server/src/main/resources/shared/mrman-service-local.yml
  80. 96 0
      config-server/src/main/resources/shared/mrman-service-pre.yml
  81. 96 0
      config-server/src/main/resources/shared/mrman-service-pro.yml
  82. 96 0
      config-server/src/main/resources/shared/mrman-service-test.yml
  83. 8 8
      data-service/src/main/java/com/diagbot/client/AiptServiceClient.java
  84. 11 11
      data-service/src/main/java/com/diagbot/client/hystrix/AiptServiceHystrix.java
  85. 12 12
      data-service/src/main/java/com/diagbot/facade/SearchFacade.java
  86. 13 13
      data-service/src/main/java/com/diagbot/web/SearchController.java
  87. 40 0
      docs/028.20200102数据库加密/fuc_med.sql
  88. 31 0
      docs/028.20200102数据库加密/init_med.sql
  89. 80 0
      docs/029.20200109模板新需求/init.sql
  90. 92 0
      docs/029.20200109模板新需求/技术服务部脚本标准模板.sql
  91. 1055 0
      docs/029.20200130浙江医院质控整改/init_user.sql
  92. 9 4
      gateway-service/pom.xml
  93. 169 0
      gateway-service/src/main/java/com/diagbot/config/RedisConfigurer.java
  94. 36 0
      gateway-service/src/main/java/com/diagbot/config/redislimiter/RateLimiterConf.java
  95. 80 0
      gateway-service/src/main/java/com/diagbot/config/redislimiter/SysKeyResolver.java
  96. 35 0
      gateway-service/src/main/java/com/diagbot/config/redislimiter/SysKeyResolverConfigurer.java
  97. 220 0
      gateway-service/src/main/java/com/diagbot/config/redislimiter/SystemRedisRateLimiter.java
  98. 2 2
      gateway-service/src/main/java/com/diagbot/filter/GlobalGatewayFilter.java
  99. 5 5
      icss-service/src/main/java/com/diagbot/client/AiptServiceClient.java
  100. 0 0
      icss-service/src/main/java/com/diagbot/client/TranServiceClient.java

+ 72 - 39
aipt-service/src/main/java/com/diagbot/aggregate/PushItemAggregate.java

@@ -7,22 +7,22 @@ import com.diagbot.biz.push.entity.MedicalIndication;
 import com.diagbot.biz.push.entity.MedicalIndicationDetail;
 import com.diagbot.biz.push.entity.ResponseData;
 import com.diagbot.biz.push.enums.FeatureTypeEnum;
-import com.diagbot.client.TranServiceClient;
 import com.diagbot.client.bean.CalculateData;
 import com.diagbot.client.bean.HosCodeVO;
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.dto.ConceptPushDTO;
 import com.diagbot.dto.PushDTO;
-import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.Concept;
 import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.facade.ClinicalFacade;
 import com.diagbot.facade.ConceptFacade;
+import com.diagbot.facade.TranEnDeFacade;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.FastJsonUtils;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.ParamConvertUtil;
-import com.diagbot.util.RespDTOUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ConceptBaseVO;
 import com.diagbot.vo.LisConfigVO;
@@ -51,9 +51,11 @@ public class PushItemAggregate {
     @Autowired
     private ConceptFacade conceptFacade;
     @Autowired
-    private TranServiceClient tranServiceClient;
+    private TranEnDeFacade tranEnDeFacade;
     @Autowired
     private ClinicalFacade clinicalFacade;
+    @Autowired
+    CryptConfiguer cryptConfiguer;
 
     @DataProvider("setAll")
     public PushDTO setAll(
@@ -114,14 +116,25 @@ public class PushItemAggregate {
         //没有推送信息时,默认取全科模板
         if (StringUtil.isBlank(deptName)) {
             deptName = "全科";
+            if (cryptConfiguer.cryptFlag) {
+                deptName = CryptUtil.encrypt_char(deptName);
+            }
         }
         ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
         conceptBaseVO.setName(deptName);
         conceptBaseVO.setLibType(LexiconTypeEnum.DEPARTMENT.getKey());
         ConceptPushDTO deptDTO = new ConceptPushDTO();
         Concept dept = conceptFacade.getConcept(conceptBaseVO);
-        if (dept == null && deptName.equals("全科") == false) {
-            deptName = "全科";
+        if (dept == null) {
+            if (cryptConfiguer.cryptFlag) {
+                if (deptName.equals(CryptUtil.encrypt_char("全科")) == false) {
+                    deptName = CryptUtil.encrypt_char("全科");
+                }
+            } else {
+                if (deptName.equals("全科") == false) {
+                    deptName = "全科";
+                }
+            }
             conceptBaseVO.setName(deptName);
             dept = conceptFacade.getConcept(conceptBaseVO);
         }
@@ -205,7 +218,6 @@ public class PushItemAggregate {
                     List<ConceptPushDTO> lisDTO = getConceptDTOList(nameList, LexiconTypeEnum.LIS_PACKAGE.getKey());
                     if (isConnect) {
                         lisDTO = addClientName(lisDTO, hosCode, ConceptTypeEnum.Lis.getKey());
-                        //lisDTO = removeLisDetail(lisDTO);
                     }
                     labRes = lisDTO;
                 }
@@ -216,9 +228,9 @@ public class PushItemAggregate {
 
     @DataProvider("setRetPacs")
     public List<ConceptPushDTO> setRetPacs(@InvokeParameter("featureTypeSet") Set<String> featureTypeSet,
-                                        @InvokeParameter("data") ResponseData data,
-                                        @InvokeParameter("isConnect") Boolean isConnect,
-                                        @InvokeParameter("hosCode") String hosCode) {
+                                           @InvokeParameter("data") ResponseData data,
+                                           @InvokeParameter("isConnect") Boolean isConnect,
+                                           @InvokeParameter("hosCode") String hosCode) {
         List<ConceptPushDTO> labRes = ListUtil.newArrayList();
         //辅检 概念列表
         if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Pacs.getKey()))) {
@@ -284,6 +296,17 @@ public class PushItemAggregate {
                 disRes = disMapDTO;
             }
         }
+        //诊断转成明文
+        if (cryptConfiguer.cryptFlag) {
+            for (Map.Entry<String, List<ConceptPushDTO>> entry : disRes.entrySet()) {
+                if (ListUtil.isNotEmpty(entry.getValue())) {
+                    for (ConceptPushDTO conceptPushDTO : entry.getValue()) {
+                        conceptPushDTO.setName(CryptUtil.decrypt_char(conceptPushDTO.getName()));
+                    }
+                    disRes.put(entry.getKey(), entry.getValue());
+                }
+            }
+        }
         return disRes;
     }
 
@@ -313,6 +336,9 @@ public class PushItemAggregate {
                                 JSONObject scaleJson = detail.getContent();
                                 if (null != scaleJson.get("name")) {
                                     String scaleName = scaleJson.get("name").toString();
+                                    if (cryptConfiguer.cryptFlag) {
+                                        scaleName = CryptUtil.encrypt_char(scaleName);
+                                    }
                                     conceptBaseVO.setName(scaleName);
                                     conceptBaseVO.setLibType(LexiconTypeEnum.GAUGE.getKey());
                                     Concept scaleConcept = conceptFacade.getConcept(conceptBaseVO);
@@ -371,7 +397,6 @@ public class PushItemAggregate {
         return conceptDTOS;
     }
 
-
     /**
      * 添加外部名称(调用方)
      *
@@ -389,42 +414,50 @@ public class PushItemAggregate {
                 .stream()
                 .map(concept -> concept.getName())
                 .collect(Collectors.toList());
+        //加密情况下,转成原文调trans层接口
+        if (cryptConfiguer.cryptFlag) {
+            CryptUtil.decryptList(uniqueNameList);
+        }
         lisConfigVO.setUniqueNameList(uniqueNameList);
         if (type.equals(ConceptTypeEnum.Lis.getKey())) {
-            RespDTO<Map<String, List<String>>> lisRes
-                    = tranServiceClient.getLisConfigByUniqueNameAndHosCode(lisConfigVO);
-            if (RespDTOUtil.respIsOK(lisRes)) {
-                Map<String, List<String>> lisMappingByUniqueName = lisRes.data;
-                for (ConceptPushDTO concept : concepts) {
-                    List<String> clientNames = lisMappingByUniqueName.get(concept.getName());
-                    if (ListUtil.isNotEmpty(clientNames)) {
-                        concept.setClientNames(clientNames);
-                    }
+            Map<String, List<String>> lisMappingByUniqueName = tranEnDeFacade.getLisConfigByUniqueNameAndHosCode(lisConfigVO);
+            for (ConceptPushDTO concept : concepts) {
+                List<String> clientNames = Lists.newLinkedList();
+                if (cryptConfiguer.cryptFlag) {
+                    clientNames = lisMappingByUniqueName.get(CryptUtil.decrypt_char(concept.getName()));
+                } else {
+                    clientNames = lisMappingByUniqueName.get(concept.getName());
+                }
+                if (ListUtil.isNotEmpty(clientNames)) {
+                    concept.setClientNames(clientNames);
                 }
             }
         } else if (type.equals(ConceptTypeEnum.Pacs.getKey())) {
-            RespDTO<Map<String, List<String>>> pacsRes
-                    = tranServiceClient.getPacsConfigByUniqueNameAndHosCode(hosCodeVO);
-            if (RespDTOUtil.respIsOK(pacsRes)) {
-                Map<String, List<String>> pacsConfigMapByUniqueName = pacsRes.data;
-                for (ConceptPushDTO concept : concepts) {
-                    List<String> clientNames = pacsConfigMapByUniqueName.get(concept.getName());
-                    if (ListUtil.isNotEmpty(clientNames)) {
-                        concept.setClientNames(clientNames);
-                    }
+            Map<String, List<String>> pacsConfigMapByUniqueName = tranEnDeFacade.getPacsConfigByUniqueNameAndHosCode(hosCodeVO);
+            for (ConceptPushDTO concept : concepts) {
+                List<String> clientNames = Lists.newLinkedList();
+                if (cryptConfiguer.cryptFlag) {
+                    clientNames = pacsConfigMapByUniqueName.get(CryptUtil.decrypt_char(concept.getName()));
+                } else {
+                    clientNames = pacsConfigMapByUniqueName.get(concept.getName());
+                }
+                if (ListUtil.isNotEmpty(clientNames)) {
+                    concept.setClientNames(clientNames);
                 }
             }
         } else if (type.equals(ConceptTypeEnum.Disease.getKey())) {
-            RespDTO<Map<String, String>> disRes = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO);
-            if (RespDTOUtil.respIsOK(disRes)) {
-                Map<String, String> disMap = disRes.data;
-                for (ConceptPushDTO concept : concepts) {
-                    String clientName = disMap.get(concept.getName());
-                    if (StringUtil.isNotBlank(clientName)) {
-                        List<String> clientNames = Lists.newLinkedList();
-                        clientNames.add(clientName);
-                        concept.setClientNames(clientNames);
-                    }
+            Map<String, String> disMap = tranEnDeFacade.getDiseaseIcdByHosCode(hosCodeVO);
+            for (ConceptPushDTO concept : concepts) {
+                String clientName = "";
+                if (cryptConfiguer.cryptFlag) {
+                    clientName = disMap.get(CryptUtil.decrypt_char(concept.getName()));
+                } else {
+                    clientName = disMap.get(concept.getName());
+                }
+                if (StringUtil.isNotBlank(clientName)) {
+                    List<String> clientNames = Lists.newLinkedList();
+                    clientNames.add(clientName);
+                    concept.setClientNames(clientNames);
                 }
             }
         }

+ 1 - 0
aipt-service/src/main/java/com/diagbot/aggregate/SearchItemAggregate.java

@@ -4,6 +4,7 @@ import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.biz.push.entity.Pacs;
 import com.diagbot.biz.push.vo.SearchVO;
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.facade.TransferFacade;
 import com.diagbot.util.ListUtil;

+ 1 - 1
aipt-service/src/main/java/com/diagbot/aggregate/TreatmentAggregate.java

@@ -1,7 +1,7 @@
 package com.diagbot.aggregate;
 
-import com.diagbot.biz.push.entity.AdverseReaction;
 import com.diagbot.biz.push.dto.ConceptDetailDTO;
+import com.diagbot.biz.push.entity.AdverseReaction;
 import com.diagbot.biz.push.entity.Medicition;
 import com.diagbot.biz.push.entity.MedicitionClass;
 import com.diagbot.biz.push.entity.MeditionDetail;

+ 102 - 0
aipt-service/src/main/java/com/diagbot/aop/CryptAspect.java

@@ -0,0 +1,102 @@
+package com.diagbot.aop;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.client.bean.Response;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.util.CryptPojoUtils;
+import com.diagbot.util.RespDTOUtil;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 数据库加解密
+ * @author: gaodm
+ * @time: 2019/12/31 13:17
+ */
+@Aspect
+@Component
+@ConditionalOnProperty(prefix = "crypt", value = { "enable" }, havingValue = "true")
+public class CryptAspect {
+
+    //切所有Controller
+    @Pointcut("execution(* com.diagbot.web..*.*(..))")
+    public void pointcutController() {
+    }
+
+    //Controller 入参加密出参解密
+    @Around("pointcutController()")
+    public Object aroundReturningController(ProceedingJoinPoint joinPoint) throws Throwable {
+        //获取方法参数
+        Object[] args = joinPoint.getArgs();
+
+        //获取参数实体类注解加密
+        CryptPojoUtils.encryptFields(args);
+        //执行方法后获取出参
+        Object proceed = joinPoint.proceed(args);
+        if (null == proceed) {
+            return null;
+        }
+        //解密
+        if (proceed instanceof RespDTO) {
+            RespDTO respDTO = (RespDTO) proceed;
+            if (RespDTOUtil.respIsOK(respDTO)) {
+                if (respDTO.data instanceof IPage) {
+                    Page page = (Page) respDTO.data;
+                    CryptPojoUtils.decryptFieldOrList(page.getRecords());
+                } else {
+                    CryptPojoUtils.decryptFieldOrList(respDTO.data);
+                }
+
+            }
+
+        }
+
+        return proceed;
+    }
+
+
+    @Pointcut("execution(* com.diagbot.client..*.*(..))")
+    public void pointcutRpcClient() {
+    }
+
+    //RpcClient 入参解密出参加密
+    @Around("pointcutRpcClient()")
+    public Object aroundReturningRpcClient(ProceedingJoinPoint joinPoint) throws Throwable {
+        //获取方法参数
+        Object[] args = joinPoint.getArgs();
+
+        //获取参数实体类解密
+        CryptPojoUtils.decryptFields(args);
+        //执行方法后获取出参
+        Object proceed = joinPoint.proceed(args);
+        if (null == proceed) {
+            return null;
+        }
+        //加密
+        if (proceed instanceof RespDTO) {
+            RespDTO respDTO = (RespDTO) proceed;
+            if (RespDTOUtil.respIsOK(respDTO)) {
+                if (respDTO.data instanceof IPage) {
+                    Page page = (Page) respDTO.data;
+                    CryptPojoUtils.encryptFieldOrList(page.getRecords());
+                } else {
+                    CryptPojoUtils.encryptFieldOrList(respDTO.data);
+                }
+
+            }
+        } else if (proceed instanceof Response) {
+            Response response = (Response) proceed;
+            if (null != response && null != response.getData()) {
+                CryptPojoUtils.encryptFieldOrList(response.getData());
+            }
+        }
+
+
+        return proceed;
+    }
+}

+ 41 - 41
aipt-service/src/main/java/com/diagbot/aop/SysLoggerAspect.java

@@ -1,41 +1,41 @@
-package com.diagbot.aop;
-
-import com.diagbot.biz.log.entity.SysLog;
-import com.diagbot.enums.SysTypeEnum;
-import com.diagbot.rabbit.MySender;
-import com.diagbot.util.AopUtil;
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Before;
-import org.aspectj.lang.annotation.Pointcut;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.stereotype.Component;
-
-/**
- * @Description: 日志拦截切面
- * @author: gaodm
- * @time: 2018/8/2 13:36
- */
-@Aspect
-@Component
-@ConditionalOnProperty(prefix = "syslog", value = { "enable" }, havingValue = "true")
-public class SysLoggerAspect {
-    @Autowired
-    private MySender mySender;
-
-    @Pointcut("@annotation(com.diagbot.annotation.SysLogger)")
-    public void loggerPointCut() {
-
-    }
-
-    @Before("loggerPointCut()")
-    public void saveSysLog(JoinPoint joinPoint) {
-        //入参设置
-        SysLog sysLog = AopUtil.sysLoggerAspect(joinPoint, SysTypeEnum.AIPT_SERVICE.getKey());
-        //保存系统日志
-        mySender.outputLogSend(sysLog);
-    }
-
-}
-
+//package com.diagbot.aop;
+//
+//import com.diagbot.biz.log.entity.SysLog;
+//import com.diagbot.enums.SysTypeEnum;
+//import com.diagbot.rabbit.MySender;
+//import com.diagbot.util.AopUtil;
+//import org.aspectj.lang.JoinPoint;
+//import org.aspectj.lang.annotation.Aspect;
+//import org.aspectj.lang.annotation.Before;
+//import org.aspectj.lang.annotation.Pointcut;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+//import org.springframework.stereotype.Component;
+//
+///**
+// * @Description: 日志拦截切面
+// * @author: gaodm
+// * @time: 2018/8/2 13:36
+// */
+//@Aspect
+//@Component
+//@ConditionalOnProperty(prefix = "syslog", value = { "enable" }, havingValue = "true")
+//public class SysLoggerAspect {
+//    @Autowired
+//    private MySender mySender;
+//
+//    @Pointcut("@annotation(com.diagbot.annotation.SysLogger)")
+//    public void loggerPointCut() {
+//
+//    }
+//
+//    @Before("loggerPointCut()")
+//    public void saveSysLog(JoinPoint joinPoint) {
+//        //入参设置
+//        SysLog sysLog = AopUtil.sysLoggerAspect(joinPoint, SysTypeEnum.AIPT_SERVICE.getKey());
+//        //保存系统日志
+//        mySender.outputLogSend(sysLog);
+//    }
+//
+//}
+//

+ 29 - 0
aipt-service/src/main/java/com/diagbot/config/CryptConfiguer.java

@@ -0,0 +1,29 @@
+package com.diagbot.config;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/1/2 10:59
+ */
+@Component
+public class CryptConfiguer {
+
+    @Value("${crypt.enable}")
+    public Boolean cryptFlag;
+
+    private static CryptConfiguer cryptConfiguer;
+
+    public static CryptConfiguer getInstance() {
+        if (null == cryptConfiguer) {
+            synchronized (CryptConfiguer.class) {
+                if (null == cryptConfiguer) {
+                    cryptConfiguer = new CryptConfiguer();
+                }
+            }
+        }
+        return cryptConfiguer;
+    }
+}

+ 2 - 0
aipt-service/src/main/java/com/diagbot/dto/ConceptBaseDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -12,5 +13,6 @@ import lombok.Setter;
 @Setter
 public class ConceptBaseDTO {
     private Long conceptId; // 概念id
+    @CryptField
     private String name;    //概念名称
 }

+ 5 - 0
aipt-service/src/main/java/com/diagbot/dto/ConceptRetrievalDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -12,14 +13,18 @@ import lombok.Setter;
 @Setter
 public class ConceptRetrievalDTO {
     private Long selfId;//本身概念id
+    @CryptField
     private String selfName;//本身名称
     private Long parentId;//父级id
+    @CryptField
     private String parentName;//父级名称
+    @CryptField
     private String sameName;//同义词名称
     private Long showType;//显示类型(1本体,0同义词)
     private Long libTypeId;//标签类型id
     private String libTypeName;//标签类型名称
     private Integer type;//questionType
     private Long uniqueId;//公表id
+    @CryptField
     private String uniqueName;//公表名称
 }

+ 2 - 0
aipt-service/src/main/java/com/diagbot/dto/DisDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import com.diagbot.annotation.CryptField;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import lombok.Getter;
 import lombok.Setter;
@@ -12,6 +13,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class DisDTO extends ConceptBaseDTO{
+    @CryptField
     @JsonIgnore
     private String typeName;//类型:慢病,急诊
 }

+ 2 - 0
aipt-service/src/main/java/com/diagbot/dto/DiseaseIcdDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -34,5 +35,6 @@ public class DiseaseIcdDTO  {
     /**
      * 朗通疾病名称
      */
+    @CryptField
     private String conceptDisName;
 }

+ 23 - 22
aipt-service/src/main/java/com/diagbot/dto/EvaluationDTO.java

@@ -1,22 +1,23 @@
-package com.diagbot.dto;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * 
- * @author wangfeng
- * @Description: TODO
- * @date 2019年5月6日 下午5:14:02
- */
-@Getter
-@Setter
-public class EvaluationDTO {
-
-	private String diseaseName;// 对应术语疾病名
-	private Long conceptId;// 术语概念id
-	private String regionName; // 区域名
-	private String regionType; // 区域类型
-	private Integer orderNo; // 区域顺序
-	private Object data;
-}
+package com.diagbot.dto;
+
+import com.diagbot.annotation.CryptField;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年5月6日 下午5:14:02
+ */
+@Getter
+@Setter
+public class EvaluationDTO {
+	@CryptField
+	private String diseaseName;// 对应术语疾病名
+	private Long conceptId;// 术语概念id
+	private String regionName; // 区域名
+	private String regionType; // 区域类型
+	private Integer orderNo; // 区域顺序
+	private Object data;
+}

+ 29 - 28
aipt-service/src/main/java/com/diagbot/dto/IndexConfigDTO.java

@@ -1,28 +1,29 @@
-package com.diagbot.dto;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * 
- * @author wangfeng
- * @Description: TODO
- * @date 2019年5月6日 下午6:45:29
- */
-@Getter
-@Setter
-public class IndexConfigDTO {
-	
-	private Long uniqueId;// 指标公表概念id
-	
-	private Long diseaseId;// 疾病概念id
-
-	private Integer groupType;// 指标项组别
-	
-	private Integer orderNo;// 显示顺序
-	
-	private String indexUnique;// 指标公表名
-
-	private String diseaseName;// 疾病概念名
-
-}
+package com.diagbot.dto;
+
+import com.diagbot.annotation.CryptField;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年5月6日 下午6:45:29
+ */
+@Getter
+@Setter
+public class IndexConfigDTO {
+	
+	private Long uniqueId;// 指标公表概念id
+	
+	private Long diseaseId;// 疾病概念id
+
+	private Integer groupType;// 指标项组别
+	
+	private Integer orderNo;// 显示顺序
+	@CryptField
+	private String indexUnique;// 指标公表名
+	@CryptField
+	private String diseaseName;// 疾病概念名
+
+}

+ 26 - 26
aipt-service/src/main/java/com/diagbot/dto/IndexDTO.java

@@ -1,26 +1,26 @@
-package com.diagbot.dto;
-
-import java.util.Date;
-import java.util.List;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * 
- * @author wangfeng
- * @Description: TODO
- * @date 2019年5月6日 下午8:09:16
- */
-@Getter
-@Setter
-public class IndexDTO {
-	
-	private String itemName; // 指标名称
-	private Long uniqueId;
-	private Integer groupType;
-	private List<String> indexUnit;//单位
-	private List<Integer> isAbnormal;//是否异常
-	private List<String> indexValue; 
-	private List<Date> creatTime;
-}
+package com.diagbot.dto;
+
+import java.util.Date;
+import java.util.List;
+
+import com.diagbot.annotation.CryptField;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年5月6日 下午8:09:16
+ */
+@Getter
+@Setter
+public class IndexDTO {
+	private String itemName; // 指标名称
+	private Long uniqueId;
+	private Integer groupType;
+	private List<String> indexUnit;//单位
+	private List<Integer> isAbnormal;//是否异常
+	private List<String> indexValue; 
+	private List<Date> creatTime;
+}

+ 4 - 0
aipt-service/src/main/java/com/diagbot/dto/RetrievalDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -12,12 +13,14 @@ import lombok.Setter;
 @Setter
 public class RetrievalDTO {
     //标签名称
+    @CryptField
     private String name;
     //标签id
     private Long questionId;
     //显示类型(静态知识出参时:0.同义词 1.本体 11.子项推出父项 21.(父项--子项)公表名)
     private Long showType;
     //Tag名称
+    @CryptField
     private String retrievalName;
     //概念id
     private Long conceptId;
@@ -28,6 +31,7 @@ public class RetrievalDTO {
     //icss标签type
     private Integer type;
     //公表名称
+    @CryptField
     private String uniqueName;
     //公表ID
     private Long uniqueId;

+ 3 - 0
aipt-service/src/main/java/com/diagbot/dto/ScaleIndexDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -12,7 +13,9 @@ import lombok.Setter;
 @Setter
 public class ScaleIndexDTO {
     private Long conceptId; // 概念id
+    @CryptField
     private String name;    //概念名称
+    @CryptField
     private String searchName; // 检索名称
     private Integer showType; // 显示类型
     private Integer fromDis; // 结果是否来自诊断

+ 4 - 0
aipt-service/src/main/java/com/diagbot/entity/ConceptDetail.java

@@ -3,6 +3,7 @@ package com.diagbot.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.annotation.CryptField;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -59,16 +60,19 @@ public class ConceptDetail implements Serializable {
     /**
      * 提示明细标题
      */
+    @CryptField
     private String title;
 
     /**
      * 提示明细内容
      */
+    @CryptField
     private String content;
 
     /**
      * 纯文本
      */
+    @CryptField
     private String text;
 
     /**

+ 2 - 0
aipt-service/src/main/java/com/diagbot/entity/DiseaseIcd.java

@@ -3,6 +3,7 @@ package com.diagbot.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.annotation.CryptField;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -76,6 +77,7 @@ public class DiseaseIcd implements Serializable {
     /**
      * 朗通疾病名称
      */
+    @CryptField
     private String conceptDisName;
 
     public String getConceptDisName() {

+ 2 - 0
aipt-service/src/main/java/com/diagbot/entity/HospitalDept.java

@@ -3,6 +3,7 @@ package com.diagbot.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -78,6 +79,7 @@ public class HospitalDept implements Serializable {
     /**
      * 朗通科室名称
      */
+    @CryptField
     private String conceptDeptName;
 
     /**

+ 44 - 2
aipt-service/src/main/java/com/diagbot/facade/AssembleFacade.java

@@ -2,7 +2,7 @@ package com.diagbot.facade;
 
 import com.diagbot.biz.push.vo.SearchVO;
 import com.diagbot.client.bean.SearchData;
-import com.diagbot.util.BeanUtil;
+import com.diagbot.enums.SysTypeEnum;
 import org.springframework.stereotype.Component;
 
 /**
@@ -20,7 +20,20 @@ public class AssembleFacade {
      */
     public SearchData assembleData(SearchVO searchVO) {
         SearchData searchData = new SearchData();
-        BeanUtil.copyProperties(searchVO, searchData);
+        //BeanUtil.copyProperties(searchVO, searchData);
+        searchData.setPasts(searchVO.getPasts());
+        searchData.setAge(searchVO.getAge());
+        searchData.setRuleType(searchVO.getRuleType());
+        searchData.setHosCode(searchVO.getHosCode());
+        searchData.setScaleName(searchVO.getScaleName());
+        searchData.setDisType(searchVO.getDisType());
+        searchData.setOther(searchVO.getOther());
+        searchData.setVital(searchVO.getVital());
+        if (searchVO.getSysType() == null) {
+            searchData.setSysType(SysTypeEnum.AIPT_SERVICE.getKey());
+        } else {
+            searchData.setSysType(searchVO.getSysType());
+        }
         switch (searchVO.getSex()) {
             case 1:
                 searchData.setSex("M");
@@ -32,6 +45,35 @@ public class AssembleFacade {
                 searchData.setSex("A");
                 break;
         }
+        searchData.setAllergy(searchVO.getAllergy());
+        searchData.setChief(searchVO.getChief());
+        searchData.setDiag(searchVO.getDiag());
+        searchData.setDiagOrder(searchVO.getDiagOrder());
+        searchData.setDiagString(searchVO.getDiagString());
+        searchData.setDiseaseName(searchVO.getDiseaseName());
+        searchData.setDrug(searchVO.getDrug());
+        searchData.setDrugOrder(searchVO.getDrugOrder());
+        searchData.setDrugString(searchVO.getDrugString());
+        searchData.setFamily(searchVO.getFamily());
+        searchData.setFeatureType(searchVO.getFeatureType());
+        searchData.setInfectious(searchVO.getInfectious());
+        searchData.setLength(searchVO.getLength());
+        searchData.setLis(searchVO.getLis());
+        searchData.setLisOrder(searchVO.getLisOrder());
+        searchData.setVital(searchVO.getVital());
+        searchData.setLisString(searchVO.getLisString());
+        searchData.setMarital(searchVO.getMarital());
+        searchData.setMarriage(searchVO.getMarriage());
+        searchData.setMenstrual(searchVO.getMenstrual());
+        searchData.setOperation(searchVO.getOperation());
+        searchData.setOperationOrder(searchVO.getOperationOrder());
+        searchData.setOtherOrder(searchVO.getOtherOrder());
+        searchData.setPacs(searchVO.getPacs());
+        searchData.setPacsOrder(searchVO.getPacsOrder());
+        searchData.setPacsString(searchVO.getPacsString());
+        searchData.setPersonal(searchVO.getPersonal());
+        searchData.setSymptom(searchVO.getSymptom());
+        searchData.setVaccination(searchData.getVaccination());
         return searchData;
     }
 }

+ 10 - 1
aipt-service/src/main/java/com/diagbot/facade/ClinicalFacade.java

@@ -7,11 +7,13 @@ import com.diagbot.client.AIServiceClient;
 import com.diagbot.client.bean.CalculateData;
 import com.diagbot.client.bean.Response;
 import com.diagbot.client.bean.SearchData;
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.entity.ScaleContent;
 import com.diagbot.enums.ScaleTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.ScaleContentService;
+import com.diagbot.util.CryptUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -36,6 +38,8 @@ public class ClinicalFacade {
     private ScaleContentService scaleContentService;
     @Autowired
     private AssembleFacade assembleFacade;
+    @Autowired
+    private CryptConfiguer cryptConfiguer;
 
     /**
      * 处理临床数据
@@ -64,7 +68,12 @@ public class ClinicalFacade {
         if (null == response) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "量表没有返回结果");
         }
-        List<ScaleContent> list = getContent(searchData.getScaleName(), JSON.toJSONString(response));
+        String scaleName = searchData.getScaleName();
+        //加密
+        if (cryptConfiguer.cryptFlag) {
+            scaleName = CryptUtil.encrypt_char(searchData.getScaleName());
+        }
+        List<ScaleContent> list = getContent(scaleName, JSON.toJSONString(response));
         return list;
     }
 

+ 19 - 10
aipt-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java

@@ -16,6 +16,7 @@ import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.ConceptDetailServiceImpl;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.ParamConvertUtil;
@@ -233,7 +234,10 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
     public List<ConceptIntroduceVO> convertParam(ConnectIntroduceVO connectIntroduceVO) {
         List<ConceptIntroduceVO> retList = Lists.newLinkedList();
         List<String> nameList = Lists.newLinkedList();
-        nameList.add(connectIntroduceVO.getName());
+        nameList.add(CryptUtil.decrypt_char(connectIntroduceVO.getName()));
+        if (connectIntroduceVO.getSysType() == null) {
+            connectIntroduceVO.setSysType(SysTypeEnum.AIPT_SERVICE.getKey());
+        }
         if (!connectIntroduceVO.getSysType().equals(SysTypeEnum.LTAPI_SERVICE.getKey())) {
             ConceptIntroduceVO conceptIntroduceVO = new ConceptIntroduceVO();
             BeanUtil.copyProperties(connectIntroduceVO, conceptIntroduceVO);
@@ -248,17 +252,17 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
             if (connectIntroduceVO.getType().equals(ConceptTypeEnum.Lis.getKey())) {
                 Map<String, Map<String, List<String>>> lisConfigMap
                         = transferFacade.getLisConfigByMealNameAndHosCode(nameList, connectIntroduceVO.getHosCode());
-                if (lisConfigMap.get(connectIntroduceVO.getName()) != null) {
-                    Map<String, List<String>> itemMap = lisConfigMap.get(connectIntroduceVO.getName());
+                if (lisConfigMap.get(CryptUtil.decrypt_char(connectIntroduceVO.getName())) != null) {
+                    Map<String, List<String>> itemMap = lisConfigMap.get(CryptUtil.decrypt_char(connectIntroduceVO.getName()));
                     if (StringUtil.isBlank(connectIntroduceVO.getDetailName())) {
-                        connectIntroduceVO.setDetailName("");
+                        connectIntroduceVO.setDetailName(CryptUtil.encrypt_char(""));
                     }
-                    List<String> uniqueNameList = itemMap.get(connectIntroduceVO.getDetailName());
+                    List<String> uniqueNameList = itemMap.get(CryptUtil.decrypt_char(connectIntroduceVO.getDetailName()));
                     if (ListUtil.isNotEmpty(uniqueNameList)) {
                         for (String uniqueName : uniqueNameList) {
                             ConceptIntroduceVO conceptIntroduceVO = new ConceptIntroduceVO();
                             BeanUtil.copyProperties(connectIntroduceVO, conceptIntroduceVO);
-                            conceptIntroduceVO.setName(uniqueName);
+                            conceptIntroduceVO.setName(CryptUtil.encrypt_char(uniqueName));
                             conceptIntroduceVO.setType(ConceptTypeEnum.LIS_TABLES.getKey());
                             conceptIntroduceVO.setLibType(LexiconTypeEnum.LIS_TABLES.getKey());
                             retList.add(conceptIntroduceVO);
@@ -272,10 +276,10 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
                 RespDTO<Map<String, List<String>>> pacsRespDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
                 if (RespDTOUtil.respIsOK(pacsRespDTO)) {
                     Map<String, List<String>> pacsMap = pacsRespDTO.data;
-                    for (String pacsStr : pacsMap.get(connectIntroduceVO.getName())) {
+                    for (String pacsStr : pacsMap.get(CryptUtil.decrypt_char(connectIntroduceVO.getName()))) {
                         ConceptIntroduceVO conceptIntroduceVO = new ConceptIntroduceVO();
                         BeanUtil.copyProperties(connectIntroduceVO, conceptIntroduceVO);
-                        conceptIntroduceVO.setName(pacsStr);
+                        conceptIntroduceVO.setName(CryptUtil.encrypt_char(pacsStr));
                         conceptIntroduceVO.setType(ConceptTypeEnum.Pacs.getKey());
                         conceptIntroduceVO.setLibType(LexiconTypeEnum.PACS_ITEMS.getKey());
                         retList.add(conceptIntroduceVO);
@@ -290,10 +294,10 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
                 RespDTO<Map<String, String>> disRespDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
                 if (RespDTOUtil.respIsOK(disRespDTO)) {
                     disMap = disRespDTO.data;
-                    if (disMap.get(connectIntroduceVO.getName()) != null) {
+                    if (disMap.get(CryptUtil.decrypt_char(connectIntroduceVO.getName())) != null) {
                         ConceptIntroduceVO conceptIntroduceVO = new ConceptIntroduceVO();
                         BeanUtil.copyProperties(connectIntroduceVO, conceptIntroduceVO);
-                        conceptIntroduceVO.setName(disMap.get(connectIntroduceVO.getName()));
+                        conceptIntroduceVO.setName(CryptUtil.encrypt_char(disMap.get(CryptUtil.decrypt_char(connectIntroduceVO.getName()))));
                         conceptIntroduceVO.setType(ConceptTypeEnum.Disease.getKey());
                         conceptIntroduceVO.setLibType(LexiconTypeEnum.DIAGNOSIS.getKey());
                         retList.add(conceptIntroduceVO);
@@ -305,6 +309,11 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
                 conceptIntroduceVO.setLibType(ParamConvertUtil.conceptConvert2Lib(conceptIntroduceVO.getType()));
                 retList.add(conceptIntroduceVO);
             }
+        } else {
+            ConceptIntroduceVO conceptIntroduceVO = new ConceptIntroduceVO();
+            BeanUtil.copyProperties(connectIntroduceVO, conceptIntroduceVO);
+            conceptIntroduceVO.setLibType(ParamConvertUtil.conceptConvert2Lib(conceptIntroduceVO.getType()));
+            retList.add(conceptIntroduceVO);
         }
         return retList;
     }

+ 38 - 0
aipt-service/src/main/java/com/diagbot/facade/ConceptDetailTestFacade.java

@@ -0,0 +1,38 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.ConceptDetail;
+import com.diagbot.service.impl.ConceptDetailServiceImpl;
+import com.diagbot.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/12/30 20:24
+ */
+@Component
+public class ConceptDetailTestFacade extends ConceptDetailServiceImpl {
+
+    public ConceptDetail saveRecord(ConceptDetail conceptDetail) {
+        this.baseMapper.insert(conceptDetail);
+        return conceptDetail;
+    }
+
+    public ConceptDetail getByIds(Long id) {
+        return this.getById(id);
+    }
+
+    public List<ConceptDetail> getByParam(ConceptDetail conceptDetail) {
+        QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
+        if (StringUtil.isNotBlank(conceptDetail.getContent())) {
+            conceptDetailQueryWrapper.like("content", conceptDetail.getContent());
+        }
+        if (StringUtil.isNotBlank(conceptDetail.getText())) {
+            conceptDetailQueryWrapper.like("text", conceptDetail.getText());
+        }
+        return this.list(conceptDetailQueryWrapper);
+    }
+}

+ 22 - 3
aipt-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRetrievalDTO;
 import com.diagbot.dto.ConceptWithOrderRes;
@@ -16,6 +17,7 @@ import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.ConceptServiceImpl;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.IntegerUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.ParamConvertUtil;
@@ -46,6 +48,8 @@ import java.util.stream.Collectors;
 public class ConceptFacade extends ConceptServiceImpl {
     @Autowired
     ConceptDetailFacade conceptDetailFacade;
+    @Autowired
+    CryptConfiguer configuer;
 
     /**
      * 验证存在并且获取概念基本信息
@@ -99,8 +103,12 @@ public class ConceptFacade extends ConceptServiceImpl {
         //出参封装
         Map<Long, String> map = new HashMap<>();
         if (ListUtil.isNotEmpty(concepts)) {
-            map = concepts.stream().collect(Collectors.toMap(r -> r.getId(), r -> r.getLibName()));
+            map = concepts
+                    .stream()
+                    .collect(Collectors.toMap(r -> r.getId(),
+                            r -> configuer.cryptFlag ? CryptUtil.decrypt_char(r.getLibName()) : r.getLibName()));
         }
+
         return map;
     }
 
@@ -131,8 +139,12 @@ public class ConceptFacade extends ConceptServiceImpl {
         //出参封装
         Map<Long, String> map = new HashMap<>();
         if (ListUtil.isNotEmpty(concepts)) {
-            map = concepts.stream().collect(Collectors.toMap(r -> r.getConceptId(), r -> r.getName()));
+            map = concepts
+                    .stream()
+                    .collect(Collectors.toMap(r -> r.getConceptId(),
+                            r -> configuer.cryptFlag ? CryptUtil.decrypt_char(r.getName()) : r.getName()));
         }
+
         return map;
     }
 
@@ -211,6 +223,9 @@ public class ConceptFacade extends ConceptServiceImpl {
             conceptExistVO.setLibType(libType);
         }
 
+        if (configuer.cryptFlag){
+            CryptUtil.encryptList(conceptExistVO.getNameList());
+        }
         //获取结构
         List<Concept> concepts
                 = this.getListByNamesAndType(conceptExistVO.getNameList(), conceptExistVO.getLibType());
@@ -218,7 +233,11 @@ public class ConceptFacade extends ConceptServiceImpl {
         //出参封装
         Map<String, Long> map = new HashMap<>();
         if (ListUtil.isNotEmpty(concepts)) {
-            map = concepts.stream().collect(Collectors.toMap(r -> r.getLibName(), r -> r.getId()));
+            map = concepts
+                    .stream()
+                    .collect(Collectors.toMap(
+                            r -> configuer.cryptFlag ? CryptUtil.decrypt_char(r.getLibName()) : r.getLibName(),
+                            r -> r.getId()));
         }
         return map;
     }

+ 7 - 0
aipt-service/src/main/java/com/diagbot/facade/DisScaleFacade.java

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptWithOrderRes;
 import com.diagbot.dto.DisScaleDTO;
@@ -8,6 +9,7 @@ import com.diagbot.entity.wrapper.ConceptWrapper;
 import com.diagbot.enums.LexiconRSTypeEnum;
 import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.service.impl.DisScaleServiceImpl;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.vo.ConceptBaseVO;
 import com.diagbot.vo.DisScaleVO;
@@ -29,6 +31,8 @@ public class DisScaleFacade extends DisScaleServiceImpl {
 
     @Autowired
     ConceptFacade conceptFacade;
+    @Autowired
+    private CryptConfiguer cryptConfiguer;
 
     /**
      * 返回诊断量表列表
@@ -74,6 +78,9 @@ public class DisScaleFacade extends DisScaleServiceImpl {
         scaleIndexVO.setStartType(LexiconTypeEnum.DIAGNOSIS.getKey());
         scaleIndexVO.setRelationType(LexiconRSTypeEnum.ORDER_BY.getKey());
         scaleIndexVO.setEndType(LexiconTypeEnum.GAUGE.getKey());
+        if (cryptConfiguer.cryptFlag) {
+            CryptUtil.encryptList(scaleIndexVO.getFilterName());
+        }
         List<ScaleIndexDTO> data = this.indexScale(scaleIndexVO);
         List<ScaleIndexDTO> res = new ArrayList<>();
         List<Long> selfList = new ArrayList<>(); // 本体

+ 20 - 2
aipt-service/src/main/java/com/diagbot/facade/DisTypeFacade.java

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.dto.DisDTO;
 import com.diagbot.dto.DisTypeDTO;
@@ -9,6 +10,7 @@ import com.diagbot.enums.DisTypeEnum;
 import com.diagbot.enums.LexiconRSTypeEnum;
 import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.service.impl.DisTypeServiceImpl;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.vo.ConceptBaseVO;
@@ -30,6 +32,8 @@ public class DisTypeFacade extends DisTypeServiceImpl {
 
     @Autowired
     ConceptFacade conceptFacade;
+    @Autowired
+    private CryptConfiguer cryptConfiguer;
 
     /**
      * 返回诊断类型
@@ -57,11 +61,22 @@ public class DisTypeFacade extends DisTypeServiceImpl {
         }
         Map<String, List<DisDTO>> map = EntityUtil.makeEntityListMap(data, "typeName");
         if (map != null) {
-            List<DisDTO> chr = map.get(DisTypeEnum.CHRONIC.getName()); //放入慢病列表
+            String typeName = "";
+            if (cryptConfiguer.cryptFlag) {
+                typeName = CryptUtil.encrypt_char(DisTypeEnum.CHRONIC.getName());
+            } else {
+                typeName = DisTypeEnum.CHRONIC.getName();
+            }
+            List<DisDTO> chr = map.get(typeName); //放入慢病列表
             if (ListUtil.isNotEmpty(chr)) {
                 res.setChronic(chr);
             }
-            List<DisDTO> eme = map.get(DisTypeEnum.EMERGENCY.getName()); //放入急诊列表
+            if (cryptConfiguer.cryptFlag) {
+                typeName = CryptUtil.encrypt_char(DisTypeEnum.EMERGENCY.getName());
+            } else {
+                typeName = DisTypeEnum.EMERGENCY.getName();
+            }
+            List<DisDTO> eme = map.get(typeName); //放入急诊列表
             if (ListUtil.isNotEmpty(eme)) {
                 res.setEmergency(eme);
             }
@@ -81,6 +96,9 @@ public class DisTypeFacade extends DisTypeServiceImpl {
         conceptBaseVO.setLibType(LexiconTypeEnum.DIAGNOSIS.getKey());
         Concept disease = conceptFacade.exist(conceptBaseVO);
         String disTypeName = DisTypeEnum.getName(disTypeVO.getDisType());
+        if (cryptConfiguer.cryptFlag) {
+            disTypeName = CryptUtil.encrypt_char(disTypeName);
+        }
         conceptBaseVO.setName(disTypeName);
         conceptBaseVO.setLibType(LexiconTypeEnum.TYPES_OF_DISEASE.getKey());
         Concept disTypeConcept = conceptFacade.exist(conceptBaseVO);

+ 3 - 0
aipt-service/src/main/java/com/diagbot/facade/DiseaseIcdFacade.java

@@ -2,6 +2,7 @@ package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.TranServiceClient;
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.dto.DiseaseIcdDTO;
 import com.diagbot.dto.GetDiseaseIcdDTO;
 import com.diagbot.dto.RespDTO;
@@ -9,8 +10,10 @@ import com.diagbot.entity.Concept;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
 import com.diagbot.vo.GetDiseaseIcdVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;

+ 16 - 7
aipt-service/src/main/java/com/diagbot/facade/EvaluationFacade.java

@@ -2,9 +2,11 @@ package com.diagbot.facade;
 
 import com.alibaba.fastjson.JSONObject;
 import com.diagbot.biz.push.vo.SearchVO;
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.dto.EvaluationDTO;
 import com.diagbot.service.impl.EvaluationServiceImpl;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.EvaluationDiseaseNameVO;
 import com.google.common.collect.Lists;
@@ -19,6 +21,8 @@ public class EvaluationFacade extends EvaluationServiceImpl {
 
     @Autowired
     PushFacade pushFacade;
+    @Autowired
+    private CryptConfiguer cryptConfiguer;
 
     /**
      * 获取管理与评估模板接口
@@ -31,16 +35,21 @@ public class EvaluationFacade extends EvaluationServiceImpl {
             return Lists.newArrayList();
         }
 
+        Map<String, JSONObject> jsonobject = pushFacade.getManagementEvaluationContent(searchVO);
         EvaluationDiseaseNameVO evaluationdiseaseNameVO = new EvaluationDiseaseNameVO();
         BeanUtil.copyProperties(searchVO, evaluationdiseaseNameVO);
-        List<EvaluationDTO> evaluationList = this.getEvaluationModule(evaluationdiseaseNameVO);
 
-        Map<String, JSONObject> jsonobject = pushFacade.getManagementEvaluationContent(searchVO);
-        for (String key : jsonobject.keySet()) {
-            for (EvaluationDTO evaluadata : evaluationList) {
-                if (key.equals(evaluadata.getRegionName())) {
-                    evaluadata.setData(jsonobject.get(key));
-                }
+        if (cryptConfiguer.cryptFlag) {
+            evaluationdiseaseNameVO.getDiseaseName().setUniqueName(CryptUtil.encrypt_char(evaluationdiseaseNameVO.getDiseaseName().getUniqueName()));
+        }
+
+        List<EvaluationDTO> evaluationList = this.getEvaluationModule(evaluationdiseaseNameVO);
+        if (jsonobject == null) {
+            return evaluationList;
+        }
+        for (EvaluationDTO evaluadata : evaluationList) {
+            if (jsonobject.containsKey(evaluadata.getRegionName())) {
+                evaluadata.setData(jsonobject.get(evaluadata.getRegionName()));
             }
         }
         return evaluationList;

+ 26 - 3
aipt-service/src/main/java/com/diagbot/facade/LisMappingFacade.java

@@ -1,11 +1,14 @@
 package com.diagbot.facade;
 
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.entity.wrapper.LisMappingWrapper;
 import com.diagbot.service.impl.LisMappingServiceImpl;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.GetLisMappingVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.LinkedHashMap;
@@ -18,10 +21,13 @@ import java.util.Map;
  * @time: 2019/9/20 13:14
  */
 @Component
-public class LisMappingFacade  extends LisMappingServiceImpl {
+public class LisMappingFacade extends LisMappingServiceImpl {
+    @Autowired
+    private CryptConfiguer cryptConfiguer;
 
     /**
      * 获取化验公表映射关系 Map<mealName,Map<itemName,uniqueName>> itemName 不为空
+     *
      * @param mealName
      * @return
      */
@@ -30,6 +36,18 @@ public class LisMappingFacade  extends LisMappingServiceImpl {
         LisMappingWrapper lisMappingWrapper = new LisMappingWrapper();
         lisMappingWrapper.setMealName(mealName);
         List<LisMappingWrapper> lisMappingWrapperList = this.getLisMappingByName(lisMappingWrapper);
+        if (ListUtil.isEmpty(lisMappingWrapperList)) {
+            return retMap;
+        }
+
+        //解密
+        if (cryptConfiguer.cryptFlag) {
+            for (LisMappingWrapper lisMap : lisMappingWrapperList) {
+                lisMap.setItemName(CryptUtil.decrypt_char(lisMap.getItemName()));
+                lisMap.setMealName(CryptUtil.decrypt_char(lisMap.getMealName()));
+                lisMap.setUniqueName(CryptUtil.decrypt_char(lisMap.getUniqueName()));
+            }
+        }
 
         Map<String, List<LisMappingWrapper>> lisMappingMap
                 = EntityUtil.makeEntityListMap(lisMappingWrapperList, "mealName");
@@ -47,18 +65,23 @@ public class LisMappingFacade  extends LisMappingServiceImpl {
 
     /**
      * 获取化验标签公表项
+     *
      * @param getLisMappingVO
      * @return
      */
     public Map<String, Map<String, String>> getLisMappingByQuestion(GetLisMappingVO getLisMappingVO) {
-        String project=getLisMappingVO.getProject();
-        List<String> details=getLisMappingVO.getDetails();
+        String project = getLisMappingVO.getProject();
+        List<String> details = getLisMappingVO.getDetails();
         if (StringUtil.isBlank(project)) {
             return null;
         }
 
         Map<String, Map<String, String>> lisMappingMap = getLisMappingByMealName(project);
 
+        //解密
+        if (cryptConfiguer.cryptFlag){
+            project = CryptUtil.decrypt_char(project);
+        }
         Map<String, Map<String, String>> retMap = new LinkedHashMap<>();
         if (lisMappingMap != null && lisMappingMap.get(project) != null) {
             Map<String, String> projectMap = new LinkedHashMap<>();

+ 13 - 5
aipt-service/src/main/java/com/diagbot/facade/PartFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.dto.ConceptWithOrderRes;
 import com.diagbot.dto.PartDTO;
 import com.diagbot.dto.PartSymptomDTO;
@@ -13,13 +14,16 @@ import com.diagbot.enums.LexiconRSTypeEnum;
 import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.vo.PartSymptomVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.lang.reflect.Field;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -36,6 +40,8 @@ public class PartFacade {
     ConceptFacade conceptFacade;
     @Autowired
     ConceptDetailFacade conceptDetailFacade;
+    @Autowired
+    private CryptConfiguer cryptConfiguer;
 
     /**
      * 根据已选部位返回对应的症状
@@ -49,6 +55,9 @@ public class PartFacade {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "请选择部位");
         }
+        if (cryptConfiguer.cryptFlag) {
+            CryptUtil.encryptList(partList);
+        }
         if (partSymptomVO.getSexType() == null) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "请选择性别");
@@ -118,10 +127,10 @@ public class PartFacade {
         // 获取症状的简述信息
         List<ConceptDetail> conceptDetailList = conceptDetailFacade.list(
                 new QueryWrapper<ConceptDetail>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .in("concept_id", symptomList.stream().map(row -> row.getEndId()).distinct().collect(Collectors.toList()))
-                .apply("find_in_set({0},position)", 7));
-        Map<Long, String> descMap = conceptDetailList.stream().collect(Collectors.toMap(row->row.getConceptId(), row->row.getText()));
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .in("concept_id", symptomList.stream().map(row -> row.getEndId()).distinct().collect(Collectors.toList()))
+                        .apply("find_in_set({0},position)", 7));
+        Map<Long, String> descMap = conceptDetailList.stream().collect(Collectors.toMap(row -> row.getConceptId(), row -> row.getText()));
 
 
         // 设置部位下的症状
@@ -159,5 +168,4 @@ public class PartFacade {
         return res;
     }
 
-
 }

+ 21 - 3
aipt-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -1,12 +1,15 @@
 package com.diagbot.facade;
 
 import com.diagbot.client.TranServiceClient;
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.GetTopPatientInfoDjDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.Concept;
 import com.diagbot.enums.LexiconTypeEnum;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ConceptBaseVO;
 import com.diagbot.vo.GetTopPatientInfoDjVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
@@ -26,6 +29,8 @@ public class PatientInfoFacade {
     private ConceptFacade conceptFacade;
     @Autowired
     TranServiceClient tranServiceClient;
+    @Autowired
+    private CryptConfiguer cryptConfiguer;
 
     /**
      * 页面顶部病人医生科室信息查询
@@ -35,13 +40,20 @@ public class PatientInfoFacade {
      */
     public GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
         RespDTO<GetTopPatientInfoDTO> respDTO = tranServiceClient.getTopPatientInfo(getTopPatientInfoVO);
-        RespDTOUtil.respNGDealCover(respDTO, "获取页面顶部病人医生科室信息失败");
+        RespDTOUtil.respNGDealCover(respDTO, respDTO.msg);
 
         GetTopPatientInfoDTO getTopPatientInfoDTO = respDTO.data;
 
         ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
         conceptBaseVO.setLibType(LexiconTypeEnum.DEPARTMENT.getKey());
-        conceptBaseVO.setName(getTopPatientInfoDTO.getSelfDeptName());
+        if (StringUtil.isNotBlank(getTopPatientInfoDTO.getSelfDeptName())) {
+            if (cryptConfiguer.cryptFlag) {
+                conceptBaseVO.setName(CryptUtil.encrypt_char(getTopPatientInfoDTO.getSelfDeptName()));
+            } else {
+                conceptBaseVO.setName(getTopPatientInfoDTO.getSelfDeptName());
+            }
+        }
+
         Concept concept = conceptFacade.exist(conceptBaseVO);
         getTopPatientInfoDTO.setSelfDeptId(concept.getId());
 
@@ -62,7 +74,13 @@ public class PatientInfoFacade {
 
         ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
         conceptBaseVO.setLibType(LexiconTypeEnum.DEPARTMENT.getKey());
-        conceptBaseVO.setName(getTopPatientInfoDjDTO.getSelfDeptName());
+        if (StringUtil.isNotBlank(getTopPatientInfoDjDTO.getSelfDeptName())) {
+            if (cryptConfiguer.cryptFlag) {
+                conceptBaseVO.setName(CryptUtil.encrypt_char(getTopPatientInfoDjDTO.getSelfDeptName()));
+            } else {
+                conceptBaseVO.setName(getTopPatientInfoDjDTO.getSelfDeptName());
+            }
+        }
         Concept concept = conceptFacade.exist(conceptBaseVO);
         getTopPatientInfoDjDTO.setSelfDeptId(concept.getId());
 

+ 318 - 0
aipt-service/src/main/java/com/diagbot/facade/TranEnDeFacade.java

@@ -0,0 +1,318 @@
+package com.diagbot.facade;
+
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.client.bean.HosCodeVO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.util.CryptUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.DiseaseIcdVO;
+import com.diagbot.vo.LisConfigVO;
+import com.diagbot.vo.PacsConfigVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:tran层对接时无法自动加解密的接口处理
+ * @Author:zhaops
+ * @time: 2020/1/6 10:19
+ */
+@Component
+public class TranEnDeFacade {
+    @Autowired
+    private TranServiceClient tranServiceClient;
+
+    /**
+     * 根据医院编码和套餐名称获取化验公表映射关系(返回map原文)
+     *
+     * @param lisConfigVO
+     * @return
+     */
+    public Map<String, Map<String, List<String>>> getLisConfigByMealNameAndHosCode(@RequestBody LisConfigVO lisConfigVO) {
+        RespDTO<Map<String, Map<String, List<String>>>> respDTO = tranServiceClient.getLisConfigByMealNameAndHosCode(lisConfigVO);
+        Map<String, Map<String, List<String>>> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, Map<String, List<String>>> map = respDTO.data;
+            retMap = map;
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院编码和套餐名称获取化验公表映射关系(返回map加密)
+     *
+     * @param lisConfigVO
+     * @return
+     */
+    public Map<String, Map<String, List<String>>> getLisConfigByMealNameAndHosCode_en(@RequestBody LisConfigVO lisConfigVO) {
+        RespDTO<Map<String, Map<String, List<String>>>> respDTO = tranServiceClient.getLisConfigByMealNameAndHosCode(lisConfigVO);
+        Map<String, Map<String, List<String>>> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, Map<String, List<String>>> map = respDTO.data;
+            for (Map.Entry<String, Map<String, List<String>>> entry : map.entrySet()) {
+                Map<String, List<String>> retSubMap = new LinkedHashMap<>();
+                for (Map.Entry<String, List<String>> subEntry : entry.getValue().entrySet()) {
+                    if (ListUtil.isNotEmpty(subEntry.getValue())) {
+                        CryptUtil.encryptList(subEntry.getValue());
+                    }
+                    retSubMap.put(CryptUtil.encrypt_char(subEntry.getKey()), subEntry.getValue());
+                }
+                retMap.put(CryptUtil.encrypt_char(entry.getKey()), retSubMap);
+            }
+        }
+        return retMap;
+    }
+
+
+    /**
+     * 根据医院编码获取辅检公表映射关系(返回map原文)
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    public Map<String, String> getPacsConfigByHosCode(@RequestBody HosCodeVO hosCodeVO) {
+        RespDTO<Map<String, String>> respDTO = tranServiceClient.getPacsConfigByHosCode(hosCodeVO);
+        Map<String, String> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, String> map = respDTO.data;
+            retMap = map;
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院编码获取辅检公表映射关系(返回map加密)
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    public Map<String, String> getPacsConfigByHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
+        RespDTO<Map<String, String>> respDTO = tranServiceClient.getPacsConfigByHosCode(hosCodeVO);
+        Map<String, String> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, String> map = respDTO.data;
+            for (Map.Entry<String, String> entry : map.entrySet()) {
+                retMap.put(CryptUtil.encrypt_char(entry.getKey()), CryptUtil.encrypt_char(entry.getValue()));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取辅检映射关系(返回map原文)
+     *
+     * @param pacsConfigVO
+     * @return
+     */
+    public Map<String, List<String>> getPacsConfig(@RequestBody PacsConfigVO pacsConfigVO) {
+        RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
+        Map<String, List<String>> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, List<String>> map = respDTO.data;
+            retMap = map;
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取辅检映射关系(返回map加密)
+     *
+     * @param pacsConfigVO
+     * @return
+     */
+    public Map<String, List<String>> getPacsConfig_en(@RequestBody PacsConfigVO pacsConfigVO) {
+        RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
+        Map<String, List<String>> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, List<String>> map = respDTO.data;
+            for (Map.Entry<String, List<String>> entry : map.entrySet()) {
+                if (ListUtil.isNotEmpty(entry.getValue())) {
+                    CryptUtil.encryptList(entry.getValue());
+                }
+                retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院编码获取提示信息标题映射关系(返回map原文)
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    public Map<String, String> getTitleMappingHosCode(@RequestBody HosCodeVO hosCodeVO) {
+        RespDTO<Map<String, String>> respDTO = tranServiceClient.getTitleMappingHosCode(hosCodeVO);
+        Map<String, String> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, String> map = respDTO.data;
+            retMap = map;
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院编码获取提示信息标题映射关系(返回map加密)
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    public Map<String, String> getTitleMappingHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
+        RespDTO<Map<String, String>> respDTO = tranServiceClient.getTitleMappingHosCode(hosCodeVO);
+        Map<String, String> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, String> map = respDTO.data;
+            for (Map.Entry<String, String> entry : map.entrySet()) {
+                retMap.put(CryptUtil.encrypt_char(entry.getKey()), CryptUtil.encrypt_char(entry.getValue()));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院编码查询诊断icd映射(返回map原文)
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    public Map<String, String> getDiseaseIcdByHosCode(@RequestBody HosCodeVO hosCodeVO) {
+        RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO);
+        Map<String, String> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, String> map = respDTO.data;
+            retMap = map;
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院编码查询诊断icd映射(返回map加密)
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    public Map<String, String> getDiseaseIcdByHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
+        RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO);
+        Map<String, String> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, String> map = respDTO.data;
+            for (Map.Entry<String, String> entry : map.entrySet()) {
+                retMap.put(CryptUtil.encrypt_char(entry.getKey()), CryptUtil.encrypt_char(entry.getValue()));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取诊断名称映射map(返回map原文)
+     *
+     * @param diseaseIcdVO
+     * @return
+     */
+    public Map<String, String> getDiseaseIcdMap(DiseaseIcdVO diseaseIcdVO) {
+        RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
+        Map<String, String> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, String> map = respDTO.data;
+            retMap = map;
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取诊断名称映射map(返回map加密)
+     *
+     * @param diseaseIcdVO
+     * @return
+     */
+    public Map<String, String> getDiseaseIcdMap_en(DiseaseIcdVO diseaseIcdVO) {
+        RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
+        Map<String, String> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, String> map = respDTO.data;
+            for (Map.Entry<String, String> entry : map.entrySet()) {
+                retMap.put(CryptUtil.encrypt_char(entry.getKey()), CryptUtil.encrypt_char(entry.getValue()));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院编码获取化验公表映射关系,公表项做key(返回map原文)
+     *
+     * @param lisConfigVO
+     * @return
+     */
+    public Map<String, List<String>> getLisConfigByUniqueNameAndHosCode(@RequestBody LisConfigVO lisConfigVO) {
+        RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getLisConfigByUniqueNameAndHosCode(lisConfigVO);
+        Map<String, List<String>> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, List<String>> map = respDTO.data;
+            retMap = map;
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院编码获取化验公表映射关系,公表项做key(返回map加密)
+     *
+     * @param lisConfigVO
+     * @return
+     */
+    public Map<String, List<String>> getLisConfigByUniqueNameAndHosCode_en(@RequestBody LisConfigVO lisConfigVO) {
+        RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getLisConfigByUniqueNameAndHosCode(lisConfigVO);
+        Map<String, List<String>> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, List<String>> map = respDTO.data;
+            for (Map.Entry<String, List<String>> entry : map.entrySet()) {
+                if (ListUtil.isNotEmpty(entry.getValue())) {
+                    CryptUtil.encryptList(entry.getValue());
+                }
+                retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院编码查询辅检公表映射,公表项做key(返回map原文)
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    public Map<String, List<String>> getPacsConfigByUniqueNameAndHosCode(@RequestBody HosCodeVO hosCodeVO) {
+        RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfigByUniqueNameAndHosCode(hosCodeVO);
+        Map<String, List<String>> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, List<String>> map = respDTO.data;
+            retMap = map;
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院编码查询辅检公表映射,公表项做key(返回map加密)
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    public Map<String, List<String>> getPacsConfigByUniqueNameAndHosCode_en(@RequestBody HosCodeVO hosCodeVO) {
+        RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfigByUniqueNameAndHosCode(hosCodeVO);
+        Map<String, List<String>> retMap = new LinkedHashMap<>();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            Map<String, List<String>> map = respDTO.data;
+            for (Map.Entry<String, List<String>> entry : map.entrySet()) {
+                if (ListUtil.isNotEmpty(entry.getValue())) {
+                    CryptUtil.encryptList(entry.getValue());
+                }
+                retMap.put(CryptUtil.encrypt_char(entry.getKey()), entry.getValue());
+            }
+        }
+        return retMap;
+    }
+}

+ 53 - 51
aipt-service/src/main/java/com/diagbot/facade/TransferFacade.java

@@ -6,13 +6,13 @@ import com.diagbot.biz.push.entity.Pacs;
 import com.diagbot.biz.push.enums.FeatureTypeEnum;
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.client.bean.HosCodeVO;
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SysSetInfoDTO;
 import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.enums.LisSourceEnum;
 import com.diagbot.enums.SysTypeEnum;
 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;
@@ -39,6 +39,8 @@ import java.util.stream.Collectors;
 public class TransferFacade {
     @Autowired
     private TranServiceClient tranServiceClient;
+    @Autowired
+    CryptConfiguer cryptConfiguer;
 
     /**
      * 查询对接状态
@@ -96,11 +98,11 @@ public class TransferFacade {
         LisConfigVO lisConfigVO = new LisConfigVO();
         lisConfigVO.setHosCode(hosCode);
         lisConfigVO.setMealNameList(mealNameList);
-        RespDTO<Map<String, Map<String, List<String>>>> lisConfigRes
-                = tranServiceClient.getLisConfigByMealNameAndHosCode(lisConfigVO);
         Map<String, Map<String, List<String>>> lisConfigMap = new LinkedHashMap<>();
-        if (RespDTOUtil.respIsOK(lisConfigRes)) {
-            lisConfigMap = lisConfigRes.data;
+        RespDTO<Map<String, Map<String, List<String>>>> respDTO
+                = tranServiceClient.getLisConfigByMealNameAndHosCode(lisConfigVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            lisConfigMap = respDTO.data;
         }
         for (Lis lisResult : lis) {
             //内部数据,获取标签时映射, 不二次映射
@@ -130,7 +132,6 @@ public class TransferFacade {
         return retLis;
     }
 
-
     /**
      * 辅检结果增加公表名(辅检项目名称)
      *
@@ -150,24 +151,25 @@ public class TransferFacade {
                 .map(pacsResult -> pacsResult.getName())
                 .distinct()
                 .collect(Collectors.toList()));
-        RespDTO<Map<String, List<String>>> pacsRespDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
-        if (RespDTOUtil.respIsOK(pacsRespDTO)) {
-            Map<String, List<String>> pacsMap = pacsRespDTO.data;
-            for (Pacs pacsResult : pacs) {
-                if (StringUtil.isBlank(pacsResult.getName())) {
-                    convertPacs.add(pacsResult);
-                    continue;
-                } else {
-                    if (ListUtil.isNotEmpty(pacsMap.get(pacsResult.getName()))) {
-                        for (String uniqueName : pacsMap.get(pacsResult.getName())) {
-                            Pacs convertPacsResult = new Pacs();
-                            BeanUtil.copyProperties(pacsResult, convertPacsResult);
-                            convertPacsResult.setUniqueName(uniqueName);
-                            convertPacs.add(convertPacsResult);
-                        }
-                    } else {
-                        convertPacs.add(pacsResult);
+        Map<String, List<String>> pacsMap = new LinkedHashMap<>();
+        RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            pacsMap = respDTO.data;
+        }
+        for (Pacs pacsResult : pacs) {
+            if (StringUtil.isBlank(pacsResult.getName())) {
+                convertPacs.add(pacsResult);
+                continue;
+            } else {
+                if (ListUtil.isNotEmpty(pacsMap.get(pacsResult.getName()))) {
+                    for (String uniqueName : pacsMap.get(pacsResult.getName())) {
+                        Pacs convertPacsResult = new Pacs();
+                        BeanUtil.copyProperties(pacsResult, convertPacsResult);
+                        convertPacsResult.setUniqueName(uniqueName);
+                        convertPacs.add(convertPacsResult);
                     }
+                } else {
+                    convertPacs.add(pacsResult);
                 }
             }
         }
@@ -187,10 +189,9 @@ public class TransferFacade {
             LisConfigVO lisConfigVO = new LisConfigVO();
             lisConfigVO.setHosCode(hosCode);
             lisConfigVO.setMealNameList(nameList);
-            RespDTO<Map<String, Map<String, List<String>>>> lisConfigRes
-                    = tranServiceClient.getLisConfigByMealNameAndHosCode(lisConfigVO);
-            if (RespDTOUtil.respIsOK(lisConfigRes)) {
-                lisConfigMap = lisConfigRes.data;
+            RespDTO<Map<String, Map<String, List<String>>>> respDTO = tranServiceClient.getLisConfigByMealNameAndHosCode(lisConfigVO);
+            if (RespDTOUtil.respIsOK(respDTO)) {
+                lisConfigMap = respDTO.data;
             }
         }
         return lisConfigMap;
@@ -217,18 +218,18 @@ public class TransferFacade {
             diseaseIcdVO.setHosCode(hosCode);
             diseaseIcdVO.setDiseaseNameList(nameList);
             Map<String, String> disMap = new LinkedHashMap<>();
-            RespDTO<Map<String, String>> disRespDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
-            if (RespDTOUtil.respIsOK(disRespDTO)) {
-                disMap = disRespDTO.data;
-                for (Item disease : items) {
-                    if (StringUtil.isBlank(disease.getName())) {
-                        continue;
-                    } else {
-                        disease.setUniqueName(disMap.get(disease.getName()));
-                    }
+            RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
+            if (RespDTOUtil.respIsOK(respDTO)) {
+                disMap = respDTO.data;
+            }
+            for (Item disease : items) {
+                if (StringUtil.isBlank(disease.getName())) {
+                    continue;
+                } else {
+                    disease.setUniqueName(disMap.get(disease.getName()));
                 }
-                convertItems = BeanUtil.listCopyTo(items, Item.class);
             }
+            convertItems = BeanUtil.listCopyTo(items, Item.class);
         } else if (type.equals(ConceptTypeEnum.Drug.getKey())) {
             //暂无映射关系
             convertItems.addAll(items);
@@ -276,13 +277,14 @@ public class TransferFacade {
             PacsConfigVO pacsConfigVO = new PacsConfigVO();
             pacsConfigVO.setHosCode(hosCode);
             pacsConfigVO.setMealNameList(strList);
-            RespDTO<Map<String, List<String>>> pacsRespDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
-            if (RespDTOUtil.respIsOK(pacsRespDTO)) {
-                Map<String, List<String>> pacsMap = pacsRespDTO.data;
-                for (Map.Entry<String, List<String>> entry : pacsMap.entrySet()) {
-                    if (ListUtil.isNotEmpty(entry.getValue())) {
-                        retStr += String.join(",", entry.getValue()) + ",";
-                    }
+            Map<String, List<String>> pacsMap = new LinkedHashMap<>();
+            RespDTO<Map<String, List<String>>> respDTO = tranServiceClient.getPacsConfig(pacsConfigVO);
+            if (RespDTOUtil.respIsOK(respDTO)) {
+                pacsMap = respDTO.data;
+            }
+            for (Map.Entry<String, List<String>> entry : pacsMap.entrySet()) {
+                if (ListUtil.isNotEmpty(entry.getValue())) {
+                    retStr += String.join(",", entry.getValue()) + ",";
                 }
             }
         } else if (type.equals(FeatureTypeEnum.Feature_Type_Disease.getKey())) {
@@ -290,13 +292,13 @@ public class TransferFacade {
             diseaseIcdVO.setHosCode(hosCode);
             diseaseIcdVO.setDiseaseNameList(strList);
             Map<String, String> disMap = new LinkedHashMap<>();
-            RespDTO<Map<String, String>> disRespDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
-            if (RespDTOUtil.respIsOK(disRespDTO)) {
-                disMap = disRespDTO.data;
-                for (String diseaseName : strList) {
-                    if (StringUtil.isNotBlank(disMap.get(diseaseName))) {
-                        retStr += disMap.get(diseaseName) + ",";
-                    }
+            RespDTO<Map<String, String>> respDTO = tranServiceClient.getDiseaseIcdMap(diseaseIcdVO);
+            if (RespDTOUtil.respIsOK(respDTO)) {
+                disMap = respDTO.data;
+            }
+            for (String diseaseName : strList) {
+                if (StringUtil.isNotBlank(disMap.get(diseaseName))) {
+                    retStr += disMap.get(diseaseName) + ",";
                 }
             }
         }

+ 18 - 5
aipt-service/src/main/java/com/diagbot/facade/TreatmentFacade.java

@@ -7,6 +7,7 @@ import com.diagbot.biz.push.entity.MedicitionClass;
 import com.diagbot.biz.push.entity.MeditionDetail;
 import com.diagbot.biz.push.entity.Treat;
 import com.diagbot.biz.push.entity.TreatmentPlan;
+import com.diagbot.config.CryptConfiguer;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.entity.Concept;
 import com.diagbot.entity.ConceptDetail;
@@ -16,6 +17,7 @@ import com.diagbot.enums.LexiconRSTypeEnum;
 import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
+import com.diagbot.util.CryptUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ConceptBaseVO;
@@ -44,6 +46,8 @@ public class TreatmentFacade {
     ConceptDetailFacade conceptDetailFacade;
     @Autowired
     DataBeanAggregateQueryFacade dataBeanAggregateQueryFacade;
+    @Autowired
+    CryptConfiguer cryptConfiguer;
 
     /**
      * 获取治疗方案
@@ -52,11 +56,16 @@ public class TreatmentFacade {
      * @return
      */
     public Treat getTreatment(Treat treat, Item diseaseName, Integer disType) {
+        String disUniqueName = diseaseName.getUniqueName();
+        if (cryptConfiguer.cryptFlag) {
+            //加密诊断名称
+            disUniqueName = CryptUtil.encrypt_char(disUniqueName);
+        }
         List<MedicitionClass> drugsList = Lists.newLinkedList();
         List<String> conceptNameList = Lists.newLinkedList();
-        conceptNameList.add(diseaseName.getUniqueName());
+        conceptNameList.add(disUniqueName);
         ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
-        conceptBaseVO.setName(diseaseName.getUniqueName());
+        conceptBaseVO.setName(disUniqueName);
         conceptBaseVO.setLibType(LexiconTypeEnum.DIAGNOSIS.getKey());
         Concept disease = conceptFacade.exist(conceptBaseVO);
         if (disease == null) {
@@ -137,12 +146,16 @@ public class TreatmentFacade {
         Boolean isChronic = false;
         if (disType != null && disType.equals(DisTypeEnum.CHRONIC.getKey())) {
             //验证是否慢病
-            conceptBaseVO.setName("慢病");
+            if (cryptConfiguer.cryptFlag) {
+                conceptBaseVO.setName(CryptUtil.encrypt_char("慢病"));
+            } else {
+                conceptBaseVO.setName("慢病");
+            }
             conceptBaseVO.setLibType(LexiconTypeEnum.TYPES_OF_DISEASE.getKey());
             Concept chronicConcept = conceptFacade.exist(conceptBaseVO);
             ConceptWrapper conceptWrapper = new ConceptWrapper();
             conceptWrapper.setStartId(disease.getId());
-            conceptWrapper.setStartName(diseaseName.getUniqueName());
+            conceptWrapper.setStartName(disUniqueName);
             conceptWrapper.setStartType(LexiconTypeEnum.DIAGNOSIS.getKey());
             conceptWrapper.setEndId(chronicConcept.getId());
             conceptWrapper.setEndName(chronicConcept.getLibName());
@@ -155,7 +168,7 @@ public class TreatmentFacade {
         try {
             Map<String, Object> invokeParams = new HashMap<>();
             invokeParams.put("treat", treat);
-            invokeParams.put("diseaseName", diseaseName.getUniqueName());
+            invokeParams.put("diseaseName", disUniqueName);
             invokeParams.put("drugsList", drugsList);
             invokeParams.put("treatmentPlan", treatmentPlanList);
             invokeParams.put("conceptMap", conceptMap);

+ 8 - 1
aipt-service/src/main/java/com/diagbot/mapper/ConceptDetailMapper.java

@@ -1,7 +1,12 @@
 package com.diagbot.mapper;
 
-import com.diagbot.entity.ConceptDetail;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.ConceptDetail;
+import com.diagbot.vo.ConceptDetailPageVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * <p>
@@ -12,5 +17,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @since 2019-05-06
  */
 public interface ConceptDetailMapper extends BaseMapper<ConceptDetail> {
+    List<ConceptDetail> selectByParam(ConceptDetail conceptDetail);
 
+    IPage<ConceptDetail> selectiveTestPage(@Param("conceptDetailPageVO") ConceptDetailPageVO conceptDetailPageVO);
 }

+ 8 - 1
aipt-service/src/main/java/com/diagbot/service/ConceptDetailService.java

@@ -1,7 +1,11 @@
 package com.diagbot.service;
 
-import com.diagbot.entity.ConceptDetail;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.ConceptDetail;
+import com.diagbot.vo.ConceptDetailPageVO;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +17,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ConceptDetailService extends IService<ConceptDetail> {
 
+    List<ConceptDetail> selectByParam(ConceptDetail conceptDetail);
+
+    IPage<ConceptDetail> selectiveTestPage(ConceptDetailPageVO conceptDetailPageVO);
 }

+ 12 - 1
aipt-service/src/main/java/com/diagbot/service/impl/ConceptDetailServiceImpl.java

@@ -1,11 +1,15 @@
 package com.diagbot.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.entity.ConceptDetail;
 import com.diagbot.mapper.ConceptDetailMapper;
 import com.diagbot.service.ConceptDetailService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.ConceptDetailPageVO;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 提示信息明细表 服务实现类
@@ -17,4 +21,11 @@ import org.springframework.stereotype.Service;
 @Service
 public class ConceptDetailServiceImpl extends ServiceImpl<ConceptDetailMapper, ConceptDetail> implements ConceptDetailService {
 
+    public List<ConceptDetail> selectByParam(ConceptDetail conceptDetail) {
+        return this.baseMapper.selectByParam(conceptDetail);
+    }
+
+    public IPage<ConceptDetail> selectiveTestPage(ConceptDetailPageVO conceptDetailPageVO) {
+        return this.baseMapper.selectiveTestPage(conceptDetailPageVO);
+    }
 }

+ 2 - 0
aipt-service/src/main/java/com/diagbot/vo/ConceptBaseVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -14,6 +15,7 @@ import javax.validation.constraints.NotNull;
 @Getter
 @Setter
 public class ConceptBaseVO {
+    @CryptField
     @NotBlank(message = "概念名称不能为空")
     private String name;
     @NotNull(message = "词性不能为空")

+ 35 - 0
aipt-service/src/main/java/com/diagbot/vo/ConceptDetailPageVO.java

@@ -0,0 +1,35 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.annotation.CryptField;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/12/31 17:15
+ */
+@Getter
+@Setter
+public class ConceptDetailPageVO extends Page {
+
+    /**
+     * 提示明细标题
+     */
+    @CryptField
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    @CryptField
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    @CryptField
+    private String text;
+}

+ 2 - 0
aipt-service/src/main/java/com/diagbot/vo/ConceptIntroduceVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.annotation.CryptField;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
@@ -16,6 +17,7 @@ import java.util.List;
 @Getter
 @Setter
 public class ConceptIntroduceVO {
+    @CryptField
     @NotBlank(message = "请输入概念名称")
     private String name;
     @NotNull(message = "请输入概念词性")

+ 2 - 0
aipt-service/src/main/java/com/diagbot/vo/ConceptUsualVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -14,6 +15,7 @@ import javax.validation.constraints.NotNull;
 @Setter
 public class ConceptUsualVO {
 
+    @CryptField
     @NotNull(message = "请输入科室名称")
     private String deptName;
     @NotNull(message = "请输入病人年龄")

+ 4 - 0
aipt-service/src/main/java/com/diagbot/vo/ConnectIntroduceVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.annotation.CryptField;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
@@ -16,13 +17,16 @@ import java.util.List;
 @Getter
 @Setter
 public class ConnectIntroduceVO {
+    @CryptField
     @NotBlank(message = "请输入术语名称")
     private String name;
+    @CryptField
     private String detailName;
     @NotNull(message = "请输入术语类型")
     private Integer type;
     @NotBlank(message = "请输入医院编码")
     private String hosCode;
+    @CryptField
     @ApiModelProperty(hidden = true)
     private String uniqueName;
     @ApiModelProperty(hidden = true)

+ 2 - 1
aipt-service/src/main/java/com/diagbot/vo/DisScaleVO.java

@@ -1,10 +1,10 @@
 package com.diagbot.vo;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
 
 /**
  * @Description: 诊断量表入参
@@ -14,6 +14,7 @@ import javax.validation.constraints.NotNull;
 @Getter
 @Setter
 public class DisScaleVO {
+    @CryptField
     @NotBlank(message = "疾病名称不能为空")
     private String disName;
 }

+ 2 - 0
aipt-service/src/main/java/com/diagbot/vo/DisTypeVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -14,6 +15,7 @@ import javax.validation.constraints.NotNull;
 @Getter
 @Setter
 public class DisTypeVO {
+    @CryptField
     @NotBlank(message = "请输入诊断名称")
     private String name;
     @NotNull(message = "请输入诊断类型")

+ 2 - 0
aipt-service/src/main/java/com/diagbot/vo/GetLisMappingVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -14,6 +15,7 @@ import java.util.List;
 @Getter
 @Setter
 public class GetLisMappingVO {
+    @CryptField
     @NotBlank(message = "请输入化验套餐项")
     private String project;
     private List<String> details;

+ 2 - 0
aipt-service/src/main/java/com/diagbot/vo/GetStaticKnowledgeVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -16,6 +17,7 @@ import java.util.List;
 @Setter
 public class GetStaticKnowledgeVO {
     //检索内容
+    @CryptField
     @NotBlank(message = "请输入检索内容")
     private String InputStr;
     //需要去重的id

+ 18 - 16
aipt-service/src/main/java/com/diagbot/vo/IndexConfigdiseaseNameVO.java

@@ -1,16 +1,18 @@
-package com.diagbot.vo;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * 
- * @author wangfeng
- * @Description: TODO
- * @date 2019年5月6日 下午6:41:38
- */
-@Setter
-@Getter
-public class IndexConfigdiseaseNameVO {
-	private String diseaseName;
-}
+package com.diagbot.vo;
+
+import com.diagbot.annotation.CryptField;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年5月6日 下午6:41:38
+ */
+@Setter
+@Getter
+public class IndexConfigdiseaseNameVO {
+	@CryptField
+	private String diseaseName;
+}

+ 37 - 35
aipt-service/src/main/java/com/diagbot/vo/IndexDataFindVO.java

@@ -1,35 +1,37 @@
-package com.diagbot.vo;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * 
- * @author wangfeng
- * @Description: 数据数据获取入参
- * @date 2019年5月7日 上午10:00:15
- */
-@Getter
-@Setter
-public class IndexDataFindVO {
-
-	/**
-	 * 疾病ID
-	 */
-	@NotNull(message = "请输入疾病名")
-	private String diseaseName;
-	/**
-	 * 患者id
-	 */
-	@NotNull(message = "请输入患者id")
-	private Long patientId;
-
-	@NotBlank(message = "请输入开始时间")
-	private String startTime;
-
-	@NotBlank(message = "请输入结束时间")
-	private String endTime;
-}
+package com.diagbot.vo;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+import com.diagbot.annotation.CryptField;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: 数据数据获取入参
+ * @date 2019年5月7日 上午10:00:15
+ */
+@Getter
+@Setter
+public class IndexDataFindVO {
+
+	/**
+	 * 疾病ID
+	 */
+	@NotNull(message = "请输入疾病名")
+	@CryptField
+	private String diseaseName;
+	/**
+	 * 患者id
+	 */
+	@NotNull(message = "请输入患者id")
+	private Long patientId;
+
+	@NotBlank(message = "请输入开始时间")
+	private String startTime;
+
+	@NotBlank(message = "请输入结束时间")
+	private String endTime;
+}

+ 2 - 0
aipt-service/src/main/java/com/diagbot/vo/RetrievalVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -17,6 +18,7 @@ public class RetrievalVO {
     private Integer type;
     private Integer age;
     @NotBlank(message = "请输入检索内容")
+    @CryptField
     private String InputStr;
     private Integer sexType;
     //需要去重的id

+ 2 - 0
aipt-service/src/main/java/com/diagbot/vo/ScaleIndexVO.java

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.diagbot.annotation.CryptField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
@@ -17,6 +18,7 @@ import java.util.List;
 @Setter
 @ApiModel
 public class ScaleIndexVO {
+    @CryptField
     @NotBlank(message = "名称不能为空")
     private String name;
     @ApiModelProperty(hidden = true)

+ 97 - 0
aipt-service/src/main/java/com/diagbot/web/ConceptDetailTestController.java

@@ -0,0 +1,97 @@
+//package com.diagbot.web;
+//
+//import com.baomidou.mybatisplus.core.metadata.IPage;
+//import com.diagbot.annotation.SysLogger;
+//import com.diagbot.config.CryptConfiguer;
+//import com.diagbot.dto.RespDTO;
+//import com.diagbot.entity.ConceptDetail;
+//import com.diagbot.facade.ConceptDetailTestFacade;
+//import com.diagbot.vo.ConceptDetailPageVO;
+//import io.swagger.annotations.Api;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.PostMapping;
+//import org.springframework.web.bind.annotation.RequestBody;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RequestParam;
+//import org.springframework.web.bind.annotation.RestController;
+//import springfox.documentation.annotations.ApiIgnore;
+//
+//import javax.validation.Valid;
+//import java.util.List;
+//
+///**
+// * @Description:
+// * @Author:zhaops
+// * @time: 2019/12/30 20:22
+// */
+//@RestController
+//@RequestMapping("/conceptDetailTest")
+//@Api(value = "提示信息加密测试", tags = { "知识库标准化-提示信息加密测试相关API" })
+//@SuppressWarnings("unchecked")
+//@Deprecated
+//@ApiIgnore
+//public class ConceptDetailTestController {
+//    @Autowired
+//    private CryptConfiguer cryptConfiguer;
+//
+//    @Autowired
+//    private ConceptDetailTestFacade conceptDetailTestFacade;
+//
+//    @PostMapping("/saveRecord")
+//    @SysLogger("saveRecord")
+//    public RespDTO<ConceptDetail> saveRecord(@Valid @RequestBody ConceptDetail conceptDetail) {
+//        ConceptDetail data = conceptDetailTestFacade.saveRecord(conceptDetail);
+//        return RespDTO.onSuc(data);
+//    }
+//
+//    @PostMapping("/getById")
+//    @SysLogger("getById")
+//    public RespDTO<ConceptDetail> getById(@RequestParam Long id) {
+//        ConceptDetail data = conceptDetailTestFacade.getByIds(id);
+//        System.out.println(cryptConfiguer.cryptFlag);
+//        return RespDTO.onSuc(data);
+//    }
+//
+//    @PostMapping("/getByParam")
+//    @SysLogger("getByParam")
+//    public RespDTO<ConceptDetail> getByParam(@Valid @RequestBody ConceptDetail conceptDetail) {
+//        List<ConceptDetail> data = conceptDetailTestFacade.getByParam(conceptDetail);
+//        return RespDTO.onSuc(data);
+//    }
+//
+//    @PostMapping("/selectByParam")
+//    @SysLogger("selectByParam")
+//    public RespDTO<ConceptDetail> selectByParam(@Valid @RequestBody ConceptDetail conceptDetail) {
+//        List<ConceptDetail> data = conceptDetailTestFacade.selectByParam(conceptDetail);
+//        return RespDTO.onSuc(data);
+//    }
+//
+//
+//    @PostMapping("/getOneByParam")
+//    @SysLogger("getOneByParam")
+//    public RespDTO<ConceptDetail> getOneByParam(@Valid @RequestBody ConceptDetail conceptDetail) {
+//        List<ConceptDetail> data = conceptDetailTestFacade.getByParam(conceptDetail);
+//        return RespDTO.onSuc(data.size() > 0 ? data.get(0) : null);
+//    }
+//
+//
+//    @PostMapping("/selectOneByParam")
+//    @SysLogger("selectOneByParam")
+//    public RespDTO<ConceptDetail> selectOneByParam(@Valid @RequestBody ConceptDetail conceptDetail) {
+//        List<ConceptDetail> data = conceptDetailTestFacade.selectByParam(conceptDetail);
+//        return RespDTO.onSuc(data.size() > 0 ? data.get(0) : null);
+//    }
+//
+//    /**
+//     * 分页查询静态知识,可带过滤条件
+//     *
+//     * @param conceptDetailPageVO
+//     * @return
+//     */
+//    @PostMapping("/getConceptDetailPage")
+//    @SysLogger("getConceptDetailPage")
+//    public RespDTO getConceptDetailPage(@RequestBody ConceptDetailPageVO conceptDetailPageVO) {
+//        IPage<ConceptDetail> conceptDetailIPage = conceptDetailTestFacade.selectiveTestPage(conceptDetailPageVO);
+//        return RespDTO.onSuc(conceptDetailIPage);
+//    }
+//}

+ 54 - 54
aipt-service/src/main/java/com/diagbot/web/DisScaleController.java

@@ -1,54 +1,54 @@
-package com.diagbot.web;
-
-
-import com.diagbot.dto.DisScaleDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.ScaleIndexDTO;
-import com.diagbot.facade.DisScaleFacade;
-import com.diagbot.vo.DisScaleVO;
-import com.diagbot.vo.ScaleIndexVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.validation.Valid;
-import java.util.List;
-
-/**
- * <p>
- * 诊断量表映射表 前端控制器
- * </p>
- *
- * @author zhoutg
- * @since 2019-05-05
- */
-@RestController
-@RequestMapping("/scale")
-@Api(value = "诊断量表API", tags = { "知识库标准化-诊断量表API" })
-@SuppressWarnings("unchecked")
-public class DisScaleController {
-
-    @Autowired
-    DisScaleFacade disScaleFacade;
-
-    @ApiOperation(value = "知识库标准化-返回诊断量表列表[by:zhoutg]",
-            notes = "")
-    @PostMapping("/getList")
-    public RespDTO<List<DisScaleDTO>> getList(@Valid @RequestBody DisScaleVO scaleVO) {
-        List<DisScaleDTO> data = disScaleFacade.getDisScaleFac(scaleVO);
-        return RespDTO.onSuc(data);
-    }
-
-
-    @ApiOperation(value = "知识库标准化-量表搜索[by:zhoutg]",
-            notes = "")
-    @PostMapping("/index")
-    public RespDTO<List<ScaleIndexDTO>> index(@Valid @RequestBody ScaleIndexVO scaleVO) {
-        List<ScaleIndexDTO> data = disScaleFacade.indexFac(scaleVO);
-        return RespDTO.onSuc(data);
-    }
-}
+//package com.diagbot.web;
+//
+//
+//import com.diagbot.dto.DisScaleDTO;
+//import com.diagbot.dto.RespDTO;
+//import com.diagbot.dto.ScaleIndexDTO;
+//import com.diagbot.facade.DisScaleFacade;
+//import com.diagbot.vo.DisScaleVO;
+//import com.diagbot.vo.ScaleIndexVO;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.PostMapping;
+//import org.springframework.web.bind.annotation.RequestBody;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import javax.validation.Valid;
+//import java.util.List;
+//
+///**
+// * <p>
+// * 诊断量表映射表 前端控制器
+// * </p>
+// *
+// * @author zhoutg
+// * @since 2019-05-05
+// */
+//@RestController
+//@RequestMapping("/scale")
+//@Api(value = "诊断量表API", tags = { "知识库标准化-诊断量表API" })
+//@SuppressWarnings("unchecked")
+//public class DisScaleController {
+//
+//    @Autowired
+//    DisScaleFacade disScaleFacade;
+//
+//    @ApiOperation(value = "知识库标准化-返回诊断量表列表[by:zhoutg]",
+//            notes = "")
+//    @PostMapping("/getList")
+//    public RespDTO<List<DisScaleDTO>> getList(@Valid @RequestBody DisScaleVO scaleVO) {
+//        List<DisScaleDTO> data = disScaleFacade.getDisScaleFac(scaleVO);
+//        return RespDTO.onSuc(data);
+//    }
+//
+//
+//    @ApiOperation(value = "知识库标准化-量表搜索[by:zhoutg]",
+//            notes = "")
+//    @PostMapping("/index")
+//    public RespDTO<List<ScaleIndexDTO>> index(@Valid @RequestBody ScaleIndexVO scaleVO) {
+//        List<ScaleIndexDTO> data = disScaleFacade.indexFac(scaleVO);
+//        return RespDTO.onSuc(data);
+//    }
+//}

+ 1 - 1
aipt-service/src/main/java/com/diagbot/web/DiseaseIcdController.java

@@ -39,7 +39,7 @@ public class DiseaseIcdController {
                     "hospitalCode:医院编号,必填<br>")
     @PostMapping("/getDiseaseIcds")
     @SysLogger("getDiseaseIcds")
-    @ApiIgnore
+//    @ApiIgnore
     public RespDTO<List<DiseaseIcdDTO>> getDiseaseIcds(@RequestBody @Valid GetDiseaseIcdVO getDiseaseIcdVO) {
         List<DiseaseIcdDTO> data = diseaseIcdFacade.getDiseaseIcds(getDiseaseIcdVO);
         return RespDTO.onSuc(data);

+ 44 - 44
aipt-service/src/main/java/com/diagbot/web/IndexConfigController.java

@@ -1,44 +1,44 @@
-package com.diagbot.web;
-
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.IndexConfigDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.facade.IndexConfigFacade;
-import com.diagbot.vo.IndexConfigdiseaseNameVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import springfox.documentation.annotations.ApiIgnore;
-
-import java.util.List;
-
-/**
- * <p>
- * 指标配置 前端控制器
- * </p>
- *
- * @author wangfeng
- * @since 2019-05-06
- */
-@RestController
-@RequestMapping("/indexConfig")
-@Api(value = "指标配置API[by:wangfeng]", tags = { "知识库标准化-指标配置API" })
-@SuppressWarnings("unchecked")
-@ApiIgnore
-public class IndexConfigController {
-
-    @Autowired
-    IndexConfigFacade indexConfigFacade;
-
-    @ApiOperation(value = "知识库标准化-根据疾病获取指标配置[by:wangfeng]", notes = "根据疾病获取指标配置")
-    @PostMapping("/getindexConfigs")
-    @SysLogger("getindexConfigs")
-    public RespDTO<List<IndexConfigDTO>> getindexConfigs(@RequestBody IndexConfigdiseaseNameVO indexConfigdiseaseNameVO) {
-        List<IndexConfigDTO> data = indexConfigFacade.getIndexConfig(indexConfigdiseaseNameVO.getDiseaseName());
-        return RespDTO.onSuc(data);
-    }
-}
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.IndexConfigDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.IndexConfigFacade;
+import com.diagbot.vo.IndexConfigdiseaseNameVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 指标配置 前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2019-05-06
+ */
+@RestController
+@RequestMapping("/indexConfig")
+@Api(value = "指标配置API[by:wangfeng]", tags = { "知识库标准化-指标配置API" })
+@SuppressWarnings("unchecked")
+//@ApiIgnore
+public class IndexConfigController {
+
+    @Autowired
+    IndexConfigFacade indexConfigFacade;
+
+    @ApiOperation(value = "知识库标准化-根据疾病获取指标配置[by:wangfeng]", notes = "根据疾病获取指标配置")
+    @PostMapping("/getindexConfigs")
+    @SysLogger("getindexConfigs")
+    public RespDTO<List<IndexConfigDTO>> getindexConfigs(@RequestBody IndexConfigdiseaseNameVO indexConfigdiseaseNameVO) {
+        List<IndexConfigDTO> data = indexConfigFacade.getIndexConfig(indexConfigdiseaseNameVO.getDiseaseName());
+        return RespDTO.onSuc(data);
+    }
+}

+ 18 - 0
aipt-service/src/main/resources/mapper/ConceptDetailMapper.xml

@@ -20,4 +20,22 @@
         <result column="source" property="source" />
     </resultMap>
 
+    <select id="selectByParam" resultType="com.diagbot.entity.ConceptDetail" parameterType="com.diagbot.entity.ConceptDetail">
+    SELECT t.*
+    FROM
+    kl_concept_detail t
+    WHERE 1=1
+    <if test="content!=null and content!=''">
+        and content like concat('%',#{content},'%')
+    </if>
+    </select>
+
+    <select id="selectiveTestPage" resultMap="BaseResultMap">
+        SELECT *
+        FROM kl_concept_detail t
+        WHERE t.is_deleted = 'N'
+        <if test="conceptDetailPageVO.content!=null and conceptDetailPageVO.content!=''">
+            and t.content like concat('%',#{conceptDetailPageVO.content},'%')
+        </if>
+    </select>
 </mapper>

+ 37 - 0
common-biz-client/pom.xml

@@ -59,6 +59,43 @@
         </dependency>
     </dependencies>
 
+    <!-- 私有仓库 -->
+    <repositories>
+        <repository>
+            <id>nexus-releases</id>
+            <name>Nexus Release Repository</name>
+            <url>http://192.168.2.236:8081/repository/maven-releases/</url>
+        </repository>
+    </repositories>
+    <!-- 私有仓库 -->
+    <pluginRepositories>
+        <pluginRepository>
+            <id>nexus-releases</id>
+            <name>Nexus Release Repository</name>
+            <url>http://192.168.2.236:8081/repository/maven-releases/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+    <distributionManagement>
+        <repository>
+            <id>nexus-releases</id>
+            <name>Nexus Release Repository</name>
+            <url>http://192.168.2.236:8081/repository/maven-releases/</url>
+        </repository>
+        <snapshotRepository>
+            <id>nexus-snapshots</id>
+            <name>Nexus Snapshot Repository</name>
+            <url>http://192.168.2.236:8081/repository/maven-snapshots/</url>
+        </snapshotRepository>
+    </distributionManagement>
+
+
     <build>
         <plugins>
             <plugin>

+ 37 - 1
common/pom.xml

@@ -75,7 +75,7 @@
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
             <version>2.8.6</version>
-            <scope>provided</scope>
+            <scope>compile</scope>
         </dependency>
 
         <dependency>
@@ -133,6 +133,42 @@
         <!--</dependency>-->
     </dependencies>
 
+    <!-- 私有仓库 -->
+    <repositories>
+        <repository>
+            <id>nexus-releases</id>
+            <name>Nexus Release Repository</name>
+            <url>http://192.168.2.236:8081/repository/maven-releases/</url>
+        </repository>
+    </repositories>
+    <!-- 私有仓库 -->
+    <pluginRepositories>
+        <pluginRepository>
+            <id>nexus-releases</id>
+            <name>Nexus Release Repository</name>
+            <url>http://192.168.2.236:8081/repository/maven-releases/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+    <distributionManagement>
+        <repository>
+            <id>nexus-releases</id>
+            <name>Nexus Release Repository</name>
+            <url>http://192.168.2.236:8081/repository/maven-releases/</url>
+        </repository>
+        <snapshotRepository>
+            <id>nexus-snapshots</id>
+            <name>Nexus Snapshot Repository</name>
+            <url>http://192.168.2.236:8081/repository/maven-snapshots/</url>
+        </snapshotRepository>
+    </distributionManagement>
+
     <build>
         <plugins>
             <plugin>

+ 26 - 0
common/src/main/java/com/diagbot/annotation/CryptField.java

@@ -0,0 +1,26 @@
+package com.diagbot.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @Description: 加解密注解
+ * @author: gaodm
+ * @time: 2019/12/30 18:36
+ */
+@Inherited
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
+public @interface CryptField {
+
+    String value() default "";
+
+    boolean encrypt() default true;
+
+    boolean decrypt() default true;
+}

+ 2 - 0
common/src/main/java/com/diagbot/biz/push/entity/AdverseReaction.java

@@ -1,5 +1,6 @@
 package com.diagbot.biz.push.entity;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -20,6 +21,7 @@ public class AdverseReaction {
     /**
      * 术语名称
      */
+    @CryptField
     private String name;
     /**
      * 词性

+ 3 - 0
common/src/main/java/com/diagbot/biz/push/entity/FeatureRate.java

@@ -1,5 +1,6 @@
 package com.diagbot.biz.push.entity;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -9,7 +10,9 @@ import lombok.Setter;
 @Getter
 @Setter
 public class FeatureRate {
+    @CryptField
     private String featureName;
+    @CryptField
     private String extraProperty;
     private String desc;
     private String rate;

+ 6 - 0
common/src/main/java/com/diagbot/biz/push/entity/MedicalIndication.java

@@ -1,5 +1,6 @@
 package com.diagbot.biz.push.entity;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -29,7 +30,12 @@ public class MedicalIndication {
     /**
      * 名称(术语、描述等)
      */
+    @CryptField
     private String name;
+    /**
+     * 医院入参
+     */
+    private String hisName;
     /**
      * 病情提示明细
      */

+ 2 - 0
common/src/main/java/com/diagbot/biz/push/entity/Medicition.java

@@ -1,5 +1,6 @@
 package com.diagbot.biz.push.entity;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -18,6 +19,7 @@ public class Medicition {
     /**
      * 药品名称
      */
+    @CryptField
     private String medicitionName;
     /**
      * 词性(10:药品通用名)

+ 3 - 0
common/src/main/java/com/diagbot/biz/push/entity/MedicitionClass.java

@@ -1,5 +1,6 @@
 package com.diagbot.biz.push.entity;
 
+import com.diagbot.annotation.CryptField;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -28,6 +29,7 @@ public class MedicitionClass {
     /**
      * 药品大类名称
      */
+    @CryptField
     private String bigdrugsName;
     /**
      * 药品大类词性
@@ -44,6 +46,7 @@ public class MedicitionClass {
     /**
      * 药品小类名称
      */
+    @CryptField
     private String subdrugsName;
     /**
      * 药品小类词性

+ 1 - 0
common/src/main/java/com/diagbot/enums/SysTypeEnum.java

@@ -30,6 +30,7 @@ public enum SysTypeEnum implements KeyedNamed {
     PREC_SERVICE(17, "prec-service"),
     PRECMAN_SERVICE(18, "precman-service"),
     MRQCMAN_SERVICE(19, "mrqcman-service"),
+    MRMAN_SERVICE(20, "mrman-service"),
     ZNWZ_SERVICE(21, "znwz-service"),
     ZZCX_SERVICE(22, "zzcx-service"),
     XLCS_SERVICE(23, "xlcs-service");

+ 2 - 2
common/src/main/java/com/diagbot/util/AopUtil.java

@@ -4,12 +4,12 @@ import com.diagbot.annotation.BiLogger;
 import com.diagbot.annotation.BiLoggerResult;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.annotation.SysLoggerExport;
+import com.diagbot.biz.log.entity.BiRecord;
+import com.diagbot.biz.log.entity.SysLog;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.enums.BiSourceEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
-import com.diagbot.biz.log.entity.BiRecord;
-import com.diagbot.biz.log.entity.SysLog;
 import com.diagbot.vo.BaseBiVO;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.ProceedingJoinPoint;

+ 208 - 0
common/src/main/java/com/diagbot/util/CryptPojoUtils.java

@@ -0,0 +1,208 @@
+package com.diagbot.util;
+
+/**
+ * @Description: 实体类加解密工具类
+ * @author: gaodm
+ * @date: 2019/12/31 21:07
+ * @version: V1.0
+ */
+
+import com.diagbot.annotation.CryptField;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.lang.reflect.Field;
+import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+public class CryptPojoUtils {
+
+    /**
+     * 对含注解字段加密
+     */
+    public static <T> void encryptFields(T[] objects) {
+        for (Object obj : objects) {
+            encryptFieldOrList(obj);
+        }
+    }
+
+    /**
+     * 对含注解字段加密
+     */
+    public static <T> void encryptFieldOrList(T t) {
+        if (isNotCrypt(t)) {
+            return;
+        }
+        if (t instanceof List) {
+            List values = (List) t;
+            for (Object object : values) {
+                CryptPojoUtils.encryptField(object);
+            }
+        } else {
+            CryptPojoUtils.encryptField(t);
+        }
+    }
+
+    /**
+     * 对含注解字段加密
+     */
+    private static <T> void encryptField(T t) {
+        if (isNotCrypt(t)) {
+            return;
+        }
+
+        Field[] declaredFields = getAllFields(t.getClass());
+        try {
+            if (declaredFields != null && declaredFields.length > 0) {
+                for (Field field : declaredFields) {
+                    if (field.isAnnotationPresent(CryptField.class)
+                            && field.getType().toString().endsWith("String")) {
+                        field.setAccessible(true);
+                        String fieldValue = (String) field.get(t);
+                        if (StringUtils.isNotEmpty(fieldValue)) {
+                            field.set(t, CryptUtil.encrypt_char(fieldValue));
+                        }
+                    } else if (field.getType().equals(List.class)) {
+                        field.setAccessible(true);
+                        List fieldValue = (List) field.get(t);
+                        if (ListUtil.isEmpty(fieldValue)) {
+                            continue;
+                        }
+                        for (Object listValue : fieldValue) {
+                            encryptField(listValue);
+                        }
+                    } else if (field.getType().equals(LinkedList.class)) {
+                        field.setAccessible(true);
+                        LinkedList fieldValue = (LinkedList) field.get(t);
+                        if (ListUtil.isEmpty(fieldValue)) {
+                            continue;
+                        }
+                        for (Object listValue : fieldValue) {
+                            encryptField(listValue);
+                        }
+                    } else {
+                        field.setAccessible(true);
+                        Object fieldValue = field.get(t);
+                        encryptField(fieldValue);
+                    }
+                }
+            }
+        } catch (IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 对含注解字段解密
+     */
+    public static <T> void decryptFields(T[] objects) {
+        for (Object obj : objects) {
+            decryptFieldOrList(obj);
+        }
+    }
+
+    /**
+     * 对含注解字段解密
+     */
+    public static <T> void decryptFieldOrList(T t) {
+        if (isNotCrypt(t)) {
+            return;
+        }
+        if (t instanceof List) {
+            List values = (List) t;
+            for (Object object : values) {
+                CryptPojoUtils.decryptField(object);
+            }
+        } else {
+            CryptPojoUtils.decryptField(t);
+        }
+    }
+
+    /**
+     * 对含注解字段解密
+     */
+    private static <T> void decryptField(T t) {
+        if (isNotCrypt(t)) {
+            return;
+        }
+
+        Field[] declaredFields = getAllFields(t.getClass());
+        try {
+            if (declaredFields != null && declaredFields.length > 0) {
+                for (Field field : declaredFields) {
+                    if (field.isAnnotationPresent(CryptField.class)
+                            && field.getType().toString().endsWith("String")) {
+                        field.setAccessible(true);
+                        String fieldValue = (String) field.get(t);
+                        if (StringUtils.isNotEmpty(fieldValue)) {
+                            field.set(t, CryptUtil.decrypt_char(fieldValue));
+                        }
+                    } else if (field.getType().equals(List.class)) {
+                        field.setAccessible(true);
+                        List fieldValue = (List) field.get(t);
+                        if (ListUtil.isEmpty(fieldValue)) {
+                            continue;
+                        }
+                        for (Object listValue : fieldValue) {
+                            decryptField(listValue);
+                        }
+                    } else if (field.getType().equals(LinkedList.class)) {
+                        field.setAccessible(true);
+                        LinkedList fieldValue = (LinkedList) field.get(t);
+                        if (ListUtil.isEmpty(fieldValue)) {
+                            continue;
+                        }
+                        for (Object listValue : fieldValue) {
+                            decryptField(listValue);
+                        }
+                    } else {
+                        field.setAccessible(true);
+                        Object fieldValue = field.get(t);
+                        decryptField(fieldValue);
+                    }
+                }
+            }
+        } catch (IllegalAccessException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    /**
+     * 判断是否需要加解密
+     *
+     * @param o
+     * @return
+     */
+    private static boolean isNotCrypt(Object o) {
+        return o == null || o instanceof Double
+                || o instanceof Integer || o instanceof Long
+                || o instanceof Boolean || o instanceof Map
+                || o instanceof Date || o instanceof LocalDate
+                || o instanceof MultipartFile || o instanceof HttpServletRequest
+                || o instanceof HttpServletResponse;
+    }
+
+    /**
+     * 获取本类及其父类的属性的方法
+     *
+     * @param clazz 当前类对象
+     * @return 字段数组
+     */
+    private static Field[] getAllFields(Class<?> clazz) {
+        List<Field> fieldList = new ArrayList<>();
+        while (clazz != null) {
+            fieldList.addAll(new ArrayList<>(Arrays.asList(clazz.getDeclaredFields())));
+            clazz = clazz.getSuperclass();
+        }
+        Field[] fields = new Field[fieldList.size()];
+        return fieldList.toArray(fields);
+    }
+}

+ 101 - 0
common/src/main/java/com/diagbot/util/CryptUtil.java

@@ -0,0 +1,101 @@
+package com.diagbot.util;
+
+import java.util.List;
+
+/**
+ * @Description: 加解密工具类
+ * @author: gaodm
+ * @time: 2019/12/30 11:09
+ */
+public class CryptUtil {
+
+    private final static char EN_MAX = '\u0080';//128
+    private final static int MOVE_NUM = 2;
+    private final static char DE_MAX = EN_MAX + MOVE_NUM;
+
+    /**
+     * 加密,把一个字符串在原有的基础上+2
+     *
+     * @param data 需要解密的原字符串
+     * @return 返回解密后的新字符串
+     */
+    public static String encrypt_char(String data) {
+        char[] chars = data.toCharArray();
+        for (int i = 0; i < chars.length; i++) {
+            if (EN_MAX < chars[i]) {
+                chars[i] += MOVE_NUM;
+            }
+        }
+        return new String(chars);
+    }
+
+    /**
+     * 解密:把一个加密后的字符串在原有基础上-2
+     *
+     * @param data 加密后的字符串
+     * @return 返回解密后的新字符串
+     */
+    public static String decrypt_char(String data) {
+        char[] chars = data.toCharArray();
+        for (int i = 0; i < chars.length; i++) {
+            if (DE_MAX < chars[i]) {
+                chars[i] -= MOVE_NUM;
+            }
+        }
+        return new String(chars);
+    }
+
+
+    /**
+     * 对List<String>进行加密
+     *
+     * @param list 加密前的list
+     * @return 加密后的list
+     */
+    public static void encryptList(List<String> list) {
+        if (ListUtil.isNotEmpty(list)) {
+            for (int i = 0; i < list.size(); i++) {
+                list.set(i, CryptUtil.encrypt_char(list.get(i)));
+            }
+        }
+    }
+
+    /**
+     * 对List<String>进行解密
+     * @param list 解密前的list
+     * @return 解密后的list
+     */
+    public static void decryptList(List<String> list) {
+        if (ListUtil.isNotEmpty(list)) {
+            for (int i = 0; i < list.size(); i++) {
+                list.set(i, CryptUtil.decrypt_char(list.get(i)));
+            }
+        }
+    }
+
+
+
+    public static void main(String[] args) {
+        //加密英文
+        String data = "解密后:�dsfaa2132159-4331}~\u007F";
+        String charResult = encrypt_char(data);
+        System.out.println("加密后:" + charResult);
+        //解密
+        String charStr = decrypt_char(charResult);
+        System.out.println("解密后:" + charStr);
+
+
+        //加密中文
+        data = "跳梁小豆tlxd666,z";
+        String result = encrypt_char(data);
+        System.out.println("加密后:" + result);
+        String str1 = decrypt_char(result);
+        System.out.println("解密后:" + str1);
+
+//        int num = 32;
+//        while (num <= 128) {
+//            System.out.println((char) num + "  (Unicode编码对应的数字为:) " + num);
+//            num++;
+//        }
+    }
+}

+ 3 - 0
common/src/main/java/com/diagbot/util/HttpUtils.java

@@ -66,6 +66,9 @@ public class HttpUtils {
             if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
                 ip = request.getHeader("HTTP_X_FORWARDED_FOR");
             }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getHeader("X-Real-IP");
+            }
             if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
                 ip = request.getRemoteAddr();
             }

+ 3 - 0
config-server/src/main/resources/shared/application-dev.yml

@@ -77,6 +77,9 @@ syslog:
 bilog:
   enable: false
 
+crypt:
+  enable: true
+
 mrqc:
   server:
     address: http://192.168.2.234:8090

+ 3 - 0
config-server/src/main/resources/shared/application-local.yml

@@ -77,6 +77,9 @@ syslog:
 bilog:
   enable: false
 
+crypt:
+  enable: true
+
 mrqc:
   server:
     address: http://192.168.2.234:8090

+ 3 - 0
config-server/src/main/resources/shared/application-pre.yml

@@ -77,6 +77,9 @@ syslog:
 bilog:
   enable: false
 
+crypt:
+  enable: true
+
 mrqc:
   server:
     address: http://192.168.2.186:8090

+ 3 - 0
config-server/src/main/resources/shared/application-pro.yml

@@ -77,6 +77,9 @@ syslog:
 bilog:
   enable: false
 
+crypt:
+  enable: true
+
 mrqc:
   server:
     address: http://192.168.2.123:8090

+ 3 - 0
config-server/src/main/resources/shared/application-test.yml

@@ -77,6 +77,9 @@ syslog:
 bilog:
   enable: false
 
+crypt:
+  enable: true
+
 mrqc:
   server:
     address: http://192.168.2.241:8090

+ 65 - 21
config-server/src/main/resources/shared/gateway-service-dev.yml

@@ -1,4 +1,33 @@
+ratelimiter-conf:
+  #配置限流参数与RateLimiterConf类映射
+  rateLimitMap:
+    #格式为:routeid(gateway配置routes时指定的).replenishRate(流速)/burstCapacity令牌桶大小
+    icss-service.replenishRate: 20
+    icss-service.burstCapacity: 500
+    data-service.replenishRate: 20
+    data-service.burstCapacity: 500
+    ltapi-service.replenishRate: 20
+    ltapi-service.burstCapacity: 500
+    triage-service.replenishRate: 20
+    triage-service.burstCapacity: 500
+    prec-service.replenishRate: 20
+    prec-service.burstCapacity: 500
+
 spring:
+  #redis
+  redis:
+    database:
+      cache: 0 # Redis限流缓存索引
+    host: 192.168.2.236  #Redis服务器地址
+    port: 6379 # Redis服务器连接端口
+    password: lantone # Redis服务器连接密码(默认为空)
+    lettuce:
+      pool:
+        max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
+        max-idle: 5 # 连接池中的最大空闲连接
+        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+        min-idle: 0 # 连接池中的最小空闲连接
+    timeout: 20000 # 连接超时时间(毫秒)
   #mq
   rabbitmq:
     host: 192.168.2.236
@@ -14,6 +43,10 @@ spring:
           destination: myLog
     #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
     gateway:
+      discovery:
+        locator:
+          enabled: false
+          lowerCaseServiceId: true
       default-filters:
       routes:
       - id: user-service
@@ -21,105 +54,110 @@ spring:
         predicates:
         - Path=/api/user/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: logger-service
         uri: lb://logger-service
         predicates:
         - Path=/api/log/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: bi-service
         uri: lb://bi-service
         predicates:
         - Path=/api/bi/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: diagbotman-service
         uri: lb://diagbotman-service
         predicates:
         - Path=/api/diagbotman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: feedback-service
         uri: lb://feedback-service
         predicates:
         - Path=/api/feedback/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: triage-service
         uri: lb://triage-service
         predicates:
         - Path=/api/triage/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: icss-service
         uri: lb://icss-service
         predicates:
         - Path=/api/icss/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: icssman-service
         uri: lb://icssman-service
         predicates:
         - Path=/api/icssman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: knowledgeman-service
         uri: lb://knowledgeman-service
         predicates:
         - Path=/api/knowledgeman/**
         filters:
-#        - SwaggerHeaderFilter
-        - StripPrefix=2
-      - id: prec-service
-        uri: lb://prec-service
-        predicates:
-        - Path=/api/prec/**
-        filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: tran-service
         uri: lb://tran-service
         predicates:
         - Path=/api/tran/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: prec-service
+        uri: lb://prec-service
+        predicates:
+        - Path=/api/prec/**
+        filters:
+        - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: aipt-service
         uri: lb://aipt-service
         predicates:
         - Path=/api/aipt/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: data-service
         uri: lb://data-service
         predicates:
         - Path=/api/data/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: ltapi-service
         uri: lb://ltapi-service
         predicates:
         - Path=/api/ltapi/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: precman-service
         uri: lb://precman-service
         predicates:
         - Path=/api/precman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: mrqcman-service
         uri: lb://mrqcman-service
@@ -128,6 +166,12 @@ spring:
         filters:
         #        - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: mrman-service
+        uri: lb://mrman-service
+        predicates:
+        - Path=/api/mrman/**
+        filters:
+        - StripPrefix=2
       - id: znwz-service
         uri: lb://znwz-service
         predicates:

+ 55 - 15
config-server/src/main/resources/shared/gateway-service-local.yml

@@ -1,4 +1,33 @@
+ratelimiter-conf:
+  #配置限流参数与RateLimiterConf类映射
+  rateLimitMap:
+    #格式为:routeid(gateway配置routes时指定的).replenishRate(流速)/burstCapacity令牌桶大小
+    icss-service.replenishRate: 20
+    icss-service.burstCapacity: 500
+    data-service.replenishRate: 20
+    data-service.burstCapacity: 500
+    ltapi-service.replenishRate: 20
+    ltapi-service.burstCapacity: 500
+    triage-service.replenishRate: 20
+    triage-service.burstCapacity: 500
+    prec-service.replenishRate: 20
+    prec-service.burstCapacity: 500
+
 spring:
+  #redis
+  redis:
+    database:
+      cache: 0 # Redis限流缓存索引
+    host: 192.168.2.236  #Redis服务器地址
+    port: 6378 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
+    password: lantone # Redis服务器连接密码(默认为空)
+    lettuce:
+      pool:
+        max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
+        max-idle: 5 # 连接池中的最大空闲连接
+        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+        min-idle: 0 # 连接池中的最小空闲连接
+    timeout: 20000 # 连接超时时间(毫秒)
   #mq
   rabbitmq:
     host: localhost
@@ -25,105 +54,110 @@ spring:
         predicates:
         - Path=/api/user/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: logger-service
         uri: lb://logger-service
         predicates:
         - Path=/api/log/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: bi-service
         uri: lb://bi-service
         predicates:
         - Path=/api/bi/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: diagbotman-service
         uri: lb://diagbotman-service
         predicates:
         - Path=/api/diagbotman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: feedback-service
         uri: lb://feedback-service
         predicates:
         - Path=/api/feedback/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: triage-service
         uri: lb://triage-service
         predicates:
         - Path=/api/triage/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: icss-service
         uri: lb://icss-service
         predicates:
         - Path=/api/icss/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: icssman-service
         uri: lb://icssman-service
         predicates:
         - Path=/api/icssman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: knowledgeman-service
         uri: lb://knowledgeman-service
         predicates:
         - Path=/api/knowledgeman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: tran-service
         uri: lb://tran-service
         predicates:
         - Path=/api/tran/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: prec-service
         uri: lb://prec-service
         predicates:
         - Path=/api/prec/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: aipt-service
         uri: lb://aipt-service
         predicates:
         - Path=/api/aipt/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: data-service
         uri: lb://data-service
         predicates:
         - Path=/api/data/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: ltapi-service
         uri: lb://ltapi-service
         predicates:
         - Path=/api/ltapi/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: precman-service
         uri: lb://precman-service
         predicates:
         - Path=/api/precman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: mrqcman-service
         uri: lb://mrqcman-service
@@ -132,6 +166,12 @@ spring:
         filters:
         #        - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: mrman-service
+        uri: lb://mrman-service
+        predicates:
+        - Path=/api/mrman/**
+        filters:
+        - StripPrefix=2
       - id: znwz-service
         uri: lb://znwz-service
         predicates:

+ 69 - 23
config-server/src/main/resources/shared/gateway-service-pre.yml

@@ -1,4 +1,33 @@
+ratelimiter-conf:
+  #配置限流参数与RateLimiterConf类映射
+  rateLimitMap:
+    #格式为:routeid(gateway配置routes时指定的).replenishRate(流速)/burstCapacity令牌桶大小
+    icss-service.replenishRate: 20
+    icss-service.burstCapacity: 500
+    data-service.replenishRate: 20
+    data-service.burstCapacity: 500
+    ltapi-service.replenishRate: 20
+    ltapi-service.burstCapacity: 500
+    triage-service.replenishRate: 20
+    triage-service.burstCapacity: 500
+    prec-service.replenishRate: 20
+    prec-service.burstCapacity: 500
+
 spring:
+  #redis
+  redis:
+    database:
+      cache: 0 # Redis限流缓存索引
+    host: 192.168.2.121  #Redis服务器地址
+    port: 6379 # Redis服务器连接端口
+    password: lantone # Redis服务器连接密码(默认为空)
+    lettuce:
+      pool:
+        max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
+        max-idle: 5 # 连接池中的最大空闲连接
+        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+        min-idle: 0 # 连接池中的最小空闲连接
+    timeout: 20000 # 连接超时时间(毫秒)
   #mq
   rabbitmq:
     host: 192.168.2.121
@@ -14,6 +43,10 @@ spring:
           destination: myLog
     #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
     gateway:
+      discovery:
+        locator:
+          enabled: false
+          lowerCaseServiceId: true
       default-filters:
       routes:
       - id: user-service
@@ -21,119 +54,132 @@ spring:
         predicates:
         - Path=/api/user/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: logger-service
         uri: lb://logger-service
         predicates:
         - Path=/api/log/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: bi-service
         uri: lb://bi-service
         predicates:
         - Path=/api/bi/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: diagbotman-service
         uri: lb://diagbotman-service
         predicates:
         - Path=/api/diagbotman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: feedback-service
         uri: lb://feedback-service
         predicates:
         - Path=/api/feedback/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: triage-service
         uri: lb://triage-service
         predicates:
         - Path=/api/triage/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: icss-service
         uri: lb://icss-service
         predicates:
         - Path=/api/icss/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: icssman-service
         uri: lb://icssman-service
         predicates:
         - Path=/api/icssman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: knowledgeman-service
         uri: lb://knowledgeman-service
         predicates:
         - Path=/api/knowledgeman/**
         filters:
-#        - SwaggerHeaderFilter
-        - StripPrefix=2
-      - id: prec-service
-        uri: lb://prec-service
-        predicates:
-        - Path=/api/prec/**
-        filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: tran-service
         uri: lb://tran-service
         predicates:
         - Path=/api/tran/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: prec-service
+        uri: lb://prec-service
+        predicates:
+        - Path=/api/prec/**
+        filters:
+        - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: aipt-service
         uri: lb://aipt-service
         predicates:
         - Path=/api/aipt/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: data-service
         uri: lb://data-service
         predicates:
         - Path=/api/data/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: ltapi-service
         uri: lb://ltapi-service
         predicates:
         - Path=/api/ltapi/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: precman-service
         uri: lb://precman-service
         predicates:
         - Path=/api/precman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: precold-service
         uri: lb://precold-service
         predicates:
         - Path=/api/precold/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: mrqcman-service
         uri: lb://mrqcman-service
         predicates:
         - Path=/api/mrqcman/**
         filters:
-        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: mrman-service
+        uri: lb://mrman-service
+        predicates:
+        - Path=/api/mrman/**
+        filters:
         - StripPrefix=2
       - id: znwz-service
         uri: lb://znwz-service

+ 65 - 21
config-server/src/main/resources/shared/gateway-service-pro.yml

@@ -1,4 +1,33 @@
+ratelimiter-conf:
+  #配置限流参数与RateLimiterConf类映射
+  rateLimitMap:
+    #格式为:routeid(gateway配置routes时指定的).replenishRate(流速)/burstCapacity令牌桶大小
+    icss-service.replenishRate: 20
+    icss-service.burstCapacity: 500
+    data-service.replenishRate: 20
+    data-service.burstCapacity: 500
+    ltapi-service.replenishRate: 20
+    ltapi-service.burstCapacity: 500
+    triage-service.replenishRate: 20
+    triage-service.burstCapacity: 500
+    prec-service.replenishRate: 20
+    prec-service.burstCapacity: 500
+
 spring:
+  #redis
+  redis:
+    database:
+      cache: 0 # Redis限流缓存索引
+    host: 192.168.2.122  #Redis服务器地址
+    port: 6379 # Redis服务器连接端口
+    password: lantone # Redis服务器连接密码(默认为空)
+    lettuce:
+      pool:
+        max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
+        max-idle: 5 # 连接池中的最大空闲连接
+        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+        min-idle: 0 # 连接池中的最小空闲连接
+    timeout: 20000 # 连接超时时间(毫秒)
   #mq
   rabbitmq:
     host: 192.168.2.122
@@ -14,6 +43,10 @@ spring:
           destination: myLog
     #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
     gateway:
+      discovery:
+        locator:
+          enabled: false
+          lowerCaseServiceId: true
       default-filters:
       routes:
       - id: user-service
@@ -21,105 +54,110 @@ spring:
         predicates:
         - Path=/api/user/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: logger-service
         uri: lb://logger-service
         predicates:
         - Path=/api/log/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: bi-service
         uri: lb://bi-service
         predicates:
         - Path=/api/bi/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: diagbotman-service
         uri: lb://diagbotman-service
         predicates:
         - Path=/api/diagbotman/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: feedback-service
         uri: lb://feedback-service
         predicates:
         - Path=/api/feedback/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: triage-service
         uri: lb://triage-service
         predicates:
         - Path=/api/triage/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: icss-service
         uri: lb://icss-service
         predicates:
         - Path=/api/icss/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: icssman-service
         uri: lb://icssman-service
         predicates:
         - Path=/api/icssman/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: knowledgeman-service
         uri: lb://knowledgeman-service
         predicates:
         - Path=/api/knowledgeman/**
         filters:
-        #        - SwaggerHeaderFilter
-        - StripPrefix=2
-      - id: prec-service
-        uri: lb://prec-service
-        predicates:
-        - Path=/api/prec/**
-        filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: tran-service
         uri: lb://tran-service
         predicates:
         - Path=/api/tran/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: prec-service
+        uri: lb://prec-service
+        predicates:
+        - Path=/api/prec/**
+        filters:
+        - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: aipt-service
         uri: lb://aipt-service
         predicates:
         - Path=/api/aipt/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: data-service
         uri: lb://data-service
         predicates:
         - Path=/api/data/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: ltapi-service
         uri: lb://ltapi-service
         predicates:
         - Path=/api/ltapi/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: precman-service
         uri: lb://precman-service
         predicates:
         - Path=/api/precman/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: mrqcman-service
         uri: lb://mrqcman-service
@@ -128,6 +166,12 @@ spring:
         filters:
         #        - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: mrman-service
+        uri: lb://mrman-service
+        predicates:
+        - Path=/api/mrman/**
+        filters:
+        - StripPrefix=2
       - id: znwz-service
         uri: lb://znwz-service
         predicates:

+ 59 - 22
config-server/src/main/resources/shared/gateway-service-test.yml

@@ -1,4 +1,33 @@
+ratelimiter-conf:
+  #配置限流参数与RateLimiterConf类映射
+  rateLimitMap:
+    #格式为:routeid(gateway配置routes时指定的).replenishRate(流速)/burstCapacity令牌桶大小
+    icss-service.replenishRate: 20
+    icss-service.burstCapacity: 500
+    data-service.replenishRate: 20
+    data-service.burstCapacity: 500
+    ltapi-service.replenishRate: 20
+    ltapi-service.burstCapacity: 500
+    triage-service.replenishRate: 20
+    triage-service.burstCapacity: 500
+    prec-service.replenishRate: 20
+    prec-service.burstCapacity: 500
+
 spring:
+  #redis
+  redis:
+    database:
+      cache: 0 # Redis限流缓存索引
+    host: 192.168.2.241  #Redis服务器地址
+    port: 6379 # Redis服务器连接端口
+    password: lantone # Redis服务器连接密码(默认为空)
+    lettuce:
+      pool:
+        max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
+        max-idle: 5 # 连接池中的最大空闲连接
+        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+        min-idle: 0 # 连接池中的最小空闲连接
+    timeout: 20000 # 连接超时时间(毫秒)
   #mq
   rabbitmq:
     host: 192.168.2.241
@@ -14,6 +43,10 @@ spring:
           destination: myLog
       #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
     gateway:
+      discovery:
+        locator:
+          enabled: false
+          lowerCaseServiceId: true
       default-filters:
       routes:
       - id: user-service
@@ -21,112 +54,110 @@ spring:
         predicates:
         - Path=/api/user/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: logger-service
         uri: lb://logger-service
         predicates:
         - Path=/api/log/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: bi-service
         uri: lb://bi-service
         predicates:
         - Path=/api/bi/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: diagbotman-service
         uri: lb://diagbotman-service
         predicates:
         - Path=/api/diagbotman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: feedback-service
         uri: lb://feedback-service
         predicates:
         - Path=/api/feedback/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: triage-service
         uri: lb://triage-service
         predicates:
         - Path=/api/triage/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: icss-service
         uri: lb://icss-service
         predicates:
         - Path=/api/icss/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: icssman-service
         uri: lb://icssman-service
         predicates:
         - Path=/api/icssman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: knowledgeman-service
         uri: lb://knowledgeman-service
         predicates:
         - Path=/api/knowledgeman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: tran-service
         uri: lb://tran-service
         predicates:
         - Path=/api/tran/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: prec-service
         uri: lb://prec-service
         predicates:
         - Path=/api/prec/**
         filters:
-        #        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: aipt-service
         uri: lb://aipt-service
         predicates:
         - Path=/api/aipt/**
         filters:
-#        - SwaggerHeaderFilter
-        - StripPrefix=2
-      - id: icssyz-service
-        uri: lb://icss-service
-        predicates:
-        - Path=/api/icssyz/**
-        filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: data-service
         uri: lb://data-service
         predicates:
         - Path=/api/data/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: ltapi-service
         uri: lb://ltapi-service
         predicates:
         - Path=/api/ltapi/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
+        - name: RequestRateLimiter
+          args:
+            rate-limiter: "#{@systemRedisRateLimiter}"
+            key-resolver: "#{@sysKeyResolver}"
       - id: precman-service
         uri: lb://precman-service
         predicates:
         - Path=/api/precman/**
         filters:
-#        - SwaggerHeaderFilter
         - StripPrefix=2
       - id: mrqcman-service
         uri: lb://mrqcman-service
@@ -135,6 +166,12 @@ spring:
         filters:
         #        - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: mrman-service
+        uri: lb://mrman-service
+        predicates:
+        - Path=/api/mrman/**
+        filters:
+        - StripPrefix=2
       - id: znwz-service
         uri: lb://znwz-service
         predicates:

+ 96 - 0
config-server/src/main/resources/shared/mrman-service-dev.yml

@@ -0,0 +1,96 @@
+server:
+  port: 8833
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: oracle.jdbc.driver.OracleDriver
+      platform: oracle
+      url: jdbc:oracle:thin:@192.168.2.246:1521:orcl
+      username: ETRACKMRQC
+      password: ETRACKMRQC
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: wall,log4j
+      filter:
+        stat:
+          enabled: true
+          mergeSql: true
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.236
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false

+ 96 - 0
config-server/src/main/resources/shared/mrman-service-local.yml

@@ -0,0 +1,96 @@
+server:
+  port: 8833
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: oracle.jdbc.driver.OracleDriver
+      platform: oracle
+      url: jdbc:oracle:thin:@192.168.2.246:1521:orcl
+      username: ETRACKMRQC
+      password: ETRACKMRQC
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: wall,log4j
+      filter:
+        stat:
+          enabled: true
+          mergeSql: true
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: localhost
+    port: 5672
+    username: guest
+    password: guest
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false

+ 96 - 0
config-server/src/main/resources/shared/mrman-service-pre.yml

@@ -0,0 +1,96 @@
+server:
+  port: 8833
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: oracle.jdbc.driver.OracleDriver
+      platform: oracle
+      url: jdbc:oracle:thin:@192.168.2.246:1521:orcl
+      username: ETRACKMRQC
+      password: ETRACKMRQC
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: wall,log4j
+      filter:
+        stat:
+          enabled: true
+          mergeSql: true
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.121
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false

+ 96 - 0
config-server/src/main/resources/shared/mrman-service-pro.yml

@@ -0,0 +1,96 @@
+server:
+  port: 8833
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: oracle.jdbc.driver.OracleDriver
+      platform: oracle
+      url: jdbc:oracle:thin:@192.168.2.246:1521:orcl
+      username: ETRACKMRQC
+      password: ETRACKMRQC
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: wall,log4j
+      filter:
+        stat:
+          enabled: true
+          mergeSql: true
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.122
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false

+ 96 - 0
config-server/src/main/resources/shared/mrman-service-test.yml

@@ -0,0 +1,96 @@
+server:
+  port: 8833
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: oracle.jdbc.driver.OracleDriver
+      platform: oracle
+      url: jdbc:oracle:thin:@192.168.2.246:1521:orcl
+      username: ETRACKMRQC
+      password: ETRACKMRQC
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: wall,log4j
+      filter:
+        stat:
+          enabled: true
+          mergeSql: true
+          log-slow-sql: true
+          slow-sql-millis: 2000
+      #监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+      # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  cloud:
+    stream:
+      bindings:
+        outputLog:
+          destination: myLog
+  #          contentType: text/plain      # 实体 json string 在传递的类型装换 查看 http://docs.spring
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.241
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false

+ 8 - 8
data-service/src/main/java/com/diagbot/client/AiptServiceClient.java

@@ -97,14 +97,14 @@ public interface AiptServiceClient {
     @PostMapping("/concept/getStaticKnowledge")
     RespDTO<List<RetrievalDTO>> getStaticKnowledge(@RequestBody GetStaticKnowledgeVO getStaticKnowledgeVO);
 
-    /**
-     * 量表搜索
-     *
-     * @param scaleIndexVO
-     * @return
-     */
-    @PostMapping(value = "/scale/index")
-    RespDTO<List<ScaleIndexDTO>> index(@RequestBody ScaleIndexVO scaleIndexVO);
+//    /**
+//     * 量表搜索
+//     *
+//     * @param scaleIndexVO
+//     * @return
+//     */
+//    @PostMapping(value = "/scale/index")
+//    RespDTO<List<ScaleIndexDTO>> index(@RequestBody ScaleIndexVO scaleIndexVO);
 
     /**
      * 获取字典信息

+ 11 - 11
data-service/src/main/java/com/diagbot/client/hystrix/AiptServiceHystrix.java

@@ -121,17 +121,17 @@ public class AiptServiceHystrix implements AiptServiceClient {
         return null;
     }
 
-    /**
-     * 量表搜索
-     *
-     * @param scaleIndexVO
-     * @return
-     */
-    @Override
-    public RespDTO<List<ScaleIndexDTO>> index(@RequestBody ScaleIndexVO scaleIndexVO) {
-        log.error("【hystrix】调用{}异常", "index");
-        return null;
-    }
+//    /**
+//     * 量表搜索
+//     *
+//     * @param scaleIndexVO
+//     * @return
+//     */
+//    @Override
+//    public RespDTO<List<ScaleIndexDTO>> index(@RequestBody ScaleIndexVO scaleIndexVO) {
+//        log.error("【hystrix】调用{}异常", "index");
+//        return null;
+//    }
 
     /**
      * 获取字典信息

+ 12 - 12
data-service/src/main/java/com/diagbot/facade/SearchFacade.java

@@ -38,16 +38,16 @@ public class SearchFacade {
         return res.data;
     }
 
-    /**
-     * 量表搜索
-     *
-     * @param scaleIndexVO
-     * @return
-     */
-    public List<ScaleIndexDTO> index(ScaleIndexVO scaleIndexVO) {
-        RespDTO<List<ScaleIndexDTO>> res =
-                aiptServiceClient.index(scaleIndexVO);
-        RespDTOUtil.respNGDeal(res, "搜索量表失败");
-        return res.data;
-    }
+//    /**
+//     * 量表搜索
+//     *
+//     * @param scaleIndexVO
+//     * @return
+//     */
+//    public List<ScaleIndexDTO> index(ScaleIndexVO scaleIndexVO) {
+//        RespDTO<List<ScaleIndexDTO>> res =
+//                aiptServiceClient.index(scaleIndexVO);
+//        RespDTOUtil.respNGDeal(res, "搜索量表失败");
+//        return res.data;
+//    }
 }

+ 13 - 13
data-service/src/main/java/com/diagbot/web/SearchController.java

@@ -49,17 +49,17 @@ public class SearchController {
         return RespDTO.onSuc(searchFacade.getStaticKnowledge(getStaticVO));
     }
 
-    /**
-     * 量表搜索
-     *
-     * @param scaleIndexVO
-     * @return
-     */
-    @ApiOperation(value = "量表搜索[by:zhoutg]",
-            notes = "name:检索内容,必填<br>" +
-                    "filterName:需要过滤的名称")
-    @PostMapping(value = "/getScale")
-    public RespDTO<List<ScaleIndexDTO>> index(@Valid @RequestBody ScaleIndexVO scaleIndexVO){
-        return RespDTO.onSuc(searchFacade.index(scaleIndexVO));
-    }
+//    /**
+//     * 量表搜索
+//     *
+//     * @param scaleIndexVO
+//     * @return
+//     */
+//    @ApiOperation(value = "量表搜索[by:zhoutg]",
+//            notes = "name:检索内容,必填<br>" +
+//                    "filterName:需要过滤的名称")
+//    @PostMapping(value = "/getScale")
+//    public RespDTO<List<ScaleIndexDTO>> index(@Valid @RequestBody ScaleIndexVO scaleIndexVO){
+//        return RespDTO.onSuc(searchFacade.index(scaleIndexVO));
+//    }
 }

+ 40 - 0
docs/028.20200102数据库加密/fuc_med.sql

@@ -0,0 +1,40 @@
+DELIMITER $
+DROP FUNCTION IF EXISTS Decrypt_char $
+CREATE FUNCTION Decrypt_char(Varstring varchar(255)) RETURNS varchar(255)
+BEGIN
+DECLARE v_length INT DEFAULT 0;
+DECLARE v_Tmp varchar(255) default '';
+DECLARE v_Tmp2 char(1) default '';
+set v_length=CHAR_LENGTH(Varstring);
+WHILE v_length > 0 DO
+set v_Tmp2 = mid(Varstring,v_length,1);
+IF (ORD(v_Tmp2)> 130) THEN
+set v_Tmp = concat(v_Tmp, char(ORD(CONVERT(v_Tmp2 USING ucs2)) -2 USING ucs2));
+ELSE
+set v_Tmp = concat(v_Tmp,v_Tmp2);
+END IF;
+SET v_length = v_length - 1;
+END WHILE;
+RETURN REVERSE(v_Tmp);
+END $
+
+
+DELIMITER $
+DROP FUNCTION IF EXISTS Encrypt_char $
+CREATE FUNCTION Encrypt_char(Varstring varchar(255)) RETURNS varchar(255)
+BEGIN
+DECLARE v_length INT DEFAULT 0;
+DECLARE v_Tmp varchar(255) default '';
+DECLARE v_Tmp2 char(1) default '';
+set v_length=CHAR_LENGTH(Varstring);
+WHILE v_length > 0 DO
+set v_Tmp2 = mid(Varstring,v_length,1);
+IF (ORD(v_Tmp2)> 128) THEN
+set v_Tmp = concat(v_Tmp, char(ORD(CONVERT(v_Tmp2 USING ucs2)) +2 USING ucs2));
+ELSE
+set v_Tmp = concat(v_Tmp,v_Tmp2);
+END IF;
+SET v_length = v_length - 1;
+END WHILE;
+RETURN REVERSE(v_Tmp);
+END $

+ 31 - 0
docs/028.20200102数据库加密/init_med.sql

@@ -0,0 +1,31 @@
+use `med`;
+
+ALTER  TABLE  `kl_library_info`  drop  INDEX  NAME_TYPE_INDEX_UNIQUE;
+
+ALTER TABLE `kl_library_info`
+ADD COLUMN `name_en` varchar(255) COLLATE utf8_bin  NOT NULL DEFAULT '' COMMENT '加密name' AFTER `name`;
+
+ALTER TABLE `kl_library_info`
+ADD COLUMN `name_de` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '解密name_en' AFTER `name`;
+
+ALTER TABLE `kl_library_info`
+ADD COLUMN `spell_en` varchar(100) COLLATE utf8_general_ci  NOT NULL DEFAULT '' COMMENT '加密spell' AFTER `spell`;
+
+ALTER TABLE `kl_library_info`
+ADD COLUMN `spell_de` varchar(100) COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '解密spell_en' AFTER `spell`;
+
+ALTER TABLE `kl_concept`
+ADD COLUMN `lib_name_en` varchar(255) NOT NULL DEFAULT '' COMMENT '加密lib_name' AFTER `lib_name`;
+
+ALTER TABLE `kl_concept`
+ADD COLUMN `lib_name_de` varchar(255) NOT NULL DEFAULT '' COMMENT '解密lib_name_en' AFTER `lib_name`;
+
+-- 删除临时添加字段
+-- ALTER TABLE `kl_library_info` drop `name_en`;
+-- ALTER TABLE `kl_library_info` drop `name_de`;
+-- ALTER TABLE `kl_library_info` drop `spell_en`;
+-- ALTER TABLE `kl_library_info` drop `spell_de`;
+-- ALTER TABLE `kl_concept` drop `lib_name_en`;
+-- ALTER TABLE `kl_concept` drop `lib_name_de`;
+-- ALTER TABLE `kl_library_info` ADD UNIQUE INDEX  NAME_TYPE_INDEX_UNIQUE(`name`, `type_id`);
+

+ 80 - 0
docs/029.20200109模板新需求/init.sql

@@ -0,0 +1,80 @@
+use `sys-icss`;
+
+ALTER TABLE `icss_template_info`
+ADD COLUMN `spell` varchar(100) DEFAULT NULL COMMENT '拼音' AFTER `name`;
+
+DROP TABLE IF EXISTS `icss_template_quote`;
+CREATE TABLE `icss_template_quote` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(60) DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `template_id` bigint(20) DEFAULT NULL COMMENT '模板id',
+  `doctor_id` bigint(20) DEFAULT NULL COMMENT '医生id',
+  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='模板引用表';
+
+
+DROP TABLE IF EXISTS `icss_template_folder`;
+CREATE TABLE `icss_template_folder` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(1)  NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(20)  NOT NULL DEFAULT '' COMMENT '创建人姓名',
+  `modifier` varchar(20)  NOT NULL DEFAULT '' COMMENT '修改人姓名',
+  `name` varchar(300) NOT NULL DEFAULT '' COMMENT '名称',
+  `hospital_id` bigint(20) DEFAULT NULL COMMENT '医院id',
+  `doctor_id` bigint(20) DEFAULT NULL COMMENT '医生id',
+  `template_type` int(11) NOT NULL DEFAULT '1' COMMENT '模板类型(个人1,管理员2)',
+  `order_no` int(11) NOT NULL DEFAULT '1' COMMENT '排序号',
+  `remark` varchar(255)  NOT NULL DEFAULT '' COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8  COMMENT='模板文件夹表';
+
+
+DROP TABLE IF EXISTS `icss_folder_mapping`;
+CREATE TABLE `icss_folder_mapping` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(1)  NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(20)  NOT NULL DEFAULT '' COMMENT '创建人姓名',
+  `modifier` varchar(20)  NOT NULL DEFAULT '' COMMENT '修改人姓名',
+  `template_id` bigint(20) DEFAULT NULL COMMENT '模板id',
+  `folder_id` bigint(20) DEFAULT NULL COMMENT '文件夹id',
+  `order_no` int(11) NOT NULL DEFAULT '1' COMMENT '排序号',
+  `remark` varchar(255)  NOT NULL DEFAULT '' COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8  COMMENT='模板文件夹映射表';
+
+insert into `icss_template_folder`(`creator`,`modifier`,`name`,`hospital_id`,`doctor_id`,`template_type`,`order_no`) values (-7,-7,'未分类文件夹','-9','-7',2,99999);
+
+-- 更新icss_template_info的doctor_id
+update `sys-icss`.icss_template_info set doctor_id = CONCAT('-',doctor_id)
+where doctor_id in
+	(SELECT id FROM `sys-tran`.`tran_doctor_info` where hospital_code = 'LT');
+
+-- 更新icss_template_info的hospital_id
+update `sys-icss`.icss_template_info set hospital_id = CONCAT('-',hospital_id)
+where hospital_id in
+	(SELECT id FROM `sys-tran`.`tran_hospital_info` where code = 'LT');
+
+-- 更新icss_template_info的hospital_dept_id
+update `sys-icss`.icss_template_info set hospital_dept_id = CONCAT('-',hospital_dept_id)
+where hospital_dept_id in
+	(SELECT id FROM `sys-tran`.`tran_hospital_dept` where hospital_code = 'LT');
+
+-- 将标准模板放入“未分类文件夹”下
+insert into icss_folder_mapping(`template_id`,`creator`,`modifier`,`folder_id`)
+(SELECT id,doctor_id,doctor_id, (select id from icss_template_folder where name = '未分类文件夹') from icss_template_info where template_type = 2 and is_deleted = 'N');
+
+
+update `sys-tran`.`tran_doctor_info` set id=CONCAT('-',id)  where hospital_code = 'LT';
+update `sys-tran`.`tran_hospital_info` set id=CONCAT('-',id)  where code = 'LT';
+update `sys-tran`.`tran_hospital_dept` set id=CONCAT('-',id)  where hospital_code = 'LT';
+update `sys-tran`.`tran_patient_info` set id=CONCAT('-',id)  where hospital_code = 'LT';
+update `sys-tran`.`tran_sys_set` set id=-1  where `code` = 'template_admin';

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 92 - 0
docs/029.20200109模板新需求/技术服务部脚本标准模板.sql


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1055 - 0
docs/029.20200130浙江医院质控整改/init_user.sql


+ 9 - 4
gateway-service/pom.xml

@@ -27,10 +27,10 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-gateway</artifactId>
         </dependency>
-        <!--<dependency>-->
-            <!--<groupId>org.springframework.boot</groupId>-->
-            <!--<artifactId>spring-boot-starter-data-redis-reactive</artifactId>-->
-        <!--</dependency>-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis-reactive</artifactId>
+        </dependency>
         <!-- 配置-->
         <dependency>
             <groupId>org.springframework.cloud</groupId>
@@ -83,6 +83,11 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
         </dependency>
+        <!-- 必须加上,jedis依赖此  -->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.diagbot</groupId>
             <artifactId>common</artifactId>

+ 169 - 0
gateway-service/src/main/java/com/diagbot/config/RedisConfigurer.java

@@ -0,0 +1,169 @@
+package com.diagbot.config;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.CachingConfigurerSupport;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cache.interceptor.KeyGenerator;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.data.redis.cache.RedisCacheConfiguration;
+import org.springframework.data.redis.cache.RedisCacheManager;
+import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
+import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
+import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
+import org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializationContext;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+import java.time.Duration;
+
+@Configuration
+@EnableCaching
+@Slf4j
+public class RedisConfigurer extends CachingConfigurerSupport {
+
+    @Value("${spring.redis.database.cache}")
+    private String databaseCache;
+    @Value("${spring.redis.host}")
+    private String host;
+    @Value("${spring.redis.password}")
+    private String password;
+    @Value("${spring.redis.port}")
+    private int port;
+    @Value("${spring.redis.timeout}")
+    private int timeout;
+    @Value("${spring.redis.lettuce.pool.max-active}")
+    private int maxActive;
+    @Value("${spring.redis.lettuce.pool.max-idle}")
+    private int maxIdle;
+    @Value("${spring.redis.lettuce.pool.max-wait}")
+    private long maxWaitMillis;
+    @Value("${spring.redis.lettuce.pool.min-idle}")
+    private int minIdle;
+
+    @Autowired
+    @Qualifier("factoryForCache")
+    private LettuceConnectionFactory lettuceConnectionFactory;
+
+    @Bean
+    public GenericObjectPoolConfig getRedisConfig() {
+        GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
+        poolConfig.setMaxTotal(maxActive);
+        poolConfig.setMaxIdle(maxIdle);
+        poolConfig.setMaxWaitMillis(maxWaitMillis);
+        poolConfig.setMinIdle(minIdle);
+        return poolConfig;
+    }
+
+    @Bean
+    @Override
+    public CacheManager cacheManager() {
+        RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig()
+                // 设置 key为string序列化
+                .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
+                // 设置value为json序列化
+                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(getSerializer()))
+                // 不缓存空值
+                .disableCachingNullValues();
+        RedisCacheManager cacheManager = RedisCacheManager.builder(lettuceConnectionFactory)
+                .cacheDefaults(redisCacheConfiguration)
+                .transactionAware()
+                .build();
+        cacheManager.afterPropertiesSet();
+        log.info("RedisCacheManager config success");
+        return cacheManager;
+    }
+
+    @Bean(name = "springSessionDefaultRedisSerializer")
+    public GenericJackson2JsonRedisSerializer getGenericJackson2JsonRedisSerializer() {
+        return new GenericJackson2JsonRedisSerializer();
+    }
+
+    /**
+     * 缓存使用的redis
+     *
+     * @return
+     */
+    @Bean("factoryForCache")
+    @Primary
+    public LettuceConnectionFactory redisConnectionFactory() {
+        return getRedisConnectionFactory(Integer.valueOf(databaseCache));
+    }
+
+    @Bean(name = "redisTemplateForCache")
+    public RedisTemplate<String, Object> redisTemplate() {
+        return getRedisTemplate(lettuceConnectionFactory);
+    }
+
+    private Jackson2JsonRedisSerializer getSerializer() {
+        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
+        ObjectMapper om = new ObjectMapper();
+        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+        jackson2JsonRedisSerializer.setObjectMapper(om);
+        return jackson2JsonRedisSerializer;
+    }
+
+    @Bean
+    @Override
+    public KeyGenerator keyGenerator() {
+        //  设置自动key的生成规则,配置spring boot的注解,进行方法级别的缓存
+        // 使用:进行分割,可以很多显示出层级关系
+        // 这里其实就是new了一个KeyGenerator对象
+        return (target, method, params) -> {
+            StringBuilder sb = new StringBuilder();
+            sb.append(target.getClass().getName());
+            sb.append(":");
+            sb.append(method.getName());
+            for (Object obj : params) {
+                sb.append(":" + String.valueOf(obj));
+            }
+            String rsToUse = String.valueOf(sb);
+            log.info("自动生成Redis Key -> [{}]", rsToUse);
+            return rsToUse;
+        };
+    }
+
+    private LettuceConnectionFactory getRedisConnectionFactory(Integer database) {
+        RedisStandaloneConfiguration connection = new RedisStandaloneConfiguration();
+        connection.setHostName(host);
+        connection.setPort(port);
+        connection.setPassword(password);
+        connection.setDatabase(database);
+        GenericObjectPoolConfig poolConfig = getRedisConfig();
+        LettuceClientConfiguration builder = LettucePoolingClientConfiguration.builder()
+                .commandTimeout(Duration.ofMillis(timeout))
+                .poolConfig(poolConfig)
+                .shutdownTimeout(Duration.ZERO)
+                .build();
+        LettuceConnectionFactory factory = new LettuceConnectionFactory(connection, builder);
+        return factory;
+    }
+
+    private RedisTemplate<String, Object> getRedisTemplate(LettuceConnectionFactory factory) {
+        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
+        redisTemplate.setConnectionFactory(factory);
+
+        // value值的序列化
+        redisTemplate.setValueSerializer(getSerializer());
+        redisTemplate.setHashValueSerializer(getSerializer());
+        // key的序列化采用StringRedisSerializer
+        redisTemplate.setKeySerializer(new StringRedisSerializer());
+        redisTemplate.setHashKeySerializer(new StringRedisSerializer());
+        redisTemplate.afterPropertiesSet();
+        return redisTemplate;
+    }
+}
+ 

+ 36 - 0
gateway-service/src/main/java/com/diagbot/config/redislimiter/RateLimiterConf.java

@@ -0,0 +1,36 @@
+package com.diagbot.config.redislimiter;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/12/26 16:35
+ */
+@Component
+@ConfigurationProperties(prefix = "ratelimiter-conf")
+public class RateLimiterConf {
+    //处理速度
+    private static final String DEFAULT_REPLENISHRATE = "default.replenishRate";
+    //容量
+    private static final String DEFAULT_BURSTCAPACITY = "default.burstCapacity";
+
+    private Map<String, Integer> rateLimitMap = new ConcurrentHashMap<String, Integer>() {
+        {
+            put(DEFAULT_REPLENISHRATE, 100);
+            put(DEFAULT_BURSTCAPACITY, 1000);
+        }
+    };
+
+    public Map<String, Integer> getRateLimitMap() {
+        return rateLimitMap;
+    }
+
+    public void setRateLimitMap(Map<String, Integer> rateLimitMap) {
+        this.rateLimitMap = rateLimitMap;
+    }
+}

+ 80 - 0
gateway-service/src/main/java/com/diagbot/config/redislimiter/SysKeyResolver.java

@@ -0,0 +1,80 @@
+package com.diagbot.config.redislimiter;
+
+import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
+import org.springframework.cloud.gateway.support.ServerWebExchangeUtils;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.server.reactive.ServerHttpRequest;
+import org.springframework.web.server.ServerWebExchange;
+import reactor.core.publisher.Mono;
+
+import java.net.URI;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/12/26 15:31
+ */
+public class SysKeyResolver implements KeyResolver {
+    private static final String GATE_WAY_PREFIX = "/api";
+
+    @Override
+    public Mono<String> resolve(ServerWebExchange exchange) {
+        LinkedHashSet requiredAttribute
+                = exchange.getRequiredAttribute(ServerWebExchangeUtils.GATEWAY_ORIGINAL_REQUEST_URL_ATTR);
+        String fullUrl = "";
+        if (requiredAttribute != null) {
+            Iterator<URI> iterator = requiredAttribute.iterator();
+            while (iterator.hasNext()) {
+                URI next = iterator.next();
+                if (next.getPath().startsWith(GATE_WAY_PREFIX)) {
+                    fullUrl = next.getPath();
+                }
+            }
+        }
+
+        String myKeyResolver = getIpAddress(exchange.getRequest())
+                + "_" + fullUrl;
+        ServerHttpRequest.Builder builder = exchange.getRequest().mutate();
+        builder.header("myKeyResolver", myKeyResolver);
+        exchange.mutate().request(builder.build()).build();
+
+        return Mono.just(exchange.getRequest().getHeaders().getFirst("myKeyResolver"));
+    }
+
+    public static String getIpAddress(ServerHttpRequest request) {
+        HttpHeaders headers = request.getHeaders();
+        String ip = headers.getFirst("x-forwarded-for");
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = headers.getFirst("Proxy-Client-IP");
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = headers.getFirst("WL-Proxy-Client-IP");
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = headers.getFirst("HTTP_CLIENT_IP");
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = headers.getFirst("HTTP_X_FORWARDED_FOR");
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = headers.getFirst("X-Real-IP");
+            }
+            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+                ip = request.getRemoteAddress().getAddress().getHostAddress();
+            }
+        } else if (ip.length() > 15) {
+            String[] ips = ip.split(",");
+            for (int index = 0; index < ips.length; index++) {
+                String strIp = (String) ips[index];
+                if (!("unknown".equalsIgnoreCase(strIp))) {
+                    ip = strIp;
+                    break;
+                }
+            }
+        }
+        return ip;
+    }
+}

+ 35 - 0
gateway-service/src/main/java/com/diagbot/config/redislimiter/SysKeyResolverConfigurer.java

@@ -0,0 +1,35 @@
+package com.diagbot.config.redislimiter;
+
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.cloud.gateway.support.ConfigurationService;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.data.redis.core.ReactiveRedisTemplate;
+import org.springframework.data.redis.core.script.RedisScript;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/12/26 15:08
+ */
+@Configuration
+public class SysKeyResolverConfigurer {
+
+    @Bean
+    public SysKeyResolver sysKeyResolver() {
+        return new SysKeyResolver();
+    }
+
+    //使用自己定义的限流类
+    @Bean
+    @Primary
+    SystemRedisRateLimiter systemRedisRateLimiter(
+            ReactiveRedisTemplate<String, String> redisTemplate,
+            @Qualifier(SystemRedisRateLimiter.REDIS_SCRIPT_NAME) RedisScript<List<Long>> script,
+            ConfigurationService configurationService) {
+        return new SystemRedisRateLimiter(redisTemplate, script, configurationService);
+    }
+}

+ 220 - 0
gateway-service/src/main/java/com/diagbot/config/redislimiter/SystemRedisRateLimiter.java

@@ -0,0 +1,220 @@
+package com.diagbot.config.redislimiter;
+
+import com.diagbot.util.StringUtil;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.cloud.gateway.filter.ratelimit.AbstractRateLimiter;
+import org.springframework.cloud.gateway.filter.ratelimit.RateLimiter;
+import org.springframework.cloud.gateway.support.ConfigurationService;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.data.redis.core.ReactiveRedisTemplate;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.script.RedisScript;
+import org.springframework.util.ObjectUtils;
+import org.springframework.validation.annotation.Validated;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+import javax.validation.constraints.Min;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/12/26 16:34
+ */
+public class SystemRedisRateLimiter extends AbstractRateLimiter<SystemRedisRateLimiter.Config> implements ApplicationContextAware {
+
+    public static final String REPLENISH_RATE_KEY = "replenishRate";
+
+    public static final String BURST_CAPACITY_KEY = "burstCapacity";
+
+    public static final String CONFIGURATION_PROPERTY_NAME = "sys-redis-rate-limiter";
+    public static final String REDIS_SCRIPT_NAME = "redisRequestRateLimiterScript";
+    public static final String REMAINING_HEADER = "X-RateLimit-Remaining";
+    public static final String REPLENISH_RATE_HEADER = "X-RateLimit-Replenish-Rate";
+    public static final String BURST_CAPACITY_HEADER = "X-RateLimit-Burst-Capacity";
+
+    //处理速度
+    private static final String DEFAULT_REPLENISHRATE = "default.replenishRate";
+    //容量
+    private static final String DEFAULT_BURSTCAPACITY = "default.burstCapacity";
+
+    private ReactiveRedisTemplate<String, String> redisTemplate;
+    private RedisScript<List<Long>> script;
+    private AtomicBoolean initialized = new AtomicBoolean(false);
+
+    @Autowired
+    @Qualifier("redisTemplateForCache")
+    private RedisTemplate myredisTemplate;
+
+    private String remainingHeader = REMAINING_HEADER;
+
+    /**
+     * The name of the header that returns the replenish rate configuration.
+     */
+    private String replenishRateHeader = REPLENISH_RATE_HEADER;
+
+    /**
+     * The name of the header that returns the burst capacity configuration.
+     */
+    private String burstCapacityHeader = BURST_CAPACITY_HEADER;
+
+    private Config defaultConfig;
+
+    public SystemRedisRateLimiter(ReactiveRedisTemplate<String, String> redisTemplate,
+                                  RedisScript<List<Long>> script, ConfigurationService configurationService) {
+        super(Config.class, CONFIGURATION_PROPERTY_NAME, configurationService);
+        this.redisTemplate = redisTemplate;
+        this.script = script;
+        initialized.compareAndSet(false, true);
+    }
+
+    public SystemRedisRateLimiter(int defaultReplenishRate, int defaultBurstCapacity) {
+        super(Config.class, CONFIGURATION_PROPERTY_NAME, (ConfigurationService) null);
+        defaultConfig = new Config()
+                .setReplenishRate(defaultReplenishRate)
+                .setBurstCapacity(defaultBurstCapacity);
+
+    }
+
+    @Override
+    public Mono<RateLimiter.Response> isAllowed(String routeId, String id) {
+        if (!this.initialized.get()) {
+            throw new IllegalStateException("RedisRateLimiter is not initialized");
+        }
+        if (ObjectUtils.isEmpty(rateLimiterConf)) {
+            throw new IllegalArgumentException("No Configuration found for route " + routeId);
+        }
+        //黑名单校验
+        String blackListKey = getBlackListKey(id);
+        Integer blackListValue = (Integer)this.myredisTemplate.opsForValue().get(blackListKey);
+        if (null != blackListValue) {
+            if (blackListValue > 20) {
+                throw new IllegalArgumentException("In Blacklist: " + blackListKey);
+            }
+        }
+
+        Map<String, Integer> rateLimitMap = rateLimiterConf.getRateLimitMap();
+        //缓存的key
+        String replenishRateKey = routeId + "." + REPLENISH_RATE_KEY;
+
+        int replenishRate = ObjectUtils.isEmpty(rateLimitMap.get(replenishRateKey)) ? rateLimitMap.get(DEFAULT_REPLENISHRATE) : rateLimitMap.get(replenishRateKey);
+        //容量key
+        String burstCapacityKey = routeId + "." + BURST_CAPACITY_KEY;
+
+        int burstCapacity = ObjectUtils.isEmpty(rateLimitMap.get(burstCapacityKey)) ? rateLimitMap.get(DEFAULT_BURSTCAPACITY) : rateLimitMap.get(burstCapacityKey);
+
+        try {
+            List<String> keys = getKeys(id);
+
+            List<String> scriptArgs = Arrays.asList(replenishRate + "", burstCapacity + "",
+                    Instant.now().getEpochSecond() + "", "1");
+            Flux<List<Long>> flux = this.redisTemplate.execute(this.script, keys, scriptArgs);
+
+            return flux.onErrorResume((throwable) -> Flux.just(Arrays.asList(1L, -1L)))
+                    .reduce(new ArrayList<Long>(), (longs, l) -> {
+                        longs.addAll(l);
+                        return longs;
+                    }).map(results -> {
+                        boolean allowed = results.get(0) == 1L;
+                        Long tokensLeft = results.get(1);
+
+                        if (!allowed) {
+                            this.myredisTemplate.opsForValue().increment(blackListKey, 1);
+                        }
+
+                        RateLimiter.Response response = new RateLimiter.Response(allowed, getHeaders(replenishRate, burstCapacity, tokensLeft));
+
+                        return response;
+                    });
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return Mono.just(new RateLimiter.Response(true, getHeaders(replenishRate, burstCapacity, -1L)));
+    }
+
+    private RateLimiterConf rateLimiterConf;
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        this.rateLimiterConf = applicationContext.getBean(RateLimiterConf.class);
+    }
+
+    public HashMap<String, String> getHeaders(Integer replenishRate, Integer burstCapacity, Long tokensLeft) {
+        HashMap<String, String> headers = new HashMap<>();
+        headers.put(this.remainingHeader, tokensLeft.toString());
+        headers.put(this.replenishRateHeader, String.valueOf(replenishRate));
+        headers.put(this.burstCapacityHeader, String.valueOf(burstCapacity));
+        return headers;
+    }
+
+    static List<String> getKeys(String id) {
+        // use `{}` around keys to use Redis Key hash tags
+        // this allows for using redis cluster
+
+        // Make a unique key per user.
+        String prefix = "request_sys_rate_limiter.{" + id;
+
+        // You need two Redis keys for Token Bucket.
+        String tokenKey = prefix + "}.tokens";
+        String timestampKey = prefix + "}.timestamp";
+        return Arrays.asList(tokenKey, timestampKey);
+    }
+
+    static String getBlackListKey(String id) {
+        String ip = id.substring(0, id.indexOf("_"));
+        String key = "ip_black_list_" + ip;
+        return key;
+    }
+
+    static String getBlackListKey(String routeId, String id) {
+        String ip = id.substring(0, id.indexOf("_"));
+        String key = "ip_black_list_" + routeId + "_" + ip;
+        return key + "_" + ip;
+    }
+
+    @Validated
+    public static class Config {
+        @Min(1)
+        private int replenishRate;
+        @Min(1)
+        private int burstCapacity = 1;
+
+        public int getReplenishRate() {
+            return replenishRate;
+        }
+
+        public Config setReplenishRate(int replenishRate) {
+            this.replenishRate = replenishRate;
+            return this;
+        }
+
+        public int getBurstCapacity() {
+            return burstCapacity;
+        }
+
+        public Config setBurstCapacity(int burstCapacity) {
+            this.burstCapacity = burstCapacity;
+            return this;
+        }
+
+        @Override
+        public String toString() {
+            return "Config{" +
+                    "replenishRate=" + replenishRate +
+                    ", burstCapacity=" + burstCapacity +
+                    '}';
+        }
+    }
+}

+ 2 - 2
gateway-service/src/main/java/com/diagbot/filter/GlobalGatewayFilter.java

@@ -76,8 +76,8 @@ public class GlobalGatewayFilter implements GlobalFilter {
                 }
             }
         }
-        log.info("APIURL:{}", requestUri);
-        log.info("SERVICENAME:{}", serviceName);
+        //        log.info("APIURL:{}", requestUri);
+        //        log.info("SERVICENAME:{}", serviceName);
 
         //        if(!IS_GENERATE) {
         //            RespDTO<List<ServiceFilter>> filter = diagbotmanServiceClient.getAll();

+ 5 - 5
icss-service/src/main/java/com/diagbot/client/AiptServiceClient.java

@@ -98,11 +98,11 @@ public interface AiptServiceClient {
     RespDTO<PushDTO> pushInner(@RequestBody SearchVO searchVO);
 
 
-    @PostMapping(value = "/scale/getList")
-    RespDTO<List<DisScaleDTO>> getList(@RequestBody DisScaleVO scaleVO);
-
-    @PostMapping(value = "/scale/index")
-    RespDTO<List<ScaleIndexDTO>> index(@RequestBody ScaleIndexVO scaleIndexVO);
+//    @PostMapping(value = "/scale/getList")
+//    RespDTO<List<DisScaleDTO>> getList(@RequestBody DisScaleVO scaleVO);
+//
+//    @PostMapping(value = "/scale/index")
+//    RespDTO<List<ScaleIndexDTO>> index(@RequestBody ScaleIndexVO scaleIndexVO);
 
     @PostMapping(value = "/disType/getDisType")
     RespDTO<DisTypeDTO> getDisType();

+ 0 - 0
icss-service/src/main/java/com/diagbot/client/TranServiceClient.java


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels