Browse Source

Merge branch 'dev/zzcx20200202_init' into dev/znwz20200131_init

# Conflicts:
#	znwz-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java
gaodm 5 years ago
parent
commit
4e368b51a5
100 changed files with 5780 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. 25 0
      docs/030.20200208智能问诊等日志记录/znwz_add.sql
  17. 43 0
      docs/031.20200229自诊程序配置/init_zzcx.sql
  18. 1 0
      pom.xml
  19. 5 0
      znwz-service/pom.xml
  20. 88 0
      znwz-service/src/main/java/com/diagbot/aggregate/OptAggregate.java
  21. 106 0
      znwz-service/src/main/java/com/diagbot/aggregate/OptHospAggregate.java
  22. 18 0
      znwz-service/src/main/java/com/diagbot/dto/HospNameDTO.java
  23. 22 0
      znwz-service/src/main/java/com/diagbot/dto/OptDTO.java
  24. 25 0
      znwz-service/src/main/java/com/diagbot/dto/OptHospDTO.java
  25. 16 0
      znwz-service/src/main/java/com/diagbot/dto/PVDTO.java
  26. 18 0
      znwz-service/src/main/java/com/diagbot/dto/PVHospDTO.java
  27. 17 0
      znwz-service/src/main/java/com/diagbot/dto/PVHospSumDTO.java
  28. 16 0
      znwz-service/src/main/java/com/diagbot/dto/UVDTO.java
  29. 18 0
      znwz-service/src/main/java/com/diagbot/dto/UVHospDTO.java
  30. 17 0
      znwz-service/src/main/java/com/diagbot/dto/UVHospSumDTO.java
  31. 16 0
      znwz-service/src/main/java/com/diagbot/dto/ZZDTO.java
  32. 18 0
      znwz-service/src/main/java/com/diagbot/dto/ZZHospDTO.java
  33. 17 0
      znwz-service/src/main/java/com/diagbot/dto/ZZHospSumDTO.java
  34. 121 0
      znwz-service/src/main/java/com/diagbot/entity/OptInfo.java
  35. 16 0
      znwz-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java
  36. 125 0
      znwz-service/src/main/java/com/diagbot/facade/OptInfoFacade.java
  37. 53 0
      znwz-service/src/main/java/com/diagbot/mapper/OptInfoMapper.java
  38. 55 0
      znwz-service/src/main/java/com/diagbot/service/OptInfoService.java
  39. 83 0
      znwz-service/src/main/java/com/diagbot/service/impl/OptInfoServiceImpl.java
  40. 67 0
      znwz-service/src/main/java/com/diagbot/vo/OptSaveVO.java
  41. 28 0
      znwz-service/src/main/java/com/diagbot/vo/OptVO.java
  42. 69 0
      znwz-service/src/main/java/com/diagbot/web/OptInfoController.java
  43. 363 0
      znwz-service/src/main/resources/mapper/OptInfoMapper.xml
  44. 25 0
      zzcx-service/.gitignore
  45. 205 0
      zzcx-service/pom.xml
  46. 36 0
      zzcx-service/src/main/java/com/diagbot/ZzcxServiceApplication.java
  47. 109 0
      zzcx-service/src/main/java/com/diagbot/aggregate/OptAggregate.java
  48. 106 0
      zzcx-service/src/main/java/com/diagbot/aggregate/OptHospAggregate.java
  49. 41 0
      zzcx-service/src/main/java/com/diagbot/aop/SysLoggerAspect.java
  50. 19 0
      zzcx-service/src/main/java/com/diagbot/config/CustomAccessTokenConverter.java
  51. 15 0
      zzcx-service/src/main/java/com/diagbot/config/GlobalMethodSecurityConfigurer.java
  52. 48 0
      zzcx-service/src/main/java/com/diagbot/config/JwtConfigurer.java
  53. 33 0
      zzcx-service/src/main/java/com/diagbot/config/MybatisPlusConfigurer.java
  54. 42 0
      zzcx-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  55. 70 0
      zzcx-service/src/main/java/com/diagbot/config/SwaggerConfigurer.java
  56. 81 0
      zzcx-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  57. 29 0
      zzcx-service/src/main/java/com/diagbot/config/security/UrlConfigAttribute.java
  58. 79 0
      zzcx-service/src/main/java/com/diagbot/config/security/UrlFilterSecurityInterceptor.java
  59. 40 0
      zzcx-service/src/main/java/com/diagbot/config/security/UrlMetadataSourceService.java
  60. 47 0
      zzcx-service/src/main/java/com/diagbot/config/wx/WxMpConfiguration.java
  61. 46 0
      zzcx-service/src/main/java/com/diagbot/config/wx/WxMpProperties.java
  62. 22 0
      zzcx-service/src/main/java/com/diagbot/dto/HospItemDTO.java
  63. 18 0
      zzcx-service/src/main/java/com/diagbot/dto/HospNameDTO.java
  64. 22 0
      zzcx-service/src/main/java/com/diagbot/dto/OptDTO.java
  65. 25 0
      zzcx-service/src/main/java/com/diagbot/dto/OptHospDTO.java
  66. 16 0
      zzcx-service/src/main/java/com/diagbot/dto/PVDTO.java
  67. 18 0
      zzcx-service/src/main/java/com/diagbot/dto/PVHospDTO.java
  68. 17 0
      zzcx-service/src/main/java/com/diagbot/dto/PVHospSumDTO.java
  69. 38 0
      zzcx-service/src/main/java/com/diagbot/dto/QuestionDTO.java
  70. 24 0
      zzcx-service/src/main/java/com/diagbot/dto/SaveInquiryDTO.java
  71. 71 0
      zzcx-service/src/main/java/com/diagbot/dto/SysSetDTO.java
  72. 16 0
      zzcx-service/src/main/java/com/diagbot/dto/UVDTO.java
  73. 18 0
      zzcx-service/src/main/java/com/diagbot/dto/UVHospDTO.java
  74. 17 0
      zzcx-service/src/main/java/com/diagbot/dto/UVHospSumDTO.java
  75. 16 0
      zzcx-service/src/main/java/com/diagbot/dto/ZZDTO.java
  76. 18 0
      zzcx-service/src/main/java/com/diagbot/dto/ZZHospDTO.java
  77. 17 0
      zzcx-service/src/main/java/com/diagbot/dto/ZZHospSumDTO.java
  78. 169 0
      zzcx-service/src/main/java/com/diagbot/entity/InquiryDetail.java
  79. 78 0
      zzcx-service/src/main/java/com/diagbot/entity/InquiryInfo.java
  80. 166 0
      zzcx-service/src/main/java/com/diagbot/entity/OptInfo.java
  81. 60 0
      zzcx-service/src/main/java/com/diagbot/entity/QuestionDetail.java
  82. 120 0
      zzcx-service/src/main/java/com/diagbot/entity/QuestionInfo.java
  83. 80 0
      zzcx-service/src/main/java/com/diagbot/entity/QuestionMapping.java
  84. 169 0
      zzcx-service/src/main/java/com/diagbot/entity/SysSet.java
  85. 21 0
      zzcx-service/src/main/java/com/diagbot/entity/wrapper/QuestionInfoWrapper.java
  86. 81 0
      zzcx-service/src/main/java/com/diagbot/exception/CommonExceptionHandler.java
  87. 39 0
      zzcx-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java
  88. 14 0
      zzcx-service/src/main/java/com/diagbot/facade/InquiryDetailFacade.java
  89. 63 0
      zzcx-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java
  90. 199 0
      zzcx-service/src/main/java/com/diagbot/facade/OptInfoFacade.java
  91. 65 0
      zzcx-service/src/main/java/com/diagbot/facade/QuestionDetailFacade.java
  92. 227 0
      zzcx-service/src/main/java/com/diagbot/facade/QuestionFacade.java
  93. 36 0
      zzcx-service/src/main/java/com/diagbot/facade/SysSetFacade.java
  94. 197 0
      zzcx-service/src/main/java/com/diagbot/facade/WeixinFacade.java
  95. 16 0
      zzcx-service/src/main/java/com/diagbot/mapper/InquiryDetailMapper.java
  96. 16 0
      zzcx-service/src/main/java/com/diagbot/mapper/InquiryInfoMapper.java
  97. 61 0
      zzcx-service/src/main/java/com/diagbot/mapper/OptInfoMapper.java
  98. 16 0
      zzcx-service/src/main/java/com/diagbot/mapper/QuestionDetailMapper.java
  99. 48 0
      zzcx-service/src/main/java/com/diagbot/mapper/QuestionInfoMapper.java
  100. 0 0
      zzcx-service/src/main/java/com/diagbot/mapper/QuestionMappingMapper.java

