Browse Source

first commit

wangweiqun 6 years ago
commit
75f72006a1
32 changed files with 4084 additions and 0 deletions
  1. 1159 0
      ehr-cloud/pom.xml
  2. 606 0
      ehr-ms-parent-pom/pom.xml
  3. 187 0
      pom.xml
  4. 18 0
      src/main/java/com/yihu/ehr/analysis/LogCollection.java
  5. 12 0
      src/main/java/com/yihu/ehr/analysis/config/SchedulingConfig.java
  6. 101 0
      src/main/java/com/yihu/ehr/analysis/config/es/ElasticFactory.java
  7. 73 0
      src/main/java/com/yihu/ehr/analysis/config/kafka/KafkaConsumerConfig.java
  8. 48 0
      src/main/java/com/yihu/ehr/analysis/config/kafka/KafkaProducerConfig.java
  9. 48 0
      src/main/java/com/yihu/ehr/analysis/config/swagger/SwaggerConfig.java
  10. 11 0
      src/main/java/com/yihu/ehr/analysis/config/war/ServletInitializer.java
  11. 37 0
      src/main/java/com/yihu/ehr/analysis/controller/KafKaTest.java
  12. 88 0
      src/main/java/com/yihu/ehr/analysis/controller/QuotaController.java
  13. 29 0
      src/main/java/com/yihu/ehr/analysis/etl/BusinessTypeEnum.java
  14. 188 0
      src/main/java/com/yihu/ehr/analysis/etl/ETLConstantData.java
  15. 108 0
      src/main/java/com/yihu/ehr/analysis/etl/util/IdcardUtil.java
  16. 97 0
      src/main/java/com/yihu/ehr/analysis/listener/LabelDataListener.java
  17. 10 0
      src/main/java/com/yihu/ehr/analysis/listener/save/LogSaver.java
  18. 26 0
      src/main/java/com/yihu/ehr/analysis/listener/save/impl/ESLogSaver.java
  19. 23 0
      src/main/java/com/yihu/ehr/analysis/listener/save/impl/MongoLogSaver.java
  20. 183 0
      src/main/java/com/yihu/ehr/analysis/model/BusinessDataModel.java
  21. 93 0
      src/main/java/com/yihu/ehr/analysis/model/DataModel.java
  22. 141 0
      src/main/java/com/yihu/ehr/analysis/model/OperatorDataModel.java
  23. 31 0
      src/main/java/com/yihu/ehr/analysis/model/emun/BusinessType.java
  24. 98 0
      src/main/java/com/yihu/ehr/analysis/service/AppFeatureService.java
  25. 45 0
      src/main/java/com/yihu/ehr/analysis/service/AppService.java
  26. 49 0
      src/main/java/com/yihu/ehr/analysis/service/QuotaService.java
  27. 105 0
      src/main/java/com/yihu/ehr/analysis/util/ElasticsearchUtil.java
  28. 37 0
      src/main/resources/application.yml
  29. 29 0
      src/main/resources/banner.txt
  30. 23 0
      src/main/resources/bootstrap.yml
  31. 340 0
      src/main/resources/city.properties
  32. 41 0
      src/main/resources/quartz.properties

+ 1159 - 0
ehr-cloud/pom.xml

