Browse Source

Merge branch 'develop_znwz_zzcx_xlcs' into jsfwb/common

# Conflicts:
#	pom.xml
liuqq 3 years ago
parent
commit
1aa2599772
100 changed files with 6661 additions and 1 deletions
  1. 2 1
      common/src/main/java/com/diagbot/enums/ProductTypeEnum.java
  2. 3 0
      common/src/main/java/com/diagbot/enums/SysTypeEnum.java
  3. 10 0
      common/src/main/java/com/diagbot/util/IdCard.java
  4. 82 0
      config-server/src/main/resources/shared/application-tzsl.yml
  5. 28 0
      config-server/src/main/resources/shared/gateway-service-dev.yml
  6. 28 0
      config-server/src/main/resources/shared/gateway-service-local.yml
  7. 21 0
      config-server/src/main/resources/shared/gateway-service-pre.yml
  8. 29 0
      config-server/src/main/resources/shared/gateway-service-pro.yml
  9. 21 0
      config-server/src/main/resources/shared/gateway-service-test.yml
  10. 114 0
      config-server/src/main/resources/shared/xlcs-service-dev.yml
  11. 114 0
      config-server/src/main/resources/shared/xlcs-service-local.yml
  12. 109 0
      config-server/src/main/resources/shared/xlcs-service-pre.yml
  13. 109 0
      config-server/src/main/resources/shared/xlcs-service-pro.yml
  14. 114 0
      config-server/src/main/resources/shared/xlcs-service-test.yml
  15. 115 0
      config-server/src/main/resources/shared/znwz-service-dev.yml
  16. 115 0
      config-server/src/main/resources/shared/znwz-service-local.yml
  17. 110 0
      config-server/src/main/resources/shared/znwz-service-pre.yml
  18. 110 0
      config-server/src/main/resources/shared/znwz-service-pro.yml
  19. 110 0
      config-server/src/main/resources/shared/znwz-service-test.yml
  20. 104 0
      config-server/src/main/resources/shared/zzcx-service-dev.yml
  21. 104 0
      config-server/src/main/resources/shared/zzcx-service-local.yml
  22. 104 0
      config-server/src/main/resources/shared/zzcx-service-pre.yml
  23. 104 0
      config-server/src/main/resources/shared/zzcx-service-pro.yml
  24. 104 0
      config-server/src/main/resources/shared/zzcx-service-test.yml
  25. 104 0
      config-server/src/main/resources/shared/zzcxtzsl-service-tzsl.yml
  26. 151 0
      docs/029.20200131智能问诊初始化脚本/init_znwz.sql
  27. 6 0
      docs/030.20200202自诊程序初始化脚本/add.sql
  28. 158 0
      docs/030.20200202自诊程序初始化脚本/init_zzcx.sql
  29. 25 0
      docs/030.20200208智能问诊等日志记录/znwz_add.sql
  30. 44 0
      docs/031.20200229自诊程序配置/init_zzcx.sql
  31. 20 0
      docs/031.20200229自诊程序配置/zzcx20200220.sql
  32. 91 0
      docs/032.20200225心理健康猜测试初始化脚本/init_xlcs.sql
  33. 19 0
      docs/032.20200225心理健康猜测试初始化脚本/xlcs20200304.sql
  34. 11 0
      docs/032.20200228自诊程序对接/init_zzcx.sql
  35. 4 0
      pom.xml
  36. 25 0
      xlcs-service/.gitignore
  37. 205 0
      xlcs-service/pom.xml
  38. 36 0
      xlcs-service/src/main/java/com/diagbot/XlcsServiceApplication.java
  39. 109 0
      xlcs-service/src/main/java/com/diagbot/aggregate/OptAggregate.java
  40. 106 0
      xlcs-service/src/main/java/com/diagbot/aggregate/OptHospAggregate.java
  41. 41 0
      xlcs-service/src/main/java/com/diagbot/aop/SysLoggerAspect.java
  42. 19 0
      xlcs-service/src/main/java/com/diagbot/config/CustomAccessTokenConverter.java
  43. 15 0
      xlcs-service/src/main/java/com/diagbot/config/GlobalMethodSecurityConfigurer.java
  44. 26 0
      xlcs-service/src/main/java/com/diagbot/config/IdcConfigurer.java
  45. 48 0
      xlcs-service/src/main/java/com/diagbot/config/JwtConfigurer.java
  46. 33 0
      xlcs-service/src/main/java/com/diagbot/config/MybatisPlusConfigurer.java
  47. 42 0
      xlcs-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  48. 70 0
      xlcs-service/src/main/java/com/diagbot/config/SwaggerConfigurer.java
  49. 81 0
      xlcs-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  50. 29 0
      xlcs-service/src/main/java/com/diagbot/config/security/UrlConfigAttribute.java
  51. 79 0
      xlcs-service/src/main/java/com/diagbot/config/security/UrlFilterSecurityInterceptor.java
  52. 40 0
      xlcs-service/src/main/java/com/diagbot/config/security/UrlMetadataSourceService.java
  53. 47 0
      xlcs-service/src/main/java/com/diagbot/config/wx/WxMpConfiguration.java
  54. 46 0
      xlcs-service/src/main/java/com/diagbot/config/wx/WxMpProperties.java
  55. 33 0
      xlcs-service/src/main/java/com/diagbot/dto/GetInquiryDetailDTO.java
  56. 40 0
      xlcs-service/src/main/java/com/diagbot/dto/HistoryInquiryDTO.java
  57. 22 0
      xlcs-service/src/main/java/com/diagbot/dto/HospItemDTO.java
  58. 18 0
      xlcs-service/src/main/java/com/diagbot/dto/HospNameDTO.java
  59. 114 0
      xlcs-service/src/main/java/com/diagbot/dto/InquiryDTO.java
  60. 40 0
      xlcs-service/src/main/java/com/diagbot/dto/InquiryPatDTO.java
  61. 22 0
      xlcs-service/src/main/java/com/diagbot/dto/OptDTO.java
  62. 25 0
      xlcs-service/src/main/java/com/diagbot/dto/OptHospDTO.java
  63. 16 0
      xlcs-service/src/main/java/com/diagbot/dto/PVDTO.java
  64. 18 0
      xlcs-service/src/main/java/com/diagbot/dto/PVHospDTO.java
  65. 17 0
      xlcs-service/src/main/java/com/diagbot/dto/PVHospSumDTO.java
  66. 30 0
      xlcs-service/src/main/java/com/diagbot/dto/SaveInquiryDTO.java
  67. 71 0
      xlcs-service/src/main/java/com/diagbot/dto/SysSetDTO.java
  68. 33 0
      xlcs-service/src/main/java/com/diagbot/dto/SysSetProHosResDTO.java
  69. 16 0
      xlcs-service/src/main/java/com/diagbot/dto/UVDTO.java
  70. 18 0
      xlcs-service/src/main/java/com/diagbot/dto/UVHospDTO.java
  71. 17 0
      xlcs-service/src/main/java/com/diagbot/dto/UVHospSumDTO.java
  72. 16 0
      xlcs-service/src/main/java/com/diagbot/dto/ZZDTO.java
  73. 18 0
      xlcs-service/src/main/java/com/diagbot/dto/ZZHospDTO.java
  74. 17 0
      xlcs-service/src/main/java/com/diagbot/dto/ZZHospSumDTO.java
  75. 67 0
      xlcs-service/src/main/java/com/diagbot/entity/Client.java
  76. 47 0
      xlcs-service/src/main/java/com/diagbot/entity/Constants.java
  77. 169 0
      xlcs-service/src/main/java/com/diagbot/entity/InquiryDetail.java
  78. 164 0
      xlcs-service/src/main/java/com/diagbot/entity/InquiryInfo.java
  79. 53 0
      xlcs-service/src/main/java/com/diagbot/entity/JSONResponseBean.java
  80. 166 0
      xlcs-service/src/main/java/com/diagbot/entity/OptInfo.java
  81. 16 0
      xlcs-service/src/main/java/com/diagbot/entity/Option.java
  82. 142 0
      xlcs-service/src/main/java/com/diagbot/entity/Request.java
  83. 120 0
      xlcs-service/src/main/java/com/diagbot/entity/Response.java
  84. 172 0
      xlcs-service/src/main/java/com/diagbot/entity/SysSet.java
  85. 29 0
      xlcs-service/src/main/java/com/diagbot/entity/SystemHeader.java
  86. 50 0
      xlcs-service/src/main/java/com/diagbot/enums/IdTypeEnum.java
  87. 81 0
      xlcs-service/src/main/java/com/diagbot/exception/CommonExceptionHandler.java
  88. 39 0
      xlcs-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java
  89. 14 0
      xlcs-service/src/main/java/com/diagbot/facade/InquiryDetailFacade.java
  90. 399 0
      xlcs-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java
  91. 215 0
      xlcs-service/src/main/java/com/diagbot/facade/OptInfoFacade.java
  92. 86 0
      xlcs-service/src/main/java/com/diagbot/facade/SysSetFacade.java
  93. 197 0
      xlcs-service/src/main/java/com/diagbot/facade/WeixinFacade.java
  94. 36 0
      xlcs-service/src/main/java/com/diagbot/idc/AbstractIdCreater.java
  95. 26 0
      xlcs-service/src/main/java/com/diagbot/idc/IdCreater.java
  96. 62 0
      xlcs-service/src/main/java/com/diagbot/idc/InvisibleIdCreater.java
  97. 71 0
      xlcs-service/src/main/java/com/diagbot/idc/VisibleIdCreater.java
  98. 16 0
      xlcs-service/src/main/java/com/diagbot/mapper/InquiryDetailMapper.java
  99. 29 0
      xlcs-service/src/main/java/com/diagbot/mapper/InquiryInfoMapper.java
  100. 0 0
      xlcs-service/src/main/java/com/diagbot/mapper/OptInfoMapper.java

+ 2 - 1
common/src/main/java/com/diagbot/enums/ProductTypeEnum.java