+ 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"),
     PRECMAN_SERVICE(18, "precman-service"),
     MRQCMAN_SERVICE(19, "mrqcman-service"),
-    ZNWZ_SERVICE(21, "znwz-service");
+    ZNWZ_SERVICE(21, "znwz-service"),
+    ZZCX_SERVICE(22, "zzcx-service");
 
     @Setter
     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:
         #        - SwaggerHeaderFilter
         - StripPrefix=2
-
+      - id: zzcx-service
+        uri: lb://zzcx-service
+        predicates:
+        - Path=/api/zzcx/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
+      - id: zzcxtzsl-service
+        uri: lb://zzcxtzsl-service
+        predicates:
+        - Path=/api/zzcxtzsl/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
 server:
   port: 5050
 

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

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

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

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

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

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

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

@@ -142,6 +142,13 @@ spring:
         filters:
         #        - SwaggerHeaderFilter
         - StripPrefix=2
+      - id: zzcx-service
+        uri: lb://zzcx-service
+        predicates:
+        - Path=/api/zzcx/**
+        filters:
+        #        - SwaggerHeaderFilter
+        - StripPrefix=2
 
 server:
   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='自诊记录-明细表';
+
+
+

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

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

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

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

+ 1 - 0
pom.xml

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

+ 5 - 0
znwz-service/pom.xml

@@ -154,6 +154,11 @@
             <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>io.github.lvyahui8</groupId>
+            <artifactId>spring-boot-data-aggregator-starter</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 88 - 0
znwz-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
znwz-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);
+    }
+}

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

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

+ 121 - 0
znwz-service/src/main/java/com/diagbot/entity/OptInfo.java

@@ -0,0 +1,121 @@
+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
+ */
+@Getter
+@Setter
+@TableName("znwz_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;
+
+    /**
+     * 公众号appid
+     */
+    private String appId;
+
+    /**
+     * 医院名称
+     */
+    private String organName;
+
+    /**
+     * 医生所在科室名称
+     */
+    private String department;
+
+    /**
+     * 医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医生名称
+     */
+    private String doctorName;
+
+    /**
+     * 用户ID
+     */
+    private String mpiId;
+
+    /**
+     * 用户名称
+     */
+    private String patientName;
+
+    /**
+     * 用户年龄
+     */
+    private Integer patientAge;
+
+    /**
+     * 用户性别
+     */
+    private String patientSex;
+
+    /**
+     * 链接来源 (链接来源 (1:问诊2:挂号3:自诊))
+     */
+    private String source;
+
+}