@ -0,0 +1,1159 @@
<?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.yihu.ehr</groupId>
    <artifactId>ehr-cloud</artifactId>
    <version>1.2.0</version>
    <packaging>pom</packaging>
    <name>ehr-cloud</name>
    <description>EHR parent pom for all</description>
    <url>http://ehr.yihu.com</url>
    <organization>
        <name>JKZL Software, Inc.</name>
        <url>http://www.yihu.com</url>
    </organization>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>sand</id>
            <name>Sand Wen</name>
            <email>sand.fj.wen@gmail.com</email>
            <organization>JKZL Software, Inc.</organization>
            <organizationUrl>http://www.yihu.com</organizationUrl>
            <roles>
                <role>Project lead</role>
                <role>Project designer</role>
                <role>Project programmer</role>
            </roles>
        </developer>
        <developer>
            <id>yzh</id>
            <name>叶泽华</name>
            <email>yzh@qq.com</email>
            <organization>JKZL Software, Inc.</organization>
            <organizationUrl>http://www.yihu.com</organizationUrl>
            <roles>
                <role>Project programmer</role>
            </roles>
        </developer>
        <developer>
            <id>cws</id>
            <name>陈维山</name>
            <email>hill9868@qq.com</email>
            <organization>JKZL Software, Inc.</organization>
            <organizationUrl>http://www.yihu.com</organizationUrl>
            <roles>
                <role>Project programmer</role>
            </roles>
        </developer>
        <developer>
            <id>hzy</id>
            <name>黄志勇</name>
            <email>hzy@qq.com</email>
            <organization>JKZL Software, Inc.</organization>
            <organizationUrl>http://www.yihu.com</organizationUrl>
            <roles>
                <role>Project programmer</role>
            </roles>
        </developer>
    </developers>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.spring-framework>4.3.13.RELEASE</version.spring-framework>
        <version.spring-boot>1.5.9.RELEASE</version.spring-boot>
        <version.spring-cloud-starter>1.3.2.RELEASE</version.spring-cloud-starter>
        <version.spring-cloud>1.4.2.RELEASE</version.spring-cloud>
        <version.spring-security>4.2.3.RELEASE</version.spring-security>
        <version.spring-oauth2>2.0.14.RELEASE</version.spring-oauth2>
        <version.spring-session>1.3.1.RELEASE</version.spring-session>
        <version.spring-session-hazelcast>2.0.1.RELEASE</version.spring-session-hazelcast>
        <version.spring-data-commons>1.13.9.RELEASE</version.spring-data-commons>
        <version.spring-data-hadoop>2.2.0.RELEASE</version.spring-data-hadoop>
        <version.spring-data-solr>2.1.3.RELEASE</version.spring-data-solr>
        <version.spring-data-redis>1.7.1.RELEASE</version.spring-data-redis>
        <version.spring-data-jpa>1.11.10.RELEASE</version.spring-data-jpa>
        <version.spring-kafka>1.0.5.RELEASE</version.spring-kafka>
        <version.commons-bean-utils>1.9.2</version.commons-bean-utils>
        <version.commons-codec>1.9</version.commons-codec>
        <version.commons-collections>3.2.1</version.commons-collections>
        <version.commons-compress>1.9</version.commons-compress>
        <version.commons-dbcp2>2.1.1</version.commons-dbcp2>
        <version.commons-dbutils>1.6</version.commons-dbutils>
        <version.commons-io>2.4</version.commons-io>
        <version.commons-lang3>3.2.1</version.commons-lang3>
        <version.commons-pool2>2.4.2</version.commons-pool2>
        <version.zookeeper>3.4.6</version.zookeeper>
        <version.hadoop-client>2.6.5</version.hadoop-client>
        <version.hbase-client>1.1.1</version.hbase-client>
        <version.solr>5.5.4</version.solr>
        <version.hibernate>4.3.11.Final</version.hibernate>
        <version.hibernate-validator>6.0.10.Final</version.hibernate-validator>
        <version.hibernate-jpa-api>1.0.0.Final</version.hibernate-jpa-api>
        <version.http-core>4.4.3</version.http-core>
        <version.http-client>4.5.1</version.http-client>
        <version.http-mime>4.5.1</version.http-mime>
        <version.io-dropwizard-metrics>3.1.2</version.io-dropwizard-metrics>
        <version.java>1.8</version.java>
        <version.jackson>2.6.6</version.jackson>
        <version.jedis>2.9.0</version.jedis>
        <version.jcl-over-slf4j>1.7.19</version.jcl-over-slf4j>
        <version.jul-over-slf4j>1.7.21</version.jul-over-slf4j>
        <version.joda-time>2.8.2</version.joda-time>
        <version.junit>4.12</version.junit>
        <version.logging>1.2</version.logging>
        <version.log4j>1.2.17</version.log4j>
        <version.log4j2>2.4.1</version.log4j2>
        <version.logback>1.1.7</version.logback>
        <version.mysql>5.1.45</version.mysql>
        <version.pinyin4j>2.5.0</version.pinyin4j>
        <version.quartz>2.2.3</version.quartz>
        <version.servlet-api>3.1.0</version.servlet-api>
        <version.slf4j>1.7.21</version.slf4j>
        <version.statsd-client>3.1.0</version.statsd-client>
        <version.swagger>2.7.0</version.swagger>
        <version.swagger-ui>2.7.0</version.swagger-ui>
        <version.thrift>0.9.1</version.thrift>
        <version.tomcat-embed>8.5.27</version.tomcat-embed>
        <version.websocket-api>1.1</version.websocket-api>
        <version.zip4j>1.3.2</version.zip4j>
        <version.poi>3.12</version.poi>
        <version.scala>2.10.6</version.scala>
        <version.elasticsearch>2.1.0</version.elasticsearch>
        <version.elasticsearch-sql>2.4.1.0</version.elasticsearch-sql>
        <version.jest>2.4.0</version.jest>
        <version.alibaba-druid>1.0.15</version.alibaba-druid>
        <version.feign>9.5.0</version.feign>
        <version.hystrix>1.5.10</version.hystrix>
        <version.archaius>0.7.5</version.archaius>
        <version.ehr>1.2.0</version.ehr>
        <version.eip>1.3.1</version.eip>
        <version.json>20160212</version.json>
        <version.json-lib>2.4</version.json-lib>
        <version.fastjson>1.2.17</version.fastjson>
        <version.commons-net>3.3</version.commons-net>
        <version.jxl>2.6</version.jxl>
        <version.fastdfs>1.27</version.fastdfs>
        <version.spring.boot.admin>1.5.7</version.spring.boot.admin>
        <version.jettison>1.3.7</version.jettison>
    </properties>
    <dependencyManagement>
        <dependencies>
            <!--<dependency>-->
                <!--<groupId>org.springframework.boot</groupId>-->
                <!--<artifactId>spring-boot-dependencies</artifactId>-->
                <!--<version>1.5.9.RELEASE</version>-->
                <!--<type>pom</type>-->
                <!--<scope>import</scope>-->
            <!--</dependency>-->
            <!--<dependency>-->
                <!--<groupId>org.springframework.cloud</groupId>-->
                <!--<artifactId>spring-cloud-dependencies</artifactId>-->
                <!--<version>Finchley.M5</version>-->
                <!--<type>pom</type>-->
                <!--<scope>import</scope>-->
            <!--</dependency>-->
            <!-- Base library-->
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>${version.servlet-api}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${version.junit}</version>
                <scope>test</scope>
            </dependency>
            <!-- Spring framework family -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aop</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aspects</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context-support</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-expression</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-messaging</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-orm</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-oxm</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>${version.spring-framework}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka -->
            <dependency>
                <groupId>org.springframework.kafka</groupId>
                <artifactId>spring-kafka</artifactId>
                <version>${version.spring-kafka}</version>
            </dependency>
            <!-- Spring boot family -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-actuator</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-autoconfigure</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-aop</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-redis</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-batch</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-jdbc</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-security</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-thymeleaf</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <version>${version.spring-boot}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-mongodb</artifactId>
                <version>${version.spring-boot}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Spring cloud family -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter</artifactId>
                <version>${version.spring-cloud-starter}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-config-server</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-archaius</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-config</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-eureka</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-eureka-server</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-netflix-eureka</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-feign</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-ribbon</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-zuul</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-hystrix</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
                <version>${version.spring-cloud}</version>
            </dependency>
            <!-- Feign -->
            <dependency>
                <groupId>io.github.openfeign</groupId>
                <artifactId>feign-core</artifactId>
                <version>${version.feign}</version>
            </dependency>
            <!-- Hystrix -->
            <dependency>
                <groupId>com.netflix.hystrix</groupId>
                <artifactId>hystrix-core</artifactId>
                <version>${version.hystrix}</version>
            </dependency>
            <!-- Archaius -->
            <dependency>
                <groupId>com.netflix.archaius</groupId>
                <artifactId>archaius-core</artifactId>
                <version>${version.archaius}</version>
            </dependency>
            <!-- Spring data family -->
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-commons</artifactId>
                <version>${version.spring-data-commons}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-hadoop-hbase</artifactId>
                <version>${version.spring-data-hadoop}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-solr</artifactId>
                <version>${version.spring-data-solr}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Spring session family-->
            <dependency>
                <groupId>org.springframework.session</groupId>
                <artifactId>spring-session-hazelcast</artifactId>
                <version>${version.spring-session-hazelcast}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.session</groupId>
                <artifactId>spring-session</artifactId>
                <version>${version.spring-session}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.session</groupId>
                <artifactId>spring-session-data-redis</artifactId>
                <version>${version.spring-session}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Spring Security -->
            <!--<dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-config</artifactId>
                <version>${version.spring-security}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-core</artifactId>
                <version>${version.spring-security}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-crypto</artifactId>
                <version>${version.spring-security}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-web</artifactId>
                <version>${version.spring-security}</version>
                <scope>${dependency.scope}</scope>
            </dependency>-->
            <!-- Oauth2 -->
            <dependency>
                <groupId>org.springframework.security.oauth</groupId>
                <artifactId>spring-security-oauth2</artifactId>
                <version>${version.spring-oauth2}</version>
                <scope>${dependency.scope}</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework.security</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!--Jackson library -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${version.jackson}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${version.jackson}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${version.jackson}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Http library -->
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpcore</artifactId>
                <version>${version.http-core}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${version.http-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpmime</artifactId>
                <version>${version.http-mime}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!--Apache commons library -->
            <dependency>
                <groupId>org.codehaus.woodstox</groupId>
                <artifactId>stax2-api</artifactId>
                <version>3.1.4</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.codehaus.woodstox</groupId>
                <artifactId>woodstox-core-asl</artifactId>
                <version>4.4.1</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.noggit</groupId>
                <artifactId>noggit</artifactId>
                <version>0.6</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${version.commons-lang3}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi</artifactId>
                <version>${version.poi}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>commons-beanutils</groupId>
                <artifactId>commons-beanutils</artifactId>
                <version>${version.commons-bean-utils}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-pool2</artifactId>
                <version>${version.commons-pool2}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>commons-dbutils</groupId>
                <artifactId>commons-dbutils</artifactId>
                <version>${version.commons-dbutils}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-dbcp2</artifactId>
                <version>${version.commons-dbcp2}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${version.commons-io}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>${version.commons-collections}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>${version.commons-codec}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>${version.commons-compress}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Mysql library -->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>${version.mysql}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Hibernate framework library -->
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>${version.hibernate}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>${version.hibernate-validator}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>${version.hibernate}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.hibernate.javax.persistence</groupId>
                <artifactId>hibernate-jpa-2.1-api</artifactId>
                <version>${version.hibernate-jpa-api}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Zookeeper library -->
            <dependency>
                <groupId>org.apache.zookeeper</groupId>
                <artifactId>zookeeper</artifactId>
                <version>${version.zookeeper}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Hadoop library -->
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-annotations</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-auth</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-common</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-distcp</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-hdfs</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-mapreduce-client-common</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-mapreduce-client-core</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-mapreduce-client-jobclient</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-mapreduce-client-shuffle</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-streaming</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-yarn-api</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-yarn-client</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-yarn-common</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-yarn-server-common</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-yarn-server-nodemanager</artifactId>
                <version>${version.hadoop-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.hbase</groupId>
                <artifactId>hbase-client</artifactId>
                <version>${version.hbase-client}</version>
                <scope>${dependency.scope}</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.hadoop</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.hbase</groupId>
                <artifactId>hbase-common</artifactId>
                <version>${version.hbase-client}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.hbase</groupId>
                <artifactId>hbase-protocol</artifactId>
                <version>${version.hbase-client}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!-- export library -->
            <dependency>
                <groupId>net.sourceforge.jexcelapi</groupId>
                <artifactId>jxl</artifactId>
                <version>${version.jxl}</version>
            </dependency>
            <!-- Google library -->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>18.0</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>3.0.1</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>2.6.2</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>2.5.0</version>
            </dependency>
            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>4.1.0</version>
            </dependency>
            <!-- Solr library -->
            <dependency>
                <groupId>org.apache.solr</groupId>
                <artifactId>solr-core</artifactId>
                <version>${version.solr}</version>
                <scope>${dependency.scope}</scope>
                <exclusions>
                    <exclusion>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.solr</groupId>
                <artifactId>solr-solrj</artifactId>
                <version>${version.solr}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!-- Elasticsearch -->
            <dependency>
                <groupId>org.elasticsearch</groupId>
                <artifactId>elasticsearch</artifactId>
                <version>${version.elasticsearch}</version>
            </dependency>
            <dependency>
                <groupId>org.nlpcn</groupId>
                <artifactId>elasticsearch-sql</artifactId>
                <version>${version.elasticsearch-sql}</version>
            </dependency>
            <!-- Jest -->
            <dependency>
                <groupId>io.searchbox</groupId>
                <artifactId>jest</artifactId>
                <version>${version.jest}</version>
            </dependency>
            <!-- Redis library -->
            <dependency>
                <groupId>redis.clients</groupId>
                <artifactId>jedis</artifactId>
                <version>${version.jedis}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- FastDFS library -->
            <dependency>
                <groupId>org.csource</groupId>
                <artifactId>fastdfs-client-java</artifactId>
                <version>${version.fastdfs}</version>
            </dependency>
            <!-- Quartz library -->
            <dependency>
                <groupId>org.quartz-scheduler</groupId>
                <artifactId>quartz</artifactId>
                <version>${version.quartz}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.quartz-scheduler</groupId>
                <artifactId>quartz-jobs</artifactId>
                <version>${version.quartz}</version>
            </dependency>
            <!-- Zip library -->
            <dependency>
                <groupId>net.lingala.zip4j</groupId>
                <artifactId>zip4j</artifactId>
                <version>${version.zip4j}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Pinyin library -->
            <dependency>
                <groupId>com.belerweb</groupId>
                <artifactId>pinyin4j</artifactId>
                <version>${version.pinyin4j}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Swagger-ui library -->
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger2</artifactId>
                <version>${version.swagger}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger-ui</artifactId>
                <version>${version.swagger-ui}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- date Time util library -->
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>${version.joda-time}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.thrift</groupId>
                <artifactId>libthrift</artifactId>
                <version>${version.thrift}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>com.timgroup</groupId>
                <artifactId>java-statsd-client</artifactId>
                <version>${version.statsd-client}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-core</artifactId>
                <version>${version.io-dropwizard-metrics}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Log framework library -->
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>${version.logging}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>${version.log4j}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${version.logback}</version>
                <scope>${dependency.scope}</scope>
            </dependency>
            <!-- Alibaba -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid</artifactId>
                <version>${version.alibaba-druid}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${version.fastjson}</version>
            </dependency>
            <!-- Spring Boot Admin -->
            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-starter-server</artifactId>
                <version>${version.spring.boot.admin}</version>
            </dependency>
            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-server-ui</artifactId>
                <version>${version.spring.boot.admin}</version>
            </dependency>
            <!-- Extend library-->
            <dependency>
                <groupId>org.codehaus.jettison</groupId>
                <artifactId>jettison</artifactId>
                <version>${version.jettison}</version>
            </dependency>
            <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>${version.json}</version>
            </dependency>
            <dependency>
                <groupId>net.sf.json-lib</groupId>
                <artifactId>json-lib</artifactId>
                <version>${version.json-lib}</version>
            </dependency>
            <dependency>
                <groupId>commons-net</groupId>
                <artifactId>commons-net</artifactId>
                <version>${version.commons-net}</version>
            </dependency>
            <!-- 个推相关 -->
            <dependency>
                <groupId>com.gexin.platform</groupId>
                <artifactId>gexin-rp-sdk-http</artifactId>
                <version>4.0.1.17</version>
            </dependency>
            <dependency>
                <groupId>com.gexin.platform</groupId>
                <artifactId>gexin-rp-fastjson</artifactId>
                <version>1.0.0.1</version>
            </dependency>
            <dependency>
                <groupId>com.gexin.platform</groupId>
                <artifactId>gexin-rp-sdk-base</artifactId>
                <version>4.0.0.22</version>
            </dependency>
            <dependency>
                <groupId>com.gexin.platform</groupId>
                <artifactId>gexin-rp-sdk-template</artifactId>
                <version>4.0.0.16</version>
            </dependency>
            <dependency>
                <groupId>com.gexin.platform</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>2.5.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <repositories>
        <repository>
            <id>public</id>
            <name>public</name>
            <url>http://172.19.103.43:8081/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>public</id>
            <name>public</name>
            <url>http://172.19.103.43:8081/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>2.10</version>
            </extension>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-http-lightweight</artifactId>
                <version>2.10</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>
            </plugin>
        </plugins>
    </build>
</project>

+ 606 - 0
ehr-ms-parent-pom/pom.xml

@ -0,0 +1,606 @@
<?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>
    <parent>
        <groupId>com.yihu.ehr</groupId>
        <artifactId>ehr-cloud</artifactId>
        <version>1.2.0</version>
        <relativePath>../ehr-cloud/pom.xml</relativePath>
    </parent>
    <artifactId>ehr-ms-parent-pom</artifactId>
    <packaging>pom</packaging>
    <description>EHR micro service parent pom</description>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jooq</groupId>
                    <artifactId>jooq-codegen-maven</artifactId>
                    <version>${jooq.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring-boot.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.5.1</version>
                    <configuration>
                        <recompressZippedFiles>false</recompressZippedFiles>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <version>2.9</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.18</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-help-plugin</artifactId>
                    <version>2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>2.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.3</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.doxia</groupId>
                            <artifactId>doxia-module-markdown</artifactId>
                            <version>1.5</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.9.1</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.3.2</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.2</version>
                </plugin>
                <plugin>
                    <groupId>pl.project13.maven</groupId>
                    <artifactId>git-commit-id-plugin</artifactId>
                    <version>2.1.11</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${version.spring-boot}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <executions>
                    <execution>
                        <id>checkstyle-validation</id>
                        <phase>validate</phase>
                        <configuration>
                            <skip>true</skip>
                            <configLocation>src/checkstyle/checkstyle.xml</configLocation>
                            <suppressionsLocation>src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
                            <headerLocation>src/checkstyle/checkstyle-header.txt</headerLocation>
                            <propertyExpansion>checkstyle.build.directory=${project.build.directory}</propertyExpansion>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>${version.java}</source>
                    <target>${version.java}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <id>enforce-rules</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[1.8,)</version>
                                </requireJavaVersion>
                                <!--<requireProperty>
                                    <property>main.basedir</property>
                                </requireProperty>-->
                                <!--<requireProperty>
                                    <property>project.organization.name</property>
                                </requireProperty>-->
                                <!--<requireProperty>
                                    <property>project.name</property>
                                </requireProperty>-->
                                <!--<requireProperty>
                                    <property>project.description</property>
                                </requireProperty>-->
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*Tests.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/Abstract*.java</exclude>
                    </excludes>
                    <!--<systemPropertyVariables>-->
                    <!--<java.security.egd>file:/dev/./urandom</java.security.egd>-->
                    <!--<java.awt.headless>true</java.awt.headless>-->
                    <!--</systemPropertyVariables>-->
                    <argLine>-Xmx1024m</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!--<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
                <configuration>
                    <skip>${disable.checks}</skip>
                    <signature>
                        <groupId>org.codehaus.mojo.signature</groupId>
                        <artifactId>java16</artifactId>
                        <version>1.0</version>
                    </signature>
                    <annotations>
                        <annotation>org.springframework.lang.UsesJava8</annotation>
                        <annotation>org.springframework.lang.UsesJava7</annotation>
                        <annotation>org.springframework.boot.lang.UsesUnsafeJava</annotation>
                    </annotations>
                </configuration>
                <executions>
                    <execution>
                        <id>enforce-java-6</id>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>-->
        </plugins>
    </build>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-admin-gateway-model</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-data-elasticsearch</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-data-fastdfs</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-data-hbase</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-data-mysql</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-data-query</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-data-redis</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-data-solr</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-ehr-constants</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-entity</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <!--<dependency>-->
            <!--<groupId>com.yihu.ehr</groupId>-->
            <!--<artifactId>commons-metrics</artifactId>-->
            <!--<version>${version.ehr}</version>-->
            <!--</dependency>-->
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-profile-core</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-redis-mq</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-rest-model</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.hos</groupId>
                <artifactId>common-rest-model</artifactId>
                <version>${version.eip}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-ui-swagger</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-util</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-web</artifactId>
                <version>${version.ehr}</version>
            </dependency>
            <!--<dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>commons-metrics</artifactId>
                <version>${version.ehr}</version>
            </dependency>-->
        </dependencies>
    </dependencyManagement>
    <!--
    profiles分为三种场景(dev,test,prod),三种部署模式(jar,war,docker).预计是9种模式,
    但目前仅使用到dev,test,prod的jar,test的war.若有需要可以组合配置这些部署模式.
    - dev的可执行jar包,在本机调试,不需要配置wagon参数。
    - test,prod的可执行jar包,需要在编译后传送到服务器上部署,故需配置wagon参数,参数可根据服务需要自行配置。
    - dev,test,prod的war包,编译后使用tomcat api部署,故需配置tomcat参数,参数可根据服务需要自行配置。
    -->
    <profiles>
        <profile>
            <id>dev-jar</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <skipTests>true</skipTests>
                <packaging.type>jar</packaging.type>
                <dependency.scope>compile</dependency.scope>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </dependency>
                <!--<dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-devtools</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>-->
            </dependencies>
        </profile>
        <profile>
            <id>test-jar</id>
            <properties>
                <skipTests>true</skipTests>
                <packaging.type>jar</packaging.type>
                <dependency.scope>compile</dependency.scope>
                <wagonServerId/>
                <wagonUrl/>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>wagon-maven-plugin</artifactId>
                        <version>1.0</version>
                        <configuration>
                            <serverId>${wagonServerId}</serverId>
                            <fromFile>${project.build.directory}/${project.build.finalName}.jar</fromFile>
                            <url>${wagonUrl}</url>
                            <commands>
                                <command>pkill -f ${project.build.finalName}.jar</command>
                                <command>nohub java -Djava.security.egd=file:/dev/./urandom -jar
                                    ${project.build.finalName}.jar &amp;
                                </command>
                            </commands>
                            <displayCommandOutputs>true</displayCommandOutputs>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                    <exclusions>
                        <exclusion>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-starter-logging</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-devtools</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>test-war</id>
            <activation>
                <property>
                    <name>spring.profiles.active</name>
                    <value>default,test</value>
                </property>
            </activation>
            <properties>
                <skipTests>true</skipTests>
                <packaging.type>war</packaging.type>
                <dependency.scope>provided</dependency.scope>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                    <scope>${dependency.scope}</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-starter-logging</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-devtools</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.tomcat.maven</groupId>
                        <artifactId>tomcat7-maven-plugin</artifactId>
                        <version>2.2</version>
                        <configuration>
                            <url>http://localhost:8080/manager/text</url>
                            <server>tomcat8</server>
                            <username>deployer</username>
                            <password>jkzldeployer</password>
                            <path>/${project.artifactId}</path>
                            <update>true</update>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>prod-jar</id>
            <activation>
                <property>
                    <name>spring.profiles.active</name>
                    <value>default,prod</value>
                </property>
            </activation>
            <properties>
                <skipTests>true</skipTests>
                <packaging.type>war</packaging.type>
                <dependency.scope>compile</dependency.scope>
                <wagonServerId>11.1.2.21</wagonServerId>
                <wagonUrl>scp://user:password@11.1.2.21/home/root/ehr-release</wagonUrl>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                    <scope>${dependency.scope}</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-starter-logging</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>prod-war</id>
            <properties>
                <skipTests>true</skipTests>
                <packaging.type>war</packaging.type>
                <dependency.scope>provided</dependency.scope>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                    <scope>${dependency.scope}</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-starter-logging</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-devtools</artifactId>
                    <scope>${dependency.scope}</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

+ 187 - 0
pom.xml

@ -0,0 +1,187 @@
<?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>
    <parent>
        <groupId>com.yihu.ehr</groupId>
        <artifactId>ehr-ms-parent-pom</artifactId>
        <version>1.2.0</version>
        <relativePath>ehr-ms-parent-pom/pom.xml</relativePath>
    </parent>
    <artifactId>svr-log-collection</artifactId>
    <packaging>${packaging.type}</packaging>
    <dependencies>
        <!-- true -->
        <!-- Quartz -->
        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz</artifactId>
            <version>${version.quartz}</version>
        </dependency>
        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz-jobs</artifactId>
            <version>${version.quartz}</version>
        </dependency>
        <!-- Servlet -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${version.servlet-api}</version>
        </dependency>
        <!-- Junit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${version.junit}</version>
        </dependency>
        <!-- Swagger UI -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${version.swagger}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${version.swagger-ui}</version>
        </dependency>
        <!-- JDBC -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${version.mysql}</version>
        </dependency>
        <!--<dependency>-->
        <!--<groupId>redis.clients</groupId>-->
        <!--<artifactId>jedis</artifactId>-->
        <!--<version>${version.jedis}</version>-->
        <!--</dependency>-->
        <!--<dependency>-->
        <!--<groupId>org.springframework.kafka</groupId>-->
        <!--<artifactId>spring-kafka</artifactId>-->
        <!--<version>1.1.0.RELEASE</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.springframework.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>0.9.0.2.3.4.0-3485</version>
            <!--<scope>system</scope>-->
            <!--<systemPath>E:\repository\repository\org\springframework\kafka\kafka-clients\0.9.0.2.3.4.0-3485\kafka-clients-0.9.0.2.3.4.0-3485.jar</systemPath>-->
        </dependency>
        <dependency>
            <groupId>org.springframework.kafka</groupId>
            <artifactId>spring-kafka</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>kafka-clients</artifactId>
                    <groupId>org.apache.kafka</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <!--Spring session family-->
        <dependency>
            <groupId>org.springframework.session</groupId>
            <artifactId>spring-session</artifactId>
            <version>${version.spring-session}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.session</groupId>
            <artifactId>spring-session-hazelcast</artifactId>
        </dependency>
        <!--Spring integration -->
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-jmx</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <!--Spring boot family-->
        <!--<dependency>-->
        <!--<groupId>org.springframework.boot</groupId>-->
        <!--<artifactId>spring-boot-devtools</artifactId>-->
        <!--<version>${version.spring-boot}</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <version>${version.spring-boot}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>${version.spring-boot}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
            <version>${version.spring-boot}</version>
        </dependency>
        <!--<dependency>-->
        <!--<groupId>org.springframework.boot</groupId>-->
        <!--<artifactId>spring-boot-starter-security</artifactId>-->
        <!--<version>${version.spring-boot}</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>${version.spring-boot}</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
        <!-- ES -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
            <version>${version.spring-boot}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
            <scope>${dependency.scope}</scope>
        </dependency>
        <dependency>
            <groupId>io.searchbox</groupId>
            <artifactId>jest</artifactId>
            <version>${version.jest}</version>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>${version.commons-collections}</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-rest-model</artifactId>
        </dependency>
    </dependencies>
</project>

+ 18 - 0
src/main/java/com/yihu/ehr/analysis/LogCollection.java

@ -0,0 +1,18 @@
package com.yihu.ehr.analysis;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
/**
 * Created by Administrator on 2017/2/6.
 */
@SpringBootApplication
public class LogCollection {
    public static ApplicationContext ctx = null;
    public static void main(String[] args) {
        ctx = SpringApplication.run(LogCollection.class, args);
    }
}

+ 12 - 0
src/main/java/com/yihu/ehr/analysis/config/SchedulingConfig.java

@ -0,0 +1,12 @@
package com.yihu.ehr.analysis.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
 * Created by Administrator on 2017/2/6.
 */
//@EnableScheduling
//@Configuration
public class SchedulingConfig {
}

+ 101 - 0
src/main/java/com/yihu/ehr/analysis/config/es/ElasticFactory.java

@ -0,0 +1,101 @@
//package com.yihu.ehr.analysis.config.es;
//
//import io.searchbox.client.JestClient;
//import io.searchbox.client.JestClientFactory;
//import io.searchbox.client.config.HttpClientConfig;
//import org.elasticsearch.client.Client;
//import org.elasticsearch.client.transport.TransportClient;
//import org.elasticsearch.common.settings.Settings;
//import org.elasticsearch.common.transport.InetSocketTransportAddress;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//import org.springframework.util.StringUtils;
//
//import java.net.InetAddress;
//import java.net.UnknownHostException;
//import java.util.Arrays;
//import java.util.concurrent.TimeUnit;
//
///**
// * Created by chenweida on 2017/6/5.
// */
//@Component
//public class ElasticFactory {
//    private static JestClientFactory factory = null;
//
//    @Value("${es.host}")
//    private String esHost;//http://59.61.92.90:9065,http://59.61.92.90:9067
//    @Value("${es.tHost}")
//    private String tHost;// 59.61.92.90:9066,59.61.92.90:9068
//    @Value("${es.clusterName}")
//    private String clusterName;
////-----------------------------------jestClient----------------------------------------
//
//    /**
//     * @param "http://localhost:9200"
//     * @return
//     */
//    public JestClient getJestClient() {
//        if (factory == null) {
//            //初始化链接
//            init();
//        }
//        return factory.getObject();
//    }
//
//    /**
//     * 初始化链接
//     * 9200
//     */
//    public synchronized void init() {
//        String[] hostArray = esHost.split(",");
//        // Construct a new Jest client according to configuration via factory
//        factory = new JestClientFactory();
//        HttpClientConfig httpClientConfig = new HttpClientConfig
//                .Builder(Arrays.asList(hostArray))//http://59.61.92.90:9065,http://59.61.92.90:9067
//                .multiThreaded(true)
//                .maxTotalConnection(50)// 最大链接
//                .maxConnectionIdleTime(120, TimeUnit.SECONDS)//链接等待时间
//                .connTimeout(60 * 1000)
//                // .discoveryEnabled(true)
//                .readTimeout(60 * 1000)//60秒
//                .build();
//
//
//        factory.setHttpClientConfig(httpClientConfig);//得到链接
//    }
//
//    //-----------------------------------TransportClient----------------------------------------
//    private TransportClient transportClient;
//
//    public Client getTransportClient() {
//        try {
//            initTranClient();
//            return transportClient;
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return null;
//    }
//
//    /**
//     * 9300
//     *
//     * @throws UnknownHostException
//     */
//    private synchronized void initTranClient() throws UnknownHostException {
//        if (transportClient == null) {
//            String[] hosts = tHost.split(",");
//            Settings settings = Settings.settingsBuilder()
//                    .put("cluster.name", StringUtils.isEmpty(clusterName) ? "jkzl" : clusterName)//默认集群名字是jkzl
//                    .build();
//
//            transportClient = TransportClient.builder().settings(settings).build();
//
//            for (String oneHost : hosts) {
//                String[] hostAndport = oneHost.split(":");
//                transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(hostAndport[0]), Integer.valueOf(hostAndport[1])));
//            }
//        }
//    }
//}

+ 73 - 0
src/main/java/com/yihu/ehr/analysis/config/kafka/KafkaConsumerConfig.java

@ -0,0 +1,73 @@
package com.yihu.ehr.analysis.config.kafka;
import com.yihu.ehr.analysis.listener.LabelDataListener;
import com.yihu.ehr.analysis.listener.save.LogSaver;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.config.KafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
import org.springframework.kafka.listener.ConcurrentMessageListenerContainer;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by Administrator on 2017/2/6.
 */
@EnableKafka
@Configuration
public class KafkaConsumerConfig {
    @Value("${kafka.broker.address}")
    private String kafkaBrokerAddress;
    @Value("${zookeeper.broker.address}")
    private String zookeeperBrokerAddress;
    @Autowired
    private LogSaver logSaver;
    @Bean
    KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String, String>> kafkaListenerContainerFactory() {
        ConcurrentKafkaListenerContainerFactory<String, String> factory = new ConcurrentKafkaListenerContainerFactory<>();
        factory.setConsumerFactory(consumerFactory());
        factory.setConcurrency(3);
        factory.getContainerProperties().setPollTimeout(3000);
        return factory;
    }
    @Bean
    public ConsumerFactory<String, String> consumerFactory() {
        return new DefaultKafkaConsumerFactory<>(consumerConfigs());
    }
    @Bean
    public Map<String, Object> consumerConfigs() {
        Map<String, Object> propsMap = new HashMap<>();
        propsMap.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, this.kafkaBrokerAddress);
        //如果设为true,consumer会定时向ZooKeeper发送已经获取到的消息的offset。当consumer进程挂掉时,已经提交的offset可以继续使用,让新的consumer继续工作
        propsMap.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, true);
        //consumer向ZooKeeper发送offset的时间间隔。 1秒
        propsMap.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "1000");
        //socket请求的超时时间。实际的超时时间为max.fetch.wait + socket.timeout.ms  15秒
        propsMap.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "15000");
        //唯一的指明了consumer的group的名字,group名一样的进程属于同一个consumer group。
        propsMap.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
        propsMap.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
        propsMap.put(ConsumerConfig.GROUP_ID_CONFIG, "ehr-protal-group");//wlyy-analysis-group
        propsMap.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
        return propsMap;
    }
    @Bean
    public LabelDataListener labelDataListener() {
        LabelDataListener labelDataListener= new LabelDataListener();
        labelDataListener.setLogSaveManager(logSaver);
        return labelDataListener;
    }
}

