Browse Source

Merge branch 'dev/zzcx20200202_init' into dev/znwz20200208_log

gaodm 5 years ago
parent
commit
418a693c01
100 changed files with 5258 additions and 2 deletions
  1. 2 1
      common/src/main/java/com/diagbot/enums/SysTypeEnum.java
  2. 82 0
      config-server/src/main/resources/shared/application-tzsl.yml
  3. 14 1
      config-server/src/main/resources/shared/gateway-service-dev.yml
  4. 14 0
      config-server/src/main/resources/shared/gateway-service-local.yml
  5. 7 0
      config-server/src/main/resources/shared/gateway-service-pre.yml
  6. 15 0
      config-server/src/main/resources/shared/gateway-service-pro.yml
  7. 7 0
      config-server/src/main/resources/shared/gateway-service-test.yml
  8. 104 0
      config-server/src/main/resources/shared/zzcx-service-dev.yml
  9. 104 0
      config-server/src/main/resources/shared/zzcx-service-local.yml
  10. 104 0
      config-server/src/main/resources/shared/zzcx-service-pre.yml
  11. 104 0
      config-server/src/main/resources/shared/zzcx-service-pro.yml
  12. 104 0
      config-server/src/main/resources/shared/zzcx-service-test.yml
  13. 104 0
      config-server/src/main/resources/shared/zzcxtzsl-service-tzsl.yml
  14. 6 0
      docs/030.20200202自诊程序初始化脚本/add.sql
  15. 158 0
      docs/030.20200202自诊程序初始化脚本/init_zzcx.sql
  16. 1 0
      pom.xml
  17. 25 0
      zzcx-service/.gitignore
  18. 205 0
      zzcx-service/pom.xml
  19. 36 0
      zzcx-service/src/main/java/com/diagbot/ZzcxServiceApplication.java
  20. 88 0
      zzcx-service/src/main/java/com/diagbot/aggregate/OptAggregate.java
  21. 106 0
      zzcx-service/src/main/java/com/diagbot/aggregate/OptHospAggregate.java
  22. 41 0
      zzcx-service/src/main/java/com/diagbot/aop/SysLoggerAspect.java
  23. 19 0
      zzcx-service/src/main/java/com/diagbot/config/CustomAccessTokenConverter.java
  24. 15 0
      zzcx-service/src/main/java/com/diagbot/config/GlobalMethodSecurityConfigurer.java
  25. 48 0
      zzcx-service/src/main/java/com/diagbot/config/JwtConfigurer.java
  26. 33 0
      zzcx-service/src/main/java/com/diagbot/config/MybatisPlusConfigurer.java
  27. 42 0
      zzcx-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  28. 70 0
      zzcx-service/src/main/java/com/diagbot/config/SwaggerConfigurer.java
  29. 81 0
      zzcx-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  30. 29 0
      zzcx-service/src/main/java/com/diagbot/config/security/UrlConfigAttribute.java
  31. 79 0
      zzcx-service/src/main/java/com/diagbot/config/security/UrlFilterSecurityInterceptor.java
  32. 40 0
      zzcx-service/src/main/java/com/diagbot/config/security/UrlMetadataSourceService.java
  33. 47 0
      zzcx-service/src/main/java/com/diagbot/config/wx/WxMpConfiguration.java
  34. 46 0
      zzcx-service/src/main/java/com/diagbot/config/wx/WxMpProperties.java
  35. 18 0
      zzcx-service/src/main/java/com/diagbot/dto/HospNameDTO.java
  36. 22 0
      zzcx-service/src/main/java/com/diagbot/dto/OptDTO.java
  37. 25 0
      zzcx-service/src/main/java/com/diagbot/dto/OptHospDTO.java
  38. 16 0
      zzcx-service/src/main/java/com/diagbot/dto/PVDTO.java
  39. 18 0
      zzcx-service/src/main/java/com/diagbot/dto/PVHospDTO.java
  40. 17 0
      zzcx-service/src/main/java/com/diagbot/dto/PVHospSumDTO.java
  41. 38 0
      zzcx-service/src/main/java/com/diagbot/dto/QuestionDTO.java
  42. 24 0
      zzcx-service/src/main/java/com/diagbot/dto/SaveInquiryDTO.java
  43. 16 0
      zzcx-service/src/main/java/com/diagbot/dto/UVDTO.java
  44. 18 0
      zzcx-service/src/main/java/com/diagbot/dto/UVHospDTO.java
  45. 17 0
      zzcx-service/src/main/java/com/diagbot/dto/UVHospSumDTO.java
  46. 16 0
      zzcx-service/src/main/java/com/diagbot/dto/ZZDTO.java
  47. 18 0
      zzcx-service/src/main/java/com/diagbot/dto/ZZHospDTO.java
  48. 17 0
      zzcx-service/src/main/java/com/diagbot/dto/ZZHospSumDTO.java
  49. 169 0
      zzcx-service/src/main/java/com/diagbot/entity/InquiryDetail.java
  50. 78 0
      zzcx-service/src/main/java/com/diagbot/entity/InquiryInfo.java
  51. 166 0
      zzcx-service/src/main/java/com/diagbot/entity/OptInfo.java
  52. 60 0
      zzcx-service/src/main/java/com/diagbot/entity/QuestionDetail.java
  53. 120 0
      zzcx-service/src/main/java/com/diagbot/entity/QuestionInfo.java
  54. 80 0
      zzcx-service/src/main/java/com/diagbot/entity/QuestionMapping.java
  55. 21 0
      zzcx-service/src/main/java/com/diagbot/entity/wrapper/QuestionInfoWrapper.java
  56. 81 0
      zzcx-service/src/main/java/com/diagbot/exception/CommonExceptionHandler.java
  57. 39 0
      zzcx-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java
  58. 14 0
      zzcx-service/src/main/java/com/diagbot/facade/InquiryDetailFacade.java
  59. 63 0
      zzcx-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java
  60. 124 0
      zzcx-service/src/main/java/com/diagbot/facade/OptInfoFacade.java
  61. 65 0
      zzcx-service/src/main/java/com/diagbot/facade/QuestionDetailFacade.java
  62. 227 0
      zzcx-service/src/main/java/com/diagbot/facade/QuestionFacade.java
  63. 197 0
      zzcx-service/src/main/java/com/diagbot/facade/WeixinFacade.java
  64. 16 0
      zzcx-service/src/main/java/com/diagbot/mapper/InquiryDetailMapper.java
  65. 16 0
      zzcx-service/src/main/java/com/diagbot/mapper/InquiryInfoMapper.java
  66. 53 0
      zzcx-service/src/main/java/com/diagbot/mapper/OptInfoMapper.java
  67. 16 0
      zzcx-service/src/main/java/com/diagbot/mapper/QuestionDetailMapper.java
  68. 48 0
      zzcx-service/src/main/java/com/diagbot/mapper/QuestionInfoMapper.java
  69. 16 0
      zzcx-service/src/main/java/com/diagbot/mapper/QuestionMappingMapper.java
  70. 23 0
      zzcx-service/src/main/java/com/diagbot/rabbit/MyProcessor.java
  71. 27 0
      zzcx-service/src/main/java/com/diagbot/rabbit/MySender.java
  72. 16 0
      zzcx-service/src/main/java/com/diagbot/service/InquiryDetailService.java
  73. 16 0
      zzcx-service/src/main/java/com/diagbot/service/InquiryInfoService.java
  74. 55 0
      zzcx-service/src/main/java/com/diagbot/service/OptInfoService.java
  75. 16 0
      zzcx-service/src/main/java/com/diagbot/service/QuestionDetailService.java
  76. 40 0
      zzcx-service/src/main/java/com/diagbot/service/QuestionInfoService.java
  77. 16 0
      zzcx-service/src/main/java/com/diagbot/service/QuestionMappingService.java
  78. 20 0
      zzcx-service/src/main/java/com/diagbot/service/impl/InquiryDetailServiceImpl.java
  79. 20 0
      zzcx-service/src/main/java/com/diagbot/service/impl/InquiryInfoServiceImpl.java
  80. 83 0
      zzcx-service/src/main/java/com/diagbot/service/impl/OptInfoServiceImpl.java
  81. 20 0
      zzcx-service/src/main/java/com/diagbot/service/impl/QuestionDetailServiceImpl.java
  82. 39 0
      zzcx-service/src/main/java/com/diagbot/service/impl/QuestionInfoServiceImpl.java
  83. 20 0
      zzcx-service/src/main/java/com/diagbot/service/impl/QuestionMappingServiceImpl.java
  84. 17 0
      zzcx-service/src/main/java/com/diagbot/vo/HospitalVO.java
  85. 28 0
      zzcx-service/src/main/java/com/diagbot/vo/OptVO.java
  86. 19 0
      zzcx-service/src/main/java/com/diagbot/vo/QuestionIds2VO.java
  87. 17 0
      zzcx-service/src/main/java/com/diagbot/vo/QuestionVO.java
  88. 26 0
      zzcx-service/src/main/java/com/diagbot/vo/SaveInquiryDetailVO.java
  89. 45 0
      zzcx-service/src/main/java/com/diagbot/vo/SaveInquiryVO.java
  90. 19 0
      zzcx-service/src/main/java/com/diagbot/vo/WeixinVO.java
  91. 42 0
      zzcx-service/src/main/java/com/diagbot/web/InquiryInfoController.java
  92. 72 0
      zzcx-service/src/main/java/com/diagbot/web/OptInfoController.java
  93. 58 0
      zzcx-service/src/main/java/com/diagbot/web/QuestionInfoController.java
  94. 67 0
      zzcx-service/src/main/java/com/diagbot/web/ViewController.java
  95. 61 0
      zzcx-service/src/main/java/com/diagbot/web/WeXinJsSdkController.java
  96. 69 0
      zzcx-service/src/main/java/com/diagbot/web/WexinController.java
  97. 43 0
      zzcx-service/src/main/resources/bootstrap.yml
  98. 316 0
      zzcx-service/src/main/resources/logback-spring.xml
  99. 19 0
      zzcx-service/src/main/resources/mapper/InquiryDetailMapper.xml
  100. 0 0
      zzcx-service/src/main/resources/mapper/InquiryInfoMapper.xml

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