+ 16 - 0
znwz-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -5,6 +5,7 @@ import com.diagbot.entity.Client;
 import com.diagbot.entity.InquiryDetail;
 import com.diagbot.entity.InquiryInfo;
 import com.diagbot.entity.JSONResponseBean;
+import com.diagbot.entity.OptInfo;
 import com.diagbot.entity.Request;
 import com.diagbot.entity.Response;
 import com.diagbot.exception.CommonErrorCode;
@@ -13,6 +14,7 @@ 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.FastJsonUtils;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.SaveInquiryVO;
@@ -49,6 +51,9 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
     @Value("${nali.appSecret}")
     private String appSecret;
 
+    @Autowired
+    private OptInfoFacade optInfoFacade;
+
     public SaveInquiryDTO saveInquiry(SaveInquiryVO saveInquiryVO) {
         SaveInquiryDTO saveInquiryDTO = new SaveInquiryDTO();
         List<String> naliRetList = getUrl(saveInquiryVO);
@@ -77,6 +82,17 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         });
         inquiryDetailService.saveBatch(inquiryDetailList);
 
+        saveInquiryDTO.setBody(retUrl);
+
+        //记录日志
+        OptInfo optInfo = new OptInfo();
+        BeanUtil.copyProperties(saveInquiryVO, optInfo);
+        optInfo.setGmtModified(now);
+        optInfo.setGmtCreate(now);
+        optInfo.setIp(HttpUtils.getIpAddress());
+        optInfo.setSource(saveInquiryVO.getFrom());
+        optInfo.setOptType("2");
+        optInfoFacade.save(optInfo);
         return saveInquiryDTO;
     }
 