+ 48 - 0
src/main/java/com/yihu/ehr/analysis/config/kafka/KafkaProducerConfig.java

@ -0,0 +1,48 @@
package com.yihu.ehr.analysis.config.kafka;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.common.serialization.StringSerializer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.core.DefaultKafkaProducerFactory;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.core.ProducerFactory;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by Administrator on 2017/2/6.
 */
@Configuration
@EnableKafka
public class KafkaProducerConfig {
    @Value("${kafka.broker.address}")
    private String brokerAddress;
    @Bean
    public ProducerFactory<String, String> producerFactory() {
        return new DefaultKafkaProducerFactory<>(producerConfigs());
    }
    @Bean
    public Map<String, Object> producerConfigs() {
        Map<String, Object> props = new HashMap<>();
        props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, this.brokerAddress);
        props.put(ProducerConfig.RETRIES_CONFIG, 0);
        props.put(ProducerConfig.BATCH_SIZE_CONFIG, 16384);
        props.put(ProducerConfig.LINGER_MS_CONFIG, 1);
        props.put(ProducerConfig.BUFFER_MEMORY_CONFIG, 33554432);
        props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
        props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
        return props;
    }
    @Bean
    public KafkaTemplate<String, String> kafkaTemplate() {
        return new KafkaTemplate<String, String>(producerFactory());
    }
}