@@ -30,7 +30,8 @@ public enum SysTypeEnum implements KeyedNamed {
     PREC_SERVICE(17, "prec-service"),
     PREC_SERVICE(17, "prec-service"),
     PRECMAN_SERVICE(18, "precman-service"),
     PRECMAN_SERVICE(18, "precman-service"),
     MRQCMAN_SERVICE(19, "mrqcman-service"),
     MRQCMAN_SERVICE(19, "mrqcman-service"),
-    ZNWZ_SERVICE(21, "znwz-service");
+    ZNWZ_SERVICE(21, "znwz-service"),
+    ZZCX_SERVICE(22, "zzcx-service");
 
 
     @Setter
     @Setter
     private int key;
     private int key;

+ 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

+ 14 - 1
config-server/src/main/resources/shared/gateway-service-dev.yml

@@ -135,7 +135,20 @@ spring:
         filters:
         filters:
         #        - SwaggerHeaderFilter
         #        - SwaggerHeaderFilter
         - StripPrefix=2
         - 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
 server:
 server:
   port: 5050
   port: 5050
 
 

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

@@ -139,6 +139,20 @@ spring:
         filters:
         filters:
         #        - SwaggerHeaderFilter
         #        - SwaggerHeaderFilter
         - StripPrefix=2
         - 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
 
 
 server:
 server:
   port: 5050
   port: 5050

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

@@ -142,6 +142,13 @@ spring:
         filters:
         filters:
         #        - SwaggerHeaderFilter
         #        - SwaggerHeaderFilter
         - StripPrefix=2
         - StripPrefix=2
+      - id: zzcx-service
+        uri: lb://zzcx-service
+        predicates:
+        - Path=/api/zzcx/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 
 server:
 server:
   port: 5050
   port: 5050

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

@@ -135,6 +135,21 @@ spring:
         filters:
         filters:
         #        - SwaggerHeaderFilter
         #        - SwaggerHeaderFilter
         - StripPrefix=2
         - 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
+
 
 
 server:
 server:
   port: 5050
   port: 5050

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

@@ -142,6 +142,13 @@ spring:
         filters:
         filters:
         #        - SwaggerHeaderFilter
         #        - SwaggerHeaderFilter
         - StripPrefix=2
         - StripPrefix=2
+      - id: zzcx-service
+        uri: lb://zzcx-service
+        predicates:
+        - Path=/api/zzcx/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 
 server:
 server:
   port: 5050
   port: 5050

+ 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-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: 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

+ 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='自诊记录-明细表';
+
+
+

+ 1 - 0
pom.xml

@@ -35,6 +35,7 @@
         <module>mrqcman-service</module>
         <module>mrqcman-service</module>
         <module>common-biz-client</module>
         <module>common-biz-client</module>
         <module>znwz-service</module>
         <module>znwz-service</module>
+        <module>zzcx-service</module>
     </modules>
     </modules>
 
 
     <parent>
     <parent>

+ 25 - 0
zzcx-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
zzcx-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>zzcx-service</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>zzcx-service</name>
+    <description>zzcx 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
zzcx-service/src/main/java/com/diagbot/ZzcxServiceApplication.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 ZzcxServiceApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(ZzcxServiceApplication.class, args);
+    }
+}

+ 88 - 0
zzcx-service/src/main/java/com/diagbot/aggregate/OptAggregate.java

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

+ 19 - 0
zzcx-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
zzcx-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 {
+
+}

+ 48 - 0
zzcx-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
zzcx-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
zzcx-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
zzcx-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(" zzcx-service api ")
+                .description("zzcx-service 微服务")
+                .termsOfServiceUrl("")
+                .contact(new Contact("diagbot","",""))
+                .version("1.0")
+                .build();
+    }
+
+}

+ 81 - 0
zzcx-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
zzcx-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
zzcx-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
zzcx-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
zzcx-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
zzcx-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);
+    }
+}

+ 18 - 0
zzcx-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;
+}

+ 22 - 0
zzcx-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
zzcx-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
zzcx-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
zzcx-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
zzcx-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;
+}

+ 38 - 0
zzcx-service/src/main/java/com/diagbot/dto/QuestionDTO.java

@@ -0,0 +1,38 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.QuestionDetail;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: 返回标签内容
+ * @Author: ztg
+ * @Date: 2018/10/24 16:11
+ */
+@Getter
+@Setter
+public class QuestionDTO {
+
+    private Long id;// id
+    private String name;//内容
+    private String tagName;//标签名称
+    private Integer type;//类型(1:症状 3:其他史 4:查体,5:化验 6:辅检 7:诊断)
+    private Integer controlType; //控件类型
+    private Integer itemType; //元素类型
+    private Integer tagType; //标签标识
+    private String labelPrefix = ""; //前置内容
+    private String labelSuffix = ""; //后置内容
+    private String url;    //图片url地址
+    private String description; // 客户端界面描述
+    private Integer specFlag;//特殊标记(0:没有标记,1:拼接到主诉)
+    private Integer required;//必填(0:不必填,1:必填)
+    private String explains;//详细阐述
+    private Integer exclusionType; //互斥类型
+    private List<QuestionDetail> questionDetailList = new ArrayList<>(); //标签明细表
+    private List<QuestionDTO> questionMapping = new ArrayList<>();     //下级标签
+    private String flag; // 类型标记
+    private String remark;//备注
+}

+ 24 - 0
zzcx-service/src/main/java/com/diagbot/dto/SaveInquiryDTO.java

@@ -0,0 +1,24 @@
+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;
+
+}

+ 16 - 0
zzcx-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
zzcx-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
zzcx-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
zzcx-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
zzcx-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
zzcx-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;
+}

+ 169 - 0
zzcx-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("zzcx_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 +
+                "}";
+    }
+}

+ 78 - 0
zzcx-service/src/main/java/com/diagbot/entity/InquiryInfo.java

@@ -0,0 +1,78 @@
+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("zzcx_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 diagnosis;
+
+    /**
+     * 医院名称
+     */
+    private String hospitalCode;
+
+    /**
+     * 访问者的IP
+     */
+    private String ip;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 166 - 0
zzcx-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("zzcx_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 +
+                "}";
+    }
+}

+ 60 - 0
zzcx-service/src/main/java/com/diagbot/entity/QuestionDetail.java

@@ -0,0 +1,60 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 标签明细表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+@Getter
+@Setter
+@TableName("zzcx_question_detail")
+public class QuestionDetail implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 客户端界面描述
+     */
+    private String description;
+
+    /**
+     * question_id
+     */
+    private Long questionId;
+
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 特殊类型
+     */
+    private Integer exclusion;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 120 - 0
zzcx-service/src/main/java/com/diagbot/entity/QuestionInfo.java

@@ -0,0 +1,120 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 标签基础表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+@Getter
+@Setter
+@TableName("zzcx_question_info")
+public class QuestionInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 内容
+     */
+    private String name;
+
+    /**
+     * 标签名
+     */
+    private String tagName;
+
+    /**
+     * 性别(1:男 2:女 3:通用)
+     */
+    private Integer sexType;
+
+    /**
+     * 最小年龄
+     */
+    private Integer ageBegin;
+
+    /**
+     * 最大年龄
+     */
+    private Integer ageEnd;
+
+    /**
+     * 类型
+     */
+    private Integer type;
+
+    /**
+     * 控件类型
+     */
+    private Integer controlType;
+
+    /**
+     * 元素类型
+     */
+    private Integer itemType;
+
+    /**
+     * 标签标识
+     */
+    private Integer tagType;
+
+
+    /**
+     * 前置内容
+     */
+    private String labelPrefix;
+
+    /**
+     * 后置内容
+     */
+    private String labelSuffix;
+
+    /**
+     * 客户端界面描述
+     */
+    private String description;
+
+    /**
+     * 图片url地址
+     */
+    private String url;
+
+    /**
+     * 特殊标记(0:没有标记,1:拼接到主诉)
+     */
+    private Integer specFlag;
+
+    /**
+     * 必填(0:不必填,1:必填)
+     */
+    private Integer required;
+
+    /**
+     * 详细阐述
+     */
+    private String explains;
+
+    /**
+     * 类型标记(1:时间类型,2:诱因类型,3:有无类型)
+     */
+    private String flag;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 80 - 0
zzcx-service/src/main/java/com/diagbot/entity/QuestionMapping.java