@@ -15,7 +15,8 @@ public enum ProductTypeEnum implements KeyedNamed {
     TRIAGE(4, "智能分诊"),
     TRIAGE(4, "智能分诊"),
     DATA(5, "页面推送模式"),
     DATA(5, "页面推送模式"),
     PREC(6, "智能预问诊"),
     PREC(6, "智能预问诊"),
-    LTAPI(7, "数据引擎模式");
+    LTAPI(7, "数据引擎模式"),
+    ZNWZ(8, "智能问诊");
     @Setter
     @Setter
     private int key;
     private int key;
 
 

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

@@ -31,6 +31,9 @@ public enum SysTypeEnum implements KeyedNamed {
     PRECMAN_SERVICE(18, "precman-service"),
     PRECMAN_SERVICE(18, "precman-service"),
     MRQCMAN_SERVICE(19, "mrqcman-service"),
     MRQCMAN_SERVICE(19, "mrqcman-service"),
     MRMAN_SERVICE(20, "mrman-service"),
     MRMAN_SERVICE(20, "mrman-service"),
+    ZNWZ_SERVICE(21, "znwz-service"),
+    ZZCX_SERVICE(22, "zzcx-service"),
+    XLCS_SERVICE(23, "xlcs-service"),
     LTKG_SERVICE(30, "ltkg-service");
     LTKG_SERVICE(30, "ltkg-service");
 
 
     @Setter
     @Setter

+ 10 - 0
common/src/main/java/com/diagbot/util/IdCard.java

@@ -33,6 +33,16 @@ public class IdCard {
         return iAge;
         return iAge;
     }
     }
 
 
+    /**
+     * 根据身份编号获取年龄加1
+     *
+     * @param idCard 身份编号
+     * @return 年龄
+     */
+    public static int getAgeByIdCardAddOne(String idCard) {
+        return getAgeByIdCard(idCard) + 1;
+    }
+
     /**
     /**
      * 根据身份编号获取生日
      * 根据身份编号获取生日
      *
      *

+ 82 - 0
config-server/src/main/resources/shared/application-tzsl.yml

@@ -0,0 +1,82 @@
+#logging:
+#  level:
+#    org.springframework.security: INFO
+
+hystrix:
+  command:
+    default:
+      execution:
+        isolation:
+          thread:
+            timeoutInMilliseconds: 20000
+
+ribbon:
+  ReadTimeout: 20000
+  ConnectTimeout: 20000
+  MaxAutoRetries: 0
+  MaxAutoRetriesNextServer: 1
+
+eureka:
+  instance:
+    prefer-ip-address: true #使用IP注册
+    instance-id: ${spring.cloud.client.ip-address}:${server.port}
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health #2.0后actuator的地址发生了变化
+  client:
+    registryFetchIntervalSeconds: 5
+#    serviceUrl:
+#      defaultZone: http://eureka1:8761/eureka/
+
+#endpoints:
+#  health:
+#    sensitive: false
+#    enabled: true
+#  actuator:
+#    enabled: true
+#    sensitive: false
+#  beans:
+#    sensitive: false
+#    enabled: true
+
+
+management:
+  endpoints:
+    web:
+      exposure:
+        include: bus-refresh,health,info,hystrix.stream
+      cors:
+        allowed-origins: "*"
+        allowed-methods: "*"
+  endpoint:
+    health:
+      show-details: always
+feign:
+  hystrix:
+    enabled: true
+
+spring:
+  #消息总线
+  cloud:
+    bus:
+      enabled: true
+      trace:
+        enabled: true
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: GMT+8
+
+server:
+  max-http-header-size: 10MB
+
+swagger:
+  enable: true
+
+syslog:
+  enable: true
+
+bilog:
+  enable: false
+
+mrqc:
+  server:
+    address: http://192.168.2.123:8090

+ 28 - 0
config-server/src/main/resources/shared/gateway-service-dev.yml

@@ -183,6 +183,34 @@ spring:
         - Path=/api/ltkg/**
         - Path=/api/ltkg/**
         filters:
         filters:
         - StripPrefix=2
         - StripPrefix=2
+      - id: znwz-service
+        uri: lb://znwz-service
+        predicates:
+        - Path=/api/znwz/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: zzcx-service
+        uri: lb://zzcx-service
+        predicates:
+        - Path=/api/zzcx/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: zzcxtzsl-service
+        uri: lb://zzcxtzsl-service
+        predicates:
+        - Path=/api/zzcxtzsl/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: xlcs-service
+        uri: lb://xlcs-service
+        predicates:
+        - Path=/api/xlcs/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 
 server:
 server:
   port: 5050
   port: 5050

+ 28 - 0
config-server/src/main/resources/shared/gateway-service-local.yml

@@ -183,6 +183,34 @@ spring:
         - Path=/api/ltkg/**
         - Path=/api/ltkg/**
         filters:
         filters:
         - StripPrefix=2
         - StripPrefix=2
+      - id: znwz-service
+        uri: lb://znwz-service
+        predicates:
+        - Path=/api/znwz/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: zzcx-service
+        uri: lb://zzcx-service
+        predicates:
+        - Path=/api/zzcx/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: zzcxtzsl-service
+        uri: lb://zzcxtzsl-service
+        predicates:
+        - Path=/api/zzcxtzsl/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: xlcs-service
+        uri: lb://xlcs-service
+        predicates:
+        - Path=/api/xlcs/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 
 server:
 server:
   port: 5050
   port: 5050

+ 21 - 0
config-server/src/main/resources/shared/gateway-service-pre.yml

@@ -193,6 +193,27 @@ spring:
         - Path=/api/ltkg/**
         - Path=/api/ltkg/**
         filters:
         filters:
         - StripPrefix=2
         - StripPrefix=2
+      - id: znwz-service
+        uri: lb://znwz-service
+        predicates:
+        - Path=/api/znwz/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: zzcx-service
+        uri: lb://zzcx-service
+        predicates:
+        - Path=/api/zzcx/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: xlcs-service
+        uri: lb://xlcs-service
+        predicates:
+        - Path=/api/xlcs/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 
 server:
 server:
   port: 5050
   port: 5050

+ 29 - 0
config-server/src/main/resources/shared/gateway-service-pro.yml

@@ -183,6 +183,35 @@ spring:
         - Path=/api/ltkg/**
         - Path=/api/ltkg/**
         filters:
         filters:
         - StripPrefix=2
         - StripPrefix=2
+      - id: znwz-service
+        uri: lb://znwz-service
+        predicates:
+        - Path=/api/znwz/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: zzcx-service
+        uri: lb://zzcx-service
+        predicates:
+        - Path=/api/zzcx/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: zzcxtzsl-service
+        uri: lb://zzcxtzsl-service
+        predicates:
+        - Path=/api/zzcxtzsl/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: xlcs-service
+        uri: lb://xlcs-service
+        predicates:
+        - Path=/api/xlcs/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+
 
 
 server:
 server:
   port: 5050
   port: 5050

+ 21 - 0
config-server/src/main/resources/shared/gateway-service-test.yml

@@ -183,6 +183,27 @@ spring:
         - Path=/api/ltkg/**
         - Path=/api/ltkg/**
         filters:
         filters:
         - StripPrefix=2
         - StripPrefix=2
+      - id: znwz-service
+        uri: lb://znwz-service
+        predicates:
+        - Path=/api/znwz/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: zzcx-service
+        uri: lb://zzcx-service
+        predicates:
+        - Path=/api/zzcx/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: xlcs-service
+        uri: lb://xlcs-service
+        predicates:
+        - Path=/api/xlcs/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 
 server:
 server:
   port: 5050
   port: 5050

+ 114 - 0
config-server/src/main/resources/shared/xlcs-service-dev.yml

@@ -0,0 +1,114 @@
+server:
+  port: 8854
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-xlcs?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxedd53be102996426
+  secret: c164e280950342f166a933dd7aa6daf7
+
+#nali:
+#  apiUrl: http://116.62.170.131:8096/openapi-devtest/gateway
+#  appKey: ngari5e34e52511dc394f
+#  appSecret: 11dc394fc05518c1
+
+nali:
+  apiUrl: https://ssltest.ngarihealth.com/openapi-prerelease/gateway
+  appKey: ngari5e48d9ec11dc3978
+  appSecret: 11dc397869c2d24a

+ 114 - 0
config-server/src/main/resources/shared/xlcs-service-local.yml

@@ -0,0 +1,114 @@
+server:
+  port: 8854
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-xlcs?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxedd53be102996426
+  secret: c164e280950342f166a933dd7aa6daf7
+
+#nali:
+#  apiUrl: http://116.62.170.131:8096/openapi-devtest/gateway
+#  appKey: ngari5e34e52511dc394f
+#  appSecret: 11dc394fc05518c1
+
+nali:
+  apiUrl: https://ssltest.ngarihealth.com/openapi-prerelease/gateway
+  appKey: ngari5e48d9ec11dc3978
+  appSecret: 11dc397869c2d24a

+ 109 - 0
config-server/src/main/resources/shared/xlcs-service-pre.yml

@@ -0,0 +1,109 @@
+server:
+  port: 8854
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.121:3306/sys-xlcs?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: teamback
+      password: goTulmLeon
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxe4e2b88ec9c578bd
+  secret: 16ae52c464d2a201c7ede0820dadb4a9
+
+nali:
+  apiUrl: https://openapi.ngarihealth.com/openapi/gateway
+  appKey: ngari5e3517480e980e6e
+  appSecret: 0e980e6e502ab074

+ 109 - 0
config-server/src/main/resources/shared/xlcs-service-pro.yml

@@ -0,0 +1,109 @@
+server:
+  port: 8854
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://118.31.77.177:3306/sys-xlcs?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: langtong
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxe4e2b88ec9c578bd
+  secret: 16ae52c464d2a201c7ede0820dadb4a9
+
+nali:
+  apiUrl: https://openapi.ngarihealth.com/openapi/gateway
+  appKey: ngari5e3517480e980e6e
+  appSecret: 0e980e6e502ab074

+ 114 - 0
config-server/src/main/resources/shared/xlcs-service-test.yml

@@ -0,0 +1,114 @@
+server:
+  port: 8854
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.241:3306/sys-xlcs?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxe4e2b88ec9c578bd
+  secret: 16ae52c464d2a201c7ede0820dadb4a9
+
+#nali:
+#  apiUrl: http://116.62.170.131:8096/openapi-devtest/gateway
+#  appKey: ngari5e34e52511dc394f
+#  appSecret: 11dc394fc05518c1
+
+nali:
+  apiUrl: https://ssltest.ngarihealth.com/openapi-prerelease/gateway
+  appKey: ngari5e48d9ec11dc3978
+  appSecret: 11dc397869c2d24a

+ 115 - 0
config-server/src/main/resources/shared/znwz-service-dev.yml

@@ -0,0 +1,115 @@
+server:
+  port: 8852
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-znwz?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+        outputBiLog:
+          destination: myBiLog
+
+  #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
+
+imageUrl:
+  prefix: http://192.168.2.236:82
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+#nali:
+#  apiUrl: http://116.62.170.131:8096/openapi-devtest/gateway
+#  appKey: ngari5e34e52511dc394f
+#  appSecret: 11dc394fc05518c1
+
+nali:
+  apiUrl: https://ssltest.ngarihealth.com/openapi-prerelease/gateway
+  appKey: ngari5e48d9ec11dc3978
+  appSecret: 11dc397869c2d24a

+ 115 - 0
config-server/src/main/resources/shared/znwz-service-local.yml

@@ -0,0 +1,115 @@
+server:
+  port: 8852
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-znwz?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+        outputBiLog:
+          destination: myBiLog
+
+  #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
+
+imageUrl:
+  prefix: http://192.168.2.236:82
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+#nali:
+#  apiUrl: http://116.62.170.131:8096/openapi-devtest/gateway
+#  appKey: ngari5e34e52511dc394f
+#  appSecret: 11dc394fc05518c1
+
+nali:
+  apiUrl: https://ssltest.ngarihealth.com/openapi-prerelease/gateway
+  appKey: ngari5e48d9ec11dc3978
+  appSecret: 11dc397869c2d24a

+ 110 - 0
config-server/src/main/resources/shared/znwz-service-pre.yml

@@ -0,0 +1,110 @@
+server:
+  port: 8852
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.121:3306/sys-znwz?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: teamback
+      password: goTulmLeon
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+        outputBiLog:
+          destination: myBiLog
+
+  #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
+
+imageUrl:
+  prefix: http://192.168.2.121:82
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+nali:
+  apiUrl: https://openapi.ngarihealth.com/openapi/gateway
+  appKey: ngari5e3517480e980e6e
+  appSecret: 0e980e6e502ab074

+ 110 - 0
config-server/src/main/resources/shared/znwz-service-pro.yml

@@ -0,0 +1,110 @@
+server:
+  port: 8852
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.122:3306/sys-znwz?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+        outputBiLog:
+          destination: myBiLog
+
+  #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
+
+imageUrl:
+  prefix: http://192.168.2.122:82
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+nali:
+  apiUrl: https://openapi.ngarihealth.com/openapi/gateway
+  appKey: ngari5e3517480e980e6e
+  appSecret: 0e980e6e502ab074

+ 110 - 0
config-server/src/main/resources/shared/znwz-service-test.yml

@@ -0,0 +1,110 @@
+server:
+  port: 8852
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.241:3306/sys-znwz?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+        outputBiLog:
+          destination: myBiLog
+
+  #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
+
+imageUrl:
+  prefix: http://192.168.2.241:82
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+nali:
+  apiUrl: http://116.62.170.131:8096/openapi-devtest/gateway
+  appKey: ngari5e34e52511dc394f
+  appSecret: 11dc394fc05518c1

+ 104 - 0
config-server/src/main/resources/shared/zzcx-service-dev.yml

@@ -0,0 +1,104 @@
+server:
+  port: 8853
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-zzcx?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxedd53be102996426
+  secret: c164e280950342f166a933dd7aa6daf7

+ 104 - 0
config-server/src/main/resources/shared/zzcx-service-local.yml

@@ -0,0 +1,104 @@
+server:
+  port: 8853
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.236:3306/sys-zzcxtzsl?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxedd53be102996426
+  secret: c164e280950342f166a933dd7aa6daf7

+ 104 - 0
config-server/src/main/resources/shared/zzcx-service-pre.yml

@@ -0,0 +1,104 @@
+server:
+  port: 8853
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.121:3306/sys-zzcx?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: teamback
+      password: goTulmLeon
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxe4e2b88ec9c578bd
+  secret: 16ae52c464d2a201c7ede0820dadb4a9

+ 104 - 0
config-server/src/main/resources/shared/zzcx-service-pro.yml

@@ -0,0 +1,104 @@
+server:
+  port: 8853
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.122:3306/sys-zzcx?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxe4e2b88ec9c578bd
+  secret: 16ae52c464d2a201c7ede0820dadb4a9

+ 104 - 0
config-server/src/main/resources/shared/zzcx-service-test.yml

@@ -0,0 +1,104 @@
+server:
+  port: 8853
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://192.168.2.241:3306/sys-zzcx?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: lantone
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxe4e2b88ec9c578bd
+  secret: 16ae52c464d2a201c7ede0820dadb4a9

+ 104 - 0
config-server/src/main/resources/shared/zzcxtzsl-service-tzsl.yml

@@ -0,0 +1,104 @@
+server:
+  port: 8853
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driver-class-name: com.mysql.cj.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://118.31.77.177:3306/sys-zzcx?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      username: root
+      password: langtong
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      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
+
+io.github.lvyahui8.spring:
+  base-packages: com.diagbot.aggregate
+  thread-number: 12
+
+weixin:
+  appid: wxe4e2b88ec9c578bd
+  secret: 16ae52c464d2a201c7ede0820dadb4a9

+ 151 - 0
docs/029.20200131智能问诊初始化脚本/init_znwz.sql

@@ -0,0 +1,151 @@
+drop database if exists `sys-znwz`;
+CREATE DATABASE  `sys-znwz` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
+use `sys-znwz`;
+
+/*
+Navicat MySQL Data Transfer
+
+Source Server         : 2.236平台开发环境
+Source Server Version : 50723
+Source Host           : 192.168.2.236:3306
+Source Database       : sys-znwz
+
+Target Server Type    : MYSQL
+Target Server Version : 50723
+File Encoding         : 65001
+
+Date: 2019-07-30 17:12:35
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+--
+-- -- ----------------------------
+-- -- Table structure for znwz_dictionary_info
+-- -- ----------------------------
+-- DROP TABLE IF EXISTS `znwz_dictionary_info`;
+-- CREATE TABLE `znwz_dictionary_info` (
+--   `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 '0' COMMENT '创建人,0表示无创建人值',
+--   `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+--   `group_type` bigint(20) NOT NULL DEFAULT '0' COMMENT '分组(值自定义)',
+--   `name` varchar(100) NOT NULL DEFAULT '' COMMENT '内容',
+--   `val` varchar(255) NOT NULL DEFAULT '' COMMENT '值',
+--   `return_type` int(11) NOT NULL DEFAULT '1' COMMENT '返回类型(0: 都返回,1:后台维护返回 2:icss界面返回)',
+--   `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+--   `remark` varchar(300) DEFAULT NULL COMMENT '备注',
+--   PRIMARY KEY (`id`)
+-- ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='字典表';
+--
+--
+-- -- ----------------------------
+-- -- Table structure for znwz_question_detail
+-- -- ----------------------------
+-- DROP TABLE IF EXISTS `znwz_question_detail`;
+-- CREATE TABLE `znwz_question_detail` (
+--   `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 '0' COMMENT '创建人,0表示无创建人值',
+--   `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+--   `question_id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'question_id',
+--   `description` varchar(100) NOT NULL DEFAULT '' COMMENT '患者界面描述',
+--   `name` varchar(100) NOT NULL DEFAULT '' COMMENT '名称',
+--   `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+--   `exclusion` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:不互斥,1:与其他都互斥',
+--   `remark` varchar(300) DEFAULT NULL COMMENT '备注',
+--   PRIMARY KEY (`id`),
+--   KEY `index_questonid` (`question_id`) USING BTREE
+-- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='标签明细表';
+--
+--
+-- -- ----------------------------
+-- -- Table structure for znwz_question_info
+-- -- ----------------------------
+-- DROP TABLE IF EXISTS `znwz_question_info`;
+-- CREATE TABLE `znwz_question_info` (
+--   `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 '0' COMMENT '创建人,0表示无创建人值',
+--   `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+--   `tag_name` varchar(100) NOT NULL DEFAULT '' COMMENT '标签名',
+--   `name` varchar(100) NOT NULL DEFAULT '' COMMENT '内容',
+--   `description` varchar(100) NOT NULL DEFAULT '' COMMENT '患者界面描述,例如:腹泻的描述-拉肚子',
+--   `sex_type` tinyint(11) NOT NULL DEFAULT '3' COMMENT '性别(1:男 2:女 3:通用)',
+--   `age_begin` int(11) NOT NULL DEFAULT '0' COMMENT '最小年龄',
+--   `age_end` int(11) NOT NULL DEFAULT '200' COMMENT '最大年龄',
+--   `tag_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '标签标识(1:单标签 4:组合标签,胸痛  6:组合标签,既往史)',
+--   `control_type` tinyint(4) DEFAULT '0' COMMENT '控件类型(0:无类型,默认值 1:单选 2:多选 3:多行输入,生命体征 4:上传图片 5:文本域,自行服药 6:文本框 7:数字文本框)',
+--   `type` tinyint(4) DEFAULT NULL COMMENT '类型(1:症状 3:其他史 51:诊疗情况 52:补充 )',
+--   `item_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '元素类型(0:主标签,例如主诉现病史-症状标签,1:次标签:主诉现病史-其他标签)\r\n',
+--   `label_prefix` varchar(100) NOT NULL DEFAULT '' COMMENT '前置内容',
+--   `label_suffix` varchar(100) NOT NULL DEFAULT '' COMMENT '后置内容',
+--   `url` varchar(255) NOT NULL DEFAULT '' COMMENT '图片url地址',
+--   `remark` varchar(300) DEFAULT NULL COMMENT '备注',
+--   PRIMARY KEY (`id`),
+--   UNIQUE KEY `tag_name,type` (`tag_name`,`type`,`is_deleted`,`id`) USING BTREE
+-- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='标签基础表';
+--
+-- -- ----------------------------
+-- -- Table structure for znwz_question_mapping
+-- -- ----------------------------
+-- DROP TABLE IF EXISTS `znwz_question_mapping`;
+-- CREATE TABLE `znwz_question_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 '0' COMMENT '创建人,0表示无创建人值',
+--   `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+--   `parent_question` bigint(20) DEFAULT NULL COMMENT '上级question',
+--   `son_question` bigint(20) DEFAULT NULL COMMENT '下级question',
+--   `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+--   `exclusion_type` int(11) NOT NULL DEFAULT '0' COMMENT '互斥类型(0:不互斥, 1:互斥 主要用在组合项:例如既往史无殊)',
+--   `remark` varchar(300) DEFAULT NULL COMMENT '备注',
+--   PRIMARY KEY (`id`),
+--   KEY `parent_question` (`parent_question`)
+-- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='标签映射表';
+
+CREATE TABLE `znwz_inquiry_info` (
+  `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 '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `app_id` varchar(64) DEFAULT NULL COMMENT '公众号appid',
+  `organ_name` varchar(64) DEFAULT NULL COMMENT '医院名称',
+  `department` varchar(64) DEFAULT NULL COMMENT '医生所在科室名称',
+  `doctor_id` varchar(64) DEFAULT NULL COMMENT '医生ID',
+  `doctor_name` varchar(64) DEFAULT NULL COMMENT '医生名称',
+  `mpi_id` varchar(64) DEFAULT NULL COMMENT '用户在纳里的ID',
+  `patient_name` varchar(64) DEFAULT NULL COMMENT '用户名称',
+  `patient_age` int(2) DEFAULT NULL COMMENT '用户年龄',
+  `patient_sex` varchar(2) DEFAULT NULL COMMENT '用户性别',
+  `diagnosis` varchar(256) DEFAULT NULL COMMENT '诊断',
+  `ret_url` varchar(512) DEFAULT NULL COMMENT '纳里返回的url',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='问诊记录-主表';
+
+CREATE TABLE `znwz_inquiry_detail` (
+  `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 '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `inquiry_id` bigint(20) NOT NULL COMMENT '问诊记录id',
+  `question` varchar(1024) DEFAULT NULL COMMENT '问题',
+  `answer` varchar(1024) DEFAULT NULL COMMENT '答案',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='问诊记录-明细表';
+
+
+

+ 6 - 0
docs/030.20200202自诊程序初始化脚本/add.sql

@@ -0,0 +1,6 @@
+use `sys-zzcx`;
+ALTER TABLE `zzcx_opt_info`
+ADD COLUMN `hospital_code` varchar(255) NOT NULL DEFAULT '朗通通用' COMMENT '医院名称' after `modifier`;
+
+ALTER TABLE `zzcx_inquiry_info`
+ADD COLUMN `hospital_code` varchar(255) NOT NULL DEFAULT '朗通通用' COMMENT '医院名称' after `modifier`;

+ 158 - 0
docs/030.20200202自诊程序初始化脚本/init_zzcx.sql

@@ -0,0 +1,158 @@
+drop database if exists `sys-zzcx`;
+CREATE DATABASE  `sys-zzcx` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
+use `sys-zzcx`;
+
+/*
+Navicat MySQL Data Transfer
+
+Source Server         : 2.236平台开发环境
+Source Server Version : 50723
+Source Host           : 192.168.2.236:3306
+Source Database       : sys-znwz
+
+Target Server Type    : MYSQL
+Target Server Version : 50723
+File Encoding         : 65001
+
+Date: 2019-07-30 17:12:35
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+--
+-- -- ----------------------------
+-- -- Table structure for znwz_dictionary_info
+-- -- ----------------------------
+-- DROP TABLE IF EXISTS `znwz_dictionary_info`;
+-- CREATE TABLE `znwz_dictionary_info` (
+--   `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 '0' COMMENT '创建人,0表示无创建人值',
+--   `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+--   `group_type` bigint(20) NOT NULL DEFAULT '0' COMMENT '分组(值自定义)',
+--   `name` varchar(100) NOT NULL DEFAULT '' COMMENT '内容',
+--   `val` varchar(255) NOT NULL DEFAULT '' COMMENT '值',
+--   `return_type` int(11) NOT NULL DEFAULT '1' COMMENT '返回类型(0: 都返回,1:后台维护返回 2:icss界面返回)',
+--   `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+--   `remark` varchar(300) DEFAULT NULL COMMENT '备注',
+--   PRIMARY KEY (`id`)
+-- ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='字典表';
+--
+--
+-- -- ----------------------------
+-- -- Table structure for znwz_question_detail
+-- -- ----------------------------
+-- DROP TABLE IF EXISTS `znwz_question_detail`;
+-- CREATE TABLE `znwz_question_detail` (
+--   `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 '0' COMMENT '创建人,0表示无创建人值',
+--   `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+--   `question_id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'question_id',
+--   `description` varchar(100) NOT NULL DEFAULT '' COMMENT '患者界面描述',
+--   `name` varchar(100) NOT NULL DEFAULT '' COMMENT '名称',
+--   `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+--   `exclusion` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:不互斥,1:与其他都互斥',
+--   `remark` varchar(300) DEFAULT NULL COMMENT '备注',
+--   PRIMARY KEY (`id`),
+--   KEY `index_questonid` (`question_id`) USING BTREE
+-- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='标签明细表';
+--
+--
+-- -- ----------------------------
+-- -- Table structure for znwz_question_info
+-- -- ----------------------------
+-- DROP TABLE IF EXISTS `znwz_question_info`;
+-- CREATE TABLE `znwz_question_info` (
+--   `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 '0' COMMENT '创建人,0表示无创建人值',
+--   `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+--   `tag_name` varchar(100) NOT NULL DEFAULT '' COMMENT '标签名',
+--   `name` varchar(100) NOT NULL DEFAULT '' COMMENT '内容',
+--   `description` varchar(100) NOT NULL DEFAULT '' COMMENT '患者界面描述,例如:腹泻的描述-拉肚子',
+--   `sex_type` tinyint(11) NOT NULL DEFAULT '3' COMMENT '性别(1:男 2:女 3:通用)',
+--   `age_begin` int(11) NOT NULL DEFAULT '0' COMMENT '最小年龄',
+--   `age_end` int(11) NOT NULL DEFAULT '200' COMMENT '最大年龄',
+--   `tag_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '标签标识(1:单标签 4:组合标签,胸痛  6:组合标签,既往史)',
+--   `control_type` tinyint(4) DEFAULT '0' COMMENT '控件类型(0:无类型,默认值 1:单选 2:多选 3:多行输入,生命体征 4:上传图片 5:文本域,自行服药 6:文本框 7:数字文本框)',
+--   `type` tinyint(4) DEFAULT NULL COMMENT '类型(1:症状 3:其他史 51:诊疗情况 52:补充 )',
+--   `item_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '元素类型(0:主标签,例如主诉现病史-症状标签,1:次标签:主诉现病史-其他标签)\r\n',
+--   `label_prefix` varchar(100) NOT NULL DEFAULT '' COMMENT '前置内容',
+--   `label_suffix` varchar(100) NOT NULL DEFAULT '' COMMENT '后置内容',
+--   `url` varchar(255) NOT NULL DEFAULT '' COMMENT '图片url地址',
+--   `remark` varchar(300) DEFAULT NULL COMMENT '备注',
+--   PRIMARY KEY (`id`),
+--   UNIQUE KEY `tag_name,type` (`tag_name`,`type`,`is_deleted`,`id`) USING BTREE
+-- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='标签基础表';
+--
+-- -- ----------------------------
+-- -- Table structure for znwz_question_mapping
+-- -- ----------------------------
+-- DROP TABLE IF EXISTS `znwz_question_mapping`;
+-- CREATE TABLE `znwz_question_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 '0' COMMENT '创建人,0表示无创建人值',
+--   `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+--   `parent_question` bigint(20) DEFAULT NULL COMMENT '上级question',
+--   `son_question` bigint(20) DEFAULT NULL COMMENT '下级question',
+--   `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+--   `exclusion_type` int(11) NOT NULL DEFAULT '0' COMMENT '互斥类型(0:不互斥, 1:互斥 主要用在组合项:例如既往史无殊)',
+--   `remark` varchar(300) DEFAULT NULL COMMENT '备注',
+--   PRIMARY KEY (`id`),
+--   KEY `parent_question` (`parent_question`)
+-- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='标签映射表';
+
+DROP TABLE IF EXISTS `zzcx_opt_info`;
+CREATE TABLE `zzcx_opt_info` (
+  `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 '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `ip` varchar(100) NOT NULL DEFAULT '' COMMENT '访问者的IP',
+  `opt_type` varchar(10) DEFAULT NULL COMMENT '操作类型:1 开始,2 结束',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='操作信息';
+
+DROP TABLE IF EXISTS `zzcx_inquiry_info`;
+CREATE TABLE `zzcx_inquiry_info` (
+  `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 '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `ip` varchar(100) NOT NULL DEFAULT '' COMMENT '访问者的IP',
+  `diagnosis` varchar(1024) DEFAULT NULL COMMENT '诊断',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='自诊记录-主表';
+
+DROP TABLE IF EXISTS `zzcx_inquiry_detail`;
+CREATE TABLE `zzcx_inquiry_detail` (
+  `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 '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `inquiry_id` bigint(20) NOT NULL COMMENT '问诊记录id',
+  `question` varchar(1024) DEFAULT NULL COMMENT '问题',
+  `answer` varchar(1024) DEFAULT NULL COMMENT '答案',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='自诊记录-明细表';
+
+
+

+ 25 - 0
docs/030.20200208智能问诊等日志记录/znwz_add.sql

@@ -0,0 +1,25 @@
+use `sys-znwz`;
+
+DROP TABLE IF EXISTS `znwz_opt_info`;
+CREATE TABLE `znwz_opt_info` (
+  `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 '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `app_id` varchar(64) DEFAULT NULL COMMENT '公众号appid',
+  `organ_name` varchar(64) DEFAULT NULL COMMENT '医院名称',
+  `department` varchar(64) DEFAULT NULL COMMENT '医生所在科室名称',
+  `doctor_id` varchar(64) DEFAULT NULL COMMENT '医生ID',
+  `doctor_name` varchar(64) DEFAULT NULL COMMENT '医生名称',
+  `mpi_id` varchar(64) DEFAULT NULL COMMENT '用户在纳里的ID',
+  `patient_name` varchar(64) DEFAULT NULL COMMENT '用户名称',
+  `patient_age` int(2) DEFAULT NULL COMMENT '用户年龄',
+  `patient_sex` varchar(2) DEFAULT NULL COMMENT '用户性别',
+  `ip` varchar(100) NOT NULL DEFAULT '' COMMENT '访问者的IP',
+  `source` varchar(10) DEFAULT NULL COMMENT '链接来源 (1:问诊2:挂号3:自诊)',
+  `opt_type` varchar(10) DEFAULT NULL COMMENT '操作类型:1 开始,2 结束',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='操作信息';

+ 44 - 0
docs/031.20200229自诊程序配置/init_zzcx.sql

@@ -0,0 +1,44 @@
+use `sys-zzcx`;
+
+DROP TABLE IF EXISTS `zzcx_sys_set`;
+CREATE TABLE `zzcx_sys_set` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(1) 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(20) DEFAULT NULL COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) DEFAULT NULL COMMENT '修改人,如果为0则表示纪录未修改',
+  `hospital_code` varchar(255) NOT NULL DEFAULT '朗通通用' COMMENT '医院名称',
+  `name` varchar(100) DEFAULT NULL COMMENT '配置名称',
+  `code` varchar(100) DEFAULT NULL COMMENT '配置编码',
+  `value` varchar(255) DEFAULT NULL,
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='医院所有配置信息';
+
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '朗通通用', 'logo图片参数', 'imgUrl', '551.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('2', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '朗通通用', '公众号首页', 'publicUrl', 'http://www.baidu.com', '公众号首页');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('3', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '朗通通用', '挂号页面', 'registerUrl', 'http://www.zjlantone.com/', '挂号页面');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('4', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '台州市立医院', 'logo图片参数', 'imgUrl', 'taiz.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('5', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '浙江省金华市武义县第一人民医院', 'logo图片参数', 'imgUrl', 'wuyi.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('6', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '平阳县人民医院', 'logo图片参数', 'imgUrl', 'pyx.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('7', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '长兴县卫生健康局', 'logo图片参数', 'imgUrl', 'cxx.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('8', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '温岭市第一人民医院', 'logo图片参数', 'imgUrl', 'wenlin.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('9', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '三门县人民医院', 'logo图片参数', 'imgUrl', 'shanmen.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('10', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '宁波市医疗中心李惠利医院', 'logo图片参数', 'imgUrl', 'lhl.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('11', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '宁波华美医院', 'logo图片参数', 'imgUrl', 'hmyy.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('12', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '宁波北仑区人民医院', 'logo图片参数', 'imgUrl', 'blyy.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('13', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '点赞', 'logo图片参数', 'imgUrl', 'dianzan.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('14', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '余姚市妇幼保健院', 'logo图片参数', 'imgUrl', 'yuyao.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '丽水市人民医院', 'logo图片参数', 'imgUrl', 'lishui.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('16', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '智医', 'logo图片参数', 'imgUrl', 'zhiyi.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('17', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '安徽汇达', 'logo图片参数', 'imgUrl', 'huida.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('18', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '湖南竹海堂', 'logo图片参数', 'imgUrl', 'zht.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('19', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '杭州一席', 'logo图片参数', 'imgUrl', 'yixi.png', 'logo图片参数');
+INSERT INTO `sys-zzcx`.`zzcx_sys_set` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `name`, `code`, `value`, `remark`) VALUES ('20', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', NULL, NULL, '飞图影像', 'logo图片参数', 'imgUrl', 'ftyx.png', 'logo图片参数');
+
+
+ALTER TABLE `zzcx_sys_set`
+ADD COLUMN `province` varchar(50) NOT NULL DEFAULT '' COMMENT '省份' after `value`;
+
+

+ 20 - 0
docs/031.20200229自诊程序配置/zzcx20200220.sql

@@ -0,0 +1,20 @@
+ALTER TABLE `zzcx_inquiry_info`
+ADD COLUMN `pat_name` varchar(50) NOT NULL DEFAULT '' COMMENT '姓名' after `ip`;
+
+ALTER TABLE `zzcx_inquiry_info`
+ADD COLUMN `pat_age` int(8) NOT NULL DEFAULT '0' COMMENT '年龄' after `pat_name`;
+
+ALTER TABLE `zzcx_inquiry_info`
+ADD COLUMN `pat_sex` tinyint(4)  NOT NULL DEFAULT '0' COMMENT '性别' after `pat_age`;
+
+ALTER TABLE `zzcx_inquiry_info`
+ADD COLUMN `id_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '证件类型(1:身份证,2:护照)' after `pat_sex`;
+
+ALTER TABLE `zzcx_inquiry_info`
+ADD COLUMN `id_num` varchar(100) NOT NULL DEFAULT '' COMMENT '证件号' after `id_type`;
+
+ALTER TABLE `zzcx_inquiry_info`
+ADD COLUMN `degree` tinyint(4) NOT NULL DEFAULT '0' COMMENT '诊断程度(1:高,2:中,3:低)' after `id_num`;
+
+
+

+ 91 - 0
docs/032.20200225心理健康猜测试初始化脚本/init_xlcs.sql

@@ -0,0 +1,91 @@
+drop database if exists `sys-xlcs`;
+CREATE DATABASE  `sys-xlcs` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
+use `sys-xlcs`;
+
+-- ----------------------------
+-- Table structure for xlcs_inquiry_detail
+-- ----------------------------
+DROP TABLE IF EXISTS `xlcs_inquiry_detail`;
+CREATE TABLE `xlcs_inquiry_detail` (
+  `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 '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `inquiry_id` bigint(20) NOT NULL COMMENT '问诊记录id',
+  `question` varchar(1024) DEFAULT NULL COMMENT '问题',
+  `answer` varchar(1024) DEFAULT NULL COMMENT '答案',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='心理测试记录-明细表';
+
+-- ----------------------------
+-- Table structure for xlcs_inquiry_info
+-- ----------------------------
+DROP TABLE IF EXISTS `xlcs_inquiry_info`;
+CREATE TABLE `xlcs_inquiry_info` (
+  `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 '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `hospital_code` varchar(255) NOT NULL DEFAULT '朗通通用' COMMENT '医院名称',
+  `ip` varchar(100) NOT NULL DEFAULT '' COMMENT '访问者的IP',
+  `pat_name` varchar(50) NOT NULL DEFAULT '' COMMENT '姓名',
+  `pat_age` int(8) NOT NULL DEFAULT '0' COMMENT '年龄',
+  `pat_sex` tinyint(4) NOT NULL DEFAULT '0' COMMENT '性别性别(1:男 2:女)',
+  `id_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '证件类型(1:身份证,2:护照)',
+  `id_num` varchar(100) NOT NULL DEFAULT '' COMMENT '证件号',
+  `phone` varchar(25) NOT NULL DEFAULT '' COMMENT '手机号码',
+  `personnel` varchar(50) NOT NULL DEFAULT '' COMMENT '人员类型',
+  `anxiety_point` varchar(4) NOT NULL DEFAULT '' COMMENT '焦虑症总分',
+  `anxiety_judge` varchar(1024) NOT NULL DEFAULT '' COMMENT '焦虑症判断依据',
+  `anxiety_advise` varchar(1024) NOT NULL DEFAULT '' COMMENT '焦虑症建议',
+  `depression_point` varchar(4) NOT NULL DEFAULT '' COMMENT '抑郁症总分',
+  `depression_judge` varchar(1024) NOT NULL DEFAULT '' COMMENT '抑郁症判断依据',
+  `depression_advise` varchar(1024) NOT NULL DEFAULT '' COMMENT '抑郁症建议',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='心理测试记录-主表';
+
+-- ----------------------------
+-- Table structure for xlcs_opt_info
+-- ----------------------------
+DROP TABLE IF EXISTS `xlcs_opt_info`;
+CREATE TABLE `xlcs_opt_info` (
+  `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 '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `hospital_code` varchar(255) NOT NULL DEFAULT '朗通通用' COMMENT '医院名称',
+  `ip` varchar(100) NOT NULL DEFAULT '' COMMENT '访问者的IP',
+  `opt_type` varchar(10) DEFAULT NULL COMMENT '操作类型:1 开始,2 结束',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`),
+  KEY `idx_gmt_create` (`gmt_create`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='操作信息';
+
+-- ----------------------------
+-- Table structure for xlcs_sys_set
+-- ----------------------------
+DROP TABLE IF EXISTS `xlcs_sys_set`;
+CREATE TABLE `xlcs_sys_set` (
+  `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 '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `hospital_code` varchar(255) NOT NULL DEFAULT '朗通通用' COMMENT '医院名称',
+  `name` varchar(100) DEFAULT NULL COMMENT '配置名称',
+  `code` varchar(100) DEFAULT NULL COMMENT '配置编码',
+  `value` varchar(255) DEFAULT NULL,
+  `province` varchar(50) NOT NULL DEFAULT '' COMMENT '省份',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='医院所有配置信息';
+

+ 19 - 0
docs/032.20200225心理健康猜测试初始化脚本/xlcs20200304.sql

@@ -0,0 +1,19 @@
+use `sys-xlcs`;
+
+ALTER TABLE `xlcs_inquiry_info`
+ADD COLUMN `anxiety_range` varchar(1024) NOT NULL DEFAULT '' COMMENT '焦虑症分段说明' after `anxiety_point`;
+
+ALTER TABLE `xlcs_inquiry_info`
+ADD COLUMN `depression_range` varchar(1024) NOT NULL DEFAULT '' COMMENT '抑郁症分段说明' after `depression_point`;
+
+ALTER TABLE `xlcs_inquiry_info`
+ADD COLUMN `mpi_id` varchar(64) NOT NULL DEFAULT '' COMMENT '用户信息Id' after `depression_advise`;
+
+ALTER TABLE `xlcs_inquiry_info`
+ADD COLUMN `app_id` varchar(64) NOT NULL DEFAULT '' COMMENT '公众号appid' after `mpi_id`;
+
+ALTER TABLE `xlcs_inquiry_info`
+ADD COLUMN  `machine_id` varchar(25) NOT NULL DEFAULT '' COMMENT '机器ID' after `app_id`;
+
+ALTER TABLE `xlcs_inquiry_detail`
+MODIFY COLUMN `remark` VARCHAR (3000) DEFAULT NULL COMMENT '备注';

+ 11 - 0
docs/032.20200228自诊程序对接/init_zzcx.sql

@@ -0,0 +1,11 @@
+use `sys-zzcx`;
+
+ALTER TABLE `zzcx_inquiry_info` ADD `inquiry_code` varchar(50) NOT NULL DEFAULT '' COMMENT '就诊序列号' AFTER `id_num`;
+ALTER TABLE `zzcx_inquiry_info` ADD `dept_code` varchar(100) NOT NULL DEFAULT '' COMMENT '对接科室主键' AFTER `inquiry_code`;
+ALTER TABLE `zzcx_inquiry_info` ADD `dept_name` varchar(100) NOT NULL DEFAULT '' COMMENT '对接科室名称' AFTER `dept_code`;
+ALTER TABLE `zzcx_inquiry_info` ADD `doctor_code` varchar(100) NOT NULL DEFAULT '' COMMENT '对接医生主键' AFTER `dept_name`;
+ALTER TABLE `zzcx_inquiry_info` ADD `doctor_name` varchar(100) NOT NULL DEFAULT '' COMMENT '对接医生姓名' AFTER `doctor_code`;
+ALTER TABLE `zzcx_inquiry_info` ADD `source` varchar(100) NOT NULL DEFAULT '' COMMENT '厂商' AFTER `hospital_code`;
+
+
+ALTER TABLE `zzcx_inquiry_detail` MODIFY COLUMN `remark` varchar(3000) DEFAULT NULL COMMENT '备注';

+ 4 - 0
pom.xml

@@ -37,6 +37,9 @@
         <module>common-biz-client</module>
         <module>common-biz-client</module>
         <module>ltkg-service</module>
         <module>ltkg-service</module>
         <module>cdssman-service</module>
         <module>cdssman-service</module>
+        <module>znwz-service</module>
+        <module>zzcx-service</module>
+        <module>xlcs-service</module>
     </modules>
     </modules>
 
 
     <parent>
     <parent>
@@ -224,6 +227,7 @@
         </pluginRepository>
         </pluginRepository>
     </pluginRepositories>
     </pluginRepositories>
 
 
+
     <distributionManagement>
     <distributionManagement>
         <repository>
         <repository>
             <id>nexus-releases</id>
             <id>nexus-releases</id>

+ 25 - 0
xlcs-service/.gitignore

@@ -0,0 +1,25 @@
+/target/
+!.mvn/wrapper/maven-wrapper.jar
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/build/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/

+ 205 - 0
xlcs-service/pom.xml

@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.diagbot</groupId>
+    <artifactId>xlcs-service</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>xlcs-service</name>
+    <description>心理测试 service for Spring Boot</description>
+
+    <parent>
+        <groupId>com.diagbot</groupId>
+        <artifactId>diagbotcloud</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.diagbot</groupId>
+            <artifactId>common</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+        </dependency>
+
+        <!-- 配置-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-config</artifactId>
+        </dependency>
+
+        <!-- 开启web-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-undertow</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+        </dependency>
+
+        <!-- 开启feign-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+
+        <!-- dashboard -->
+        <!-- actuator-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!--hystrix-dashboard-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
+        </dependency>
+        <!--hystrix -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
+        </dependency>
+
+        <!-- zipkin-->
+        <!--<dependency>-->
+            <!--<groupId>org.springframework.cloud</groupId>-->
+            <!--<artifactId>spring-cloud-starter-zipkin</artifactId>-->
+        <!--</dependency>-->
+
+        <!--swagger-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+        </dependency>
+        <!--database-->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <!--security-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-oauth2</artifactId>
+        </dependency>
+
+        <!-- mq -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>net.logstash.logback</groupId>
+            <artifactId>logstash-logback-encoder</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-bus-amqp</artifactId>
+        </dependency>
+
+        <!-- mybatis-plus begin -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+        </dependency>
+        <!-- mybatis-plus end -->
+
+        <!-- 阿里巴巴druid数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+        <!-- springboot整合mybatis(核心就这一个) -->
+        <!-- 注意顺序,这个一定要放在最下面 -->
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>${mybatis-spring-boot.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
+        </dependency>
+
+        <!--<dependency>-->
+            <!--<groupId>com.github.binarywang</groupId>-->
+            <!--<artifactId>weixin-java-mp</artifactId>-->
+            <!--<version>3.6.0</version>-->
+        <!--</dependency>-->
+
+        <dependency>
+            <groupId>io.github.lvyahui8</groupId>
+            <artifactId>spring-boot-data-aggregator-starter</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <!-- 添加docker-maven插件 -->
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <configuration>
+                    <imageName>${docker.image.prefix}/${project.artifactId}:${project.version}</imageName>
+                    <forceTags>true</forceTags>
+                    <!--镜像的FROM,使用压缩的小镜像-->
+                    <baseImage>frolvlad/alpine-oraclejre8:slim</baseImage>
+                    <entryPoint>["java", "-jar", "-Xms256m", "-Xmx1024m", "-Duser.timezone=GMT+8", "/${project.build.finalName}.jar"]</entryPoint>
+                    <resources>
+                        <resource>
+                            <targetPath>/</targetPath>
+                            <directory>${project.build.directory}</directory>
+                            <include>${project.build.finalName}.jar</include>
+                        </resource>
+                    </resources>
+                    <serverId>docker-registry</serverId>
+                    <registryUrl>${registryUrl}</registryUrl>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

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

@@ -0,0 +1,36 @@
+package com.diagbot;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
+import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
+import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
+import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
+import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.cloud.netflix.hystrix.EnableHystrix;
+import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
+/**
+ * @Description: 自诊程序启动文件
+ * @author: gaodm
+ * @time: 2018/8/7 9:26
+ */
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
+        JmxAutoConfiguration.class })
+@EnableEurekaClient
+@EnableFeignClients({ "com.diagbot.client" })
+@EnableHystrixDashboard
+@EnableHystrix
+@EnableCircuitBreaker
+@RefreshScope
+@ConfigurationPropertiesScan
+public class XlcsServiceApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(XlcsServiceApplication.class, args);
+    }
+}