+ 125 - 0
znwz-service/src/main/java/com/diagbot/facade/OptInfoFacade.java

@@ -0,0 +1,125 @@
+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.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.HttpUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.OptSaveVO;
+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(OptSaveVO optSaveVO, String optType) {
+        OptInfo optInfo = new OptInfo();
+        BeanUtil.copyProperties(optSaveVO, optInfo);
+        Date now = DateUtil.now();
+        optInfo.setGmtModified(now);
+        optInfo.setGmtCreate(now);
+        optInfo.setIp(HttpUtils.getIpAddress());
+        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;
+    }
+}

+ 53 - 0
znwz-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();
+}

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

@@ -0,0 +1,55 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+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>
+ * 操作信息 服务类
+ * </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();
+
+}

+ 83 - 0
znwz-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();
+    }
+}

+ 67 - 0
znwz-service/src/main/java/com/diagbot/vo/OptSaveVO.java

@@ -0,0 +1,67 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/5 12:44
+ */
+@Getter
+@Setter
+public class OptSaveVO {
+    //医院编码
+    //    @NotBlank(message = "请输入医院信息")
+    //    private String hospitalCode = "朗通通用";
+
+    /**
+     * 公众号appid
+     */
+    private String appId;
+
+    /**
+     * 医院名称
+     */
+    private String organName;
+
+    /**
+     * 医生所在科室名称
+     */
+    private String department;
+
+    /**
+     * 医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医生名称
+     */
+    private String doctorName;
+
+    /**
+     * 用户ID
+     */
+    private String mpiId;
+
+    /**
+     * 用户名称
+     */
+    private String patientName;
+
+    /**
+     * 用户年龄
+     */
+    private Integer patientAge;
+
+    /**
+     * 用户性别
+     */
+    private String patientSex;
+
+    /**
+     * 链接来源 (链接来源 (1:问诊2:挂号3:自诊))
+     */
+    private String source;
+}

+ 28 - 0
znwz-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;
+}

+ 69 - 0
znwz-service/src/main/java/com/diagbot/web/OptInfoController.java

@@ -0,0 +1,69 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.OptDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.OptInfoFacade;
+import com.diagbot.vo.OptSaveVO;
+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 OptSaveVO hospitalVO) {
+        return RespDTO.onSuc(optInfoFacade.saveOptOnfo(hospitalVO, "1"));
+    }
+
+    @ApiOperation(value = "获取合计数据不带医院名称[by:gaodm]",
+            notes = "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());
+//    }
+}