@@ -0,0 +1,80 @@
+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 2018-11-15
+ */
+@TableName("zzcx_question_mapping")
+public class QuestionMapping 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;
+
+    /**
+     * 上级question
+     */
+    private Long parentQuestion;
+
+    /**
+     * 下级question
+     */
+    private Long sonQuestion;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 互斥类型
+     */
+    private Integer exclusionType;
+
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 21 - 0
zzcx-service/src/main/java/com/diagbot/entity/wrapper/QuestionInfoWrapper.java

@@ -0,0 +1,21 @@
+package com.diagbot.entity.wrapper;
+
+import com.diagbot.entity.QuestionInfo;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 标签扩展表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+@Getter
+@Setter
+public class QuestionInfoWrapper extends QuestionInfo {
+    private Long parentQuestion; //父级问题ID
+    private Integer exclusionType; //互斥类型
+
+}

+ 81 - 0
zzcx-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
zzcx-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
zzcx-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 {
+
+}

+ 63 - 0
zzcx-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -0,0 +1,63 @@
+package com.diagbot.facade;
+
+import com.diagbot.entity.InquiryDetail;
+import com.diagbot.entity.InquiryInfo;
+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.HttpUtils;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.HospitalVO;
+import com.diagbot.vo.SaveInquiryVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/2/1 23:33
+ */
+@Component
+public class InquiryInfoFacade extends InquiryInfoServiceImpl {
+
+
+    @Autowired
+    OptInfoFacade optInfoFacade;
+
+    @Autowired
+    @Qualifier("inquiryDetailServiceImpl")
+    private InquiryDetailServiceImpl inquiryDetailService;
+
+    public void saveInquiry(SaveInquiryVO saveInquiryVO) {
+        if (StringUtil.isBlank(saveInquiryVO.getHospitalCode())) {
+            saveInquiryVO.setHospitalCode("朗通通用");
+        }
+        Date now = DateUtil.now();
+
+        InquiryInfo inquiryInfo = new InquiryInfo();
+        BeanUtil.copyProperties(saveInquiryVO, inquiryInfo);
+        inquiryInfo.setGmtCreate(now);
+        inquiryInfo.setGmtModified(now);
+        inquiryInfo.setIp(HttpUtils.getIpAddress());
+        save(inquiryInfo);
+
+        List<InquiryDetail> inquiryDetailList = BeanUtil.listCopyTo(saveInquiryVO.getDetailList(), InquiryDetail.class);
+        inquiryDetailList.forEach(i -> {
+            i.setInquiryId(inquiryInfo.getId());
+            i.setGmtCreate(now);
+            i.setGmtModified(now);
+        });
+        inquiryDetailService.saveBatch(inquiryDetailList);
+
+        HospitalVO hospitalVO = new HospitalVO();
+        hospitalVO.setHospitalCode(saveInquiryVO.getHospitalCode());
+        // 保存记录表
+        optInfoFacade.saveOptOnfo(hospitalVO, "2");
+    }
+
+}

+ 124 - 0
zzcx-service/src/main/java/com/diagbot/facade/OptInfoFacade.java

@@ -0,0 +1,124 @@
+package com.diagbot.facade;
+
+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.OptVO;
+import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @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 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 HospNameDTO getAllHospitalName(){
+        HospNameDTO hospNameDTO = new HospNameDTO();
+        List<String> hospitalList = optInfoFacade.getAllHospital();
+        if(ListUtil.isNotEmpty(hospitalList)){
+            hospNameDTO.setHospitalCode(hospitalList);
+        }
+        return hospNameDTO;
+    }
+}

+ 65 - 0
zzcx-service/src/main/java/com/diagbot/facade/QuestionDetailFacade.java

@@ -0,0 +1,65 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.QuestionDetail;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.QuestionDetailServiceImpl;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 标签业务层
+ * @author: zhoutg
+ * @time: 2018/8/6 9:11
+ */
+@Component
+public class QuestionDetailFacade extends QuestionDetailServiceImpl {
+
+
+    /**
+     * 根据id获取标签明细
+     *
+     * @param questionId 标签id
+     * @return 标签内容
+     */
+    public List<QuestionDetail> getByQuestionId(Long questionId) {
+        List<QuestionDetail> questionDetailList = new ArrayList<>();
+        if (questionId == null) {
+            return questionDetailList;
+        }
+        QueryWrapper queryWrapper = new QueryWrapper();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        queryWrapper.eq("question_id", questionId);
+        queryWrapper.orderByAsc("order_no");
+        questionDetailList = this.list(queryWrapper);
+        return questionDetailList;
+    }
+
+    /**
+     * 根据id获取标签明细
+     *
+     * @param questionIds 标签ids
+     * @return 标签内容
+     */
+    public Map<Long, List<QuestionDetail>> getByQuestionIds(List<Long> questionIds) {
+        Map<Long, List<QuestionDetail>> map = new LinkedHashMap<>();
+        if (ListUtil.isEmpty(questionIds)) {
+            return map;
+        }
+        QueryWrapper queryWrapper = new QueryWrapper();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        queryWrapper.in("question_id", questionIds);
+        queryWrapper.orderByAsc("question_id", "order_no");
+        List<QuestionDetail> questionDetailList = this.list(queryWrapper);
+        if (ListUtil.isNotEmpty(questionDetailList)) {
+            map = EntityUtil.makeEntityListMap(questionDetailList, "questionId");
+        }
+        return map;
+    }
+}