+ 109 - 0
xlcs-service/src/main/java/com/diagbot/aggregate/OptAggregate.java

@@ -0,0 +1,109 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.dto.OptDTO;
+import com.diagbot.dto.PVDTO;
+import com.diagbot.dto.UVDTO;
+import com.diagbot.dto.ZZDTO;
+import com.diagbot.facade.OptInfoFacade;
+import com.diagbot.util.ListUtil;
+import com.diagbot.vo.OptVO;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import io.github.lvyahui8.spring.annotation.InvokeParameter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 10:38
+ */
+@Component
+public class OptAggregate {
+    @Autowired
+    private OptInfoFacade optInfoFacade;
+
+    @DataProvider("getAllOptSum")
+    public OptDTO getAllOptSum(
+            @InvokeParameter("optVO") OptVO optVO,
+            @DataConsumer("getPV") List<PVDTO> pvdtoList,
+            @DataConsumer("getPVSum") Long pvSum,
+            @DataConsumer("getUV") List<UVDTO> uvdtoList,
+            @DataConsumer("getUVSum") Long uvSum,
+            @DataConsumer("getZZ") List<ZZDTO> zzdtoList,
+            @DataConsumer("getZZSum") Long zzSum) {
+        OptDTO optDTO = new OptDTO();
+        if (ListUtil.isNotEmpty(pvdtoList)) {
+            optDTO.setPvdto(pvdtoList);
+        }
+        if (null != pvSum) {
+            optDTO.setPvSum(pvSum);
+        }
+        if (ListUtil.isNotEmpty(uvdtoList)) {
+            optDTO.setUvdto(uvdtoList);
+        }
+        if (null != uvSum) {
+            optDTO.setUvSum(uvSum);
+        }
+        if (ListUtil.isNotEmpty(zzdtoList)) {
+            optDTO.setZzdto(zzdtoList);
+        }
+        if (null != zzSum) {
+            optDTO.setZzSum(zzSum);
+        }
+        return optDTO;
+    }
+
+
+    @DataProvider("getAllOptSumNoDays")
+    public OptDTO getAllOptSumNoDays(
+            @InvokeParameter("optVO") OptVO optVO,
+            @DataConsumer("getPVSum") Long pvSum,
+            @DataConsumer("getUVSum") Long uvSum,
+            @DataConsumer("getZZSum") Long zzSum) {
+        OptDTO optDTO = new OptDTO();
+        if (null != pvSum) {
+            optDTO.setPvSum(pvSum);
+        }
+        if (null != uvSum) {
+            optDTO.setUvSum(uvSum);
+        }
+        if (null != zzSum) {
+            optDTO.setZzSum(zzSum);
+        }
+        return optDTO;
+    }
+
+
+    @DataProvider("getPV")
+    public List<PVDTO> getPV(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getPV(optVO);
+    }
+
+    @DataProvider("getPVSum")
+    public Long getPVSum(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getPVSum(optVO);
+    }
+
+    @DataProvider("getUV")
+    public List<UVDTO> getUV(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getUV(optVO);
+    }
+
+    @DataProvider("getUVSum")
+    public Long getUVSum(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getUVSum(optVO);
+    }
+
+    @DataProvider("getZZ")
+    public List<ZZDTO> getZZ(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getZZ(optVO);
+    }
+
+    @DataProvider("getZZSum")
+    public Long getZZSum(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getZZSum(optVO);
+    }
+}