+ 363 - 0
znwz-service/src/main/resources/mapper/OptInfoMapper.xml

@@ -0,0 +1,363 @@
+<?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.OptInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.OptInfo">
+        <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="hospital_code" property="hospitalCode" />-->
+        <result column="app_id" property="appId" />
+        <result column="organ_name" property="organName" />
+        <result column="department" property="department" />
+        <result column="doctor_id" property="doctorId" />
+        <result column="doctor_name" property="doctorName" />
+        <result column="mpi_id" property="mpiId" />
+        <result column="patient_name" property="patientName" />
+        <result column="patient_age" property="patientAge" />
+        <result column="patient_sex" property="patientSex" />
+        <result column="ip" property="ip" />
+        <result column="opt_type" property="optType" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+    <select id="getPV" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.PVDTO">
+        SELECT
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        count(1) AS pvCnt
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 1
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+          <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+          AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+          AND gmt_create &lt;= #{endDate}
+        </if>
+        GROUP BY
+        DATE_FORMAT(gmt_create, '%Y-%m-%d')
+        ORDER BY
+        DATE_FORMAT(gmt_create, '%Y-%m-%d');
+    </select>
+
+    <select id="getPVSum" parameterType="com.diagbot.vo.OptVO" resultType="java.lang.Long">
+        SELECT
+        count(1) AS pvSum
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 1
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+    </select>
+
+    <select id="getUV" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.UVDTO">
+        SELECT
+        t.days AS days,
+        count(ip) AS uvCnt
+        FROM
+        (
+        SELECT DISTINCT
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 1
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        ) t
+        GROUP BY
+        days
+        ORDER BY
+        days;
+    </select>
+
+    <select id="getUVSum" parameterType="com.diagbot.vo.OptVO" resultType="java.lang.Long">
+        SELECT
+        count(ip) AS uvSum
+        FROM
+        (
+        SELECT DISTINCT
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 1
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        ) t;
+    </select>
+
+    <select id="getZZ" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.ZZDTO">
+        SELECT
+        t.days AS days,
+        count(ip) AS zzCnt
+        FROM
+        (
+        SELECT DISTINCT
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 2
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        ) t
+        GROUP BY
+        days
+        ORDER BY
+        days;
+    </select>
+
+    <select id="getZZSum" parameterType="com.diagbot.vo.OptVO" resultType="java.lang.Long">
+        SELECT
+        count(ip) AS zzSum
+        FROM
+        (
+        SELECT DISTINCT
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 2
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        ) t;
+    </select>
+
+    <!--按照医院合计-->
+    <select id="getPVHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.PVHospDTO">
+        SELECT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        count(1) AS pvCnt
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 1
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+--         AND hospital_code !='朗通通用'
+        GROUP BY
+        hospital_code,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d')
+        ORDER BY
+        hospital_code,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d');
+    </select>
+
+    <select id="getPVSumHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.PVHospSumDTO">
+        SELECT
+        hospital_code AS hospitalCode,
+        count(1) AS pvSum
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 1
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+--         AND hospital_code !='朗通通用'
+        GROUP BY
+        hospital_code
+        ORDER BY
+        pvSum desc;
+    </select>
+
+    <select id="getUVHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.UVHospDTO">
+        SELECT
+        t.hospitalCode AS hospitalCode,
+        t.days AS days,
+        count(ip) AS uvCnt
+        FROM
+        (
+        SELECT DISTINCT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 1
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+--         AND hospital_code !='朗通通用'
+        ) t
+        GROUP BY
+        hospitalCode,
+        days
+        ORDER BY
+        hospitalCode,
+        days;
+
+    </select>
+
+    <select id="getUVSumHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.UVHospSumDTO">
+        SELECT
+        t.hospitalCode AS hospitalCode,
+        count(ip) AS uvSum
+        FROM
+        (
+        SELECT DISTINCT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 1
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+--         AND hospital_code !='朗通通用'
+        ) t
+        GROUP BY
+        hospitalCode
+        ORDER BY
+        uvSum desc;
+    </select>
+
+    <select id="getZZHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.ZZHospDTO">
+        SELECT
+        t.hospitalCode AS hospitalCode,
+        t.days AS days,
+        count(ip) AS zzCnt
+        FROM
+        (
+        SELECT DISTINCT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 2
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+--         AND hospital_code !='朗通通用'
+        ) t
+        GROUP BY
+        hospitalCode,
+        days
+        ORDER BY
+        hospitalCode,
+        days;
+
+    </select>
+
+    <select id="getZZSumHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.ZZHospSumDTO">
+        SELECT
+        t.hospitalCode AS hospitalCode,
+        count(ip) AS zzSum
+        FROM
+        (
+        SELECT DISTINCT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        znwz_opt_info
+        WHERE
+        opt_type = 2
+        <!--<if test="hospitalCode != null and hospitalCode != ''">-->
+            <!--AND hospital_code = #{hospitalCode}-->
+        <!--</if>-->
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+--         AND hospital_code !='朗通通用'
+        ) t
+        GROUP BY
+        hospitalCode
+        ORDER BY
+        zzSum desc;
+    </select>
+
+    <select id="getAllHospital" resultType="java.lang.String">
+        SELECT DISTINCT(hospital_code) AS hospitalCode FROM `znwz_opt_info`;
+    </select>
+
+</mapper>

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

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

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

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

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

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

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

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

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

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