+ 227 - 0
zzcx-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -0,0 +1,227 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.QuestionDTO;
+import com.diagbot.entity.QuestionDetail;
+import com.diagbot.entity.QuestionInfo;
+import com.diagbot.entity.wrapper.QuestionInfoWrapper;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.QuestionInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.vo.QuestionIds2VO;
+import com.diagbot.vo.QuestionVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 标签业务层
+ * @author: zhoutg
+ * @time: 2018/8/6 9:11
+ */
+@Component
+public class QuestionFacade extends QuestionInfoServiceImpl {
+
+    @Autowired
+    QuestionDetailFacade questionDetailFacade;
+
+    /**
+     * 根据参数返回标签内容
+     *
+     * @param questionVO 获取标签内容参数
+     * @return 标签内容
+     */
+    public QuestionDTO getById(QuestionVO questionVO) {
+        Map paramMap = new HashMap<>();
+        paramMap.put("sexType", questionVO.getSexType());
+        paramMap.put("age", questionVO.getAge());
+        paramMap.put("id", questionVO.getId());
+        QuestionInfo questionInfo = this.getByParam(paramMap);
+        if (questionInfo == null) { //无数据直接返回,不通过报错的形式返回
+            return new QuestionDTO();
+        }
+        QuestionDTO res = new QuestionDTO();
+        BeanUtil.copyProperties(questionInfo, res);
+
+        if (questionInfo.getTagType().equals(1)) {
+            //获取明细项
+            List<QuestionDetail> questionDetailList = questionDetailFacade.getByQuestionId(questionVO.getId());
+            res.setQuestionDetailList(questionDetailList);
+        }
+
+        //获取子标签
+        List<QuestionInfoWrapper> questionMapping = this.getByQuestionMapping(paramMap);
+        List<QuestionDTO> sonQuestionList = BeanUtil.listCopyTo(questionMapping, QuestionDTO.class);
+        res.setQuestionMapping(sonQuestionList);
+        //获取子标签的明细项
+        if (ListUtil.isNotEmpty(sonQuestionList)) {
+            Map paramMap1 = new HashMap<>();
+            paramMap1.put("sexType", questionVO.getSexType());
+            paramMap1.put("age", questionVO.getAge());
+            List<Long> sonQuestionIds = sonQuestionList.stream()
+                    .map(artist -> artist.getId())
+                    .collect(Collectors.toList());
+            Map<Long, List<QuestionDetail>> sonQuestionMap = questionDetailFacade.getByQuestionIds(sonQuestionIds);
+            paramMap1.put("ids", sonQuestionIds);
+            //获取第二级子标签
+            List<QuestionInfoWrapper> questionMapping1 = this.getByQuestionMapping(paramMap1);
+            Map<Long, List<QuestionInfoWrapper>> qm1 =
+                    EntityUtil.makeEntityListMap(questionMapping1, "parentQuestion");
+            for (QuestionDTO bean : sonQuestionList) {
+                List<QuestionDetail> questionDetailList1 = sonQuestionMap.get(bean.getId());
+                if (ListUtil.isEmpty(questionDetailList1)) {
+                    questionDetailList1 = new ArrayList<>();
+                }
+                bean.setQuestionDetailList(questionDetailList1);
+                List<QuestionDTO> sonQuestionList1 = new ArrayList<>();
+                if (ListUtil.isNotEmpty(qm1.get(bean.getId()))) {
+                    sonQuestionList1 = BeanUtil.listCopyTo(qm1.get(bean.getId()), QuestionDTO.class);
+                }
+                bean.setQuestionMapping(sonQuestionList1);
+
+                List<Long> sonQuestionIds1 = sonQuestionList1.stream()
+                        .map(artist -> artist.getId())
+                        .collect(Collectors.toList());
+                Map<Long, List<QuestionDetail>> sonQuestionMap1 = questionDetailFacade.getByQuestionIds(sonQuestionIds1);
+                for (QuestionDTO questionDTO : sonQuestionList1) {
+                    //获取二级子明细项
+                    List<QuestionDetail> questionDetailList2 = sonQuestionMap1.get(questionDTO.getId());
+                    if (ListUtil.isEmpty(questionDetailList2)) {
+                        questionDetailList2 = new ArrayList<>();
+                    }
+                    questionDTO.setQuestionDetailList(questionDetailList2);
+                }
+
+            }
+        }
+        return res;
+    }
+
+
+    /**
+     * 查询多个id返回标签内容
+     *
+     * @param questionIds2VO 获取标签内容参数
+     * @return 标签内容
+     */
+    public Map<Long, Object> getByIds(QuestionIds2VO questionIds2VO) {
+        Integer sexType = questionIds2VO.getSexType();
+        Integer age = questionIds2VO.getAge();
+        Map<Long, Object> data = new LinkedHashMap<>();
+        if (ListUtil.isEmpty(questionIds2VO.getIds())) {
+            return data;
+        }
+
+        Map paramMap = new HashMap<>();
+        paramMap.put("sexType", sexType);
+        paramMap.put("age", age);
+        paramMap.put("idList", questionIds2VO.getIds());
+
+        List<QuestionInfo> questionInfoList = this.getByParam2(paramMap);
+        List<Long> questionId = questionInfoList.stream().map(r -> r.getId()).collect(Collectors.toList());
+
+        // 获取第一层明细项
+        Map<Long, List<QuestionDetail>> detailMap = getQuestionDetailWithMap(questionInfoList.stream()
+                .filter(r -> r.getTagType() == 1).map(r -> r.getId()).collect(Collectors.toList()));
+
+        // 获取第二层mapping和明细项
+        List<Long> ques2 = new ArrayList<>();
+        Map<Long, List<QuestionInfoWrapper>> mapping2 = getQuestionMappingWithMap(sexType, age, questionId, ques2);
+        Map<Long, List<QuestionDetail>> detailMap2 = getQuestionDetailWithMap(ques2);
+
+        // 获取第三层mapping和明细项
+        List<Long> ques3 = new ArrayList<>();
+        Map<Long, List<QuestionInfoWrapper>> mapping3 = new HashMap<>();
+        Map<Long, List<QuestionDetail>> detailMap3 = new HashMap<>();
+        if (!ListUtil.isEmpty(ques2)) {
+            mapping3 = getQuestionMappingWithMap(sexType, age, ques2, ques3);
+            detailMap3 = getQuestionDetailWithMap(ques3);
+        }
+
+        for (QuestionInfo questionInfo : questionInfoList) {
+            QuestionDTO res = new QuestionDTO();
+            BeanUtil.copyProperties(questionInfo, res);
+            // 设置第一层明细
+            if (detailMap.get(res.getId()) != null) {
+                res.setQuestionDetailList(detailMap.get(res.getId()));
+            }
+
+            // 设置第二层mapping
+            List<QuestionInfoWrapper> w2 = mapping2.get(res.getId());
+            if (ListUtil.isNotEmpty(w2)) {
+                List<QuestionDTO> m2 = BeanUtil.listCopyTo(w2, QuestionDTO.class);
+                res.setQuestionMapping(m2);
+                for (QuestionDTO q2 : m2) {
+                    // 设置第二层明细
+                    if (detailMap2.get(q2.getId()) != null) {
+                        q2.setQuestionDetailList(detailMap2.get(q2.getId()));
+                    }
+                    List<QuestionInfoWrapper> w3 = mapping3.get(q2.getId());
+                    if (ListUtil.isNotEmpty(w3)) {
+                        // 设置第三层mapping
+                        List<QuestionDTO> m3 = BeanUtil.listCopyTo(w3, QuestionDTO.class);
+                        q2.setQuestionMapping(m3);
+                        for (QuestionDTO q3 : m3) {
+                            // 设置第三层明细
+                            if (detailMap3.get(q3.getId()) != null) {
+                                q3.setQuestionDetailList(detailMap3.get(q3.getId()));
+                            }
+                        }
+                    }
+                }
+            }
+            data.put(res.getId(), res);
+        }
+        return data;
+    }
+
+
+    /**
+     * 根据questionIds获取明细
+     *
+     * @param questionIds
+     * @return
+     */
+    public Map<Long, List<QuestionDetail>> getQuestionDetailWithMap(List<Long> questionIds) {
+        if (ListUtil.isEmpty(questionIds)) {
+            return new LinkedHashMap<>();
+        }
+
+        List<QuestionDetail> detailList = questionDetailFacade.list(new QueryWrapper<QuestionDetail>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .in("question_id", questionIds)
+                .orderByAsc("order_no"));
+        Map<Long, List<QuestionDetail>> detailMap =
+                EntityUtil.makeEntityListMap(detailList, "questionId");
+        return detailMap;
+    }
+
+
+    /**
+     * 获取下级question
+     *
+     * @param sexType 性别
+     * @param age     年龄
+     * @param ids     列表
+     * @return
+     */
+    public Map getQuestionMappingWithMap(Integer sexType, Integer age, List<Long> ids, List<Long> mappIds) {
+        Map paramMap = new HashMap<>();
+        paramMap.put("sexType", sexType);
+        paramMap.put("age", age);
+        paramMap.put("ids", ids);
+        List<QuestionInfoWrapper> questionMapping1 = this.getByQuestionMapping(paramMap);
+        List<Long> list = questionMapping1.stream().map(r -> r.getId()).collect(Collectors.toList());
+        mappIds.addAll(list);
+        return EntityUtil.makeEntityListMap(questionMapping1, "parentQuestion");
+    }
+
+}

+ 197 - 0
zzcx-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 "";
+    }
+}

+ 16 - 0
zzcx-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> {
+
+}

+ 16 - 0
zzcx-service/src/main/java/com/diagbot/mapper/InquiryInfoMapper.java

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

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

@@ -0,0 +1,53 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.PVDTO;
+import com.diagbot.dto.PVHospDTO;
+import com.diagbot.dto.PVHospSumDTO;
+import com.diagbot.dto.UVDTO;
+import com.diagbot.dto.UVHospDTO;
+import com.diagbot.dto.UVHospSumDTO;
+import com.diagbot.dto.ZZDTO;
+import com.diagbot.dto.ZZHospDTO;
+import com.diagbot.dto.ZZHospSumDTO;
+import com.diagbot.entity.OptInfo;
+import com.diagbot.vo.OptVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 操作信息 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-02
+ */
+public interface OptInfoMapper extends BaseMapper<OptInfo> {
+    List<PVDTO> getPV(OptVO optVO);
+
+    Long getPVSum(OptVO optVO);
+
+    List<UVDTO> getUV(OptVO optVO);
+
+    Long getUVSum(OptVO optVO);
+
+    List<ZZDTO> getZZ(OptVO optVO);
+
+    Long getZZSum(OptVO optVO);
+
+    //医院合计
+    List<PVHospDTO> getPVHosp(OptVO optVO);
+
+    List<PVHospSumDTO> getPVSumHosp(OptVO optVO);
+
+    List<UVHospDTO> getUVHosp(OptVO optVO);
+
+    List<UVHospSumDTO> getUVSumHosp(OptVO optVO);
+
+    List<ZZHospDTO> getZZHosp(OptVO optVO);
+
+    List<ZZHospSumDTO> getZZSumHosp(OptVO optVO);
+
+    List<String> getAllHospital();
+}

+ 16 - 0
zzcx-service/src/main/java/com/diagbot/mapper/QuestionDetailMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.QuestionDetail;
+
+/**
+ * <p>
+ * 标签明细表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+public interface QuestionDetailMapper extends BaseMapper<QuestionDetail> {
+
+}

+ 48 - 0
zzcx-service/src/main/java/com/diagbot/mapper/QuestionInfoMapper.java

@@ -0,0 +1,48 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.QuestionInfo;
+import com.diagbot.entity.wrapper.QuestionInfoWrapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 标签基础表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
+
+
+    /**
+     * 根据参数获取标签信息
+     *
+     * @param map 参数
+     * @return
+     */
+    public QuestionInfo getByParam(Map map);
+
+
+    /**
+     * 根据参数获取标签信息
+     *
+     * @param map 参数
+     * @return
+     */
+    public List<QuestionInfo> getByParam2(Map map);
+
+
+    /**
+     * 根据questionMapping获取标签信息
+     *
+     * @param map 参数
+     * @return
+     */
+    public List<QuestionInfoWrapper> getByQuestionMapping(Map map);
+
+
+}

+ 16 - 0
zzcx-service/src/main/java/com/diagbot/mapper/QuestionMappingMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.QuestionMapping;
+
+/**
+ * <p>
+ * 标签映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+public interface QuestionMappingMapper extends BaseMapper<QuestionMapping> {
+
+}

+ 23 - 0
zzcx-service/src/main/java/com/diagbot/rabbit/MyProcessor.java

@@ -0,0 +1,23 @@
+package com.diagbot.rabbit;
+
+import org.springframework.cloud.stream.annotation.Input;
+import org.springframework.cloud.stream.annotation.Output;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.messaging.SubscribableChannel;
+
+/**
+ * @Description: 自定义Stream发布和消费对象
+ * @author: gaodm
+ * @time: 2018/8/29 13:39
+ */
+public interface MyProcessor {
+
+    String INPUT_LOG = "inputLog";
+    String OUTPUT_LOG = "outputLog";
+
+    @Input(INPUT_LOG)
+    SubscribableChannel inputLog();
+
+    @Output(OUTPUT_LOG)
+    MessageChannel outputLog();
+}