+ 106 - 0
xlcs-service/src/main/java/com/diagbot/aggregate/OptHospAggregate.java

@@ -0,0 +1,106 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.dto.OptHospDTO;
+import com.diagbot.dto.PVHospDTO;
+import com.diagbot.dto.PVHospSumDTO;
+import com.diagbot.dto.UVHospDTO;
+import com.diagbot.dto.UVHospSumDTO;
+import com.diagbot.dto.ZZHospDTO;
+import com.diagbot.dto.ZZHospSumDTO;
+import com.diagbot.facade.OptInfoFacade;
+import com.diagbot.util.ListUtil;
+import com.diagbot.vo.OptVO;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import io.github.lvyahui8.spring.annotation.InvokeParameter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 10:38
+ */
+@Component
+public class OptHospAggregate {
+    @Autowired
+    private OptInfoFacade optInfoFacade;
+
+    @DataProvider("getAllOptSumHosp")
+    public OptHospDTO getAllOptSumHosp(
+            @InvokeParameter("optVO") OptVO optVO,
+            @DataConsumer("getPVHosp") List<PVHospDTO> pvHospDto,
+            @DataConsumer("getPVSumHosp") List<PVHospSumDTO> pvHospSumDto,
+            @DataConsumer("getUVHosp") List<UVHospDTO> uvHospDto,
+            @DataConsumer("getUVSumHosp") List<UVHospSumDTO> uvHospSumDto,
+            @DataConsumer("getZZHosp") List<ZZHospDTO> zzHospDto,
+            @DataConsumer("getZZSumHosp") List<ZZHospSumDTO> zzHospSumDto) {
+        OptHospDTO optHospDTO = new OptHospDTO();
+        if (ListUtil.isNotEmpty(pvHospDto)) {
+            optHospDTO.setPvHospDto(pvHospDto);
+        }
+        if (ListUtil.isNotEmpty(pvHospSumDto)) {
+            optHospDTO.setPvHospSumDto(pvHospSumDto);
+            Long pvSum = 0L;
+            for (PVHospSumDTO pvHospSumDTO : pvHospSumDto) {
+                pvSum += pvHospSumDTO.getPvSum();
+            }
+            optHospDTO.setPvSum(pvSum);
+        }
+        if (ListUtil.isNotEmpty(uvHospDto)) {
+            optHospDTO.setUvHospDto(uvHospDto);
+        }
+        if (ListUtil.isNotEmpty(uvHospSumDto)) {
+            optHospDTO.setUvHospSumDto(uvHospSumDto);
+            Long uvSum = 0L;
+            for (UVHospSumDTO uvHospSumDTO : uvHospSumDto) {
+                uvSum += uvHospSumDTO.getUvSum();
+            }
+            optHospDTO.setUvSum(uvSum);
+        }
+        if (ListUtil.isNotEmpty(zzHospDto)) {
+            optHospDTO.setZzHospDto(zzHospDto);
+        }
+        if (ListUtil.isNotEmpty(zzHospSumDto)) {
+            optHospDTO.setZzHospSumDto(zzHospSumDto);
+            Long zzSum = 0L;
+            for (ZZHospSumDTO zzHospSumDTO : zzHospSumDto) {
+                zzSum += zzHospSumDTO.getZzSum();
+            }
+            optHospDTO.setZzSum(zzSum);
+        }
+        return optHospDTO;
+    }
+
+    @DataProvider("getPVHosp")
+    public List<PVHospDTO> getPVHosp(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getPVHosp(optVO);
+    }
+
+    @DataProvider("getPVSumHosp")
+    public List<PVHospSumDTO> getPVSumHosp(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getPVSumHosp(optVO);
+    }
+
+    @DataProvider("getUVHosp")
+    public List<UVHospDTO> getUVHosp(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getUVHosp(optVO);
+    }
+
+    @DataProvider("getUVSumHosp")
+    public List<UVHospSumDTO> getUVSumHosp(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getUVSumHosp(optVO);
+    }
+
+    @DataProvider("getZZHosp")
+    public List<ZZHospDTO> getZZHosp(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getZZHosp(optVO);
+    }
+
+    @DataProvider("getZZSumHosp")
+    public List<ZZHospSumDTO> getZZSumHosp(@InvokeParameter("optVO") OptVO optVO) {
+        return optInfoFacade.getZZSumHosp(optVO);
+    }
+}

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

@@ -0,0 +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.XLCS_SERVICE.getKey());
+//        //保存系统日志
+//        mySender.outputLogSend(sysLog);
+//    }
+//
+//}
+//

+ 19 - 0
xlcs-service/src/main/java/com/diagbot/config/CustomAccessTokenConverter.java

@@ -0,0 +1,19 @@
+package com.diagbot.config;
+
+import org.springframework.security.oauth2.provider.OAuth2Authentication;
+import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+@Component
+public class CustomAccessTokenConverter extends DefaultAccessTokenConverter {
+
+    @Override
+    public OAuth2Authentication extractAuthentication(Map<String, ?> claims) {
+        OAuth2Authentication authentication = super.extractAuthentication(claims);
+        authentication.setDetails(claims);
+        return authentication;
+    }
+
+}

+ 15 - 0
xlcs-service/src/main/java/com/diagbot/config/GlobalMethodSecurityConfigurer.java

@@ -0,0 +1,15 @@
+package com.diagbot.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+
+/**
+ * @Description: 安全配置类
+ * @author: gaodm
+ * @time: 2018/8/2 13:38
+ */
+@Configuration
+@EnableGlobalMethodSecurity(prePostEnabled = true)
+public class GlobalMethodSecurityConfigurer {
+
+}

+ 26 - 0
xlcs-service/src/main/java/com/diagbot/config/IdcConfigurer.java

@@ -0,0 +1,26 @@
+package com.diagbot.config;
+
+//import com.diagbot.idc.InvisibleIdCreater;
+
+import com.diagbot.idc.VisibleIdCreater;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @Description: ID生成器配置
+ * @author: gaodm
+ * @time: 2018/9/20 10:43
+ */
+@Configuration
+public class IdcConfigurer {
+
+    @Bean
+    public VisibleIdCreater visibleIdCreater() {
+        return new VisibleIdCreater(0, 0);
+    }
+
+    //    @Bean
+    //    public InvisibleIdCreater invisibleIdCreater() {
+    //        return new InvisibleIdCreater(0, 0);
+    //    }
+}

+ 48 - 0
xlcs-service/src/main/java/com/diagbot/config/JwtConfigurer.java

@@ -0,0 +1,48 @@
+package com.diagbot.config;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+import org.springframework.security.oauth2.provider.token.TokenStore;
+import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
+import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
+import org.springframework.util.FileCopyUtils;
+
+import java.io.IOException;
+
+/**
+ * @Description: JWT配置类
+ * @author: gaodm
+ * @time: 2018/8/2 13:38
+ */
+@Configuration
+public class JwtConfigurer {
+    @Autowired
+    private CustomAccessTokenConverter customAccessTokenConverter;
+
+    @Bean
+    @Qualifier("tokenStore")
+    public TokenStore tokenStore() {
+
+        System.out.println("Created JwtTokenStore");
+        return new JwtTokenStore(jwtTokenEnhancer());
+    }
+
+    @Bean
+    protected JwtAccessTokenConverter jwtTokenEnhancer() {
+        JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
+        Resource resource = new ClassPathResource("public.cert");
+        String publicKey;
+        try {
+            publicKey = new String(FileCopyUtils.copyToByteArray(resource.getInputStream()));
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        converter.setVerifierKey(publicKey);
+        converter.setAccessTokenConverter(customAccessTokenConverter);
+        return converter;
+    }
+}

+ 33 - 0
xlcs-service/src/main/java/com/diagbot/config/MybatisPlusConfigurer.java

@@ -0,0 +1,33 @@
+package com.diagbot.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * @Description: MybatisPlus配置类
+ * @author: gaodm
+ * @time: 2018/8/2 13:39
+ */
+@EnableTransactionManagement
+@Configuration
+@MapperScan("com.diagbot.mapper*")//这个注解,作用相当于下面的@Bean MapperScannerConfigurer,2者配置1份即可
+public class MybatisPlusConfigurer {
+
+    /**
+     * mybatis-plus分页插件<br>
+     * 文档:http://mp.baomidou.com<br>
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
+        // 设置请求的页面大于最大页后操作,true调回到首页,false继续请求,默认false
+        //paginationInterceptor.setOverflow(false);
+        // 设置最大单页限制数量,默认500条,-1不受限制
+        paginationInterceptor.setLimit(500L);
+        return paginationInterceptor;
+    }
+
+}

+ 42 - 0
xlcs-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -0,0 +1,42 @@
+package com.diagbot.config;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
+import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
+import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
+import org.springframework.security.oauth2.provider.token.TokenStore;
+
+/**
+ * @Description: 权限资源配置类
+ * @author: gaodm
+ * @time: 2018/8/2 14:21
+ */
+@Configuration
+@EnableResourceServer
+public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
+    Logger log = LoggerFactory.getLogger(ResourceServerConfigurer.class);
+
+    @Override
+    public void configure(HttpSecurity http) throws Exception {
+        http
+                .csrf().disable()
+                .authorizeRequests()
+                .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
+//                .antMatchers("/**").authenticated();
+                .antMatchers("/**").permitAll();
+    }
+
+
+    @Override
+    public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
+        log.info("Configuring ResourceServerSecurityConfigurer ");
+        resources.resourceId("user-service").tokenStore(tokenStore);
+    }
+
+    @Autowired
+    TokenStore tokenStore;
+}

+ 70 - 0
xlcs-service/src/main/java/com/diagbot/config/SwaggerConfigurer.java

@@ -0,0 +1,70 @@
+package com.diagbot.config;
+
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.ParameterBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.schema.ModelRef;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.service.Parameter;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @Description: Swagger配置类
+ * @author: gaodm
+ * @time: 2018/8/2 14:21
+ */
+@Configuration
+@ConditionalOnProperty(prefix = "swagger", value = { "enable" }, havingValue = "true")
+@EnableSwagger2
+public class SwaggerConfigurer {
+    /**
+     * 全局参数
+     *
+     * @return
+     */
+    private List<Parameter> parameter() {
+        List<Parameter> params = new ArrayList<>();
+        params.add(new ParameterBuilder().name("Authorization")
+                .description("Authorization Bearer token")
+                .modelRef(new ModelRef("string"))
+                .parameterType("header")
+                .required(false).build());
+        return params;
+    }
+
+
+    @Bean
+    public Docket sysApi() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.diagbot.web"))
+                .paths(PathSelectors.any())
+                .build().globalOperationParameters(parameter());
+        //.securitySchemes(newArrayList(oauth()))
+        // .securityContexts(newArrayList(securityContext()));
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title(" xlcs-service api ")
+                .description("心理测试 微服务")
+                .termsOfServiceUrl("")
+                .contact(new Contact("diagbot","",""))
+                .version("1.0")
+                .build();
+    }
+
+}

+ 81 - 0
xlcs-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -0,0 +1,81 @@
+package com.diagbot.config.security;
+
+import org.springframework.security.access.AccessDecisionManager;
+import org.springframework.security.access.AccessDeniedException;
+import org.springframework.security.access.ConfigAttribute;
+import org.springframework.security.authentication.InsufficientAuthenticationException;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.web.FilterInvocation;
+import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Collection;
+
+
+/**
+ * @Description: 自定义权限拦截
+ * @author: gaodm
+ * @time: 2018/8/23 13:46
+ */
+@Service
+public class UrlAccessDecisionManager implements AccessDecisionManager {
+    @Override
+    public void decide(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes) throws AccessDeniedException, InsufficientAuthenticationException {
+//        HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
+//        String url, method;
+//        if (matchPermitAllUrl(request)) {
+//            return;
+//        }
+//        if ("anonymousUser".equals(authentication.getPrincipal())) {
+//            throw new AccessDeniedException("no right");
+//        } else {
+//            for (GrantedAuthority ga : authentication.getAuthorities()) {
+//                String[] authority = ga.getAuthority().split(";");
+//                url = authority[0];
+//                method = authority[1];
+//                if (matchers(url, request)) {
+//                    if (method.equals(request.getMethod()) || "ALL".equals(method)) {
+//                        return;
+//                    }
+//                }
+//            }
+//        }
+//        throw new AccessDeniedException("no right");
+    }
+
+
+    @Override
+    public boolean supports(ConfigAttribute attribute) {
+        return true;
+    }
+
+    @Override
+    public boolean supports(Class<?> clazz) {
+        return true;
+    }
+
+    private Boolean matchPermitAllUrl(HttpServletRequest request){
+        if (matchers("/swagger/**", request)
+                || matchers("/v2/**", request)
+                || matchers("/swagger-ui.html/**", request)
+                || matchers("/swagger-resources/**", request)
+                || matchers("/webjars/**", request)
+                || matchers("/druid/**", request)
+                || matchers("/actuator/**", request)
+                || matchers("/hystrix/**", request)
+                || matchers("/", request)) {
+            return true;
+        }
+        return false;
+    }
+
+    private boolean matchers(String url, HttpServletRequest request) {
+        AntPathRequestMatcher matcher = new AntPathRequestMatcher(url);
+        if (matcher.matches(request)) {
+            return true;
+        }
+        return false;
+    }
+}

+ 29 - 0
xlcs-service/src/main/java/com/diagbot/config/security/UrlConfigAttribute.java

@@ -0,0 +1,29 @@
+package com.diagbot.config.security;
+
+import org.springframework.security.access.ConfigAttribute;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description: 自定义权限拦截
+ * @author: gaodm
+ * @time: 2018/8/23 13:47
+ */
+public class UrlConfigAttribute implements ConfigAttribute {
+
+    private final HttpServletRequest httpServletRequest;
+
+    public UrlConfigAttribute(HttpServletRequest httpServletRequest) {
+        this.httpServletRequest = httpServletRequest;
+    }
+
+
+    @Override
+    public String getAttribute() {
+        return null;
+    }
+
+    public HttpServletRequest getHttpServletRequest() {
+        return httpServletRequest;
+    }
+}

+ 79 - 0
xlcs-service/src/main/java/com/diagbot/config/security/UrlFilterSecurityInterceptor.java

@@ -0,0 +1,79 @@
+package com.diagbot.config.security;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.SecurityMetadataSource;
+import org.springframework.security.access.intercept.AbstractSecurityInterceptor;
+import org.springframework.security.access.intercept.InterceptorStatusToken;
+import org.springframework.security.web.FilterInvocation;
+import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import java.io.IOException;
+
+/**
+ * @Description: 自定义权限拦截
+ * @author: gaodm
+ * @time: 2018/8/23 13:47
+ */
+@Service
+public class UrlFilterSecurityInterceptor extends AbstractSecurityInterceptor implements Filter {
+
+
+    @Autowired
+    private FilterInvocationSecurityMetadataSource securityMetadataSource;
+
+    @Autowired
+    public void setUrlAccessDecisionManager(UrlAccessDecisionManager urlAccessDecisionManager) {
+        super.setAccessDecisionManager(urlAccessDecisionManager);
+    }
+
+
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+
+    }
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+
+        FilterInvocation fi = new FilterInvocation(request, response, chain);
+        invoke(fi);
+    }
+
+
+    public void invoke(FilterInvocation fi) throws IOException, ServletException {
+        //fi里面有一个被拦截的url
+        //里面调用UrlMetadataSource的getAttributes(Object object)这个方法获取fi对应的所有权限
+        //再调用UrlAccessDecisionManager的decide方法来校验用户的权限是否足够
+        InterceptorStatusToken token = super.beforeInvocation(fi);
+        try {
+            //执行下一个拦截器
+            fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
+        } finally {
+            super.afterInvocation(token, null);
+        }
+    }
+
+
+    @Override
+    public void destroy() {
+
+    }
+
+    @Override
+    public Class<?> getSecureObjectClass() {
+        return FilterInvocation.class;
+
+    }
+
+    @Override
+    public SecurityMetadataSource obtainSecurityMetadataSource() {
+        return this.securityMetadataSource;
+    }
+}

+ 40 - 0
xlcs-service/src/main/java/com/diagbot/config/security/UrlMetadataSourceService.java

@@ -0,0 +1,40 @@
+package com.diagbot.config.security;
+
+import org.springframework.security.access.ConfigAttribute;
+import org.springframework.security.web.FilterInvocation;
+import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @Description: 自定义权限拦截
+ * @author: gaodm
+ * @time: 2018/8/23 13:47
+ */
+@Service
+public class UrlMetadataSourceService implements
+        FilterInvocationSecurityMetadataSource {
+
+    @Override
+    public Collection<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException {
+        final HttpServletRequest request = ((FilterInvocation) object).getRequest();
+        Set<ConfigAttribute> allAttributes = new HashSet<>();
+        ConfigAttribute configAttribute = new UrlConfigAttribute(request);
+        allAttributes.add(configAttribute);
+        return allAttributes;
+    }
+
+    @Override
+    public Collection<ConfigAttribute> getAllConfigAttributes() {
+        return null;
+    }
+
+    @Override
+    public boolean supports(Class<?> clazz) {
+        return true;
+    }
+}