+ 48 - 0
src/main/java/com/yihu/ehr/analysis/config/swagger/SwaggerConfig.java

@ -0,0 +1,48 @@
package com.yihu.ehr.analysis.config.swagger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import static com.google.common.base.Predicates.or;
import static springfox.documentation.builders.PathSelectors.regex;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
    public static final String Iot_API = "quota";
    @Bean
    public Docket iotAPI() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName(Iot_API)
                .useDefaultResponseMessages(false)
                .forCodeGeneration(false)
                .pathMapping("/")
                .select()
                .paths(or(
                        regex("/quota/.*")
                ))
                .build()
                .apiInfo(iotApiInfo());
    }
    private ApiInfo iotApiInfo() {
        ApiInfo iotInfo = new ApiInfo("基卫2.0API",
                "EHR API,提供日志相关服务。",
                "1.0",
                "No terms of service",
                "wenfujian@jkzl.com",
                "The Apache License, Version 2.0",
                "http://www.apache.org/licenses/LICENSE-2.0.html"
        );
        return iotInfo;
    }
}

+ 11 - 0
src/main/java/com/yihu/ehr/analysis/config/war/ServletInitializer.java

@ -0,0 +1,11 @@
package com.yihu.ehr.analysis.config.war;
/**
 * Created by Administrator on 2016.10.14.
 */
//public class ServletInitializer extends SpringBootServletInitializer {
//    @Override
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
//        return application.sources(Application.class);
//    }
//}

+ 37 - 0
src/main/java/com/yihu/ehr/analysis/controller/KafKaTest.java

@ -0,0 +1,37 @@
package com.yihu.ehr.analysis.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.support.SendResult;
import org.springframework.util.concurrent.ListenableFuture;
import org.springframework.util.concurrent.ListenableFutureCallback;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by Administrator on 2017/2/6.
 */
@RestController
public class KafKaTest {
    @Autowired
    private KafkaTemplate kafkaTemplate;
    @RequestMapping("/produce")
    public void contextLoads() throws InterruptedException {
        System.out.println("发送消息开始");
        ListenableFuture<SendResult<String, String>> future = kafkaTemplate.send("topicTest", "ABC");
        future.addCallback(new ListenableFutureCallback<SendResult<String, String>>() {
            @Override
            public void onSuccess(SendResult<String, String> result) {
                System.out.println("success");
            }
            @Override
            public void onFailure(Throwable ex) {
                System.out.println("failed");
            }
        });
        System.out.println(Thread.currentThread().getId());
    }
}

File diff suppressed because it is too large
+ 88 - 0
src/main/java/com/yihu/ehr/analysis/controller/QuotaController.java


+ 29 - 0
src/main/java/com/yihu/ehr/analysis/etl/BusinessTypeEnum.java

@ -0,0 +1,29 @@
package com.yihu.ehr.analysis.etl;
/**
 * 业务类型
 *
 * Created by lyr-pc on 2017/2/17.
 */
public enum  BusinessTypeEnum {
    // 咨询
    consult
    // 指导
    , guidance
    // 健康教育
    , article
    // 随访
    , followup
    // 预约
    , appointment
    // 标签
    , label
    // 注册
    , register
    // 健康档案
    , archive
    // 签约
    , sign
    // 体征
    , index
}

+ 188 - 0
src/main/java/com/yihu/ehr/analysis/etl/ETLConstantData.java

@ -0,0 +1,188 @@
package com.yihu.ehr.analysis.etl;
import java.io.IOException;
import java.util.Properties;
/**
 * Created by lyr-pc on 2017/2/20.
 */