+ 27 - 0
zzcx-service/src/main/java/com/diagbot/rabbit/MySender.java

@@ -0,0 +1,27 @@
+package com.diagbot.rabbit;
+
+import com.diagbot.biz.log.entity.SysLog;
+import com.diagbot.util.GsonUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.cloud.stream.annotation.EnableBinding;
+import org.springframework.integration.support.MessageBuilder;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 发布者
+ * @author: gaodm
+ * @time: 2018/8/29 13:41
+ */
+@Component
+@EnableBinding({ MyProcessor.class })
+public class MySender {
+    @Autowired
+    @Qualifier("outputLog")
+    MessageChannel outputLog;
+
+    public void outputLogSend(SysLog sysLog) {
+        outputLog.send(MessageBuilder.withPayload(GsonUtil.toJson(sysLog)).build());
+    }
+}

+ 16 - 0
zzcx-service/src/main/java/com/diagbot/service/InquiryDetailService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.InquiryDetail;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 问诊记录-明细表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-01
+ */
+public interface InquiryDetailService extends IService<InquiryDetail> {
+
+}

+ 16 - 0
zzcx-service/src/main/java/com/diagbot/service/InquiryInfoService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.InquiryInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 问诊记录-主表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-01
+ */
+public interface InquiryInfoService extends IService<InquiryInfo> {
+
+}

+ 55 - 0
zzcx-service/src/main/java/com/diagbot/service/OptInfoService.java

@@ -0,0 +1,55 @@
+package com.diagbot.service;
+
+import com.diagbot.dto.PVDTO;
+import com.diagbot.dto.PVHospDTO;
+import com.diagbot.dto.PVHospSumDTO;
+import com.diagbot.dto.UVDTO;
+import com.diagbot.dto.UVHospDTO;
+import com.diagbot.dto.UVHospSumDTO;
+import com.diagbot.dto.ZZDTO;
+import com.diagbot.dto.ZZHospDTO;
+import com.diagbot.dto.ZZHospSumDTO;
+import com.diagbot.entity.OptInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.vo.OptVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 操作信息 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-02
+ */
+public interface OptInfoService extends IService<OptInfo> {
+
+    List<PVDTO> getPV(OptVO optVO);
+
+    Long getPVSum(OptVO optVO);
+
+    List<UVDTO> getUV(OptVO optVO);
+
+    Long getUVSum(OptVO optVO);
+
+    List<ZZDTO> getZZ(OptVO optVO);
+
+    Long getZZSum(OptVO optVO);
+
+    //医院合计
+    List<PVHospDTO> getPVHosp(OptVO optVO);
+
+    List<PVHospSumDTO> getPVSumHosp(OptVO optVO);
+
+    List<UVHospDTO> getUVHosp(OptVO optVO);
+
+    List<UVHospSumDTO> getUVSumHosp(OptVO optVO);
+
+    List<ZZHospDTO> getZZHosp(OptVO optVO);
+
+    List<ZZHospSumDTO> getZZSumHosp(OptVO optVO);
+
+    List<String> getAllHospital();
+
+}

+ 16 - 0
zzcx-service/src/main/java/com/diagbot/service/QuestionDetailService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.QuestionDetail;
+
+/**
+ * <p>
+ * 标签明细表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+public interface QuestionDetailService extends IService<QuestionDetail> {
+
+}

+ 40 - 0
zzcx-service/src/main/java/com/diagbot/service/QuestionInfoService.java

@@ -0,0 +1,40 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.QuestionInfo;
+import com.diagbot.entity.wrapper.QuestionInfoWrapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 标签基础表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+public interface QuestionInfoService extends IService<QuestionInfo> {
+
+    /**
+     * 根据参数获取标签信息
+     *
+     * @param map 参数
+     * @return
+     */
+    public QuestionInfo getByParam(Map map);
+
+
+    public List<QuestionInfo> getByParam2(Map map);
+
+
+    /**
+     * 根据questionMapping获取标签信息
+     *
+     * @param map 参数
+     * @return
+     */
+    public List<QuestionInfoWrapper> getByQuestionMapping(Map map);
+
+}

+ 16 - 0
zzcx-service/src/main/java/com/diagbot/service/QuestionMappingService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.QuestionMapping;
+
+/**
+ * <p>
+ * 标签映射表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+public interface QuestionMappingService extends IService<QuestionMapping> {
+
+}

+ 20 - 0
zzcx-service/src/main/java/com/diagbot/service/impl/InquiryDetailServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.InquiryDetail;
+import com.diagbot.mapper.InquiryDetailMapper;
+import com.diagbot.service.InquiryDetailService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 问诊记录-明细表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-01
+ */
+@Service
+public class InquiryDetailServiceImpl extends ServiceImpl<InquiryDetailMapper, InquiryDetail> implements InquiryDetailService {
+
+}

+ 20 - 0
zzcx-service/src/main/java/com/diagbot/service/impl/InquiryInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.InquiryInfo;
+import com.diagbot.mapper.InquiryInfoMapper;
+import com.diagbot.service.InquiryInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 问诊记录-主表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-01
+ */
+@Service
+public class InquiryInfoServiceImpl extends ServiceImpl<InquiryInfoMapper, InquiryInfo> implements InquiryInfoService {
+
+}

+ 83 - 0
zzcx-service/src/main/java/com/diagbot/service/impl/OptInfoServiceImpl.java

@@ -0,0 +1,83 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.PVDTO;
+import com.diagbot.dto.PVHospDTO;
+import com.diagbot.dto.PVHospSumDTO;
+import com.diagbot.dto.UVDTO;
+import com.diagbot.dto.UVHospDTO;
+import com.diagbot.dto.UVHospSumDTO;
+import com.diagbot.dto.ZZDTO;
+import com.diagbot.dto.ZZHospDTO;
+import com.diagbot.dto.ZZHospSumDTO;
+import com.diagbot.entity.OptInfo;
+import com.diagbot.mapper.OptInfoMapper;
+import com.diagbot.service.OptInfoService;
+import com.diagbot.vo.OptVO;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 操作信息 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-02
+ */
+@Service
+public class OptInfoServiceImpl extends ServiceImpl<OptInfoMapper, OptInfo> implements OptInfoService {
+    public List<PVDTO> getPV(OptVO optVO) {
+        return this.baseMapper.getPV(optVO);
+    }
+
+    public Long getPVSum(OptVO optVO) {
+        return this.baseMapper.getPVSum(optVO);
+    }
+
+    public List<UVDTO> getUV(OptVO optVO) {
+        return this.baseMapper.getUV(optVO);
+    }
+
+    public Long getUVSum(OptVO optVO) {
+        return this.baseMapper.getUVSum(optVO);
+    }
+
+    public List<ZZDTO> getZZ(OptVO optVO) {
+        return this.baseMapper.getZZ(optVO);
+    }
+
+    public Long getZZSum(OptVO optVO) {
+        return this.baseMapper.getZZSum(optVO);
+    }
+
+    //医院合计
+    public List<PVHospDTO> getPVHosp(OptVO optVO) {
+        return this.baseMapper.getPVHosp(optVO);
+    }
+
+    public List<PVHospSumDTO> getPVSumHosp(OptVO optVO) {
+        return this.baseMapper.getPVSumHosp(optVO);
+    }
+
+    public List<UVHospDTO> getUVHosp(OptVO optVO) {
+        return this.baseMapper.getUVHosp(optVO);
+    }
+
+    public List<UVHospSumDTO> getUVSumHosp(OptVO optVO) {
+        return this.baseMapper.getUVSumHosp(optVO);
+    }
+
+    public List<ZZHospDTO> getZZHosp(OptVO optVO) {
+        return this.baseMapper.getZZHosp(optVO);
+    }
+
+    public List<ZZHospSumDTO> getZZSumHosp(OptVO optVO) {
+        return this.baseMapper.getZZSumHosp(optVO);
+    }
+
+    public List<String> getAllHospital(){
+        return this.baseMapper.getAllHospital();
+    }
+}

+ 20 - 0
zzcx-service/src/main/java/com/diagbot/service/impl/QuestionDetailServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.QuestionDetail;
+import com.diagbot.mapper.QuestionDetailMapper;
+import com.diagbot.service.QuestionDetailService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 标签明细表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+@Service
+public class QuestionDetailServiceImpl extends ServiceImpl<QuestionDetailMapper, QuestionDetail> implements QuestionDetailService {
+
+}

+ 39 - 0
zzcx-service/src/main/java/com/diagbot/service/impl/QuestionInfoServiceImpl.java

@@ -0,0 +1,39 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.QuestionInfo;
+import com.diagbot.entity.wrapper.QuestionInfoWrapper;
+import com.diagbot.mapper.QuestionInfoMapper;
+import com.diagbot.service.QuestionInfoService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 标签基础表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+@Service
+public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, QuestionInfo> implements QuestionInfoService {
+
+    @Override
+    public QuestionInfo getByParam(Map map) {
+        return baseMapper.getByParam(map);
+    }
+
+    @Override
+    public List<QuestionInfo> getByParam2(Map map) {
+        return baseMapper.getByParam2(map);
+    }
+
+    @Override
+    public List<QuestionInfoWrapper> getByQuestionMapping(Map map) {
+        return baseMapper.getByQuestionMapping(map);
+    }
+
+}