+ 47 - 0
xlcs-service/src/main/java/com/diagbot/config/wx/WxMpConfiguration.java

@@ -0,0 +1,47 @@
+//package com.diagbot.config.wx;
+//
+//import lombok.AllArgsConstructor;
+//import me.chanjar.weixin.mp.api.WxMpService;
+//import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
+//import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
+//import org.springframework.boot.context.properties.EnableConfigurationProperties;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//
+//import java.util.List;
+//import java.util.stream.Collectors;
+//
+///**
+// * @Description:
+// * @author: gaodm
+// * @time: 2020/2/5 19:52
+// */
+//@AllArgsConstructor
+//@Configuration
+//@EnableConfigurationProperties(WxMpProperties.class)
+//public class WxMpConfiguration {
+//
+//    private final WxMpProperties properties;
+//
+//    @Bean
+//    public WxMpService wxMpService() {
+//        // 代码里 getConfigs()处报错的同学,请注意仔细阅读项目说明,你的IDE需要引入lombok插件!!!!
+//        final List<WxMpProperties.MpConfig> configs = this.properties.getConfigs();
+//        if (configs == null) {
+//            throw new RuntimeException("大哥,拜托先看下项目首页的说明(readme文件),添加下相关配置,注意别配错了!");
+//        }
+//
+//        WxMpService service = new WxMpServiceImpl();
+//        service.setMultiConfigStorages(configs
+//                .stream().map(a -> {
+//                    WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl();
+//                    configStorage.setAppId(a.getAppId());
+//                    configStorage.setSecret(a.getSecret());
+//                    configStorage.setToken(a.getToken());
+//                    configStorage.setAesKey(a.getAesKey());
+//                    return configStorage;
+//                }).collect(Collectors.toMap(WxMpDefaultConfigImpl::getAppId, a -> a, (o, n) -> o)));
+//        return service;
+//    }
+//
+//}

+ 46 - 0
xlcs-service/src/main/java/com/diagbot/config/wx/WxMpProperties.java

@@ -0,0 +1,46 @@
+//package com.diagbot.config.wx;
+//
+//import com.diagbot.util.FastJsonUtils;
+//import lombok.Data;
+//import org.springframework.boot.context.properties.ConfigurationProperties;
+//
+//import java.util.List;
+//
+///**
+// * @Description:
+// * @author: gaodm
+// * @time: 2020/2/5 20:00
+// */
+//@Data
+//@ConfigurationProperties(prefix = "wx.mp")
+//public class WxMpProperties {
+//    private List<MpConfig> configs;
+//
+//    @Data
+//    public static class MpConfig {
+//        /**
+//         * 设置微信公众号的appid
+//         */
+//        private String appId;
+//
+//        /**
+//         * 设置微信公众号的app secret
+//         */
+//        private String secret;
+//
+//        /**
+//         * 设置微信公众号的token
+//         */
+//        private String token;
+//
+//        /**
+//         * 设置微信公众号的EncodingAESKey
+//         */
+//        private String aesKey;
+//    }
+//
+//    @Override
+//    public String toString() {
+//        return FastJsonUtils.getBeanToJson(this);
+//    }
+//}

+ 33 - 0
xlcs-service/src/main/java/com/diagbot/dto/GetInquiryDetailDTO.java

@@ -0,0 +1,33 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.Option;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/28 15:46
+ */
+@Getter
+@Setter
+public class GetInquiryDetailDTO {
+
+    /**
+     * 问题
+     */
+    private String question;
+
+    /**
+     * 答案
+     */
+    private String answer;
+
+    /**
+     * 题目选项
+     */
+    private List<Option> options;
+
+}

+ 40 - 0
xlcs-service/src/main/java/com/diagbot/dto/HistoryInquiryDTO.java

@@ -0,0 +1,40 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:历史记录出参
+ * @Author:zhaops
+ * @time: 2020/3/5 10:56
+ */
+@Getter
+@Setter
+public class HistoryInquiryDTO {
+    private Long id;
+    private Date gmtCreate;
+    private Date gmtModified;
+    private String creator;
+    private String modifier;
+    private String hospitalCode;
+    private String ip;
+    private String patName;
+    private Integer patAge;
+    private Integer patSex;
+    private Integer idType;
+    private String idNum;
+    private String phone;
+    private String personnel;
+    private String anxietyPoint;
+    private String anxietyRange;
+    private String anxietyJudge;
+    private String anxietyAdvise;
+    private String depressionPoint;
+    private String depressionRange;
+    private String depressionJudge;
+    private String depressionAdvise;
+    private List<GetInquiryDetailDTO> detailList;
+}

+ 22 - 0
xlcs-service/src/main/java/com/diagbot/dto/HospItemDTO.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class HospItemDTO {
+    //医院名称
+    private String hospitalCode;
+    // pvSum
+    private Long pvSum = 0L;
+    //uvSum
+    private Long uvSum = 0L;
+    //zzSum
+    private Long zzSum = 0L;
+}

+ 18 - 0
xlcs-service/src/main/java/com/diagbot/dto/HospNameDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class HospNameDTO {
+    //医院名称
+    private List<String> hospitalCode;
+}

+ 114 - 0
xlcs-service/src/main/java/com/diagbot/dto/InquiryDTO.java

@@ -0,0 +1,114 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/2/3 9:50
+ */
+@Getter
+@Setter
+public class InquiryDTO {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 医院名称
+     */
+    private String hospitalCode;
+
+    /**
+     * 访问者的IP
+     */
+    private String ip;
+
+    /**
+     * 姓名
+     */
+    private String patName;
+
+    /**
+     * 年龄
+     */
+    private Integer patAge;
+
+    /**
+     * 性别
+     */
+    private Integer patSex;
+
+    /**
+     * 证件类型(1:身份证,2:护照)
+     */
+    private Integer idType;
+
+    /**
+     * 证件号
+     */
+    private String idNum;
+
+    /**
+     * 人员类型
+     */
+    private String personnel;
+
+    /**
+     * 焦虑症总分
+     */
+    private String anxietyPoint;
+
+    /**
+     * 焦虑症分段说明
+     */
+    private String anxietyRange;
+
+    /**
+     * 焦虑症判断依据
+     */
+    private String anxietyJudge;
+
+    /**
+     * 焦虑症建议
+     */
+    private String anxietyAdvise;
+
+    /**
+     * 抑郁症总分
+     */
+    private String depressionPoint;
+
+    /**
+     * 抑郁症分段说明
+     */
+    private String depressionRange;
+
+    /**
+     * 抑郁症判断依据
+     */
+    private String depressionJudge;
+
+    /**
+     * 抑郁症建议
+     */
+    private String depressionAdvise;
+
+}

+ 40 - 0
xlcs-service/src/main/java/com/diagbot/dto/InquiryPatDTO.java

@@ -0,0 +1,40 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/2/3 9:50
+ */
+@Getter
+@Setter
+public class InquiryPatDTO {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 姓名
+     */
+    private String patName;
+
+    /**
+     * 年龄
+     */
+    private Integer patAge;
+
+    /**
+     * 性别
+     */
+    private Integer patSex;
+
+    /**
+     * 证件类型(1:身份证,2:护照)
+     */
+    private Integer idType;
+
+    /**
+     * 证件号
+     */
+    private String idNum;
+}

+ 22 - 0
xlcs-service/src/main/java/com/diagbot/dto/OptDTO.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:50
+ */
+@Getter
+@Setter
+public class OptDTO {
+    private List<PVDTO> pvdto;
+    private Long pvSum;
+    private List<UVDTO> uvdto;
+    private Long uvSum;
+    private List<ZZDTO> zzdto;
+    private Long zzSum;
+}

+ 25 - 0
xlcs-service/src/main/java/com/diagbot/dto/OptHospDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:50
+ */
+@Getter
+@Setter
+public class OptHospDTO {
+    private List<PVHospDTO> pvHospDto;
+    private List<PVHospSumDTO> pvHospSumDto;
+    private Long pvSum;
+    private List<UVHospDTO> uvHospDto;
+    private List<UVHospSumDTO> uvHospSumDto;
+    private Long uvSum;
+    private List<ZZHospDTO> zzHospDto;
+    private List<ZZHospSumDTO> zzHospSumDto;
+    private Long zzSum;
+}

+ 16 - 0
xlcs-service/src/main/java/com/diagbot/dto/PVDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class PVDTO {
+    private String days;
+    private Long pvCnt;
+}

+ 18 - 0
xlcs-service/src/main/java/com/diagbot/dto/PVHospDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class PVHospDTO {
+    //医院名称
+    private String hospitalCode;
+    private String days;
+    private Long pvCnt;
+}

+ 17 - 0
xlcs-service/src/main/java/com/diagbot/dto/PVHospSumDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class PVHospSumDTO {
+    //医院名称
+    private String hospitalCode;
+    private Long pvSum;
+}

+ 30 - 0
xlcs-service/src/main/java/com/diagbot/dto/SaveInquiryDTO.java

@@ -0,0 +1,30 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:56
+ */
+@ApiModel(value = "问诊记录保存接口出参")
+@Getter
+@Setter
+public class SaveInquiryDTO {
+
+    /**
+     * 纳里返回的url
+     */
+    @ApiModelProperty(value = "纳里返回的url")
+    private String body;
+
+    private String response;
+
+    private String request;
+
+    private String requestBodys;
+
+}

+ 71 - 0
xlcs-service/src/main/java/com/diagbot/dto/SysSetDTO.java