+ 169 - 0
zzcx-service/src/main/java/com/diagbot/entity/SysSet.java

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

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

@@ -0,0 +1,199 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.HospItemDTO;
+import com.diagbot.dto.HospNameDTO;
+import com.diagbot.dto.OptDTO;
+import com.diagbot.dto.OptHospDTO;
+import com.diagbot.entity.OptInfo;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.OptInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.HttpUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.HospitalVO;
+import com.diagbot.vo.OptHospPageVO;
+import com.diagbot.vo.OptHospVO;
+import com.diagbot.vo.OptVO;
+import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.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 OptDTO getOptSumNoDays(OptVO optVO) {
+        //入参验证
+        if (null != optVO && null != optVO.getStartDate()) {
+            optVO.setStartDate(DateUtil.getFirstTimeOfDay(optVO.getStartDate()));
+        }
+        if (null != optVO && null != optVO.getEndDate()) {
+            optVO.setEndDate(DateUtil.getLastTimeOfDay(optVO.getEndDate()));
+        }
+
+        if (null != optVO && null != optVO.getStartDate() && null != optVO.getEndDate()) {
+            if (DateUtil.after(optVO.getStartDate(), optVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+
+        //获取统计数据
+        OptDTO optDTO = new OptDTO();
+
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("optVO", optVO);
+            optDTO
+                    = dataBeanAggregateQueryFacade.get("getAllOptSumNoDays", invokeParams, OptDTO.class);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+        //        optDTO.setPvdto(this.getPV(optVO));
+        //        optDTO.setPvSum(this.getPVSum(optVO));
+        //        optDTO.setUvdto(this.getUV(optVO));
+        //        optDTO.setUvSum(this.getUVSum(optVO));
+        //        optDTO.setZzdto(this.getZZ(optVO));
+        //        optDTO.setZzSum(this.getZZSum(optVO));
+        return optDTO;
+    }
+
+
+    public OptHospDTO getOptSumHosp(OptVO optVO) {
+        //入参验证
+        if (null != optVO && null != optVO.getStartDate()) {
+            optVO.setStartDate(DateUtil.getFirstTimeOfDay(optVO.getStartDate()));
+        }
+        if (null != optVO && null != optVO.getEndDate()) {
+            optVO.setEndDate(DateUtil.getLastTimeOfDay(optVO.getEndDate()));
+        }
+
+        if (null != optVO && null != optVO.getStartDate() && null != optVO.getEndDate()) {
+            if (DateUtil.after(optVO.getStartDate(), optVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+
+        //获取统计数据
+        OptHospDTO optHospDTO = new OptHospDTO();
+
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("optVO", optVO);
+            optHospDTO
+                    = dataBeanAggregateQueryFacade.get("getAllOptSumHosp", invokeParams, OptHospDTO.class);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+
+        return optHospDTO;
+    }
+
+
+    public List<HospItemDTO> getOptSumHospNoDays(OptHospVO optHospVO) {
+        //入参验证
+        if (null != optHospVO && null != optHospVO.getStartDate()) {
+            optHospVO.setStartDate(DateUtil.getFirstTimeOfDay(optHospVO.getStartDate()));
+        }
+        if (null != optHospVO && null != optHospVO.getEndDate()) {
+            optHospVO.setEndDate(DateUtil.getLastTimeOfDay(optHospVO.getEndDate()));
+        }
+
+        if (null != optHospVO && null != optHospVO.getStartDate() && null != optHospVO.getEndDate()) {
+            if (DateUtil.after(optHospVO.getStartDate(), optHospVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+        return this.getHospitalPUZ(optHospVO);
+    }
+
+
+    public IPage<HospItemDTO> getOptSumHospNoDaysPageFac(OptHospPageVO optHospPageVO) {
+        //入参验证
+        if (null != optHospPageVO && null != optHospPageVO.getStartDate()) {
+            optHospPageVO.setStartDate(DateUtil.getFirstTimeOfDay(optHospPageVO.getStartDate()));
+        }
+        if (null != optHospPageVO && null != optHospPageVO.getEndDate()) {
+            optHospPageVO.setEndDate(DateUtil.getLastTimeOfDay(optHospPageVO.getEndDate()));
+        }
+
+        if (null != optHospPageVO && null != optHospPageVO.getStartDate() && null != optHospPageVO.getEndDate()) {
+            if (DateUtil.after(optHospPageVO.getStartDate(), optHospPageVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+        return getPageHospitalPUZ(optHospPageVO);
+    }
+
+    public HospNameDTO getAllHospitalName(){
+        HospNameDTO hospNameDTO = new HospNameDTO();
+        List<String> hospitalList = optInfoFacade.getAllHospital();
+        if(ListUtil.isNotEmpty(hospitalList)){
+            hospNameDTO.setHospitalCode(hospitalList);
+        }
+        return hospNameDTO;
+    }
+}

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

+ 36 - 0
zzcx-service/src/main/java/com/diagbot/facade/SysSetFacade.java

@@ -0,0 +1,36 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.SysSetDTO;
+import com.diagbot.entity.SysSet;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.SysSetServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.SysSetVO;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @date: 2020/2/9 12:04
+ * @version: V1.0
+ */
+@Component
+public class SysSetFacade extends SysSetServiceImpl {
+    public List<SysSetDTO> getSysSet(SysSetVO sysSetVO){
+        if (null != sysSetVO && StringUtil.isBlank(sysSetVO.getHospitalCode())){
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "医院编码不能为空!");
+        }
+        QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
+        sysSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_code",sysSetVO.getHospitalCode());
+        List<SysSet> sysSetList = this.list(sysSetQueryWrapper);
+        List<SysSetDTO> res = BeanUtil.listCopyTo(sysSetList, SysSetDTO.class);
+        return res;
+    }
+}

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

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

@@ -0,0 +1,61 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.HospItemDTO;
+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.OptHospPageVO;
+import com.diagbot.vo.OptHospVO;
+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();
+
+    List<HospItemDTO> getHospitalPUZ(OptHospVO optHospVO);
+
+    IPage<HospItemDTO> getPageHospitalPUZ(OptHospPageVO optHospPageVO);
+}

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

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


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