+ 20 - 0
zzcx-service/src/main/java/com/diagbot/service/impl/QuestionMappingServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.QuestionMapping;
+import com.diagbot.mapper.QuestionMappingMapper;
+import com.diagbot.service.QuestionMappingService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 标签映射表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+@Service
+public class QuestionMappingServiceImpl extends ServiceImpl<QuestionMappingMapper, QuestionMapping> implements QuestionMappingService {
+
+}

+ 17 - 0
zzcx-service/src/main/java/com/diagbot/vo/HospitalVO.java

@@ -0,0 +1,17 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/5 12:44
+ */
+@Getter
+@Setter
+public class HospitalVO {
+    //医院编码
+    //    @NotBlank(message = "请输入医院信息")
+    private String hospitalCode = "朗通通用";
+}

+ 28 - 0
zzcx-service/src/main/java/com/diagbot/vo/OptVO.java

@@ -0,0 +1,28 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:21
+ */
+@Getter
+@Setter
+public class OptVO {
+    //医院名称
+    private String hospitalCode;
+    //开始时间
+    @ApiModelProperty(value="开始时间,格式为:2018-11-28 17:25:30")
+    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
+    private Date startDate;
+    //结束时间
+    @ApiModelProperty(value="结束时间,格式为:2018-11-28 17:25:30")
+    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
+    private Date endDate;
+}

+ 19 - 0
zzcx-service/src/main/java/com/diagbot/vo/QuestionIds2VO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2018/8/6 10:16
+ */
+@Getter
+@Setter
+public class QuestionIds2VO {
+    private List<Long> ids;
+    private Integer sexType;
+    private Integer age;
+}

+ 17 - 0
zzcx-service/src/main/java/com/diagbot/vo/QuestionVO.java

@@ -0,0 +1,17 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2018/8/6 10:16
+ */
+@Getter
+@Setter
+public class QuestionVO {
+    private Long id;
+    private Integer sexType;
+    private Integer age;
+}

+ 26 - 0
zzcx-service/src/main/java/com/diagbot/vo/SaveInquiryDetailVO.java

@@ -0,0 +1,26 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author rengb
+ * @Description
+ * @time 2018年11月23日下午2:29:43
+ */
+@Getter
+@Setter
+public class SaveInquiryDetailVO {
+
+    /**
+     * 问题
+     */
+    private String question;
+
+    /**
+     * 答案
+     */
+    private String answer;
+
+
+}

+ 45 - 0
zzcx-service/src/main/java/com/diagbot/vo/SaveInquiryVO.java

@@ -0,0 +1,45 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value = "问诊记录保存接口传参")
+@Getter
+@Setter
+public class SaveInquiryVO {
+
+    //医院名称
+//    @NotBlank(message = "请输入医院信息")
+    private String hospitalCode;
+
+    /**
+     * 访问者的IP
+     */
+    @ApiModelProperty(value = "访问者的IP", hidden = true)
+    private String ip;
+
+    /**
+     * 诊断
+     */
+    @ApiModelProperty(value = "诊断", required = true)
+    private String diagnosis;
+
+
+    /**
+     * 问诊明细
+     */
+    @Valid
+    @ApiModelProperty(value = "问诊明细", required = true)
+    private List<SaveInquiryDetailVO> detailList;
+
+}

+ 19 - 0
zzcx-service/src/main/java/com/diagbot/vo/WeixinVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:21
+ */
+@Getter
+@Setter
+public class WeixinVO {
+    private String url;
+}

+ 42 - 0
zzcx-service/src/main/java/com/diagbot/web/InquiryInfoController.java

@@ -0,0 +1,42 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SaveInquiryDTO;
+import com.diagbot.facade.InquiryInfoFacade;
+import com.diagbot.vo.SaveInquiryVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * @author zhoutg
+ * @since 2018-11-23
+ */
+@RestController
+@RequestMapping("/inquiryInfo")
+@Api(value = "问诊记录API", tags = { "问诊-问诊记录API" })
+@SuppressWarnings("unchecked")
+public class InquiryInfoController {
+
+    @Autowired
+    private InquiryInfoFacade inquiryInfoFacade;
+
+    @ApiOperation(value = "问诊记录保存[by:zhoutg]")
+    @PostMapping("/saveInquiry")
+    @SysLogger("saveInquiry")
+    @Transactional
+    public RespDTO<Boolean> saveInquiry(@RequestBody SaveInquiryVO saveInquiryVO) {
+        inquiryInfoFacade.saveInquiry(saveInquiryVO);
+        return RespDTO.onSuc(true);
+    }
+
+
+}

+ 72 - 0
zzcx-service/src/main/java/com/diagbot/web/OptInfoController.java

@@ -0,0 +1,72 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.HospNameDTO;
+import com.diagbot.dto.OptDTO;
+import com.diagbot.dto.OptHospDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.OptInfoFacade;
+import com.diagbot.vo.HospitalVO;
+import com.diagbot.vo.OptVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 操作信息 前端控制器
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-02-02
+ */
+@RestController
+@Api(value = "操作记录", tags = { "操作记录API" })
+@SuppressWarnings("unchecked")
+@RequestMapping("/optInfo")
+public class OptInfoController {
+    @Autowired
+    private OptInfoFacade optInfoFacade;
+
+    @ApiOperation(value = "操作记录保存[by:gaodm]")
+    @PostMapping("/saveOptInfo")
+    @SysLogger("saveOptInfo")
+    @Transactional
+    public RespDTO<Boolean> saveOptOnfo(@RequestBody HospitalVO hospitalVO) {
+        return RespDTO.onSuc(optInfoFacade.saveOptOnfo(hospitalVO, "1"));
+    }
+
+    @ApiOperation(value = "获取合计数据不带医院名称[by:gaodm]",
+            notes = "hospitalCode: 医院名称,String<br>" +
+                    "startDate: 开始时间,Date<br>" +
+                    "endDate: 结束时间,Date<br>")
+    @PostMapping("/getOptSum")
+    @SysLogger("getOptSum")
+    public RespDTO<OptDTO> getOptSum(@RequestBody OptVO optVO) {
+        return RespDTO.onSuc(optInfoFacade.getOptSum(optVO));
+    }
+
+
+    @ApiOperation(value = "获取合计数据带医院名称[by:gaodm]",
+            notes = "hospitalCode: 医院名称,String<br>" +
+                    "startDate: 开始时间,Date<br>" +
+                    "endDate: 结束时间,Date<br>")
+    @PostMapping("/getOptSumHosp")
+    @SysLogger("getOptSumHosp")
+    public RespDTO<OptHospDTO> getOptSumHosp(@RequestBody OptVO optVO) {
+        return RespDTO.onSuc(optInfoFacade.getOptSumHosp(optVO));
+    }
+
+    @ApiOperation(value = "获取所有医院名称[by:gaodm]",
+            notes = "")
+    @PostMapping("/getAllHospitalName")
+    @SysLogger("getAllHospitalName")
+    public RespDTO<HospNameDTO> getAllHospitalName() {
+        return RespDTO.onSuc(optInfoFacade.getAllHospitalName());
+    }
+}

+ 58 - 0
zzcx-service/src/main/java/com/diagbot/web/QuestionInfoController.java

@@ -0,0 +1,58 @@
+//package com.diagbot.web;
+//
+//
+//import com.diagbot.dto.QuestionDTO;
+//import com.diagbot.dto.RespDTO;
+//import com.diagbot.facade.QuestionFacade;
+//import com.diagbot.vo.QuestionIds2VO;
+//import com.diagbot.vo.QuestionVO;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.PostMapping;
+//import org.springframework.web.bind.annotation.RequestBody;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.util.Map;
+//
+///**
+// * <p>
+// * 标签基础表 前端控制器
+// * </p>
+// *
+// * @author zhoutg
+// * @since 2018-11-15
+// */
+//@RequestMapping("/zzcx-questionInfo")
+//@RestController
+//@Api(value = "标签相关API", tags = { "自测程序-标签相关API" })
+//@SuppressWarnings("unchecked")
+//public class QuestionInfoController {
+//
+//    @Autowired
+//    QuestionFacade questionFacade;
+//
+//    @ApiOperation(value = "自诊程序-根据参数返回标签内容[by:zhoutg]",
+//            notes = "id: questionId<br>" +
+//                    "sexType:性别,1:男,2:女<br>" +
+//                    "age:年龄")
+//    @PostMapping("/getById")
+//    public RespDTO<QuestionDTO> getById(@RequestBody QuestionVO questionVO) {
+//        QuestionDTO data = questionFacade.getById(questionVO);
+//        return RespDTO.onSuc(data);
+//    }
+//
+//
+//    @ApiOperation(value = "智能程序-查询多个id优化[by:zhoutg]",
+//            notes = "ids: 多个questionId<br>" +
+//                    "sexType:性别,1:男,2:女<br>" +
+//                    "age:年龄")
+//    @PostMapping("/getByIds")
+//    public RespDTO<Map<Long, Object>> getByIds(@RequestBody QuestionIds2VO questionIds2VO) {
+//        Map<Long, Object> data = questionFacade.getByIds(questionIds2VO);
+//        return RespDTO.onSuc(data);
+//    }
+//
+//
+//}

+ 67 - 0
zzcx-service/src/main/java/com/diagbot/web/ViewController.java