@@ -0,0 +1,71 @@
+package com.diagbot.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @date: 2020/2/9 12:06
+ * @version: V1.0
+ */
+@Getter
+@Setter
+public class SysSetDTO {
+//    /**
+//     * 主键
+//     */
+//    @TableId(value = "id", type = IdType.AUTO)
+//    private Long id;
+//
+//    /**
+//     * 是否删除,N:未删除,Y:删除
+//     */
+//    private String isDeleted;
+//
+//    /**
+//     * 记录创建时间
+//     */
+//    private LocalDateTime gmtCreate;
+//
+//    /**
+//     * 记录修改时间,如果时间是1970年则表示纪录未修改
+//     */
+//    private LocalDateTime gmtModified;
+//
+//    /**
+//     * 创建人,0表示无创建人值
+//     */
+//    private String creator;
+//
+//    /**
+//     * 修改人,如果为0则表示纪录未修改
+//     */
+//    private String modifier;
+//
+//    /**
+//     * 医院名称
+//     */
+//    private String hospitalCode;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+
+    /**
+     * 配置编码
+     */
+    private String code;
+
+    private String value;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 33 - 0
xlcs-service/src/main/java/com/diagbot/dto/SysSetProHosResDTO.java

@@ -0,0 +1,33 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @date: 2020/2/9 12:06
+ * @version: V1.0
+ */
+@Getter
+@Setter
+public class SysSetProHosResDTO {
+
+    /**
+     * 医院列表
+     */
+    private List<String> hospitalCodeList;
+
+    /**
+     * 省份
+     */
+    private String province;
+
+    /**
+     * 医院数量
+     */
+    private int size = 0;
+
+}

+ 16 - 0
xlcs-service/src/main/java/com/diagbot/dto/UVDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class UVDTO {
+    private String days;
+    private Long uvCnt;
+}

+ 18 - 0
xlcs-service/src/main/java/com/diagbot/dto/UVHospDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class UVHospDTO {
+    //医院名称
+    private String hospitalCode;
+    private String days;
+    private Long uvCnt;
+}

+ 17 - 0
xlcs-service/src/main/java/com/diagbot/dto/UVHospSumDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class UVHospSumDTO {
+    //医院名称
+    private String hospitalCode;
+    private Long uvSum;
+}

+ 16 - 0
xlcs-service/src/main/java/com/diagbot/dto/ZZDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class ZZDTO {
+    private String days;
+    private Long zzCnt;
+}

+ 18 - 0
xlcs-service/src/main/java/com/diagbot/dto/ZZHospDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class ZZHospDTO {
+    //医院名称
+    private String hospitalCode;
+    private String days;
+    private Long zzCnt;
+}

+ 17 - 0
xlcs-service/src/main/java/com/diagbot/dto/ZZHospSumDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class ZZHospSumDTO {
+    //医院名称
+    private String hospitalCode;
+    private Long zzSum;
+}

+ 67 - 0
xlcs-service/src/main/java/com/diagbot/entity/Client.java

@@ -0,0 +1,67 @@
+
+package com.diagbot.entity;
+
+import com.diagbot.util.AESUtils;
+import com.diagbot.util.JSONUtils;
+import com.diagbot.util.MessageDigestUtil;
+import com.diagbot.util.OpenApiUtils;
+import com.diagbot.util.SignUtil;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.UUID;
+
+/**
+ * Client
+ */
+public class Client {
+
+    private String apiUrl;
+    private String appKey;
+    private String appSecret;
+    private String encodingAesKey;
+
+    public Client(String apiUrl, String appKey, String appSecret, String encodingAesKey) {
+        this.apiUrl = apiUrl;
+        this.appKey = appKey;
+        this.appSecret = appSecret;
+        this.encodingAesKey = encodingAesKey;
+    }
+
+    /**
+     * 发送请求
+     *
+     * @param request request对象
+     * @return Response
+     * @throws Exception
+     */
+    public Response execute(Request request) throws Exception {
+        request.setApiUrl(this.apiUrl);
+        request.setAppKey(this.appKey);
+        request.setAppSecret(this.appSecret);
+        request.setEncodingAesKey(this.encodingAesKey);
+        request.addHeader(SystemHeader.X_CA_KEY, request.getAppKey());
+        request.addHeader(SystemHeader.X_CA_NONCE, UUID.randomUUID().toString());
+        request.addHeader(SystemHeader.X_CA_TIMESTAMP, String.valueOf(System.currentTimeMillis()));
+        String jsonStr = JSONUtils.toString(request.getBodys());
+        String encryptStr;
+        if (StringUtils.isNotEmpty(request.getEncodingAesKey())) {
+            encryptStr = AESUtils.encrypt(jsonStr, request.getEncodingAesKey());
+        } else {
+            encryptStr = jsonStr;
+        }
+        String contentMd5 = MessageDigestUtil.base64AndMD5(encryptStr);
+        request.addHeader(SystemHeader.X_CONTENT_MD5, contentMd5);
+        String signature = SignUtil.sign(request.getAppSecret(), request.getHeaders());
+        request.addHeader(SystemHeader.X_CA_SIGNATURE, signature);
+        request.setStringBody(encryptStr);
+        return OpenApiUtils.post(request);
+    }
+
+    public static void main(String[] args) throws Exception {
+        String body = "[1]";
+        String encryptStr = AESUtils.encrypt(body, "1234567890123456");
+        String contentMd5 = MessageDigestUtil.base64AndMD5(encryptStr.getBytes());
+        System.out.println(contentMd5);
+
+    }
+}

+ 47 - 0
xlcs-service/src/main/java/com/diagbot/entity/Constants.java

@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.diagbot.entity;
+
+/**
+ * 通用常量
+ */
+public class Constants {
+    //签名算法HmacSha256
+    public static final String HMAC_SHA256 = "HmacSHA256";
+    //编码UTF-8
+    public static final String ENCODING = "UTF-8";
+    //UserAgent
+    public static final String USER_AGENT = "demo/aliyun/java";
+    //换行符
+    public static final String LF = "\n";
+    //串联符
+    public static final String SPE1 = ",";
+    //示意符
+    public static final String SPE2 = ":";
+    //连接符
+    public static final String SPE3 = "&";
+    //赋值符
+    public static final String SPE4 = "=";
+    //问号符
+    public static final String SPE5 = "?";
+    //默认请求超时时间,单位毫秒
+    public static final int DEFAULT_TIMEOUT = 1000;
+    //参与签名的系统Header前缀,只有指定前缀的Header才会参与到签名中
+    public static final String CA_HEADER_TO_SIGN_PREFIX_SYSTEM = "X-Ca-";
+}

+ 169 - 0
xlcs-service/src/main/java/com/diagbot/entity/InquiryDetail.java

@@ -0,0 +1,169 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 问诊记录-明细表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-01
+ */
+@TableName("xlcs_inquiry_detail")
+public class InquiryDetail implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 问诊记录id
+     */
+    private Long inquiryId;
+
+    /**
+     * 问题
+     */
+    private String question;
+
+    /**
+     * 答案
+     */
+    private String answer;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public Long getInquiryId() {
+        return inquiryId;
+    }
+
+    public void setInquiryId(Long inquiryId) {
+        this.inquiryId = inquiryId;
+    }
+
+    public String getQuestion() {
+        return question;
+    }
+
+    public void setQuestion(String question) {
+        this.question = question;
+    }
+
+    public String getAnswer() {
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "InquiryDetail{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", inquiryId=" + inquiryId +
+                ", question=" + question +
+                ", answer=" + answer +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 164 - 0
xlcs-service/src/main/java/com/diagbot/entity/InquiryInfo.java

@@ -0,0 +1,164 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 问诊记录-主表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-02
+ */
+@TableName("xlcs_inquiry_info")
+@Getter
+@Setter
+public class InquiryInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+
+    /**
+     * 医院名称
+     */
+    private String hospitalCode;
+
+    /**
+     * 访问者的IP
+     */
+    private String ip;
+
+    /**
+     * 姓名
+     */
+    private String patName;
+
+    /**
+     * 年龄
+     */
+    private Integer patAge;
+
+    /**
+     * 性别
+     */
+    private Integer patSex;
+
+    /**
+     * 证件类型(1:身份证,2:护照)
+     */
+    private Integer idType;
+
+    /**
+     * 证件号
+     */
+    private String idNum;
+
+    /**
+     * 手机号码
+     */
+    private String phone;
+
+    /**
+     * 人员类型
+     */
+    private String personnel;
+
+    /**
+     * 焦虑症总分
+     */
+    private String anxietyPoint;
+
+    /**
+     * 焦虑症分段说明
+     */
+    private String anxietyRange;
+
+    /**
+     * 焦虑症判断依据
+     */
+    private String anxietyJudge;
+
+    /**
+     * 焦虑症建议
+     */
+    private String anxietyAdvise;
+
+    /**
+     * 抑郁症总分
+     */
+    private String depressionPoint;
+
+    /**
+     * 抑郁症分段说明
+     */
+    private String depressionRange;
+
+    /**
+     * 抑郁症判断依据
+     */
+    private String depressionJudge;
+
+    /**
+     * 抑郁症建议
+     */
+    private String depressionAdvise;
+
+    /**
+     * 用户授权id
+     */
+    private String mpiId;
+
+    /**
+     * 公众号id
+     */
+    private String appId;
+
+    /**
+     * 机器ID
+     */
+    private String machineId;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 53 - 0
xlcs-service/src/main/java/com/diagbot/entity/JSONResponseBean.java

@@ -0,0 +1,53 @@
+package com.diagbot.entity;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class JSONResponseBean {
+	private int code = 200;
+	private String msg;
+	private Object body;
+	private Map<String, Object> properties;
+	
+	public int getCode() {
+		return code;
+	}
+	
+	public void setCode(int code) {
+		this.code = code;
+	}
+	
+	public String getMsg() {
+		return msg;
+	}
+	
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+	
+	public Object getBody() {
+		return body;
+	}
+	
+	public void setBody(Object body) {
+		this.body = body;
+	}
+	
+	public Map<String, Object> getProperties() {
+		return properties;
+	}
+	
+	public Object getProperty(String nm){
+		if(properties == null || properties.isEmpty()){
+			return null;
+		}
+		return properties.get(nm);
+	}
+	
+	public void setProperty(String name, Object val){
+		if(properties == null){
+			properties = new HashMap<>();
+		}
+		properties.put(name, val);
+	}
+}

+ 166 - 0
xlcs-service/src/main/java/com/diagbot/entity/OptInfo.java

@@ -0,0 +1,166 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 操作信息
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-02
+ */
+@TableName("xlcs_opt_info")
+public class OptInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    //医院编码
+    private String hospitalCode;
+
+    /**
+     * 访问者的IP
+     */
+    private String ip;
+
+    /**
+     * 操作类型:1 开始,2 结束
+     */
+    private String optType;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public String getHospitalCode() {
+        return hospitalCode;
+    }
+
+    public void setHospitalCode(String hospitalCode) {
+        this.hospitalCode = hospitalCode;
+    }
+
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+
+    public String getOptType() {
+        return optType;
+    }
+
+    public void setOptType(String optType) {
+        this.optType = optType;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "OptInfo{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", ip=" + ip +
+                ", optType=" + optType +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 16 - 0
xlcs-service/src/main/java/com/diagbot/entity/Option.java

@@ -0,0 +1,16 @@
+package com.diagbot.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/3/3 16:01
+ */
+@Getter
+@Setter
+public class Option {
+    private Boolean select;
+    private String name;
+}

+ 142 - 0
xlcs-service/src/main/java/com/diagbot/entity/Request.java

@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.diagbot.entity;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Request
+ */
+public class Request {
+
+    public Request() {
+    }
+
+    public Request(String serviceId, String method, List<Object> bodys) {
+        this.appKey = appKey;
+        this.appSecret = appSecret;
+        this.bodys=bodys;
+        headers = new HashMap<>();
+        headers.put(SystemHeader.X_CA_KEY, appKey);
+        headers.put(SystemHeader.X_SERVICE_ID, serviceId);
+        headers.put(SystemHeader.X_SERVICE_METHOD, method);
+    }
+    /**
+     * (必选)服务请求地址
+     */
+    private String apiUrl;
+
+
+
+    /**
+     * (必选)APP KEY
+     */
+    private String appKey;
+
+    /**
+     * (必选)APP密钥
+     */
+    private String appSecret;
+
+    private String encodingAesKey;
+
+
+    /**
+     * (必选) HTTP头
+     */
+    private Map<String, String> headers;
+    
+
+
+    /**
+     * (必选)请求参数
+     */
+    private List<Object> bodys;
+
+    /**
+     * (可选)字符串Body体
+     */
+    private String stringBody;
+
+
+    public String getAppKey() {
+        return appKey;
+    }
+
+    public void setAppKey(String appKey) {
+        this.appKey = appKey;
+    }
+
+    public String getAppSecret() {
+        return appSecret;
+    }
+
+    public void setAppSecret(String appSecret) {
+        this.appSecret = appSecret;
+    }
+
+
+    public Map<String, String> getHeaders() {
+        return headers;
+    }
+
+    public void setHeaders(Map<String, String> headers) {
+        this.headers = headers;
+    }
+
+    public List<Object> getBodys() {
+        return bodys;
+    }
+
+    public void setBodys(List<Object> bodys) {
+        this.bodys = bodys;
+    }
+
+    public String getStringBody() {
+        return stringBody;
+    }
+
+    public void setStringBody(String stringBody) {
+        this.stringBody = stringBody;
+    }
+
+    public String getEncodingAesKey() {
+        return encodingAesKey;
+    }
+
+    public void setEncodingAesKey(String encodingAesKey) {
+        this.encodingAesKey = encodingAesKey;
+    }
+
+    public String getApiUrl() {
+        return apiUrl;
+    }
+
+    public void setApiUrl(String apiUrl) {
+        this.apiUrl = apiUrl;
+    }
+    public void addHeader(String name, String value){
+        if(headers==null){
+            headers = new HashMap<>();
+        }
+        headers.put(name, value);
+    }
+}

+ 120 - 0
xlcs-service/src/main/java/com/diagbot/entity/Response.java

@@ -0,0 +1,120 @@
+package com.diagbot.entity;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class Response {
+    /**
+     * http 请求状态码
+     */
+    private int statusCode;
+    private String contentType;
+    /**
+     * 请求唯一 ID,请求一旦进入 API 网关应用后,API 网关就会生成请求 ID 并通过响应头返回给客户端,
+     * 建议客户端与后端服务都记录此请求 ID,可用于问题排查与跟踪。
+     */
+    private String requestId;
+    /**
+     * API网关会将服务端的StringToSign放到HTTP应答的Header中返回到客户端,Key为:X-Ca-Error-Message
+     * 只需要将本地计算的StringToSign与服务端返回的StringToSign进行对比即可找到问题;
+     * 如果服务端与客户端的签名串是一致的,请检查用于签名计算的密钥是否正确;
+     */
+    private String caErrorMsg;
+    /**
+     * 业务接口返回的错误信息
+     */
+    private String errorMessage;
+    private Map<String, String> headers;
+    private String body;
+    private JSONResponseBean jsonResponseBean;
+
+    public boolean isSuccess() {
+        return (200 == statusCode && jsonResponseBean != null && 200 == jsonResponseBean.getCode());
+    }
+
+    public Response() {
+
+    }
+
+    public int getStatusCode() {
+        return statusCode;
+    }
+
+    public void setStatusCode(int statusCode) {
+        this.statusCode = statusCode;
+    }
+
+    public String getContentType() {
+        return contentType;
+    }
+
+    public void setContentType(String contentType) {
+        this.contentType = contentType;
+    }
+
+    public String getRequestId() {
+        return requestId;
+    }
+
+    public void setRequestId(String requestId) {
+        this.requestId = requestId;
+    }
+
+    public String getErrorMessage() {
+        if (jsonResponseBean != null && !"200".equals(jsonResponseBean.getCode())) {
+            return jsonResponseBean.getMsg();
+        }
+        return null;
+    }
+
+    public void setErrorMessage(String errorMessage) {
+        this.errorMessage = errorMessage;
+    }
+
+    public Map<String, String> getHeaders() {
+        return headers;
+    }
+
+    public String getHeader(String key) {
+        if (null != headers) {
+            return headers.get(key);
+        } else {
+            return null;
+        }
+    }
+
+    public void setHeaders(Map<String, String> headers) {
+        this.headers = headers;
+    }
+
+    public void setHeader(String key, String value) {
+        if (null == this.headers) {
+            this.headers = new HashMap<String, String>();
+        }
+        this.headers.put(key, value);
+    }
+
+    public String getBody() {
+        return body;
+    }
+
+    public void setBody(String body) {
+        this.body = body;
+    }
+
+    public JSONResponseBean getJsonResponseBean() {
+        return jsonResponseBean;
+    }
+
+    public void setJsonResponseBean(JSONResponseBean jsonResponseBean) {
+        this.jsonResponseBean = jsonResponseBean;
+    }
+
+    public String getCaErrorMsg() {
+        return caErrorMsg;
+    }
+
+    public void setCaErrorMsg(String caErrorMsg) {
+        this.caErrorMsg = caErrorMsg;
+    }
+}

+ 172 - 0
xlcs-service/src/main/java/com/diagbot/entity/SysSet.java

@@ -0,0 +1,172 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 医院所有配置信息
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-02-09
+ */
+@TableName("xlcs_sys_set")
+public class SysSet implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院名称
+     */
+    private String hospitalCode;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+
+    /**
+     * 配置编码
+     */
+    private String code;
+
+    private String value;
+
+    private String province;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public String getHospitalCode() {
+        return hospitalCode;
+    }
+
+    public void setHospitalCode(String hospitalCode) {
+        this.hospitalCode = hospitalCode;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+}

+ 29 - 0
xlcs-service/src/main/java/com/diagbot/entity/SystemHeader.java

@@ -0,0 +1,29 @@
+
+package com.diagbot.entity;
+
+/**
+ * 系统HTTP头常量
+ */
+public class SystemHeader {
+    //签名Header
+    public static final String X_CA_SIGNATURE = "X-Ca-Signature";
+    //所有参与签名的Header
+    public static final String X_CA_SIGNATURE_HEADERS = "X-Ca-Signature-Headers";
+    //请求时间戳
+    public static final String X_CA_TIMESTAMP = "X-Ca-Timestamp";
+    //请求放重放Nonce,15分钟内保持唯一,建议使用UUID
+    public static final String X_CA_NONCE = "X-Ca-Nonce";
+    //APP KEY
+    public static final String X_CA_KEY = "X-Ca-Key";
+    //服务id
+    public static final String X_SERVICE_ID = "X-Service-Id";
+    //具体method
+    public static final String X_SERVICE_METHOD = "X-Service-Method";
+    //MD5加密的请求体信息
+    public static final String X_CONTENT_MD5 = "X-Content-MD5";
+
+    //MD5加密的请求体信息
+    public static final String X_CA_REQUESTID = "X-Ca-RequestId";
+    //API网关会将服务端的StringToSign放到HTTP应答的Header中返回到客户端,Key为:X-Ca-Error-Message
+    public static final String X_CA_ERROR_MESSAGE = "X-Ca-Error-Message";
+}

+ 50 - 0
xlcs-service/src/main/java/com/diagbot/enums/IdTypeEnum.java

@@ -0,0 +1,50 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author zhoutg
+ * @Description: 证件类型
+ * @date 2018年11月21日 下午2:31:42
+ */
+public enum IdTypeEnum implements KeyedNamed {
+    IdentityCard (1, "身份证"),
+    Passport(2, "护照");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    IdTypeEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static IdTypeEnum getEnum(int key) {
+        for (IdTypeEnum item : IdTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        IdTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 81 - 0
xlcs-service/src/main/java/com/diagbot/exception/CommonExceptionHandler.java

@@ -0,0 +1,81 @@
+package com.diagbot.exception;
+
+import com.diagbot.dto.RespDTO;
+import com.diagbot.util.GsonUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.BindException;
+import org.springframework.validation.FieldError;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * @Description: 错误通用处理
+ * @author: gaodm
+ * @time: 2018/8/2 14:22
+ */
+@ControllerAdvice
+@ResponseBody
+@Slf4j
+public class CommonExceptionHandler {
+
+    @ExceptionHandler(Exception.class)
+    public ResponseEntity<RespDTO> handleException(Exception e) {
+        RespDTO resp = new RespDTO();
+        if (e instanceof BindException) {
+            BindException ex = (BindException) e;
+            Map<String, String> stringMap = new HashMap<>();
+            for (FieldError fieldError : ex.getBindingResult().getFieldErrors()) {
+                stringMap.put(fieldError.getField(), fieldError.getDefaultMessage());
+            }
+            String msg = GsonUtil.toJson(stringMap);
+            log.warn("【参数异常】:{}", msg);
+            resp.code = CommonErrorCode.PARAM_ERROR.getCode();
+            resp.msg = msg;
+            return new ResponseEntity(resp, HttpStatus.OK);
+        }
+        if (e instanceof MethodArgumentNotValidException) {
+            MethodArgumentNotValidException ex = (MethodArgumentNotValidException) e;
+            Map<String, String> stringMap = new HashMap<>();
+            for (FieldError fieldError : ex.getBindingResult().getFieldErrors()) {
+                stringMap.put(fieldError.getField(), fieldError.getDefaultMessage());
+            }
+            String msg = GsonUtil.toJson(stringMap);
+            log.warn("【参数异常】:{}", msg);
+            resp.code = CommonErrorCode.PARAM_ERROR.getCode();
+            resp.msg = msg;
+            return new ResponseEntity(resp, HttpStatus.OK);
+        }
+        if (e instanceof MissingServletRequestParameterException) {
+            MissingServletRequestParameterException ex = (MissingServletRequestParameterException) e;
+            Map<String, String> stringMap = new HashMap<>();
+            stringMap.put(ex.getParameterName(), "不能为null");
+            String msg = GsonUtil.toJson(stringMap);
+            log.warn("【参数异常】:{}", msg);
+            resp.code = CommonErrorCode.PARAM_ERROR.getCode();
+            resp.msg = msg;
+            return new ResponseEntity(resp, HttpStatus.OK);
+        }
+        if (e instanceof CommonException) {
+            CommonException taiChiException = (CommonException) e;
+            resp.code = taiChiException.getCode();
+            resp.msg = e.getMessage();
+            log.error("【业务异常】:{}", e.getMessage());
+            return new ResponseEntity(resp, HttpStatus.OK);
+        }
+        resp.code = CommonErrorCode.FAIL.getCode();
+        resp.msg = e.getMessage();
+        log.error("【系统异常】:{}", e.getMessage());
+        e.printStackTrace();
+        return new ResponseEntity(resp, HttpStatus.OK);
+    }
+
+}

+ 39 - 0
xlcs-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java

@@ -0,0 +1,39 @@
+package com.diagbot.exception;
+
+/**
+ * @Description: 本服务错误码
+ * 系统码(3位) + 等级码(1位) + 4位顺序号
+ * 系统码 通用码 000;用户中心 100; 管理中心 200;
+ * @author: gaodm
+ * @time: 2018/9/10 11:11
+ */
+public enum ServiceErrorCode implements ErrorCode {
+    LOG_IS_NOT_EXIST("90020001", "该日志不存在");
+
+    private String code;
+    private String msg;
+
+
+    ServiceErrorCode(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public static ServiceErrorCode codeOf(String code) {
+        for (ServiceErrorCode state : values()) {
+            if (state.getCode() == code) {
+                return state;
+            }
+        }
+        return null;
+    }
+}

+ 14 - 0
xlcs-service/src/main/java/com/diagbot/facade/InquiryDetailFacade.java

@@ -0,0 +1,14 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.InquiryDetailServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2020/2/1 23:34
+ */
+@Component
+public class InquiryDetailFacade extends InquiryDetailServiceImpl {
+
+}

+ 399 - 0
xlcs-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -0,0 +1,399 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.diagbot.dto.GetInquiryDetailDTO;
+import com.diagbot.dto.HistoryInquiryDTO;
+import com.diagbot.dto.InquiryDTO;
+import com.diagbot.dto.InquiryPatDTO;
+import com.diagbot.dto.SaveInquiryDTO;
+import com.diagbot.entity.Client;
+import com.diagbot.entity.InquiryDetail;
+import com.diagbot.entity.InquiryInfo;
+import com.diagbot.entity.JSONResponseBean;
+import com.diagbot.entity.Option;
+import com.diagbot.entity.Request;
+import com.diagbot.entity.Response;
+import com.diagbot.enums.IdTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.idc.VisibleIdCreater;
+import com.diagbot.service.impl.InquiryDetailServiceImpl;
+import com.diagbot.service.impl.InquiryInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.FastJsonUtils;
+import com.diagbot.util.GsonUtil;
+import com.diagbot.util.HttpUtils;
+import com.diagbot.util.IdCard;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.HistoryInquiryVO;
+import com.diagbot.vo.HospitalVO;
+import com.diagbot.vo.InquiryDetailVO;
+import com.diagbot.vo.InquiryMechVO;
+import com.diagbot.vo.InquiryPatInquiryVO;
+import com.diagbot.vo.InquiryPatVO;
+import com.diagbot.vo.SaveInquiryDetailVO;
+import com.diagbot.vo.SaveInquiryVO;
+import com.google.common.collect.Lists;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/2/1 23:33
+ */
+@Component
+@Slf4j
+public class InquiryInfoFacade extends InquiryInfoServiceImpl {
+
+
+    @Autowired
+    OptInfoFacade optInfoFacade;
+    @Autowired
+    InquiryDetailFacade inquiryDetailFacade;
+
+    @Autowired
+    @Qualifier("inquiryDetailServiceImpl")
+    private InquiryDetailServiceImpl inquiryDetailService;
+
+    @Autowired
+    private VisibleIdCreater visibleIdCreater;
+
+    @Autowired
+    private SysSetFacade sysSetFacade;
+
+    @Value("${nali.apiUrl}")
+    private String apiUrl;
+    @Value("${nali.appKey}")
+    private String appKey;
+    @Value("${nali.appSecret}")
+    private String appSecret;
+
+    public SaveInquiryDTO saveInquiry(SaveInquiryVO saveInquiryVO) {
+        if (StringUtil.isBlank(saveInquiryVO.getHospitalCode())) {
+            saveInquiryVO.setHospitalCode("朗通通用");
+        }
+
+        SaveInquiryDTO saveInquiryDTO = new SaveInquiryDTO();
+
+        Date now = DateUtil.now();
+        InquiryInfo inquiryInfo = null;
+        // 如果是身份证,获取性别和年龄
+        if (null != saveInquiryVO.getIdType()
+                && IdTypeEnum.IdentityCard.getKey() == saveInquiryVO.getIdType()) {
+            String idNum = saveInquiryVO.getIdNum();
+            if (StringUtil.isNotBlank(idNum)) {
+                saveInquiryVO.setPatAge(IdCard.getAgeByIdCardAddOne(idNum));
+                saveInquiryVO.setPatSex(IdCard.getGenderByIdCard(idNum));
+            }
+        }
+        /*if (StringUtil.isNotBlank(saveInquiryVO.getHospitalCode())
+                && StringUtil.isNotBlank(saveInquiryVO.getPatName())
+                && !IntegerUtil.isNull(saveInquiryVO.getIdType())
+                && StringUtil.isNotBlank(saveInquiryVO.getIdNum())) {
+            if (sysSetFacade.isCover(saveInquiryVO.getHospitalCode())) {
+                String dateStr = DateUtil.formatDate(now);
+                inquiryInfo = this.getOne(new QueryWrapper<InquiryInfo>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .eq("hospital_code", saveInquiryVO.getHospitalCode())
+                        .eq("pat_name", saveInquiryVO.getPatName())
+                        .eq("id_type", saveInquiryVO.getIdType())
+                        .eq("id_num", saveInquiryVO.getIdNum())
+                        .apply("date_format(gmt_modified, '%Y-%m-%d')={0}", dateStr), false
+                );
+            }
+        }*/
+
+        if (inquiryInfo == null) {
+            inquiryInfo = new InquiryInfo();
+            BeanUtil.copyProperties(saveInquiryVO, inquiryInfo);
+            inquiryInfo.setGmtCreate(now);
+            inquiryInfo.setGmtModified(now);
+            inquiryInfo.setIp(HttpUtils.getIpAddress());
+            save(inquiryInfo);
+        } else {
+            this.update(new UpdateWrapper<InquiryInfo>()
+                    .set("ip", HttpUtils.getIpAddress())
+                    .set("gmt_modified", now)
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getPhone()), "phone", saveInquiryVO.getPhone())
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getPersonnel()), "personnel", saveInquiryVO.getPersonnel())
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getAnxietyPoint()), "anxiety_point", saveInquiryVO.getAnxietyPoint())
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getAnxietyRange()), "anxiety_range", saveInquiryVO.getAnxietyRange())
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getAnxietyJudge()), "anxiety_judge", saveInquiryVO.getAnxietyJudge())
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getAnxietyAdvise()), "anxiety_advise", saveInquiryVO.getAnxietyAdvise())
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getDepressionPoint()), "depression_point", saveInquiryVO.getDepressionPoint())
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getDepressionRange()), "depression_range", saveInquiryVO.getDepressionRange())
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getDepressionJudge()), "depression_judge", saveInquiryVO.getDepressionJudge())
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getDepressionAdvise()), "depression_advise", saveInquiryVO.getDepressionAdvise())
+                    .set(StringUtil.isNotBlank(saveInquiryVO.getMachineId()), "machine_id", saveInquiryVO.getMachineId())
+                    .set("mpi_id", saveInquiryVO.getMpiId())
+                    .set("app_id", saveInquiryVO.getAppId())
+                    .eq("id", inquiryInfo.getId())
+            );
+            // 删除原明细
+            inquiryDetailFacade.update(new UpdateWrapper<InquiryDetail>()
+                    .set("gmt_modified", now)
+                    .set("is_deleted", IsDeleteEnum.Y.getKey())
+                    .eq("inquiry_id", inquiryInfo.getId())
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+            );
+        }
+        Long id = inquiryInfo.getId();
+        saveInquiryVO.setInquiryId(id);
+        List<InquiryDetail> inquiryDetailList = Lists.newArrayList();
+        for (SaveInquiryDetailVO saveInquiryDetailVO : saveInquiryVO.getDetailList()) {
+            InquiryDetail inquiryDetail = new InquiryDetail();
+            BeanUtil.copyProperties(saveInquiryDetailVO, inquiryDetail);
+            inquiryDetail.setInquiryId(id);
+            inquiryDetail.setGmtCreate(now);
+            inquiryDetail.setGmtModified(now);
+            if (ListUtil.isNotEmpty(saveInquiryDetailVO.getOptions())) {
+                inquiryDetail.setRemark(GsonUtil.toJson(saveInquiryDetailVO.getOptions()));
+            }
+            inquiryDetailList.add(inquiryDetail);
+        }
+        inquiryDetailService.saveBatch(inquiryDetailList);
+
+        HospitalVO hospitalVO = new HospitalVO();
+        hospitalVO.setHospitalCode(saveInquiryVO.getHospitalCode());
+        // 保存记录表
+        optInfoFacade.saveOptOnfo(hospitalVO, "2");
+
+        //邵逸夫医院 心理测试 对接纳里时,返回url
+        if (saveInquiryVO.getHospitalCode().equals("邵逸夫医院")
+                && saveInquiryVO.getFrom().equals("6")
+                && saveInquiryVO.getSource().equals("纳里")) {
+            List<String> naliRetList = getUrl(saveInquiryVO);
+            String retUrl = naliRetList.get(0);
+            saveInquiryDTO.setBody(retUrl);
+            saveInquiryDTO.setResponse(naliRetList.get(1));
+            saveInquiryDTO.setRequest(naliRetList.get(2));
+            saveInquiryDTO.setRequestBodys(naliRetList.get(3));
+        }
+        return saveInquiryDTO;
+    }
+
+
+    public List<InquiryPatDTO> getPatListFac(InquiryPatVO inquiryPatVO) {
+        return this.getPatList(inquiryPatVO);
+    }
+
+    public String getMachineId() {
+        return visibleIdCreater.getNextId(6).toString();
+    }
+
+    public List<InquiryDTO> getPatInquiryFac(InquiryPatInquiryVO inquiryPatInquiryVO) {
+        return this.getPatInquiryList(inquiryPatInquiryVO);
+    }
+
+    public List<InquiryDTO> getInquirysByMech(InquiryMechVO inquiryMechVO) {
+        return this.getInquirysByMechId(inquiryMechVO);
+    }
+
+    public List<GetInquiryDetailDTO> getDetail(InquiryDetailVO inquiryDetailVO) {
+        List<InquiryDetail> list = inquiryDetailFacade.list(new QueryWrapper<InquiryDetail>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("inquiry_id", inquiryDetailVO.getId())
+                .orderByAsc("id")
+        );
+
+        List<GetInquiryDetailDTO> resList = new ArrayList<>();
+        if (ListUtil.isNotEmpty(list)) {
+            for (InquiryDetail inquiryDetail : list) {
+                GetInquiryDetailDTO getInquiryDetailDTO = new GetInquiryDetailDTO();
+                BeanUtil.copyProperties(inquiryDetail, getInquiryDetailDTO);
+                if (StringUtil.isNotBlank(inquiryDetail.getRemark())) {
+                    getInquiryDetailDTO.setOptions(GsonUtil.toList(inquiryDetail.getRemark(), Option.class));
+                }
+                resList.add(getInquiryDetailDTO);
+            }
+        }
+        return resList;
+    }
+
+    /**
+     * 历史记录
+     *
+     * @param historyInquiryVO
+     * @return
+     */
+    public List<HistoryInquiryDTO> getHistoryInquiry(HistoryInquiryVO historyInquiryVO) {
+        //入参验证
+        if (null == historyInquiryVO) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入获取历史记录的参数!");
+        }
+
+        if (StringUtil.isBlank(historyInquiryVO.getHospitalCode())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院名称!");
+        }
+
+        if (StringUtil.isBlank(historyInquiryVO.getMachineId())) {
+            if (StringUtil.isBlank(historyInquiryVO.getPatName()) || StringUtil.isBlank(historyInquiryVO.getIdNum())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入机器ID或者同时输入证件号码和对应的姓名!");
+            }
+        }
+
+        //业务获取
+        List<HistoryInquiryDTO> historyInquiryDTOList = Lists.newLinkedList();
+        QueryWrapper<InquiryInfo> inquiryInfoQueryWrapper = new QueryWrapper<>();
+        inquiryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_code", historyInquiryVO.getHospitalCode())
+                .eq(StringUtil.isNotBlank(historyInquiryVO.getPatName()), "pat_name", historyInquiryVO.getPatName())
+                .eq(StringUtil.isNotBlank(historyInquiryVO.getIdNum()), "id_num", historyInquiryVO.getIdNum())
+                .eq(StringUtil.isNotBlank(historyInquiryVO.getMachineId()), "machine_id", historyInquiryVO.getMachineId())
+                .orderByDesc("gmt_modified");
+        List<InquiryInfo> inquiryInfoList = this.list(inquiryInfoQueryWrapper);
+        if (ListUtil.isNotEmpty(inquiryInfoList)) {
+            if (sysSetFacade.isCover(historyInquiryVO.getHospitalCode())) {
+                List<String> keys = ListUtil.newArrayList();
+                for (int i = 0; i < inquiryInfoList.size(); i++) {
+                    InquiryInfo myInquiryInfo = inquiryInfoList.get(i);
+                    if (StringUtil.isNotBlank(myInquiryInfo.getPatName())
+                            && StringUtil.isNotBlank(myInquiryInfo.getIdNum())
+                            && (0 != myInquiryInfo.getIdType())) {
+                        String key = myInquiryInfo.getIdType() + "_" + myInquiryInfo.getIdNum()
+                                + "_" + myInquiryInfo.getPatName()
+                                + "_" + DateUtil.format(myInquiryInfo.getGmtModified(), DateUtil.DATE_FORMAT);
+                        if (keys.contains(key)) {
+                            inquiryInfoList.remove(i--);
+                        } else {
+                            keys.add(key);
+                        }
+                    }
+                }
+            }
+        }
+        if (ListUtil.isNotEmpty(inquiryInfoList)) {
+            List<Long> inquiryIdList = inquiryInfoList.stream().map(i -> i.getId()).collect(Collectors.toList());
+            QueryWrapper<InquiryDetail> inquiryDetailQueryWrapper = new QueryWrapper<>();
+            inquiryDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .in("inquiry_id", inquiryIdList)
+                    .orderByAsc("inquiry_id", "id");
+            List<InquiryDetail> inquiryDetailList = inquiryDetailFacade.list(inquiryDetailQueryWrapper);
+            Map<Long, List<InquiryDetail>> detailMap = EntityUtil.makeEntityListMap(inquiryDetailList, "inquiryId");
+            for (InquiryInfo inquiryInfo : inquiryInfoList) {
+                HistoryInquiryDTO historyInquiryDTO = new HistoryInquiryDTO();
+                BeanUtil.copyProperties(inquiryInfo, historyInquiryDTO);
+                List<InquiryDetail> details = detailMap.get(inquiryInfo.getId());
+                List<GetInquiryDetailDTO> getInquiryDetailDTOList = Lists.newLinkedList();
+                if (ListUtil.isNotEmpty(details)) {
+                    for (InquiryDetail inquiryDetail : details) {
+                        GetInquiryDetailDTO getInquiryDetailDTO = new GetInquiryDetailDTO();
+                        BeanUtil.copyProperties(inquiryDetail, getInquiryDetailDTO);
+                        if (StringUtil.isNotBlank(inquiryDetail.getRemark())) {
+                            getInquiryDetailDTO.setOptions(GsonUtil.toList(inquiryDetail.getRemark(), Option.class));
+                        }
+                        getInquiryDetailDTOList.add(getInquiryDetailDTO);
+                    }
+                    historyInquiryDTO.setDetailList(getInquiryDetailDTOList);
+                }
+                historyInquiryDTOList.add(historyInquiryDTO);
+            }
+        }
+        return historyInquiryDTOList;
+    }
+
+
+    private List<String> getUrl(SaveInquiryVO saveInquiryVO) {
+        List<String> ret = Lists.newArrayList();
+        String retUrl = null;
+        Request request = null;
+        Response response = null;
+        try {
+            String encodingAesKey = "";
+            Client client = new Client(apiUrl, appKey, appSecret, encodingAesKey);
+            request = getltcs(saveInquiryVO);
+            response = client.execute(request);
+            log.info("request:" + FastJsonUtils.getBeanToJson(request));
+            log.info("requestBodys:" + FastJsonUtils.getBeanToJson(request.getBodys()));
+            log.info("response:" + FastJsonUtils.getBeanToJson(response));
+            if (response.isSuccess()) {
+                JSONResponseBean result = response.getJsonResponseBean();
+                retUrl = result.getBody().toString();
+            }
+        } catch (Exception e) {
+        }
+        ret.add(retUrl);
+        ret.add(FastJsonUtils.getBeanToJson(response));
+        ret.add(FastJsonUtils.getBeanToJson(request));
+        ret.add(FastJsonUtils.getBeanToJson(request.getBodys()));
+        return ret;
+    }
+
+    private Request getltcs(SaveInquiryVO saveInquiryVO) {
+        List bodyList = new ArrayList<>();
+
+        List<Map<String, Object>> details = new ArrayList<>();
+        saveInquiryVO.getDetailList().forEach(i -> {
+            Map<String, Object> detail = new HashMap<>();
+            detail.put("question", i.getQuestion());
+            detail.put("answer", i.getAnswer());
+            List<Map<String, Object>> optionMapList = Lists.newArrayList();
+            if (ListUtil.isNotEmpty(i.getOptions())) {
+                i.getOptions().forEach(option -> {
+                    optionMapList.add(FastJsonUtils.getJsonToMap(FastJsonUtils.getBeanToJson(option)));
+                });
+            }
+            detail.put("options", optionMapList);
+            details.add(detail);
+        });
+
+        Map<String, Object> body = new HashMap<>();
+        body.put("details", details);
+        body.put("mpiId", saveInquiryVO.getMpiId());
+        body.put("appId", saveInquiryVO.getAppId());
+        body.put("fromId", saveInquiryVO.getFrom());
+        body.put("sources", "langtong");
+        /*body.put("inquiryId", saveInquiryVO.getInquiryId());
+        body.put("anxietyPoint", saveInquiryVO.getAnxietyPoint());
+        body.put("anxietyRange", saveInquiryVO.getAnxietyRange());
+        body.put("anxietyJudge", saveInquiryVO.getAnxietyJudge());
+        body.put("anxietyAdvise", saveInquiryVO.getAnxietyAdvise());
+        body.put("depressionPoint", saveInquiryVO.getDepressionPoint());
+        body.put("depressionRange", saveInquiryVO.getDepressionRange());
+        body.put("depressionJudge", saveInquiryVO.getDepressionJudge());
+        body.put("depressionAdvise", saveInquiryVO.getDepressionAdvise());*/
+
+        String diagnosis = "";
+        diagnosis += saveInquiryVO.getAnxietyJudge() + "(" + saveInquiryVO.getAnxietyPoint() + ")" + System.lineSeparator();
+        diagnosis += saveInquiryVO.getAnxietyAdvise() + System.lineSeparator();
+        diagnosis += System.lineSeparator();
+        diagnosis += saveInquiryVO.getDepressionJudge() + "(" + saveInquiryVO.getDepressionPoint() + ")" + System.lineSeparator();
+        diagnosis += saveInquiryVO.getDepressionAdvise() + System.lineSeparator();
+        body.put("diagnosis", diagnosis);
+
+        body.put("doctorName", saveInquiryVO.getDoctorName());
+        body.put("organName", saveInquiryVO.getOrganName());
+        body.put("doctorId", saveInquiryVO.getDoctorId());
+        body.put("department", saveInquiryVO.getDepartment());
+        body.put("patientName", saveInquiryVO.getPatName());
+        body.put("patientAge", saveInquiryVO.getPatAge());
+        body.put("patientSex", saveInquiryVO.getPatientSex());
+        body.put("supplement", "");
+        body.put("pushList", Lists.newArrayList());
+        body.put("inquiryId", -1);
+
+        bodyList.add(body);
+
+        //X-Service-Id对应的值
+        String serviceId = "consult.questionRecordService";
+        //X-Service-Method对应的值
+        String method = "saveQuestionRecord";
+        return new Request(serviceId, method, bodyList);
+    }
+}