public class ETLConstantData {
    private static Properties cities = new Properties();
    static {
        try {
            cities.load(ETLConstantData.class.getResourceAsStream("/city.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    /***************************体征指标正常范围*******************************/
    // 血糖餐前最小值
    public static final double HEALTH_STANDARD_ST_MIN_BEFORE = 4;
    // 血糖餐前最大值
    public static final double HEALTH_STANDARD_ST_MAX_BEFORE = 7;
    // 血糖餐后最小值
    public static final double HEALTH_STANDARD_ST_MIN_AFTER = 4;
    // 血糖餐后最大值
    public static final double HEALTH_STANDARD_ST_MAX_AFTER = 11.1;
    // 舒张压最小值
    public static final int HEALTH_STANDARD_SZY_MIN = 60;
    // 舒张压最大值
    public static final int HEALTH_STANDARD_SZY_MAX = 90;
    // 收缩压最小值
    public static final int HEALTH_STANDARD_SSY_MIN = 90;
    // 收缩压最大值
    public static final int HEALTH_STANDARD_SSY_MAX = 140;
    /**
     * 性别
     *
     * @return
     */
    public static String sexName(int sex) {
        switch (sex) {
            case 1:
                return "男";
            case 2:
                return "女";
            default:
                return "其他";
        }
    }
    /**
     * 年龄段
     *
     * @param age
     * @return
     */
    public static String ageInterval(int age) {
        if (age < 7) {
            return "儿童";
        } else if (age >= 7 && age <= 14) {
            return "少年";
        } else if (age >= 15 && age <= 35) {
            return "青年";
        } else if (age >= 36 && age <= 60) {
            return "中年";
        } else {
            return "老年";
        }
    }
    /**
     * 获取城市名称
     *
     * @param city
     * @return
     */
    public static String cityName(String city) {
        return cities.get(city).toString();
    }
    /**
     * 体质指数转换
     *
     * @param bmi
     * @return
     */
    public static String bmiName(double bmi) {
        if (bmi < 18.5) {
            return "偏瘦";
        } else if (bmi >= 18.5 && bmi < 24) {
            return "体重正常";
        } else if (bmi >= 24 && bmi < 27) {
            return "超重";
        } else if (bmi >= 27 && bmi < 30) {
            return "偏胖";
        } else if (bmi >= 30 && bmi < 35) {
            return "肥胖";
        } else if (bmi >= 35 && bmi < 40) {
            return "重度肥胖";
        } else {
            return "极重度肥胖";
        }
    }
    /**
     * 心律情况
     *
     * @param rate
     * @return
     */
    public static String heartRate(double rate) {
        if (rate >= 40 && rate <= 160) {
            return "心率正常";
        } else {
            return "心率不正常";
        }
    }
    /**
     * 空腹血糖判断
     *
     * @param value
     * @return
     */
    public static int xueTangBefore(double value) {
        if (value < ETLConstantData.HEALTH_STANDARD_ST_MIN_BEFORE) {
            return -1;
        }
        if (value > ETLConstantData.HEALTH_STANDARD_ST_MAX_BEFORE) {
            return 1;
        }
        return 0;
    }
    /**
     * 餐后血糖判断
     *
     * @param value
     * @return
     */
    public static int xueTangAfter(double value) {
        if (value < ETLConstantData.HEALTH_STANDARD_ST_MIN_AFTER) {
            return -1;
        }
        if (value > ETLConstantData.HEALTH_STANDARD_ST_MAX_AFTER) {
            return 1;
        }
        return 0;
    }
    /**
     * 收缩压比较
     *
     * @param value
     * @return
     */
    public static int ssy(double value) {
        if (value < ETLConstantData.HEALTH_STANDARD_SSY_MIN) {
            return -1;
        }
        if (value > ETLConstantData.HEALTH_STANDARD_SSY_MAX) {
            return 1;
        }
        return 0;
    }
    /**
     * 舒张压比较
     *
     * @param value
     * @returnz
     */
    public static int szy(double value) {
        if (value < ETLConstantData.HEALTH_STANDARD_SZY_MIN) {
            return -1;
        }
        if (value > ETLConstantData.HEALTH_STANDARD_SZY_MAX) {
            return 1;
        }
        return 0;
    }
}

+ 108 - 0
src/main/java/com/yihu/ehr/analysis/etl/util/IdcardUtil.java

@ -0,0 +1,108 @@
package com.yihu.ehr.analysis.etl.util;
import org.apache.commons.lang3.StringUtils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
 * 身份证号工具类
 *
 * Created by lyr-pc on 2017/2/17.
 */
public class IdcardUtil {
    /**
     * 根据身份证的号码算出当前身份证持有者的年龄
     *
     * @param
     * @throws Exception
     */
    public static int getAgeFromIdcard(String idcard) {
        try {
            int age = -1;
            if (StringUtils.isEmpty(idcard)) {
                return age;
            }
            String birth = "";
            if (idcard.length() == 18) {
                birth = idcard.substring(6, 14);
            } else if (idcard.length() == 15) {
                birth = "19" + idcard.substring(6, 12);
            }
            int year = Integer.valueOf(birth.substring(0, 4));
            int month = Integer.valueOf(birth.substring(4, 6));
            int day = Integer.valueOf(birth.substring(6));
            Calendar cal = Calendar.getInstance();
            age = cal.get(Calendar.YEAR) - year;
            //周岁计算
            if (cal.get(Calendar.MONTH) < (month - 1) || (cal.get(Calendar.MONTH) == (month - 1) && cal.get(Calendar.DATE) < day)) {
                age--;
            }
            return age;
        } catch (Exception e) {
            return -1;
        }
    }
    /**
     * 根据身份证的号码算出当前身份证持有者的性别
     * 1 男 2 女 3未知
     *
     * @return
     * @throws Exception
     */
    public static int getSexForIdcard(String CardCode)
            throws Exception {
        int sex = 3;
        if (CardCode.length() == 18) {
            if (Integer.parseInt(CardCode.substring(16).substring(0, 1)) % 2 == 0) {// 判断性别
                sex = 2;
            } else {
                sex = 1;
            }
        } else if (CardCode.length() == 15) {
            String usex = CardCode.substring(14, 15);// 用户的性别
            if (Integer.parseInt(usex) % 2 == 0) {
                sex = 2;
            } else {
                sex = 1;
            }
        }
        return sex;
    }
    /**
     * 身份证提取出身日期
     *
     * @param card
     * @return
     * @throws Exception
     */
    public static Date getBirthdayForIdcard(String card)
            throws Exception {
        Date b = null;
        if (card.length() == 18) {
            String year = card.substring(6).substring(0, 4);// 得到年份
            String yue = card.substring(10).substring(0, 2);// 得到月份
            String ri = card.substring(12).substring(0, 2);// 得到日
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            b = format.parse(year + "-" + yue + "-" + ri);
        } else if (card.length() == 15) {
            String uyear = "19" + card.substring(6, 8);// 年份
            String uyue = card.substring(8, 10);// 月份
            String uri = card.substring(10, 12);// 得到日
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            b = format.parse(uyear + "-" + uyue + "-" + uri);
        }
        return b;
    }
}

+ 97 - 0
src/main/java/com/yihu/ehr/analysis/listener/LabelDataListener.java

@ -0,0 +1,97 @@
package com.yihu.ehr.analysis.listener;
import com.yihu.ehr.analysis.listener.save.LogSaver;
import com.yihu.ehr.analysis.model.BusinessDataModel;
import com.yihu.ehr.analysis.model.OperatorDataModel;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
/**
 * Created by Administrator on 2017/2/6.
 */
public class LabelDataListener {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private OperatorDataModel operatorDataModel;
    @Autowired
    private BusinessDataModel businessDataModel;
    private LogSaver logSaver;
    public static String mongoDb_Business_TableName = "cloud_business_log";
    public static String mongoDb_Operator_TableName = "cloud_operator_log";
    //@Scheduled(cron = "0 0/1 * * * ?") //每分钟执行一次
    //正式库的 topic名字是flumeLog
    @KafkaListener(topics = "flumeLog_ehr")
    @Transactional
    public void labelData(ConsumerRecord<?, ?> record) {
        Long startTime = System.currentTimeMillis();
        System.out.println("Kafka开始消费:" + record.topic() + " - " + record.toString());
        logger.debug("Kafka开始消费");
        Optional<?> kafkaMessage = Optional.ofNullable(record.value());
        if (kafkaMessage.isPresent()) {
            Object message = kafkaMessage.get();
            try {
                JSONObject jsonObject = new JSONObject(message.toString());
                if (jsonObject.has("logType")) {
                    String logType = String.valueOf(jsonObject.get("logType"));
                    // 根据日志类别保存到mongodb
                    saveLogToMongo(logType, jsonObject);
                    Long endTime = System.currentTimeMillis();
                    Long time = startTime - endTime;
                    logger.debug("time(ms):" + time);
                    logger.debug("保存成功 message:" + message);
                } else {
                    logger.error("数据格式错误,message:" + message);
                }
            } catch (Exception e) {
                logger.error(e.getMessage());
            }
        }
        logger.debug("Kafka结束消费");
    }
    private void saveLogToMongo(String logType, JSONObject jsonObject) throws Exception {
        switch (logType) {
            case "1": {
                //统一网关的日志
                logSaver.save(operatorDataModel.getByJsonObject(jsonObject), mongoDb_Operator_TableName);
                break;
            }
            case "3": {
                //云平台后台业务操作日志
                logSaver.save(businessDataModel.getByJsonObject(jsonObject), mongoDb_Business_TableName);
                break;
            }
            case "2": {
                //采集日志
                logSaver.save(businessDataModel.getByJsonObject(jsonObject), mongoDb_Business_TableName);
                break;
            }
        }
    }
    public LogSaver getLogSaveManager() {
        return logSaver;
    }
    public void setLogSaveManager(LogSaver logSaver) {
        this.logSaver = logSaver;
    }
//    @Scheduled(fixedRate=20000)//每20秒执行一次。开始
//    public void testTasks() {
//    }
}

+ 10 - 0
src/main/java/com/yihu/ehr/analysis/listener/save/LogSaver.java

@ -0,0 +1,10 @@
package com.yihu.ehr.analysis.listener.save;
import java.io.IOException;
/**
 * Created by chenweida on 2018/1/11.
 */
public interface LogSaver {
    public void save(Object data, String tableName) throws IOException;
}

+ 26 - 0
src/main/java/com/yihu/ehr/analysis/listener/save/impl/ESLogSaver.java

@ -0,0 +1,26 @@
//package com.yihu.ehr.analysis.listener.save.impl;
//
//import com.yihu.ehr.analysis.config.es.ElasticFactory;
//import com.yihu.ehr.analysis.listener.save.LogSaver;
//import io.searchbox.client.JestResult;
//import io.searchbox.core.Index;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//
///**
// * Created by chenweida on 2018/1/11.
// */
//@Component
//public class ESLogSaver implements LogSaver {
//    @Autowired
//    private ElasticFactory elasticFactory;
//
//    public void save(Object data, String tableName) throws IOException {
//        Index index = new Index.Builder(data).index(tableName).type(tableName).build();
//        JestResult jestResult = elasticFactory.getJestClient().execute(index);
//        System.out.println(jestResult.isSucceeded());
//        // mongoTemplate.insert( data, tableName);
//    }
//}

+ 23 - 0
src/main/java/com/yihu/ehr/analysis/listener/save/impl/MongoLogSaver.java

@ -0,0 +1,23 @@
package com.yihu.ehr.analysis.listener.save.impl;
import com.yihu.ehr.analysis.listener.save.LogSaver;
import io.searchbox.client.JestResult;
import io.searchbox.core.Index;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
 * Created by chenweida on 2018/1/11.
 */
@Component
public class MongoLogSaver implements LogSaver {
    @Autowired
    private MongoTemplate mongoTemplate;
    public void save(Object data, String tableName) throws IOException {
        mongoTemplate.insert( data, tableName);
    }
}

+ 183 - 0
src/main/java/com/yihu/ehr/analysis/model/BusinessDataModel.java

@ -0,0 +1,183 @@
package com.yihu.ehr.analysis.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.ehr.analysis.service.AppFeatureService;
import com.yihu.ehr.util.rest.Envelop;
import org.apache.commons.collections.CollectionUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.util.*;
/**
 * Created by Administrator on 2017/2/9.
 * <p>
 * * 数据对象的公工接口
 * // 业务日志
 * 0 consult // 咨询
 * 1 guidance  // 指导
 * 2 article  // 健康教育
 * 3 followup  // 随访
 * 4 appointment // 预约
 * 5 label // 标签
 * 6 register  // 注册
 * 7 archive // 健康档案
 * {
 * time:"" 时间
 * ,logType:2 日志类型
 * ,caller:"" 调用者
 * ,data:{
 * ,businessType:""  业务类型
 * ,patient:"" 居民
 * ,data:{} 业务数据
 * } 数据
 * }
 */
@Component
public class BusinessDataModel extends DataModel implements Serializable {
    Map<String, Map<String, String>> cache = new HashMap<>();
    @Autowired
    private AppFeatureService appFeatureService;
    private String data;
    private String businessType;
    private String patient;
    private String url;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @CreatedDate
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date responseTime;
    private String responseCode;
    private String response;
    private String appKey;
    private String operation;
    private String function;
    public BusinessDataModel getByJsonObject(JSONObject jsonObject) throws Exception {
        BusinessDataModel businessDataModel = new BusinessDataModel();
        try {
            businessDataModel.setLogType(String.valueOf(jsonObject.get("logType")));
            businessDataModel.setCaller(jsonObject.getString("caller"));
            businessDataModel.setTime(changeTime(jsonObject.getString("time")));
            JSONObject chlidren = jsonObject.getJSONObject("data");
            businessDataModel.setPatient(chlidren.getString("patient"));
            businessDataModel.setUrl(chlidren.getString("url"));
            businessDataModel.setResponseTime(changeTime(String.valueOf(chlidren.getInt("responseTime"))));
            businessDataModel.setResponseCode(String.valueOf(chlidren.getInt("responseCode")));
            businessDataModel.setResponse(chlidren.getString("response"));
            businessDataModel.setAppKey(chlidren.getString("appKey"));
            String url = chlidren.getString("url");
            if (!StringUtils.isEmpty(url)) {
                Map<String, String> map = new HashMap<>();
                if (cache.containsKey(url)) {
                    map = cache.get(url);
                } else {
                /*String a = url.substring(url.lastIndexOf(":"));
                String b = a.substring(a.indexOf("/") + 1);
                String urlApi = b.substring(b.indexOf("/") + 1);*/
                    Object obj = appFeatureService.appFeatureFindUrl(url);
                    if (obj != null) {
                        map = appFeatureService.getOperatPageName(obj);
                    }
                }
                if (map != null && map.size() > 0) {
                    businessDataModel.setOperation(map.get("operation"));
                    businessDataModel.setFunction(map.get("function"));
                }
            }
        } catch (Exception e) {
            throw new Exception("格式错误");
        }
        return businessDataModel;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public Date getResponseTime() {
        return responseTime;
    }
    public void setResponseTime(Date responseTime) {
        this.responseTime = responseTime;
    }
    public String getResponseCode() {
        return responseCode;
    }
    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }
    public String getResponse() {
        return response;
    }
    public void setResponse(String response) {
        this.response = response;
    }
    public String getAppKey() {
        return appKey;
    }
    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }
    public String getOperation() {
        return operation;
    }
    public void setOperation(String operation) {
        this.operation = operation;
    }
    public String getFunction() {
        return function;
    }
    public void setFunction(String function) {
        this.function = function;
    }
    public String getBusinessType() {
        return businessType;
    }
    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getData() {
        return data;
    }
    public void setData(String data) {
        this.data = data;
    }
}

+ 93 - 0
src/main/java/com/yihu/ehr/analysis/model/DataModel.java

@ -0,0 +1,93 @@
package com.yihu.ehr.analysis.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.ehr.util.datetime.DateUtil;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import java.util.Date;
/**
 * Created by Administrator on 2017/2/9.
 * 数据对象的公工接口
 * // 业务日志
 * 0 consult // 咨询
 * 1 guidance  // 指导
 * 2 article  // 健康教育
 * 3 followup  // 随访
 * 4 appointment // 预约
 * 5 label // 标签
 * 6 register  // 注册
 * 7 archive // 健康档案
 * {
 * time:"" 时间
 * ,logType:2 日志类型
 * ,caller:"" 调用者
 * ,data:{
 * ,businessType:""  业务类型
 * ,patient:"" 居民
 * ,data:{} 业务数据
 * } 数据
 * }
 * <p>
 * // 接口调用日志
 * {
 * time:"" 时间
 * ,logType:1 日志类型
 * ,caller:"" 调用者
 * ,data:{
 * responseTime:"" 响应时间
 * ,url:"" 接口URL
 * ,params:{} 参数
 * } 数据
 * }
 */
public class DataModel {
    @JestId
    protected String id;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @CreatedDate
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    protected Date time;//时间
    protected String caller; //调用者
    protected String logType;//日志类型 1接口 2业务
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getLogType() {
        return logType;
    }
    public void setLogType(String logType) {
        this.logType = logType;
    }
    public Date getTime() {
        return time;
    }
    public void setTime(Date time) {
        this.time = time;
    }
    public String getCaller() {
        return caller;
    }
    public void setCaller(String caller) {
        this.caller = caller;
    }
    protected Date changeTime(String time) {
        return DateUtil.strToDate(time);
    }
}

+ 141 - 0
src/main/java/com/yihu/ehr/analysis/model/OperatorDataModel.java

@ -0,0 +1,141 @@
package com.yihu.ehr.analysis.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.ehr.analysis.service.AppService;
import com.yihu.ehr.model.app.MApp;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.io.Serializable;
import java.util.Date;
/**
 * Created by Administrator on 2017/2/9.
 * {
 * time:"" 时间
 * ,logType:1 日志类型
 * ,caller:"" 调用者
 * ,data:{
 * responseTime:"" 响应时间
 * ,url:"" 接口URL
 * ,params:{} 参数
 * } 数据
 * }
 */
@Component
public class OperatorDataModel extends DataModel implements Serializable {
    @Autowired
    private AppService appService;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @CreatedDate
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date responseTime;
    private String responseCode;
    private String response;
    private String api;
    private String appKey;
    private String appName;
    private String url;
    private String params;
    public  OperatorDataModel getByJsonObject(JSONObject jsonObject) throws Exception {
        OperatorDataModel operatorDataModel = new OperatorDataModel();
        try {
            operatorDataModel.setLogType(String.valueOf(jsonObject.get("logType")));
            operatorDataModel.setCaller(jsonObject.getString("caller"));
            operatorDataModel.setTime(changeTime(jsonObject.getString("time")));
            JSONObject chlidren = jsonObject.getJSONObject("data");
            operatorDataModel.setResponseTime(changeTime(chlidren.get("responseTime").toString()));
            operatorDataModel.setResponseCode(chlidren.getString("responseCode"));
            operatorDataModel.setResponse(chlidren.getString("response"));
            operatorDataModel.setUrl(chlidren.getString("url"));
            JSONObject paramsChild = chlidren.getJSONObject("params");
            operatorDataModel.setApi(paramsChild.getString("api"));
            operatorDataModel.setAppKey(paramsChild.getString("appKey"));
            if( ! StringUtils.isEmpty(paramsChild.getString("appKey") ) ){
                MApp app = appService.getApp(paramsChild.getString("appKey"));
                if(app != null){
                    operatorDataModel.setAppName(app.getName());
                }
            }
            operatorDataModel.setParams(paramsChild.getString("param"));
        } catch (Exception e) {
            throw new Exception("格式错误");
        }
        return operatorDataModel;
    }
    public Date getResponseTime() {
        return responseTime;
    }
    public void setResponseTime(Date responseTime) {
        this.responseTime = responseTime;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getParams() {
        return params;
    }
    public void setParams(String params) {
        this.params = params;
    }
    public String getResponseCode() {
        return responseCode;
    }
    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }
    public String getResponse() {
        return response;
    }
    public void setResponse(String response) {
        this.response = response;
    }
    public String getApi() {
        return api;
    }
    public void setApi(String api) {
        this.api = api;
    }
    public String getAppKey() {
        return appKey;
    }
    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }
    public String getAppName() {
        return appName;
    }
    public void setAppName(String appName) {
        this.appName = appName;
    }
}

+ 31 - 0
src/main/java/com/yihu/ehr/analysis/model/emun/BusinessType.java

@ -0,0 +1,31 @@
package com.yihu.ehr.analysis.model.emun;
/**
 * Created by Administrator on 2017/2/9.
 * 业务日志类型
 */
public enum BusinessType {
    Consult("0"),//咨询
    Guidance("1"), // 指导
    Article("2"), // 健康教育
    Followup("3"),// 随访
    Appointment("4"), // 预约
    Label("5"),// 标签
    Register("6"),// 注册
    Archive("7"),// 健康档案
    Sign("8");// 签约
    private String value;
    BusinessType(String s) {
        this.value = s;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
}

+ 98 - 0
src/main/java/com/yihu/ehr/analysis/service/AppFeatureService.java

@ -0,0 +1,98 @@
package com.yihu.ehr.analysis.service;
import com.google.gson.Gson;
import com.yihu.ehr.util.http.HttpResponse;
import com.yihu.ehr.util.http.HttpUtils;
import com.yihu.ehr.util.rest.Envelop;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by janseny on 2017/7/18.
 */
@Service
public class AppFeatureService {
    @Value("${service-gateway.username}")
    private String username;
    @Value("${service-gateway.password}")
    private String password;
    @Value("${service-gateway.url}")
    private String comUrl;
    /**
     * 根据url查询对应的菜单信息
     *
     * @param url
     * @return
     */
    public Object appFeatureFindUrl(String url) throws Exception {
        String rqUrl = "/AppFeatureFindUrl";
        String resultStr = "";
        Envelop envelop = new Envelop();
        Map<String, Object> params = new HashMap<>();
        StringBuffer stringBuffer = new StringBuffer();
        if (!StringUtils.isEmpty(url)) {
            stringBuffer.append("url=" + url);
        }
        params.put("filters", "");
        String filters = stringBuffer.toString();
        if (!StringUtils.isEmpty(filters)) {
            params.put("filters", filters);
        }
        HttpResponse  httpResponse = HttpUtils.doGet(comUrl + rqUrl, params, null,  username, password);
        return httpResponse.getContent();
    }
    /**
     * 根据parentId查询对应菜单信息
     *
     * @param parentId
     * @return
     */
    public Object appFeatureFindParentId(String parentId) throws Exception {
        String url = "/appFeature/" + parentId;
        HttpResponse httpResponse = HttpUtils.doGet(comUrl + url, null, null, username, password);
        return httpResponse.getContent();
    }
    public Map<String,String> getOperatPageName(Object obj) throws Exception {
        String function = ""; // 操作页面名称
        String operation = "";// 操作内容(增、删、改、查、导入)
        Map<String,String> map = new HashMap<>();
        Gson gson = new Gson();
        Envelop envelop = gson.fromJson(obj.toString(), Envelop.class);
        if(envelop.isSuccessFlg()){
            List<Object> appFeatureList = envelop.getDetailModelList();
            if (CollectionUtils.isNotEmpty(appFeatureList)) {
                Map<Object, Object> objectMap = (Map<Object, Object>) appFeatureList.get(0);
                String type = (String) objectMap.get("type");
                if ("3".equals(type)) {
                    operation = (String) objectMap.get("name");
                    String parentId = Double.valueOf((Double) objectMap.get("parentId")).intValue() + "";
                    //调用接口查询parentId对应的菜单
                    Object obj2 = appFeatureFindParentId(parentId);
                    Envelop envelop2 = gson.fromJson(obj2.toString(), Envelop.class);
                    if(envelop2.isSuccessFlg()){
                        Map<Object, Object> objectMap2 = (Map<Object, Object>) envelop2.getObj();
                        function = (String) objectMap2.get("name");
                    }
                } else {
                    function = (String) objectMap.get("name");
                }
            }
        }
        map.put("operation",operation);
        map.put("function",function);
        return map;
    }
}

+ 45 - 0
src/main/java/com/yihu/ehr/analysis/service/AppService.java

@ -0,0 +1,45 @@
package com.yihu.ehr.analysis.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.ehr.model.app.MApp;
import com.yihu.ehr.util.http.HttpResponse;
import com.yihu.ehr.util.http.HttpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by janseny on 2017/7/18.
 */
@Service
public class AppService {
    @Value("${service-gateway.username}")
    private String username;
    @Value("${service-gateway.password}")
    private String password;
    @Value("${service-gateway.url}")
    private String comUrl;
    @Autowired
    private ObjectMapper objectMapper;
    /**
     * 根据app_id 获取 APP信息
     *
     * @param appId
     * @return
     */
    public MApp getApp(String appId) throws Exception {
        Map<String, Object> params = new HashMap<>();
        String rqUrl = "/app";
        params.put("app_id", appId);
        HttpResponse  httpResponse = HttpUtils.doGet(comUrl + rqUrl, params, null,  username, password);
        MApp detailModel = objectMapper.readValue(httpResponse.getContent(), MApp.class);
        return detailModel;
    }
}

+ 49 - 0
src/main/java/com/yihu/ehr/analysis/service/QuotaService.java

@ -0,0 +1,49 @@
//package com.yihu.ehr.analysis.service;
//
//
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import com.yihu.ehr.analysis.util.ElasticsearchUtil;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.util.List;
//import java.util.Map;
//
///**
// * Created by chenweida on 2018/1/9.
// */
//@Service
//public class QuotaService {
//    @Autowired
//    private ElasticsearchUtil elasticsearchUtil;
//
//    public String apiNum() {
//        String sql = "SELECT count(*) num,api FROM cloud_operator_log group by api ";
//        JSONArray jsonObject=new JSONArray();
//        jsonObject.addAll(elasticsearchUtil.excuteDataModel(sql));
//        return jsonObject.toString();
//    }
//
//    public String apiSuccessFlagNum() {
//        String sql = "SELECT count(*) num,api,responseCode FROM cloud_operator_log group by api,responseCode ";
//
//        JSONObject jsonObject = new JSONObject();
//        List<Map<String, Object>> maps = elasticsearchUtil.excuteDataModel(sql);
//        maps.forEach(one -> {
//            String key = one.get("api").toString();
//            JSONArray ja = null;
//            if (jsonObject.containsKey(key)) {
//                ja = jsonObject.getJSONArray(key);
//            } else {
//                ja = new JSONArray();
//            }
//            JSONObject jo = new JSONObject();
//            jo.put("responseCode", one.get("responseCode"));
//            jo.put("num", one.get("num"));
//            ja.add(jo);
//            jsonObject.put(key, ja);
//        });
//        return jsonObject.toString();
//    }
//}

+ 105 - 0
src/main/java/com/yihu/ehr/analysis/util/ElasticsearchUtil.java

@ -0,0 +1,105 @@
//package com.yihu.ehr.analysis.util;
//
//import com.alibaba.druid.sql.ast.SQLExpr;
//import com.alibaba.druid.sql.ast.expr.SQLQueryExpr;
//import com.alibaba.druid.sql.parser.SQLExprParser;
//import com.yihu.ehr.analysis.config.es.ElasticFactory;
//import org.elasticsearch.action.search.SearchResponse;
//import org.elasticsearch.client.Client;
//import org.nlpcn.es4sql.domain.Select;
//import org.nlpcn.es4sql.jdbc.ObjectResult;
//import org.nlpcn.es4sql.jdbc.ObjectResultsExtractor;
//import org.nlpcn.es4sql.parse.ElasticSqlExprParser;
//import org.nlpcn.es4sql.parse.SqlParser;
//import org.nlpcn.es4sql.query.AggregationQueryAction;
//import org.nlpcn.es4sql.query.DefaultQueryAction;
//import org.nlpcn.es4sql.query.SqlElasticSearchRequestBuilder;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
///**
// * Created by chenweida on 2017/7/17.
// * SELECT town,townName,sum(result1) result1 FROM wlyy_quota_test
// * where quotaCode='1'
// * group by town,townName , date_histogram(field='quotaDate','interval'='week')
// */
//@Component
//public class ElasticsearchUtil {
//    private Logger logger = LoggerFactory.getLogger(ElasticsearchUtil.class);
//    @Autowired
//    private ElasticFactory elasticFactory;
//    @Value("${es.type}")
//    private String esType;
//    @Value("${es.index}")
//    private String esIndex;
//
//    /**
//     * 执行sql查询es
//     *
//     * @param sql
//     * @return
//     */
//    public List<Map<String, Object>> excuteDataModel(String sql) {
//        List<Map<String, Object>> returnModels = new ArrayList<>();
//        try {
//            SQLExprParser parser = new ElasticSqlExprParser(sql);
//            SQLExpr expr = parser.expr();
//            SQLQueryExpr queryExpr = (SQLQueryExpr) expr;
////            if (parser.getLexer().token() != Token.EOF) {
////                throw new ParserException("illegal sql expr : " + sql);
////            }
//            Select select = null;
//            select = new SqlParser().parseSelect(queryExpr);
//
//            //通过抽象语法树,封装成自定义的Select,包含了select、from、where group、limit等
//            AggregationQueryAction action = null;
//            DefaultQueryAction queryAction = null;
//            SqlElasticSearchRequestBuilder requestBuilder = null;
//            if (select.isAgg) {
//                //包含计算的的排序分组的
//                action = new AggregationQueryAction(elasticFactory.getTransportClient(), select);
//                requestBuilder = action.explain();
//            } else {
//                //封装成自己的Select对象
//                Client client = elasticFactory.getTransportClient();
//                queryAction = new DefaultQueryAction(client, select);
//                requestBuilder = queryAction.explain();
//            }
//            SearchResponse response = (SearchResponse) requestBuilder.get();
//            Object queryResult = null;
//            if (sql.toUpperCase().indexOf("GROUP") != -1 || sql.toUpperCase().indexOf("SUM") != -1) {
//                queryResult = response.getAggregations();
//            } else {
//                queryResult = response.getHits();
//            }
//            ObjectResult temp = new ObjectResultsExtractor(true, true, true).extractResults(queryResult, true);
//            List<String> heads = temp.getHeaders();
//            temp.getLines().stream().forEach(one -> {
//                try {
//                    Map<String, Object> oneMap = new HashMap<String, Object>();
//                    for (int i = 0; i < one.size(); i++) {
//                        String key = null;
//                        Object value = one.get(i);
//                        key = heads.get(i);
//                        oneMap.put(key, value);
//                    }
//                    returnModels.add(oneMap);
//                } catch (Exception e) {
//                    e.printStackTrace();
//                }
//            });
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return returnModels;
//    }
//
//}

+ 37 - 0
src/main/resources/application.yml

@ -0,0 +1,37 @@
server:
  port: ${svr-log-collection.server.port}
logging:
  level:
    root: INFO
#kafka:
 # broker:
  #  address: node1.hde.h3c.com:6667
#zookeeper:
 # broker:
  #  address: node1.hde.h3c.com:2181,node2.hde.h3c.com:2181
spring:
  session:
    store-type: none
  jpa:
    database-platform: org.hibernate.dialect.MySQL5Dialect
    hibernate.dialect: org.hibernate.dialect.MySQL5Dialect
    show-sql: false
---
spring:
  profiles: dev
  datasource:
    url: jdbc:mysql://172.19.103.50:3306/healtharchive?useUnicode=true&characterEncoding=UTF-8&useSSL=false
    username: chenweishan
    password: chenweishan
service-gateway:
  username: user
  password: eureka
  url: http://192.168.1.221:10000/api/v1.0/admin
kafka:
  broker:
    address: node1.hde.h3c.com:6667
zookeeper:
  broker:
    address: node1.hde.h3c.com,node2.hde.h3c.com,node3.hde.h3c.com:2181

+ 29 - 0
src/main/resources/banner.txt

@ -0,0 +1,29 @@
                                   _oo8oo_
                                  o8888888o
                                  88" . "88
                                  (| -_- |)
                                  0\  =  /0
                                ___/'==='\___
                              .' \\|     |// '.
                             / \\|||  :  |||// \
                            / _||||| -:- |||||_ \
                           |   | \\\  -  /// |   |
                           | \_|  ''\---/''  |_/ |
                           \  .-\__  '-'  __/-.  /
                         ___'. .'  /--.--\  '. .'___
                      ."" '<  '.___\_<|>_/___.'  >' "".
                     | | :  `- \`.:`\ _ /`:.`/ -`  : | |
                     \  \ `-.   \_ __\ /__ _/   .-` /  /
                 =====`-.____`.___ \_____/ ___.`____.-`=====
                                   `=---=`
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                      佛祖保佑     永不宕机     永无Bug
 __   _      ___       _     ___   __        __    ___   _     _     ____  __   _____  _   ___   _
( (` \ \  / | |_)     | |   / / \ / /`_     / /`  / / \ | |   | |   | |_  / /`   | |  | | / / \ | |\ |
_)_)  \_\/  |_| \     |_|__ \_\_/ \_\_/     \_\_, \_\_/ |_|__ |_|__ |_|__ \_\_,  |_|  |_| \_\_/ |_| \|

+ 23 - 0
src/main/resources/bootstrap.yml

@ -0,0 +1,23 @@
spring:
  application:
    name: svr-log-collection
  cloud:
    config:
      username: user
      password: configuration
---
spring:
  profiles: dev
  cloud:
    config:
      uri: ${spring.config.uri:http://172.19.103.73:1221}
      label: ${spring.config.label:dev}
---
spring:
  profiles: prod
  cloud:
    config:
      uri: ${spring.config.uri}
      label: ${spring.config.label}

+ 340 - 0
src/main/resources/city.properties

@ -0,0 +1,340 @@
130100=\u77f3\u5bb6\u5e84\u5e02
130200=\u5510\u5c71\u5e02
130300=\u79e6\u7687\u5c9b\u5e02
130400=\u90af\u90f8\u5e02
130500=\u90a2\u53f0\u5e02
130600=\u4fdd\u5b9a\u5e02
130700=\u5f20\u5bb6\u53e3\u5e02
130800=\u627f\u5fb7\u5e02
130900=\u6ca7\u5dde\u5e02
131000=\u5eca\u574a\u5e02
131100=\u8861\u6c34\u5e02
140100=\u592a\u539f\u5e02
140200=\u5927\u540c\u5e02
140300=\u9633\u6cc9\u5e02
140400=\u957f\u6cbb\u5e02
140500=\u664b\u57ce\u5e02
140600=\u6714\u5dde\u5e02
140700=\u664b\u4e2d\u5e02
140800=\u8fd0\u57ce\u5e02
140900=\u5ffb\u5dde\u5e02
141000=\u4e34\u6c7e\u5e02
141100=\u5415\u6881\u5e02
150100=\u547c\u548c\u6d69\u7279\u5e02
150200=\u5305\u5934\u5e02
150300=\u4e4c\u6d77\u5e02
150400=\u8d64\u5cf0\u5e02
150500=\u901a\u8fbd\u5e02
150600=\u9102\u5c14\u591a\u65af\u5e02
150700=\u547c\u4f26\u8d1d\u5c14\u5e02
150800=\u5df4\u5f66\u6dd6\u5c14\u5e02
150900=\u4e4c\u5170\u5bdf\u5e03\u5e02
152200=\u5174\u5b89\u76df
152500=\u9521\u6797\u90ed\u52d2\u76df
152900=\u963f\u62c9\u5584\u76df
210100=\u6c88\u9633\u5e02
210200=\u5927\u8fde\u5e02
210300=\u978d\u5c71\u5e02
210400=\u629a\u987a\u5e02
210500=\u672c\u6eaa\u5e02
210600=\u4e39\u4e1c\u5e02
210700=\u9526\u5dde\u5e02
210800=\u8425\u53e3\u5e02
210900=\u961c\u65b0\u5e02
211000=\u8fbd\u9633\u5e02
211100=\u76d8\u9526\u5e02
211200=\u94c1\u5cad\u5e02
211300=\u671d\u9633\u5e02
211400=\u846b\u82a6\u5c9b\u5e02
220100=\u957f\u6625\u5e02
220200=\u5409\u6797\u5e02
220300=\u56db\u5e73\u5e02
220400=\u8fbd\u6e90\u5e02
220500=\u901a\u5316\u5e02
220600=\u767d\u5c71\u5e02
220700=\u677e\u539f\u5e02
220800=\u767d\u57ce\u5e02
222400=\u5ef6\u8fb9\u671d\u9c9c\u65cf\u81ea\u6cbb\u5dde
230100=\u54c8\u5c14\u6ee8\u5e02
230200=\u9f50\u9f50\u54c8\u5c14\u5e02
230300=\u9e21\u897f\u5e02
230400=\u9e64\u5c97\u5e02
230500=\u53cc\u9e2d\u5c71\u5e02
230600=\u5927\u5e86\u5e02
230700=\u4f0a\u6625\u5e02
230800=\u4f73\u6728\u65af\u5e02
230900=\u4e03\u53f0\u6cb3\u5e02
231000=\u7261\u4e39\u6c5f\u5e02
231100=\u9ed1\u6cb3\u5e02
231200=\u7ee5\u5316\u5e02
232700=\u5927\u5174\u5b89\u5cad\u5730\u533a
310100=\u5e02\u8f96\u533a
310200=\u53bf
320100=\u5357\u4eac\u5e02
320200=\u65e0\u9521\u5e02
320300=\u5f90\u5dde\u5e02
320400=\u5e38\u5dde\u5e02
320500=\u82cf\u5dde\u5e02
320600=\u5357\u901a\u5e02
320700=\u8fde\u4e91\u6e2f\u5e02
320800=\u6dee\u5b89\u5e02
320900=\u76d0\u57ce\u5e02
321000=\u626c\u5dde\u5e02
321100=\u9547\u6c5f\u5e02
321200=\u6cf0\u5dde\u5e02
321300=\u5bbf\u8fc1\u5e02
330100=\u676d\u5dde\u5e02
330200=\u5b81\u6ce2\u5e02
330300=\u6e29\u5dde\u5e02
330400=\u5609\u5174\u5e02
330500=\u6e56\u5dde\u5e02
330600=\u7ecd\u5174\u5e02
330700=\u91d1\u534e\u5e02
330800=\u8862\u5dde\u5e02
330900=\u821f\u5c71\u5e02
331000=\u53f0\u5dde\u5e02
331100=\u4e3d\u6c34\u5e02
340100=\u5408\u80a5\u5e02
340200=\u829c\u6e56\u5e02
340300=\u868c\u57e0\u5e02
340400=\u6dee\u5357\u5e02
340500=\u9a6c\u978d\u5c71\u5e02
340600=\u6dee\u5317\u5e02
340700=\u94dc\u9675\u5e02
340800=\u5b89\u5e86\u5e02
341000=\u9ec4\u5c71\u5e02
341100=\u6ec1\u5dde\u5e02
341200=\u961c\u9633\u5e02
341300=\u5bbf\u5dde\u5e02
341400=\u5de2\u6e56\u5e02
341500=\u516d\u5b89\u5e02
341600=\u4eb3\u5dde\u5e02
341700=\u6c60\u5dde\u5e02
341800=\u5ba3\u57ce\u5e02
350100=\u798f\u5dde\u5e02
350200=\u53a6\u95e8\u5e02
350300=\u8386\u7530\u5e02
350400=\u4e09\u660e\u5e02
350500=\u6cc9\u5dde\u5e02
350600=\u6f33\u5dde\u5e02
350700=\u5357\u5e73\u5e02
350800=\u9f99\u5ca9\u5e02
350900=\u5b81\u5fb7\u5e02
360100=\u5357\u660c\u5e02
360200=\u666f\u5fb7\u9547\u5e02
360300=\u840d\u4e61\u5e02
360400=\u4e5d\u6c5f\u5e02
360500=\u65b0\u4f59\u5e02
360600=\u9e70\u6f6d\u5e02
360700=\u8d63\u5dde\u5e02
360800=\u5409\u5b89\u5e02
360900=\u5b9c\u6625\u5e02
361000=\u629a\u5dde\u5e02
361100=\u4e0a\u9976\u5e02
370100=\u6d4e\u5357\u5e02
370200=\u9752\u5c9b\u5e02
370300=\u6dc4\u535a\u5e02
370400=\u67a3\u5e84\u5e02
370500=\u4e1c\u8425\u5e02
370600=\u70df\u53f0\u5e02
370700=\u6f4d\u574a\u5e02
370800=\u6d4e\u5b81\u5e02
370900=\u6cf0\u5b89\u5e02
371000=\u5a01\u6d77\u5e02
371100=\u65e5\u7167\u5e02
371200=\u83b1\u829c\u5e02
371300=\u4e34\u6c82\u5e02
371400=\u5fb7\u5dde\u5e02
371500=\u804a\u57ce\u5e02
371600=\u6ee8\u5dde\u5e02
371700=\u83cf\u6cfd\u5e02
410100=\u90d1\u5dde\u5e02
410200=\u5f00\u5c01\u5e02
410300=\u6d1b\u9633\u5e02
410400=\u5e73\u9876\u5c71\u5e02
410500=\u5b89\u9633\u5e02
410600=\u9e64\u58c1\u5e02
410700=\u65b0\u4e61\u5e02
410800=\u7126\u4f5c\u5e02
410900=\u6fee\u9633\u5e02
411000=\u8bb8\u660c\u5e02
411100=\u6f2f\u6cb3\u5e02
411200=\u4e09\u95e8\u5ce1\u5e02
411300=\u5357\u9633\u5e02
411400=\u5546\u4e18\u5e02
411500=\u4fe1\u9633\u5e02
411600=\u5468\u53e3\u5e02
411700=\u9a7b\u9a6c\u5e97\u5e02
420100=\u6b66\u6c49\u5e02
420200=\u9ec4\u77f3\u5e02
420300=\u5341\u5830\u5e02
420500=\u5b9c\u660c\u5e02
420600=\u8944\u6a0a\u5e02
420700=\u9102\u5dde\u5e02
420800=\u8346\u95e8\u5e02
420900=\u5b5d\u611f\u5e02
421000=\u8346\u5dde\u5e02
421100=\u9ec4\u5188\u5e02
421200=\u54b8\u5b81\u5e02
421300=\u968f\u5dde\u5e02
422800=\u6069\u65bd\u571f\u5bb6\u65cf\u82d7\u65cf\u81ea\u6cbb\u5dde
429000=\u7701\u76f4\u8f96\u53bf\u7ea7\u884c\u653f\u533a\u5212
430100=\u957f\u6c99\u5e02
430200=\u682a\u6d32\u5e02
430300=\u6e58\u6f6d\u5e02
430400=\u8861\u9633\u5e02
430500=\u90b5\u9633\u5e02
430600=\u5cb3\u9633\u5e02
430700=\u5e38\u5fb7\u5e02
430800=\u5f20\u5bb6\u754c\u5e02
430900=\u76ca\u9633\u5e02
431000=\u90f4\u5dde\u5e02
431100=\u6c38\u5dde\u5e02
431200=\u6000\u5316\u5e02
431300=\u5a04\u5e95\u5e02
433100=\u6e58\u897f\u571f\u5bb6\u65cf\u82d7\u65cf\u81ea\u6cbb\u5dde
440100=\u5e7f\u5dde\u5e02
440200=\u97f6\u5173\u5e02
440300=\u6df1\u5733\u5e02
440400=\u73e0\u6d77\u5e02
440500=\u6c55\u5934\u5e02
440600=\u4f5b\u5c71\u5e02
440700=\u6c5f\u95e8\u5e02
440800=\u6e5b\u6c5f\u5e02
440900=\u8302\u540d\u5e02
441200=\u8087\u5e86\u5e02
441300=\u60e0\u5dde\u5e02
441400=\u6885\u5dde\u5e02
441500=\u6c55\u5c3e\u5e02
441600=\u6cb3\u6e90\u5e02
441700=\u9633\u6c5f\u5e02
441800=\u6e05\u8fdc\u5e02
441900=\u4e1c\u839e\u5e02
442000=\u4e2d\u5c71\u5e02
445100=\u6f6e\u5dde\u5e02
445200=\u63ed\u9633\u5e02
445300=\u4e91\u6d6e\u5e02
450100=\u5357\u5b81\u5e02
450200=\u67f3\u5dde\u5e02
450300=\u6842\u6797\u5e02
450400=\u68a7\u5dde\u5e02
450500=\u5317\u6d77\u5e02
450600=\u9632\u57ce\u6e2f\u5e02
450700=\u94a6\u5dde\u5e02
450800=\u8d35\u6e2f\u5e02
450900=\u7389\u6797\u5e02
451000=\u767e\u8272\u5e02
451100=\u8d3a\u5dde\u5e02
451200=\u6cb3\u6c60\u5e02
451300=\u6765\u5bbe\u5e02
451400=\u5d07\u5de6\u5e02
460100=\u6d77\u53e3\u5e02
460200=\u4e09\u4e9a\u5e02
469000=\u7701\u76f4\u8f96\u53bf\u7ea7\u884c\u653f\u533a\u5212
500100=\u5e02\u8f96\u533a
500200=\u53bf
510100=\u6210\u90fd\u5e02
510300=\u81ea\u8d21\u5e02
510400=\u6500\u679d\u82b1\u5e02
510500=\u6cf8\u5dde\u5e02
510600=\u5fb7\u9633\u5e02
510700=\u7ef5\u9633\u5e02
510800=\u5e7f\u5143\u5e02
510900=\u9042\u5b81\u5e02
511000=\u5185\u6c5f\u5e02
511100=\u4e50\u5c71\u5e02
511300=\u5357\u5145\u5e02
511400=\u7709\u5c71\u5e02
511500=\u5b9c\u5bbe\u5e02
511600=\u5e7f\u5b89\u5e02
511700=\u8fbe\u5dde\u5e02
511800=\u96c5\u5b89\u5e02
511900=\u5df4\u4e2d\u5e02
512000=\u8d44\u9633\u5e02
513200=\u963f\u575d\u85cf\u65cf\u7f8c\u65cf\u81ea\u6cbb\u5dde
513300=\u7518\u5b5c\u85cf\u65cf\u81ea\u6cbb\u5dde
513400=\u51c9\u5c71\u5f5d\u65cf\u81ea\u6cbb\u5dde
520100=\u8d35\u9633\u5e02
520200=\u516d\u76d8\u6c34\u5e02
520300=\u9075\u4e49\u5e02
520400=\u5b89\u987a\u5e02
522200=\u94dc\u4ec1\u5730\u533a
522300=\u9ed4\u897f\u5357\u5e03\u4f9d\u65cf\u82d7\u65cf\u81ea\u6cbb\u5dde
522400=\u6bd5\u8282\u5730\u533a
522600=\u9ed4\u4e1c\u5357\u82d7\u65cf\u4f97\u65cf\u81ea\u6cbb\u5dde
522700=\u9ed4\u5357\u5e03\u4f9d\u65cf\u82d7\u65cf\u81ea\u6cbb\u5dde
530100=\u6606\u660e\u5e02
530300=\u66f2\u9756\u5e02
530400=\u7389\u6eaa\u5e02
530500=\u4fdd\u5c71\u5e02
530600=\u662d\u901a\u5e02
530700=\u4e3d\u6c5f\u5e02
530800=\u666e\u6d31\u5e02
530900=\u4e34\u6ca7\u5e02
532300=\u695a\u96c4\u5f5d\u65cf\u81ea\u6cbb\u5dde
532500=\u7ea2\u6cb3\u54c8\u5c3c\u65cf\u5f5d\u65cf\u81ea\u6cbb\u5dde
532600=\u6587\u5c71\u58ee\u65cf\u82d7\u65cf\u81ea\u6cbb\u5dde
532800=\u897f\u53cc\u7248\u7eb3\u50a3\u65cf\u81ea\u6cbb\u5dde
532900=\u5927\u7406\u767d\u65cf\u81ea\u6cbb\u5dde
533100=\u5fb7\u5b8f\u50a3\u65cf\u666f\u9887\u65cf\u81ea\u6cbb\u5dde
533300=\u6012\u6c5f\u5088\u50f3\u65cf\u81ea\u6cbb\u5dde
533400=\u8fea\u5e86\u85cf\u65cf\u81ea\u6cbb\u5dde
540100=\u62c9\u8428\u5e02
542100=\u660c\u90fd\u5730\u533a
542200=\u5c71\u5357\u5730\u533a
542300=\u65e5\u5580\u5219\u5730\u533a
542400=\u90a3\u66f2\u5730\u533a
542500=\u963f\u91cc\u5730\u533a
542600=\u6797\u829d\u5730\u533a
610100=\u897f\u5b89\u5e02
610200=\u94dc\u5ddd\u5e02
610300=\u5b9d\u9e21\u5e02
610400=\u54b8\u9633\u5e02
610500=\u6e2d\u5357\u5e02
610600=\u5ef6\u5b89\u5e02
610700=\u6c49\u4e2d\u5e02
610800=\u6986\u6797\u5e02
610900=\u5b89\u5eb7\u5e02
611000=\u5546\u6d1b\u5e02
620100=\u5170\u5dde\u5e02
620200=\u5609\u5cea\u5173\u5e02
620300=\u91d1\u660c\u5e02
620400=\u767d\u94f6\u5e02
620500=\u5929\u6c34\u5e02
620600=\u6b66\u5a01\u5e02
620700=\u5f20\u6396\u5e02
620800=\u5e73\u51c9\u5e02
620900=\u9152\u6cc9\u5e02
621000=\u5e86\u9633\u5e02
621100=\u5b9a\u897f\u5e02
621200=\u9647\u5357\u5e02
622900=\u4e34\u590f\u56de\u65cf\u81ea\u6cbb\u5dde
623000=\u7518\u5357\u85cf\u65cf\u81ea\u6cbb\u5dde
630100=\u897f\u5b81\u5e02
632100=\u6d77\u4e1c\u5730\u533a
632200=\u6d77\u5317\u85cf\u65cf\u81ea\u6cbb\u5dde
632300=\u9ec4\u5357\u85cf\u65cf\u81ea\u6cbb\u5dde
632500=\u6d77\u5357\u85cf\u65cf\u81ea\u6cbb\u5dde
632600=\u679c\u6d1b\u85cf\u65cf\u81ea\u6cbb\u5dde
632700=\u7389\u6811\u85cf\u65cf\u81ea\u6cbb\u5dde
632800=\u6d77\u897f\u8499\u53e4\u65cf\u85cf\u65cf\u81ea\u6cbb\u5dde
640100=\u94f6\u5ddd\u5e02
640200=\u77f3\u5634\u5c71\u5e02
640300=\u5434\u5fe0\u5e02
640400=\u56fa\u539f\u5e02
640500=\u4e2d\u536b\u5e02
650100=\u4e4c\u9c81\u6728\u9f50\u5e02
650200=\u514b\u62c9\u739b\u4f9d\u5e02
652100=\u5410\u9c81\u756a\u5730\u533a
652200=\u54c8\u5bc6\u5730\u533a
652300=\u660c\u5409\u56de\u65cf\u81ea\u6cbb\u5dde
652700=\u535a\u5c14\u5854\u62c9\u8499\u53e4\u81ea\u6cbb\u5dde
652800=\u5df4\u97f3\u90ed\u695e\u8499\u53e4\u81ea\u6cbb\u5dde
652900=\u963f\u514b\u82cf\u5730\u533a
653000=\u514b\u5b5c\u52d2\u82cf\u67ef\u5c14\u514b\u5b5c\u81ea\u6cbb\u5dde
653100=\u5580\u4ec0\u5730\u533a
653200=\u548c\u7530\u5730\u533a
654000=\u4f0a\u7281\u54c8\u8428\u514b\u81ea\u6cbb\u5dde
654200=\u5854\u57ce\u5730\u533a
654300=\u963f\u52d2\u6cf0\u5730\u533a
659000=\u81ea\u6cbb\u533a\u76f4\u8f96\u53bf\u7ea7\u884c\u653f\u533a\u5212

+ 41 - 0
src/main/resources/quartz.properties

@ -0,0 +1,41 @@
# Default Properties file for use by StdSchedulerFactory
# to create a Quartz Scheduler Instance, if a different
# properties file is not explicitly specified.
#
 
org.quartz.scheduler.instanceName: DefaultQuartzScheduler
org.quartz.scheduler.rmi.export: false
org.quartz.scheduler.rmi.proxy: false
org.quartz.scheduler.wrapJobExecutionInUserTransaction: false
 
org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount: 20
org.quartz.threadPool.threadPriority: 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true
 
org.quartz.jobStore.misfireThreshold: 60000
 
#============================================================================
# Configure JobStore
#============================================================================
 
# RAM
# org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore
# Configure JobStore Cluster
org.quartz.jobStore.class:org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass:org.quartz.impl.jdbcjobstore.StdJDBCDelegate
#datasource׺
org.quartz.jobStore.tablePrefix:QRTZ_
#org.quartz.jobStore.dataSource:qzDS
#
##============================================================================
## Configure Datasources
##============================================================================
##datasource
#org.quartz.dataSource.qzDS.driver: com.mysql.jdbc.Driver
#org.quartz.dataSource.qzDS.URL: jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#org.quartz.dataSource.qzDS.user: root
#org.quartz.dataSource.qzDS.password: 123456
org.quartz.jobGroupName = RS_JOBGROUP_NAME
org.quartz.triggerGroupName = RS_TRIGGERGROUP_NAME