@@ -0,0 +1,67 @@
+package com.diagbot.web;
+
+import com.diagbot.dto.OptDTO;
+import com.diagbot.dto.OptHospDTO;
+import com.diagbot.facade.OptInfoFacade;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.OptVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/7 13:17
+ */
+@Controller
+public class ViewController {
+    @Autowired
+    private OptInfoFacade optInfoFacade;
+
+    @RequestMapping("/view/indexlantone")
+    public String indexlantone(Map<String, Object> map, String hospitalCode) {
+        Date now = DateUtil.now();
+        OptVO optVO = new OptVO();
+        if (StringUtil.isNotBlank(hospitalCode)) {
+            optVO.setHospitalCode(hospitalCode);
+        }
+        optVO.setStartDate(DateUtil.addDay(now, -60));
+        optVO.setEndDate(now);
+        OptDTO optDTO = optInfoFacade.getOptSum(optVO);
+        map.put("pvSum", optDTO.getPvSum());
+        map.put("pvdto", optDTO.getPvdto());
+        map.put("uvSum", optDTO.getUvSum());
+        map.put("uvdto", optDTO.getUvdto());
+        map.put("zzSum", optDTO.getZzSum());
+        map.put("zzdto", optDTO.getZzdto());
+
+        return "index_lantong";
+    }
+
+    @RequestMapping("/view/indexall")
+    public String indexall(Map<String, Object> map, String hospitalCode) {
+        Date now = DateUtil.now();
+        OptVO optVO = new OptVO();
+        if (StringUtil.isNotBlank(hospitalCode)) {
+            optVO.setHospitalCode(hospitalCode);
+        }
+        optVO.setStartDate(DateUtil.addDay(now, -60));
+        optVO.setEndDate(now);
+        OptHospDTO optHospDTO = optInfoFacade.getOptSumHosp(optVO);
+        map.put("pvSum", optHospDTO.getPvSum());
+        map.put("pvHospDto", optHospDTO.getPvHospDto());
+        map.put("pvHospSumDto", optHospDTO.getPvHospSumDto());
+        map.put("uvSum", optHospDTO.getUvSum());
+        map.put("uvHospDto", optHospDTO.getUvHospDto());
+        map.put("uvHospSumDto", optHospDTO.getUvHospSumDto());
+        map.put("zzSum", optHospDTO.getZzSum());
+        map.put("zzHospDto", optHospDTO.getZzHospDto());
+        map.put("zzHospSumDto", optHospDTO.getZzHospSumDto());
+        return "index_all";
+    }
+}

+ 61 - 0
zzcx-service/src/main/java/com/diagbot/web/WeXinJsSdkController.java

@@ -0,0 +1,61 @@
+package com.diagbot.web;
+
+import com.diagbot.dto.RespDTO;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.bean.WxJsapiSignature;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.mp.api.WxMpService;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/5 18:03
+ */
+@AllArgsConstructor
+@RestController
+@Api(value = "微信验证", tags = { "微信验证API" })
+@SuppressWarnings("unchecked")
+@Slf4j
+@RequestMapping("jssdk/{appid}")
+public class WeXinJsSdkController {
+
+    private final WxMpService wxMpService;
+
+    @RequestMapping(value = "/config", method = RequestMethod.GET)
+    public RespDTO<WxJsapiSignature> wxJsSdkConfig(HttpServletRequest request, @PathVariable String appid, String url) {
+        if (!this.wxMpService.switchover(appid)) {
+            throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid));
+        }
+
+        try { // 直接调用wxMpServer 接口
+            WxJsapiSignature wxJsapiSignature = wxMpService.createJsapiSignature(url);
+            log.info("createJsapiSignature被调用了~~~");
+            return RespDTO.onSuc(wxJsapiSignature);
+        } catch (WxErrorException e) {
+            return null;
+        }
+    }
+
+    @RequestMapping(value = "/ticket", method = RequestMethod.GET)
+    public RespDTO<String> wxjsapiTicket(HttpServletRequest request, @PathVariable String appid) {
+        if (!this.wxMpService.switchover(appid)) {
+            throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid));
+        }
+
+        try { // 直接调用wxMpServer 接口
+            String jsapiTicket = wxMpService.getJsapiTicket();
+            return RespDTO.onSuc(jsapiTicket);
+        } catch (WxErrorException e) {
+            return null;
+        }
+    }
+
+}

+ 69 - 0
zzcx-service/src/main/java/com/diagbot/web/WexinController.java

@@ -0,0 +1,69 @@
+package com.diagbot.web;
+
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.WeixinFacade;
+import com.diagbot.vo.WeixinVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Enumeration;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2020/2/6 10:48
+ */
+@RestController
+@Api(value = "微信", tags = { "微信API" })
+@SuppressWarnings("unchecked")
+@RequestMapping("/weixin")
+@Slf4j
+public class WexinController {
+
+    @Autowired
+    WeixinFacade weixinFacade;
+
+    @GetMapping("/getConfig")
+    public RespDTO<Map> getConfig(HttpServletRequest request) {
+        WeixinVO weixinVO = new WeixinVO();
+        weixinVO.setUrl(request.getParameter("url"));
+        Map<String, String> map = weixinFacade.getConfig(weixinVO);
+        return RespDTO.onSuc(map);
+    }
+
+    @RequestMapping(value = "/test", method = RequestMethod.GET, produces = { "application/json;charset=utf-8" })
+    @ApiOperation(value = "测试微信公众号的接口配置信息", notes = "接口配置信息", httpMethod = "GET")
+    public String getWxUserInfo(HttpServletRequest request,
+                                @ApiParam(value = "微信求的 echostr") String echostr
+    ) {
+        try {
+            Map<String, String> map = new LinkedHashMap<>();
+            //只需要把微信请求的 echostr, 返回给微信就可以了
+            log.info("测试来过===================" + echostr);
+            Enumeration pNames = request.getParameterNames();
+            while (pNames.hasMoreElements()) {
+                String name = (String) pNames.nextElement();
+                String value = request.getParameter(name);
+                map.put(name, value);
+            }
+            log.info(map.toString());
+            return echostr;
+        } catch (Exception e) {
+            log.info("测试微信公众号的接口配置信息发生异常:", e);
+            return null;
+        }
+    }
+}

+ 43 - 0
zzcx-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,43 @@
+spring:
+  application:
+    name: zzcx-service
+  cloud:
+    config:
+      #uri: http://${myuri}:8769
+      fail-fast: true
+      discovery:
+        enabled: true
+        serviceId: config-server
+  profiles:
+    active: local
+
+  freemarker:
+    allow-request-override: false
+    cache: true
+    check-template-location: true
+    charset: utf-8
+    content-type: text/html
+    expose-request-attributes: false
+    expose-session-attributes: false
+    expose-spring-macro-helpers: false
+    suffix: .ftl
+    template-loader-path: classpath:/templates/
+
+eureka:
+  client:
+    serviceUrl:
+      defaultZone: http://${myuri}:8761/eureka/
+
+wx:
+  mp:
+    configs:
+    - appId: wxedd53be102996426
+      secret: c164e280950342f166a933dd7aa6daf7
+      token: testwxshare123
+      aesKey:
+    - appId: 2222 (另一个公众号的appid,以下同上)
+      secret: 1111
+      token: 111
+      aesKey: 111
+
+myuri: localhost

+ 316 - 0
zzcx-service/src/main/resources/logback-spring.xml