+ 215 - 0
xlcs-service/src/main/java/com/diagbot/facade/OptInfoFacade.java

@@ -0,0 +1,215 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.HospItemDTO;
+import com.diagbot.dto.HospNameDTO;
+import com.diagbot.dto.OptDTO;
+import com.diagbot.dto.OptHospDTO;
+import com.diagbot.entity.OptInfo;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.OptInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.HttpUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.HospitalVO;
+import com.diagbot.vo.OptHospPageVO;
+import com.diagbot.vo.OptHospVO;
+import com.diagbot.vo.OptVO;
+import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/2 15:52
+ */
+@Component
+public class OptInfoFacade extends OptInfoServiceImpl {
+    @Autowired
+    DataBeanAggregateQueryFacade dataBeanAggregateQueryFacade;
+    @Autowired
+    private OptInfoFacade optInfoFacade;
+
+    public Boolean saveOptOnfo(HospitalVO hospitalVO, String optType) {
+        OptInfo optInfo = new OptInfo();
+        Date now = DateUtil.now();
+        optInfo.setGmtModified(now);
+        optInfo.setGmtCreate(now);
+        optInfo.setIp(HttpUtils.getIpAddress());
+        optInfo.setHospitalCode(StringUtil.isNotBlank(hospitalVO.getHospitalCode()) ? hospitalVO.getHospitalCode() : "朗通通用");
+        optInfo.setOptType(optType);
+        Boolean res = this.save(optInfo);
+        return res;
+    }
+
+    public OptDTO getOptSum(OptVO optVO) {
+        //入参验证
+        if (null != optVO && null != optVO.getStartDate()) {
+            optVO.setStartDate(DateUtil.getFirstTimeOfDay(optVO.getStartDate()));
+        }
+        if (null != optVO && null != optVO.getEndDate()) {
+            optVO.setEndDate(DateUtil.getLastTimeOfDay(optVO.getEndDate()));
+        }
+
+        if (null != optVO && null != optVO.getStartDate() && null != optVO.getEndDate()) {
+            if (DateUtil.after(optVO.getStartDate(), optVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+
+        //获取统计数据
+        OptDTO optDTO = new OptDTO();
+
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("optVO", optVO);
+            optDTO
+                    = dataBeanAggregateQueryFacade.get("getAllOptSum", invokeParams, OptDTO.class);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+        //        optDTO.setPvdto(this.getPV(optVO));
+        //        optDTO.setPvSum(this.getPVSum(optVO));
+        //        optDTO.setUvdto(this.getUV(optVO));
+        //        optDTO.setUvSum(this.getUVSum(optVO));
+        //        optDTO.setZzdto(this.getZZ(optVO));
+        //        optDTO.setZzSum(this.getZZSum(optVO));
+        return optDTO;
+    }
+
+
+    public OptDTO getOptSumNoDays(OptVO optVO) {
+        //入参验证
+        if (null != optVO && null != optVO.getStartDate()) {
+            optVO.setStartDate(DateUtil.getFirstTimeOfDay(optVO.getStartDate()));
+        }
+        if (null != optVO && null != optVO.getEndDate()) {
+            optVO.setEndDate(DateUtil.getLastTimeOfDay(optVO.getEndDate()));
+        }
+
+        if (null != optVO && null != optVO.getStartDate() && null != optVO.getEndDate()) {
+            if (DateUtil.after(optVO.getStartDate(), optVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+
+        //获取统计数据
+        OptDTO optDTO = new OptDTO();
+
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("optVO", optVO);
+            optDTO
+                    = dataBeanAggregateQueryFacade.get("getAllOptSumNoDays", invokeParams, OptDTO.class);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+        //        optDTO.setPvdto(this.getPV(optVO));
+        //        optDTO.setPvSum(this.getPVSum(optVO));
+        //        optDTO.setUvdto(this.getUV(optVO));
+        //        optDTO.setUvSum(this.getUVSum(optVO));
+        //        optDTO.setZzdto(this.getZZ(optVO));
+        //        optDTO.setZzSum(this.getZZSum(optVO));
+        return optDTO;
+    }
+
+
+    public OptHospDTO getOptSumHosp(OptVO optVO) {
+        //入参验证
+        if (null != optVO && null != optVO.getStartDate()) {
+            optVO.setStartDate(DateUtil.getFirstTimeOfDay(optVO.getStartDate()));
+        }
+        if (null != optVO && null != optVO.getEndDate()) {
+            optVO.setEndDate(DateUtil.getLastTimeOfDay(optVO.getEndDate()));
+        }
+
+        if (null != optVO && null != optVO.getStartDate() && null != optVO.getEndDate()) {
+            if (DateUtil.after(optVO.getStartDate(), optVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+
+        //获取统计数据
+        OptHospDTO optHospDTO = new OptHospDTO();
+
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("optVO", optVO);
+            optHospDTO
+                    = dataBeanAggregateQueryFacade.get("getAllOptSumHosp", invokeParams, OptHospDTO.class);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+
+        return optHospDTO;
+    }
+
+
+    public List<HospItemDTO> getOptSumHospNoDays(OptHospVO optHospVO) {
+        //入参验证
+        if (null != optHospVO && null != optHospVO.getStartDate()) {
+            optHospVO.setStartDate(DateUtil.getFirstTimeOfDay(optHospVO.getStartDate()));
+        }
+        if (null != optHospVO && null != optHospVO.getEndDate()) {
+            optHospVO.setEndDate(DateUtil.getLastTimeOfDay(optHospVO.getEndDate()));
+        }
+
+        if (null != optHospVO && null != optHospVO.getStartDate() && null != optHospVO.getEndDate()) {
+            if (DateUtil.after(optHospVO.getStartDate(), optHospVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+        return this.getHospitalPUZ(optHospVO);
+    }
+
+
+    public IPage<HospItemDTO> getOptSumHospNoDaysPageFac(OptHospPageVO optHospPageVO) {
+        //入参验证
+        if (null != optHospPageVO && null != optHospPageVO.getStartDate()) {
+            optHospPageVO.setStartDate(DateUtil.getFirstTimeOfDay(optHospPageVO.getStartDate()));
+        }
+        if (null != optHospPageVO && null != optHospPageVO.getEndDate()) {
+            optHospPageVO.setEndDate(DateUtil.getLastTimeOfDay(optHospPageVO.getEndDate()));
+        }
+
+        if (null != optHospPageVO && null != optHospPageVO.getStartDate() && null != optHospPageVO.getEndDate()) {
+            if (DateUtil.after(optHospPageVO.getStartDate(), optHospPageVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+        return getPageHospitalPUZ(optHospPageVO);
+    }
+
+    public HospNameDTO getAllHospitalName(){
+        HospNameDTO hospNameDTO = new HospNameDTO();
+        List<String> hospitalList = optInfoFacade.getAllHospital();
+        if(ListUtil.isNotEmpty(hospitalList)){
+            hospNameDTO.setHospitalCode(hospitalList);
+        }
+        return hospNameDTO;
+    }
+
+
+    public HospNameDTO getAllHospitalNameWithLtFrist(){
+        HospNameDTO hospNameDTO = new HospNameDTO();
+        List<String> hospitalList = optInfoFacade.getAllHospital();
+        if(ListUtil.isNotEmpty(hospitalList)){
+            List<String> hospitalListNew = new ArrayList<>();
+            List<String> hospitalListFilter = hospitalList.stream().filter(r -> !"朗通通用".equals(r)).collect(Collectors.toList());
+            hospitalListNew.add("朗通通用");
+            hospitalListNew.addAll(hospitalListFilter);
+            hospNameDTO.setHospitalCode(hospitalListNew);
+        }
+        return hospNameDTO;
+    }
+}

+ 86 - 0
xlcs-service/src/main/java/com/diagbot/facade/SysSetFacade.java

@@ -0,0 +1,86 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.SysSetDTO;
+import com.diagbot.dto.SysSetProHosResDTO;
+import com.diagbot.entity.SysSet;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.SysSetServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.HospSetVO;
+import com.diagbot.vo.SysSetVO;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @date: 2020/2/9 12:04
+ * @version: V1.0
+ */
+@Component
+public class SysSetFacade extends SysSetServiceImpl {
+    public List<SysSetDTO> getSysSet(SysSetVO sysSetVO) {
+        if (null != sysSetVO && StringUtil.isBlank(sysSetVO.getHospitalCode())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "医院编码不能为空!");
+        }
+        QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
+        sysSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_code", sysSetVO.getHospitalCode());
+        List<SysSet> sysSetList = this.list(sysSetQueryWrapper);
+        List<SysSetDTO> res = BeanUtil.listCopyTo(sysSetList, SysSetDTO.class);
+        return res;
+    }
+
+
+    public List<SysSetProHosResDTO> getPositon() {
+        List<SysSetProHosResDTO> res = new ArrayList<>();
+        QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
+        sysSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("code", "imgUrl")
+                .ne("province", "")
+                .orderByAsc("province");
+        List<SysSet> sysSetList = this.list(sysSetQueryWrapper);
+        Map<String, List<SysSet>> map = EntityUtil.makeEntityListMap(sysSetList, "province");
+        for (String key : map.keySet()) {
+            SysSetProHosResDTO bean = new SysSetProHosResDTO();
+            bean.setProvince(key);
+            bean.setHospitalCodeList(map.get(key).stream().map(r -> r.getHospitalCode()).collect(Collectors.toList()));
+            bean.setSize(bean.getHospitalCodeList().size());
+            res.add(bean);
+        }
+        return res;
+    }
+
+    public SysSet getHospSet(HospSetVO hospSetVO) {
+        QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
+        sysSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("code", hospSetVO.getCode())
+                .eq("hospital_code", hospSetVO.getHospitalCode());
+        SysSet sysSet = this.getOne(sysSetQueryWrapper, false);
+        return sysSet;
+    }
+
+    public Boolean isCover(String hospitalCode) {
+        HospSetVO hospSetVO = new HospSetVO();
+        hospSetVO.setCode("isCover");
+        hospSetVO.setHospitalCode(hospitalCode);
+        SysSet sysSet = getHospSet(hospSetVO);
+        if (null == sysSet) {
+            return false;
+        } else {
+            if ("1".equals(sysSet.getValue())) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

+ 197 - 0
xlcs-service/src/main/java/com/diagbot/facade/WeixinFacade.java

@@ -0,0 +1,197 @@
+package com.diagbot.facade;
+
+import com.alibaba.fastjson.JSON;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.vo.WeixinVO;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2020/2/6 12:22
+ */
+@Component
+public class WeixinFacade {
+
+    @Value("${weixin.appid}")
+    private String appid;
+
+    @Value("${weixin.secret}")
+    private String secret;
+
+    // 存储accessToken 和 ticket
+    public static Map<String, String> cacheMap = new HashMap<>();
+
+    public Map getConfig(WeixinVO weixinVO) {
+        Map<String, String> map = new LinkedHashMap<>();
+        String url= weixinVO.getUrl();
+        try {
+           /* Map<String, Object> map2  = WxUtil.oppen_id(request, request.getSession());
+            String oppen_id = (String) map2.get("oppen_id");
+            String accessToken  = (String) map2.get("access_token");*/
+
+           // 1.获取accessToken
+           String accessToken = "";
+           if (cacheMap.get("accessTokenExpire") == null
+                   || Long.parseLong(cacheMap.get("accessTokenExpire")) < System.currentTimeMillis()) {
+               accessToken = getAccessToken(appid, secret);
+               cacheMap.put("accessTokenExpire", String.valueOf(System.currentTimeMillis() + 7200 * 1000)); // 过期时间
+               cacheMap.put("accessToken", accessToken);
+           } else {
+               accessToken = cacheMap.get("accessToken");
+           }
+
+            //2、获取Ticket
+            String jsapi_ticket = "";
+            if (cacheMap.get("ticketExpire") == null
+                    || Long.parseLong(cacheMap.get("ticketExpire")) < System.currentTimeMillis()) {
+                jsapi_ticket = getTicket(accessToken);
+                cacheMap.put("ticketExpire", String.valueOf(System.currentTimeMillis() + 7200 * 1000)); // 过期时间
+                cacheMap.put("ticket", jsapi_ticket);
+            } else {
+                jsapi_ticket = cacheMap.get("ticket");
+            }
+
+            //3、时间戳和随机字符串
+            String noncestr = UUID.randomUUID().toString().replace("-", "").substring(0, 16);//随机字符串
+            String timestamp = String.valueOf(System.currentTimeMillis() / 1000);//时间戳
+
+            System.out.println("accessToken:"+accessToken+"\njsapi_ticket:"+jsapi_ticket+"\n时间戳:"+timestamp+"\n随机字符串:"+noncestr);
+
+            //4、获取url
+            //String url="http://shuiqitong.com/xzw/jNotice/jNotice_templet/templet.jsp";
+                /*根据JSSDK上面的规则进行计算
+                String[] ArrTmp = {"jsapi_ticket","timestamp","nonce","url"};
+                Arrays.sort(ArrTmp);
+                StringBuffer sf = new StringBuffer();
+                for(int i=0;i<ArrTmp.length;i++){
+                    sf.append(ArrTmp[i]);
+                }
+                */
+
+            //5、将参数排序并拼接字符串
+            String str = "jsapi_ticket="+jsapi_ticket+"&noncestr="+noncestr+"&timestamp="+timestamp+"&url="+url;
+
+            //6、将字符串进行sha1加密
+            String signature =SHA1(str);
+            System.out.println("参数:"+str+"\n签名:"+signature);
+            map.put("ticket", jsapi_ticket);
+            map.put("timestamp", timestamp);
+            map.put("noncestr", noncestr);
+            map.put("signature", signature);
+            map.put("url", url);
+            map.put("appid", appid);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return map;
+    }
+
+
+    //获取access_token
+    public static String getAccessToken(String appid,String secret) {
+        String access_token = "";
+        String grant_type = "client_credential";//获取access_token填写client_credential
+        String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type="+grant_type+"&appid="+appid+"&secret="+secret;
+        //这个url链接地址和参数皆不能变
+        String requestUrl = "";
+        String oppid="";
+        String openid ="";
+        String requestUrl2="";
+        String userInfoStr="";
+        try {
+            //获取code后,请求以下链接获取access_token
+            URL urlGet = new URL(url);
+            HttpURLConnection http = (HttpURLConnection) urlGet.openConnection();
+            http.setRequestMethod("GET"); // 必须是get方式请求
+            http.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
+            http.setDoOutput(true);
+            http.setDoInput(true);
+            System.setProperty("sun.net.client.defaultConnectTimeout", "30000");// 连接超时30秒
+            System.setProperty("sun.net.client.defaultReadTimeout", "30000"); // 读取超时30秒
+            http.connect();
+            InputStream is = http.getInputStream();
+            int size = is.available();
+            byte[] jsonBytes = new byte[size];
+            is.read(jsonBytes);
+            String message = new String(jsonBytes, "UTF-8");
+            Map<String,String> map = JSON.parseObject(message, Map.class);
+           // System.out.println(map);
+            access_token = map.get("access_token");
+            // System.out.println(access_token);
+            //            is.close();
+            //
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return access_token;
+    }
+
+    //获取ticket
+    public static String getTicket(String access_token) {
+        String ticket = null;
+        String url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token="+ access_token +"&type=jsapi";//这个url链接和参数不能变
+        try {
+            URL urlGet = new URL(url);
+            HttpURLConnection http = (HttpURLConnection) urlGet.openConnection();
+            http.setRequestMethod("GET"); // 必须是get方式请求
+            http.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
+            http.setDoOutput(true);
+            http.setDoInput(true);
+            System.setProperty("sun.net.client.defaultConnectTimeout", "30000");// 连接超时30秒
+            System.setProperty("sun.net.client.defaultReadTimeout", "30000"); // 读取超时30秒
+            http.connect();
+            InputStream is = http.getInputStream();
+            int size = is.available();
+            byte[] jsonBytes = new byte[size];
+            is.read(jsonBytes);
+            String message = new String(jsonBytes, "UTF-8");
+
+            Map<String,String> map = JSON.parseObject(message, Map.class);
+            //System.out.println(map);
+            ticket = map.get("ticket");
+            //            JSONObject demoJson = JSONObject.fromObject(message);
+            //            System.out.println("JSON字符串:"+demoJson);
+            //            ticket = demoJson.getString("ticket");
+            //            is.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return ticket;
+    }
+
+
+    public static String SHA1(String decript) {
+        try {
+            MessageDigest digest = java.security.MessageDigest.getInstance("SHA-1");
+            digest.update(decript.getBytes());
+            byte messageDigest[] = digest.digest();
+            // Create Hex String
+            StringBuffer hexString = new StringBuffer();
+            // 字节数组转换为 十六进制 数
+            for (int i = 0; i < messageDigest.length; i++) {
+                String shaHex = Integer.toHexString(messageDigest[i] & 0xFF);
+                if (shaHex.length() < 2) {
+                    hexString.append(0);
+                }
+                hexString.append(shaHex);
+            }
+            return hexString.toString();
+
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+}

+ 36 - 0
xlcs-service/src/main/java/com/diagbot/idc/AbstractIdCreater.java

@@ -0,0 +1,36 @@
+package com.diagbot.idc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: ID生成抽象类接口
+ * @author: gaodm
+ * @time: 2018/9/5 9:20
+ */
+public abstract class AbstractIdCreater<T> implements IdCreater<T> {
+
+    protected int machineId;
+    protected int dataCenterId;
+
+    public AbstractIdCreater(int machineId, int dataCenterId) {
+        this.machineId = machineId;
+        this.dataCenterId = dataCenterId;
+    }
+
+    @Override
+    public abstract Long getNextId(T param);
+
+    @Override
+    public List<Long> getNextIds(T param, int size) {
+        List<Long> longs = new ArrayList<>(size);
+        for (int i = 0; i < size; i++) {
+            longs.add(getNextId(param));
+        }
+        return longs;
+    }
+
+    protected long timeGen() {
+        return System.currentTimeMillis();
+    }
+}

+ 26 - 0
xlcs-service/src/main/java/com/diagbot/idc/IdCreater.java

@@ -0,0 +1,26 @@
+package com.diagbot.idc;
+
+import java.util.List;
+
+/**
+ * @Description: ID生成接口
+ * @author: gaodm
+ * @time: 2018/9/5 9:21
+ */
+public interface IdCreater<T> {
+
+    /**
+     * 生成一个id
+     *
+     * @return 生成的id
+     */
+    Long getNextId(T param);
+
+    /**
+     * 批量生成id
+     *
+     * @param size 生成数量
+     * @return 生成的id列表
+     */
+    List<Long> getNextIds(T param, int size);
+}

+ 62 - 0
xlcs-service/src/main/java/com/diagbot/idc/InvisibleIdCreater.java

@@ -0,0 +1,62 @@
+package com.diagbot.idc;//package com.diagbot.idc;
+//
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.beans.factory.annotation.Qualifier;
+//import org.springframework.dao.DataAccessException;
+//import org.springframework.data.redis.connection.RedisConnection;
+//import org.springframework.data.redis.core.RedisCallback;
+//import org.springframework.data.redis.core.RedisTemplate;
+//
+//import java.util.List;
+//
+///**
+// * @Description: 不可见id由redis生成
+// * @author: gaodm
+// * @time: 2018/9/5 9:21
+// */
+//@SuppressWarnings("unchecked")
+//@Slf4j
+//public class InvisibleIdCreater extends AbstractIdCreater<Class> {
+//
+//    @Autowired
+//    @Qualifier("redisTemplateForIdc")
+//    RedisTemplate redisTemplate;
+//
+//    public InvisibleIdCreater(int machineId, int dataCenterId) {
+//        super(machineId, dataCenterId);
+//    }
+//
+//    @Override
+//    public Long getNextId(Class param) {
+//        final byte[] redis_key = redisTemplate.getKeySerializer().serialize("id_" + param.getName());
+//        Object execute = redisTemplate.execute(new RedisCallback() {
+//            @Override
+//            public Long doInRedis(RedisConnection connection) throws DataAccessException {
+//                Long incr = connection.incr(redis_key);
+//                return incr;
+//            }
+//        });
+//        return (Long) execute;
+//    }
+//
+//    @Override
+//    public List<Long> getNextIds(Class param, final int size) {
+//        final byte[] rawKey = redisTemplate.getKeySerializer().serialize("id_" + param.getName());
+//        //pipeline
+//        RedisCallback<List<Object>> pipelineCallback = new RedisCallback<List<Object>>() {
+//            @Override
+//            public List<Object> doInRedis(RedisConnection connection) throws DataAccessException {
+//                connection.openPipeline();
+//                for (int i = 0; i < size; i++) {
+//                    connection.incr(rawKey);
+//                }
+//                return connection.closePipeline();
+//            }
+//        };
+//
+//        List<Long> results = (List<Long>) redisTemplate.execute(pipelineCallback);
+//        return results;
+//    }
+//
+//}

+ 71 - 0
xlcs-service/src/main/java/com/diagbot/idc/VisibleIdCreater.java

@@ -0,0 +1,71 @@
+package com.diagbot.idc;
+
+
+import com.diagbot.util.DateUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.RandomUtils;
+import org.apache.commons.lang3.time.DateUtils;
+
+import java.util.Calendar;
+
+/**
+ * @Description: 可见id每秒递增
+ * @author: gaodm
+ * @time: 2018/9/5 10:45
+ */
+@Slf4j
+public class VisibleIdCreater extends AbstractIdCreater<Integer> {
+
+    private long lastTimestamp = -1L;
+
+    private long sequence = 0L;
+    private long sequenceMask = 9999;
+
+    public VisibleIdCreater(int machineId, int dataCenterId) {
+        super(machineId, dataCenterId);
+    }
+
+    @Override
+    /**
+     *  对外id生成规则
+     *  180905123451110001
+     *  180905 - 12345 -  1   -  1   -     1     - 0001
+     *   日期 -  秒数  - 业务 - 机器 - 数据中心 - 秒内自增
+     *  @param type 业务id 1.订单 2.交易 3.退款
+     *  @return 生成的id
+     */
+    public synchronized Long getNextId(Integer type) {
+
+        Calendar calendar = Calendar.getInstance();
+
+        long timestamp = timeGen() / 1000;
+
+        if (timestamp < lastTimestamp) {
+            log.error(String.format("clock is moving backwards. Rejecting requests until %d.", lastTimestamp));
+            throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
+        }
+
+        if (lastTimestamp == timestamp) {
+            sequence = (sequence + 1);
+            if (sequence > sequenceMask) {
+                //timestamp = tilNextMillis(lastTimestamp);
+                log.error(String.format("id creater sequence is full. wait to next time"));
+                return null;
+            }
+        } else {
+            sequence = getNewSequence();
+        }
+
+        lastTimestamp = timestamp;
+
+        String date = DateUtil.format(calendar.getTime(), "yyMMdd");
+        long seconds = DateUtils.getFragmentInSeconds(calendar, Calendar.DAY_OF_YEAR);
+
+        return Long.valueOf(date + String.format("%05d", seconds) + String.valueOf(type) + machineId + dataCenterId + sequence);
+    }
+
+    private long getNewSequence() {
+        return RandomUtils.nextInt(1000, 2000);
+    }
+
+}

+ 16 - 0
xlcs-service/src/main/java/com/diagbot/mapper/InquiryDetailMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.InquiryDetail;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 问诊记录-明细表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-01
+ */
+public interface InquiryDetailMapper extends BaseMapper<InquiryDetail> {
+
+}

+ 29 - 0
xlcs-service/src/main/java/com/diagbot/mapper/InquiryInfoMapper.java

@@ -0,0 +1,29 @@
+package com.diagbot.mapper;
+
+import com.diagbot.dto.InquiryDTO;
+import com.diagbot.dto.InquiryPatDTO;
+import com.diagbot.entity.InquiryInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.InquiryMechVO;
+import com.diagbot.vo.InquiryPatInquiryVO;
+import com.diagbot.vo.InquiryPatVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 问诊记录-主表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-01
+ */
+public interface InquiryInfoMapper extends BaseMapper<InquiryInfo> {
+
+    public List<InquiryPatDTO> getPatList(InquiryPatVO inquiryPatVO);
+
+    public List<InquiryDTO> getPatInquiryList(InquiryPatInquiryVO inquiryPatInquiryVO);
+
+    public List<InquiryDTO> getInquirysByMechId(InquiryMechVO inquiryMechVO);
+
+}

+ 0 - 0
xlcs-service/src/main/java/com/diagbot/mapper/OptInfoMapper.java


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