@@ -0,0 +1,316 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <!-- 项目名称 -->
+    <property name="APPDIR" value="zzcx-service"/>
+    <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
+    <property name="LOG_PATH" value="../logs"/>
+
+    <!-- 彩色日志 -->
+    <!-- 彩色日志依赖的渲染类 -->
+    <conversionRule conversionWord="clr"
+                    converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
+    <conversionRule conversionWord="wex"
+                    converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
+    <conversionRule conversionWord="wEx"
+                    converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
+    <!-- 彩色日志格式 -->
+    <!--<property name="CONSOLE_LOG_PATTERN"-->
+    <!--value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(-&#45;&#45;){faint} %clr([%15.15t]){faint} %clr(%logger){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>-->
+    <!--包名输出缩进对齐-->
+    <property name="CONSOLE_LOG_PATTERN"
+              value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+
+    <!--  日志记录器,日期滚动记录
+            ERROR 级别
+     -->
+    <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文件的路径及文件名 -->
+        <file>${LOG_PATH}/${APPDIR}/${APPDIR}_error.log</file>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 归档的日志文件的路径,例如今天是1992-11-06日志,当前写的日志文件路径为file节点指定,
+            可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
+            而1992-11-06的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
+            <fileNamePattern>${LOG_PATH}/${APPDIR}/error/${APPDIR}-error-%d{yyyy-MM-dd}.%i.log
+            </fileNamePattern>
+            <!--  保留日志天数 -->
+            <maxHistory>30</maxHistory>
+            <!-- 除按日志记录之外,还配置了日志文件不能超过10MB,若超过10MB,日志文件会以索引0开始,
+            命名日志文件,例如log-error-1992-11-06.0.log -->
+            <timeBasedFileNamingAndTriggeringPolicy
+                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <!-- 追加方式记录日志 -->
+        <append>true</append>
+        <!-- 日志文件的格式 -->
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level --- [%thread] %logger Line:%-3L - %msg%n
+            </pattern>
+            <charset>utf-8</charset>
+        </encoder>
+        <!-- 此日志文件记录error级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>error</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+
+    <!-- 日志记录器,日期滚动记录
+            WARN  级别
+     -->
+    <appender name="WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文件的路径及文件名 -->
+        <file>${LOG_PATH}/${APPDIR}/${APPDIR}_warn.log</file>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 归档的日志文件的路径,例如今天1992-11-06日志,当前写的日志文件路径为file节点指定,
+            可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
+            而1992-11-06的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
+            <fileNamePattern>${LOG_PATH}/${APPDIR}/warn/${APPDIR}-warn-%d{yyyy-MM-dd}.%i.log
+            </fileNamePattern>
+            <!--  保留日志天数 -->
+            <maxHistory>15</maxHistory>
+            <!-- 除按日志记录之外,还配置了日志文件不能超过10MB,若超过10MB,日志文件会以索引0开始,
+            命名日志文件,例如log-warn-1992-11-06.0.log -->
+            <timeBasedFileNamingAndTriggeringPolicy
+                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <!-- 追加方式记录日志 -->
+        <append>true</append>
+        <!-- 日志文件的格式 -->
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level --- [%thread] %logger Line:%-3L - %msg%n
+            </pattern>
+            <charset>utf-8</charset>
+        </encoder>
+        <!-- 此日志文件只记录warn级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>warn</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+
+    <!-- 日志记录器,日期滚动记录
+            INFO  级别
+    -->
+    <appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文件的路径及文件名 -->
+        <file>${LOG_PATH}/${APPDIR}/${APPDIR}_info.log</file>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 归档的日志文件的路径,例如今天是1992-11-06日志,当前写的日志文件路径为file节点指定,
+            可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
+            而1992-11-06的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
+            <fileNamePattern>${LOG_PATH}/${APPDIR}/info/${APPDIR}-info-%d{yyyy-MM-dd}.%i.log
+            </fileNamePattern>
+            <!--  保留日志天数 -->
+            <maxHistory>15</maxHistory>
+            <!-- 除按日志记录之外,还配置了日志文件不能超过10MB,若超过10MB,日志文件会以索引0开始,
+            命名日志文件,例如log-info-1992-11-06.0.log -->
+            <timeBasedFileNamingAndTriggeringPolicy
+                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <!-- 追加方式记录日志 -->
+        <append>true</append>
+        <!-- 日志文件的格式 -->
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level --- [%thread] %logger Line:%-3L - %msg%n
+            </pattern>
+            <charset>utf-8</charset>
+        </encoder>
+        <!-- 此日志文件只记录info级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>info</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+
+    <!-- 日志记录器,日期滚动记录
+            DEBUG  级别
+    -->
+    <appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文件的路径及文件名 -->
+        <file>${LOG_PATH}/${APPDIR}/${APPDIR}_debug.log</file>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 归档的日志文件的路径,例如今天是1992-11-06日志,当前写的日志文件路径为file节点指定,
+            可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。
+            而1992-11-06的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
+            <fileNamePattern>${LOG_PATH}/${APPDIR}/debug/${APPDIR}-debug-%d{yyyy-MM-dd}.%i.log
+            </fileNamePattern>
+            <!--  保留日志天数 -->
+            <maxHistory>15</maxHistory>
+            <!-- 除按日志记录之外,还配置了日志文件不能超过10MB,若超过10MB,日志文件会以索引0开始,
+            命名日志文件,例如log-debug-1992-11-06.0.log -->
+            <timeBasedFileNamingAndTriggeringPolicy
+                    class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <!-- 追加方式记录日志 -->
+        <append>true</append>
+        <!-- 日志文件的格式 -->
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level --- [%thread] %logger Line:%-3L - %msg%n
+            </pattern>
+            <charset>utf-8</charset>
+        </encoder>
+        <!-- 此日志文件只记录debug级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>debug</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!-- ConsoleAppender 控制台输出日志 -->
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <!--encoder 默认配置为PatternLayoutEncoder-->
+        <encoder>
+            <pattern>${CONSOLE_LOG_PATTERN}</pattern>
+            <!--<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level -&#45;&#45; [%thread] %logger Line:%-3L - %msg%n</pattern>-->
+            <charset>utf-8</charset>
+        </encoder>
+        <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>debug</level>
+        </filter>
+    </appender>
+
+
+    <!--&lt;!&ndash;输出到mysql数据库的appender配置     &ndash;&gt;-->
+    <!--<appender name="db" class="ch.qos.logback.classic.db.DBAppender">-->
+    <!--<connectionSource-->
+    <!--class="ch.qos.logback.core.db.DriverManagerConnectionSource">-->
+    <!--<driverClass>com.mysql.cj.jdbc.Driver</driverClass>-->
+    <!--<url>jdbc:mysql://120.77.222.42:3306/logback_member?characterEncoding=utf8</url>-->
+    <!--<user>root</user>-->
+    <!--<password>a123456789</password>-->
+    <!--</connectionSource>-->
+    <!--</appender>-->
+
+    <!-- FrameworkServlet日志-->
+    <logger name="org.springframework" level="WARN"/>
+
+    <!-- mybatis日志打印-->
+    <logger name="org.apache.ibatis" level="DEBUG"/>
+    <logger name="java.sql" level="DEBUG"/>
+
+    <!--  项目 mapper 路径
+            console控制台显示sql语句:STDOUT.filter.level -> debug级别
+    -->
+    <logger name="com.diagbot.mapper" level="DEBUG"/>
+
+    <appender name="LOGSTASHDEV" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
+        <destination>192.168.2.236:5044</destination>
+        <!-- encoder必须配置,有多种可选 -->
+        <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
+            <customFields>{"appname":"zzcx-service"}</customFields>
+        </encoder>
+    </appender>
+
+    <appender name="LOGSTASHTEST" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
+        <destination>192.168.2.241:5044</destination>
+        <!-- encoder必须配置,有多种可选 -->
+        <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
+            <customFields>{"appname":"zzcx-service"}</customFields>
+        </encoder>
+    </appender>
+
+    <appender name="LOGSTASHPRE" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
+        <destination>192.168.2.121:5044</destination>
+        <!-- encoder必须配置,有多种可选 -->
+        <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
+            <customFields>{"appname":"zzcx-service"}</customFields>
+        </encoder>
+    </appender>
+
+    <appender name="LOGSTASHPRO" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
+        <destination>192.168.2.122:5044</destination>
+        <!-- encoder必须配置,有多种可选 -->
+        <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
+            <customFields>{"appname":"zzcx-service"}</customFields>
+        </encoder>
+    </appender>
+
+    <!-- 本地环境下的日志配置 -->
+    <springProfile name="local">
+        <root level="INFO">
+            <appender-ref ref="ERROR"/>
+            <appender-ref ref="WARN"/>
+            <appender-ref ref="INFO"/>
+            <appender-ref ref="DEBUG"/>
+            <appender-ref ref="STDOUT"/>
+        </root>
+    </springProfile>
+
+    <!-- 开发环境下的日志配置 -->
+    <springProfile name="dev">
+        <root level="INFO">
+            <appender-ref ref="ERROR"/>
+            <appender-ref ref="WARN"/>
+            <appender-ref ref="INFO"/>
+            <appender-ref ref="DEBUG"/>
+            <appender-ref ref="STDOUT"/>
+            <appender-ref ref="LOGSTASHDEV"/>
+        </root>
+    </springProfile>
+
+    <!-- 测试环境下的日志配置 -->
+    <springProfile name="test">
+        <root level="INFO">
+            <appender-ref ref="ERROR"/>
+            <appender-ref ref="WARN"/>
+            <appender-ref ref="INFO"/>
+            <appender-ref ref="DEBUG"/>
+            <appender-ref ref="STDOUT"/>
+            <appender-ref ref="LOGSTASHTEST"/>
+        </root>
+    </springProfile>
+
+    <!-- 预发布环境下的日志配置 -->
+    <springProfile name="pre">
+        <root level="INFO">
+            <appender-ref ref="ERROR"/>
+            <appender-ref ref="WARN"/>
+            <appender-ref ref="INFO"/>
+            <appender-ref ref="DEBUG"/>
+            <appender-ref ref="STDOUT"/>
+            <appender-ref ref="LOGSTASHPRE"/>
+        </root>
+    </springProfile>
+
+    <!-- 生产环境下的日志配置 -->
+    <springProfile name="pro">
+        <root level="INFO">
+            <appender-ref ref="ERROR"/>
+            <appender-ref ref="WARN"/>
+            <appender-ref ref="INFO"/>
+            <appender-ref ref="DEBUG"/>
+            <appender-ref ref="STDOUT"/>
+            <appender-ref ref="LOGSTASHPRO"/>
+        </root>
+    </springProfile>
+
+    <springProfile name="tzsl">
+        <root level="INFO">
+            <appender-ref ref="ERROR"/>
+            <appender-ref ref="WARN"/>
+            <appender-ref ref="INFO"/>
+            <appender-ref ref="DEBUG"/>
+            <appender-ref ref="STDOUT"/>
+        </root>
+    </springProfile>
+</configuration>

+ 19 - 0
zzcx-service/src/main/resources/mapper/InquiryDetailMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.InquiryDetailMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.InquiryDetail">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="inquiry_id" property="inquiryId" />
+        <result column="question" property="question" />
+        <result column="answer" property="answer" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 0 - 0
zzcx-service/src/main/resources/mapper/InquiryInfoMapper.xml


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