Преглед изворни кода

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

wujunjie пре 7 година
родитељ
комит
b783cea769
59 измењених фајлова са 1783 додато и 348 уклоњено
  1. 1 0
      common/common-entity/pom.xml
  2. 82 0
      patient-co/patient-co-figure-label/pom.xml
  3. 29 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/FigureLabelApplication.java
  4. 54 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/DruidConfig.java
  5. 27 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/HibernateProperties.java
  6. 112 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/WlyyJpa.java
  7. 36 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/properties/DataSourceLoginProperties.java
  8. 175 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/properties/DataSourceProperties.java
  9. 92 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/swagger/SwaggerConfig.java
  10. 21 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/war/ServletInitializer.java
  11. 15 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/Convert.java
  12. 18 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/extract/Extracter.java
  13. 17 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/extract/MysqlExtracter.java
  14. 28 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/job/Mysql2ESJob.java
  15. 31 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/model/ExtractModel.java
  16. 67 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/model/SaveModel.java
  17. 14 0
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/storage/Storager.java
  18. 14 0
      patient-co/patient-co-figure-label/src/main/resources/application-dev.yml
  19. 14 0
      patient-co/patient-co-figure-label/src/main/resources/application-test.yml
  20. 30 0
      patient-co/patient-co-figure-label/src/main/resources/application.yml
  21. 23 0
      patient-co/patient-co-figure-label/src/main/resources/banner.txt
  22. 31 0
      patient-co/patient-co-figure-label/src/main/resources/logback.xml
  23. 41 0
      patient-co/patient-co-figure-label/src/main/resources/quartz.properties
  24. 7 47
      patient-co/patient-co-statistics-es/pom.xml
  25. 13 6
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/Application.java
  26. 2 3
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/DataSourceConfig.java
  27. 1 1
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/war/ServletInitializer.java
  28. 1 3
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/PrescriptionDiseaseConvert.java
  29. 18 35
      patient-co/patient-co-wlyy-job/pom.xml
  30. 5 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/Application.java
  31. 1 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/war/ServletInitializer.java
  32. 1 2
      patient-co/patient-co-wlyy-job/src/main/resources/application-dev.yml
  33. 0 1
      patient-co/patient-co-wlyy-job/src/main/resources/application-devtest.yml
  34. 1 1
      patient-co/patient-co-wlyy-job/src/main/resources/application-prod.yml
  35. 17 38
      patient-co/patient-co-wlyy/pom.xml
  36. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/Application.java
  37. 1 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/MvcConfig.java
  38. 0 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java
  39. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/war/ServletInitializer.java
  40. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDao.java
  41. 118 21
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java
  42. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java
  43. 213 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java
  44. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java
  45. 11 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  46. 150 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java
  47. 6 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/pc/prescription/PrescriptionExpressagePCService.java
  48. 83 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/iot/IotDeviceService.java
  49. 16 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/HttpUtil.java
  50. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionInfoController.java
  51. 64 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/iot/IotMonitoringHealthController.java
  52. 23 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/iot/IotDeviceController.java
  53. 4 0
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  54. 4 0
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  55. 5 1
      patient-co/patient-co-wlyy/src/main/resources/application-local.yml
  56. 4 0
      patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml
  57. 5 1
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml
  58. 4 0
      patient-co/patient-co-wlyy/src/main/resources/application-test.yml
  59. 20 150
      pom.xml

+ 1 - 0
common/common-entity/pom.xml

@ -11,6 +11,7 @@
    <modelVersion>4.0.0</modelVersion>
    <artifactId>common-entity</artifactId>
    <version>1.0.0</version>
    <dependencies>
        <dependency>

+ 82 - 0
patient-co/patient-co-figure-label/pom.xml

@ -0,0 +1,82 @@
<?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">
    <parent>
        <artifactId>patient-co-lib</artifactId>
        <groupId>com.yihu</groupId>
        <version>1.0.0</version>
        <relativePath>../../patient-co-lib/pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>patient-co-figure-label</artifactId>
    <dependencies>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>common-entity</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>common-quartz-starter</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>common-logback-starter</artifactId>
            <version>1.0.2</version>
            <exclusions>
                <exclusion>
                    <artifactId>servlet-api</artifactId>
                    <groupId>javax.servlet</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>common-swagger-starter</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-actuator-docs</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>4.3.10.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.0.15</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.5.Final</version>
        </dependency>
    </dependencies>
</project>

+ 29 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/FigureLabelApplication.java

@ -0,0 +1,29 @@
package com.yihu.wlyy.figure.label;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.context.ApplicationContext;
/**
 * Created by chenweida on 2018/3/5.
 */
@SpringBootApplication
@EnableAutoConfiguration(exclude = {
        ElasticsearchAutoConfiguration.class,
        ElasticsearchRepositoriesAutoConfiguration.class,
        ElasticsearchDataAutoConfiguration.class,
        RedisRepositoriesAutoConfiguration.class
})
public class FigureLabelApplication {
    public static ApplicationContext ctx = null;
    public static void main(String[] args) {
        ctx = SpringApplication.run(FigureLabelApplication.class, args);
    }
}

+ 54 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/DruidConfig.java

@ -0,0 +1,54 @@
package com.yihu.wlyy.figure.label.config.db;
import com.alibaba.druid.filter.stat.StatFilter;
import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * Created by chenweida on 2018/3/5.
 */
@Configuration
public class DruidConfig {
    //------------------------------------druid 监控----------------------------------------------
    @Bean
    public ServletRegistrationBean statViewServlet() {
        //创建servlet注册实体
        ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*");
        //设置ip白名单
        //servletRegistrationBean.addInitParameter("allow","127.0.0.1");
        //设置ip黑名单,如果allow与deny共同存在时,deny优先于allow
        // servletRegistrationBean.addInitParameter("deny","192.168.0.19");
        //设置控制台管理用户
        servletRegistrationBean.addInitParameter("loginUsername", "jkzl");
        servletRegistrationBean.addInitParameter("loginPassword", "jkzlehr");
        //是否可以重置数据
        servletRegistrationBean.addInitParameter("resetEnable", "false");
        return servletRegistrationBean;
    }
    @Bean
    public FilterRegistrationBean filterRegistrationBean(WebStatFilter webStatFilter) {
        //创建过滤器
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(webStatFilter);
        //设置过滤器过滤路径
        filterRegistrationBean.addUrlPatterns("/*");
        //忽略过滤的形式
        filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
        return filterRegistrationBean;
    }
    @Bean
    public StatFilter statFilter() {
        return new StatFilter();
    }
    @Bean
    public WebStatFilter webStatFilter() {
        return new WebStatFilter();
    }
    //------------------------------------druid 监控----------------------------------------------
}

+ 27 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/HibernateProperties.java

@ -0,0 +1,27 @@
package com.yihu.wlyy.figure.label.config.db;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Properties;
/**
 * Created by chenweida on 2017/4/6.
 */
@Component
public class HibernateProperties {
    @Value("${hibernate.dialect}")
    private String dialect;
    @Value("${hibernate.show_sql}")
    private String show_sql;
    @Value("${hibernate.ejb.naming_strategy}")
    private String naming_strategy;
    public  Properties hibProperties() {
        Properties properties = new Properties();
        properties.put("hibernate.dialect",dialect);
        properties.put("hibernate.show_sql", show_sql);
        properties.put("hibernate.ejb.naming_strategy", naming_strategy);
        return properties;
    }
}

+ 112 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/WlyyJpa.java

@ -0,0 +1,112 @@
package com.yihu.wlyy.figure.label.config.db;
import com.alibaba.druid.pool.DruidDataSource;
import com.yihu.wlyy.figure.label.config.db.properties.DataSourceProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
/**
 * Created by chenweida on 2017/4/6.
 */
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
        entityManagerFactoryRef = "wlyyEntityManagerFactory",
        transactionManagerRef = "wlyyTransactionManager",
        basePackages = {"com.yihu.wlyy.repository"})   //设置Repository所在位置
public class WlyyJpa {
    @Autowired
    private HibernateProperties hibernateProperties;
    @Autowired
    private DataSourceProperties dataSourceProperties;
    @Autowired
    private DruidConfig druidConfig;
    @Bean(name = "wlyyDataSource")
    @Primary
    public DataSource wlyyDataSource() throws SQLException {
        DruidDataSource datasource = new DruidDataSource();
        datasource.setUrl(dataSourceProperties.getWlyy().getUrl());
        datasource.setUsername(dataSourceProperties.getWlyy().getUsername());
        datasource.setPassword(dataSourceProperties.getWlyy().getPassword());
        datasource.setDriverClassName(dataSourceProperties.getDriverClassName());
        //configuration
        datasource.setInitialSize(dataSourceProperties.getInitialSize());
        datasource.setMinIdle(dataSourceProperties.getMinIdle());
        datasource.setMaxActive(dataSourceProperties.getMaxActive());
        datasource.setMaxWait(dataSourceProperties.getMaxWait());
        datasource.setTimeBetweenEvictionRunsMillis(dataSourceProperties.getTimeBetweenEvictionRunsMillis());
        datasource.setMinEvictableIdleTimeMillis(dataSourceProperties.getMinEvictableIdleTimeMillis());
        datasource.setValidationQuery(dataSourceProperties.getValidationQuery());
        datasource.setTestWhileIdle(dataSourceProperties.getTestWhileIdle());
        datasource.setTestOnBorrow(dataSourceProperties.getTestOnBorrow());
        datasource.setTestOnReturn(dataSourceProperties.getTestOnReturn());
        datasource.setPoolPreparedStatements(dataSourceProperties.getPoolPreparedStatements());
        datasource.setMaxPoolPreparedStatementPerConnectionSize(dataSourceProperties.getMaxPoolPreparedStatementPerConnectionSize());
        datasource.setRemoveAbandoned(dataSourceProperties.getRemoveAbandoned());
        datasource.setRemoveAbandonedTimeout(dataSourceProperties.getRemoveAbandonedTimeout());
        datasource.setLogAbandoned(dataSourceProperties.getLogAbandoned());
        datasource.setFilters(dataSourceProperties.getFilters());
        datasource.setConnectProperties(properties());//;# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
        datasource.setUseGlobalDataSourceStat(true);// 合并多个DruidDataSource的监控数据
        List proxyFilters = new ArrayList<>();
        proxyFilters.add(druidConfig.statFilter());
        datasource.setProxyFilters(proxyFilters);
        return datasource;
    }
    @Bean(name = "wlyyEntityManagerFactory")
    @Primary
    public LocalContainerEntityManagerFactoryBean entityManagerFactoryPrimary(
            @Qualifier("wlyyDataSource") DataSource dataSource) {
        LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
        emfb.setDataSource(dataSource);
        emfb.setPackagesToScan("com.yihu.wlyy.entity");
        emfb.setPersistenceUnitName("wlyy");
        JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
        emfb.setJpaVendorAdapter(vendorAdapter);
        emfb.setJpaProperties(hibernateProperties.hibProperties());
        return emfb;
    }
    @Bean(name = "wlyyTransactionManager")
    @Primary
    JpaTransactionManager transactionManagerSecondary(
            @Qualifier("wlyyEntityManagerFactory") EntityManagerFactory builder) {
        return new JpaTransactionManager(builder);
    }
    private Properties properties() {
        Properties properties = new Properties();
        properties.put("druid.stat.mergeSql", "true");
        properties.put("slowSqlMillis", "1000");
        return properties;
    }
}

+ 36 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/properties/DataSourceLoginProperties.java

@ -0,0 +1,36 @@
package com.yihu.wlyy.figure.label.config.db.properties;
/**
 * Created by chenweida on 2018/3/5.
 */
public class DataSourceLoginProperties {
    private String username;
    private String password;
    private String url;
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
}

+ 175 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/db/properties/DataSourceProperties.java

@ -0,0 +1,175 @@
package com.yihu.wlyy.figure.label.config.db.properties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
 * Created by chenweida on 2018/3/5.
 */
@ConfigurationProperties(prefix = "spring.datasource")
@Component
public class DataSourceProperties {
    private String driverClassName;
    private Integer initialSize;
    private Integer minIdle;
    private Integer maxActive;
    private Integer maxWait;
    private Integer timeBetweenEvictionRunsMillis;
    private Integer minEvictableIdleTimeMillis;
    private String validationQuery;
    private Boolean testWhileIdle;
    private Boolean testOnBorrow;
    private Boolean testOnReturn;
    private Boolean poolPreparedStatements;
    private Integer maxPoolPreparedStatementPerConnectionSize;
    private Boolean removeAbandoned;
    private Integer removeAbandonedTimeout;
    private Boolean logAbandoned;
    private String filters;
    private DataSourceLoginProperties wlyy=new DataSourceLoginProperties();
    public String getDriverClassName() {
        return driverClassName;
    }
    public void setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
    }
    public Integer getInitialSize() {
        return initialSize;
    }
    public void setInitialSize(Integer initialSize) {
        this.initialSize = initialSize;
    }
    public Integer getMinIdle() {
        return minIdle;
    }
    public void setMinIdle(Integer minIdle) {
        this.minIdle = minIdle;
    }
    public Integer getMaxActive() {
        return maxActive;
    }
    public void setMaxActive(Integer maxActive) {
        this.maxActive = maxActive;
    }
    public Integer getMaxWait() {
        return maxWait;
    }
    public void setMaxWait(Integer maxWait) {
        this.maxWait = maxWait;
    }
    public Integer getTimeBetweenEvictionRunsMillis() {
        return timeBetweenEvictionRunsMillis;
    }
    public void setTimeBetweenEvictionRunsMillis(Integer timeBetweenEvictionRunsMillis) {
        this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
    }
    public Integer getMinEvictableIdleTimeMillis() {
        return minEvictableIdleTimeMillis;
    }
    public void setMinEvictableIdleTimeMillis(Integer minEvictableIdleTimeMillis) {
        this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
    }
    public String getValidationQuery() {
        return validationQuery;
    }
    public void setValidationQuery(String validationQuery) {
        this.validationQuery = validationQuery;
    }
    public Boolean getTestWhileIdle() {
        return testWhileIdle;
    }
    public void setTestWhileIdle(Boolean testWhileIdle) {
        this.testWhileIdle = testWhileIdle;
    }
    public Boolean getTestOnBorrow() {
        return testOnBorrow;
    }
    public void setTestOnBorrow(Boolean testOnBorrow) {
        this.testOnBorrow = testOnBorrow;
    }
    public Boolean getTestOnReturn() {
        return testOnReturn;
    }
    public void setTestOnReturn(Boolean testOnReturn) {
        this.testOnReturn = testOnReturn;
    }
    public Boolean getPoolPreparedStatements() {
        return poolPreparedStatements;
    }
    public void setPoolPreparedStatements(Boolean poolPreparedStatements) {
        this.poolPreparedStatements = poolPreparedStatements;
    }
    public Integer getMaxPoolPreparedStatementPerConnectionSize() {
        return maxPoolPreparedStatementPerConnectionSize;
    }
    public void setMaxPoolPreparedStatementPerConnectionSize(Integer maxPoolPreparedStatementPerConnectionSize) {
        this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize;
    }
    public Boolean getRemoveAbandoned() {
        return removeAbandoned;
    }
    public void setRemoveAbandoned(Boolean removeAbandoned) {
        this.removeAbandoned = removeAbandoned;
    }
    public Integer getRemoveAbandonedTimeout() {
        return removeAbandonedTimeout;
    }
    public void setRemoveAbandonedTimeout(Integer removeAbandonedTimeout) {
        this.removeAbandonedTimeout = removeAbandonedTimeout;
    }
    public Boolean getLogAbandoned() {
        return logAbandoned;
    }
    public void setLogAbandoned(Boolean logAbandoned) {
        this.logAbandoned = logAbandoned;
    }
    public String getFilters() {
        return filters;
    }
    public void setFilters(String filters) {
        this.filters = filters;
    }
    public DataSourceLoginProperties getWlyy() {
        return wlyy;
    }
    public void setWlyy(DataSourceLoginProperties wlyy) {
        this.wlyy = wlyy;
    }
}

+ 92 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/swagger/SwaggerConfig.java

@ -0,0 +1,92 @@
package com.yihu.wlyy.figure.label.config.swagger;
import io.github.swagger2markup.GroupBy;
import io.github.swagger2markup.Language;
import io.github.swagger2markup.Swagger2MarkupConfig;
import io.github.swagger2markup.Swagger2MarkupConverter;
import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder;
import io.github.swagger2markup.markup.builder.MarkupLanguage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.async.DeferredResult;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
import static com.google.common.base.Predicates.or;
import static springfox.documentation.builders.PathSelectors.regex;
@EnableSwagger2
@Configuration
public class SwaggerConfig {
    private static final String Other_API = "other";
    @Bean
    public Docket otherAPI() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName(Other_API)
                .genericModelSubstitutes(DeferredResult.class)
                .useDefaultResponseMessages(false)
                .forCodeGeneration(true)
                .pathMapping("/")
                .select()
                .paths(or(
                        regex("/.*")
                ))
                .build()
                .apiInfo(otherApiInfo());
    }
    private ApiInfo otherApiInfo() {
        ApiInfo apiInfo = new ApiInfo("居民画像平台API",
                "居民画像平台API",
                "1.0",
                "No terms of service",
                "admin@jkzl.com",
                "The Apache License, Version 2.0",
                "http://www.apache.org/licenses/LICENSE-2.0.html"
        );
        return apiInfo;
    }
    /**
     * 生成html文章专用
     *
     private static final String Doctor_API = "doctor";
     private static final String Patient_API = "patient";
     private static final String Other_API = "other";
     private static final String GateWay_API = "gateway";
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {
        String groupName="doctor";
        //String groupName="patient";
        //String groupName="other";
        // String groupName="gateway";
        URL remoteSwaggerFile = new URL("http://127.0.0.1:8080//v2/api-docs?group="+groupName);
        Path outputFile = Paths.get("patient-co/patient-co-figure-label/build/"+groupName);
        Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
                .withMarkupLanguage(MarkupLanguage.ASCIIDOC)
                .withOutputLanguage(Language.ZH)
                .withPathsGroupedBy(GroupBy.TAGS)
                .withGeneratedExamples()
                .withoutInlineSchema()
                .withBasePathPrefix()
                .build();
        Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(remoteSwaggerFile)
                .withConfig(config)
                .build();
        converter.toFile(outputFile);
    }
}

+ 21 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/config/war/ServletInitializer.java

@ -0,0 +1,21 @@
package com.yihu.wlyy.figure.label.config.war;//package com.yihu.wlyy.config.war;
import com.yihu.wlyy.figure.label.FigureLabelApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
/**
 *
 */
public class ServletInitializer extends SpringBootServletInitializer {
    public ServletInitializer() {
        super();
        setRegisterErrorPageFilter(false); //报错不跳到错误页
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(FigureLabelApplication.class);
    }
}

+ 15 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/Convert.java

@ -0,0 +1,15 @@
package com.yihu.wlyy.figure.label.convert;
import com.yihu.wlyy.figure.label.model.ExtractModel;
import com.yihu.wlyy.figure.label.model.SaveModel;
import java.util.List;
/**
 * Created by chenweida on 2018/3/7.
 * 数据转换
 */
public interface Convert {
    List<SaveModel> convert(List<ExtractModel> extractModels);
}

+ 18 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/extract/Extracter.java

@ -0,0 +1,18 @@
package com.yihu.wlyy.figure.label.extract;
import com.yihu.wlyy.figure.label.model.ExtractModel;
import java.util.List;
/**
 * Created by chenweida on 2018/3/7.
 * 数据抽取器
 */
public interface Extracter {
    /**
     * 数据抽取
     *
     * @return
     */
    List<ExtractModel> extract();
}

+ 17 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/extract/MysqlExtracter.java

@ -0,0 +1,17 @@
package com.yihu.wlyy.figure.label.extract;
import com.yihu.wlyy.figure.label.model.ExtractModel;
import org.springframework.stereotype.Component;
import java.util.List;
/**
 * Created by chenweida on 2018/3/7.
 */
@Component
public class MysqlExtracter implements Extracter {
    @Override
    public List<ExtractModel> extract() {
        return null;
    }
}

+ 28 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/job/Mysql2ESJob.java

@ -0,0 +1,28 @@
package com.yihu.wlyy.figure.label.job;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
 * Created by chenweida on 2018/3/7.
 */
@Component
@Scope("prototype")
@DisallowConcurrentExecution//防止到了执行时间点前一任务还在执行中,但是这时有空闲的线程,那么马上又会执行,这样一来就会存在同一job被并行执行
public class Mysql2ESJob implements Job {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        //1抽取数据
        //1.1数据转换
        // 如果表fl_label_dict_job中有配置convert_clazz就进行数据转换获取标签
        //2数据保存
    }
}

+ 31 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/model/ExtractModel.java

@ -0,0 +1,31 @@
package com.yihu.wlyy.figure.label.model;
/**
 * Created by chenweida on 2018/3/7.
 */
public class ExtractModel {
    /**
     *  身份证
     */
    private String idcard;
    /**
     * 数据
     */
    private String data;
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getData() {
        return data;
    }
    public void setData(String data) {
        this.data = data;
    }
}

+ 67 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/model/SaveModel.java

@ -0,0 +1,67 @@
package com.yihu.wlyy.figure.label.model;
/**
 * Created by chenweida on 2018/3/7.
 */
public class SaveModel {
    /**
     * 身份证
     */
    private String idcard;
    /**
     * 标签类型
     */
    private String labelType;
    /**
     * 标签code
     */
    private String labelCode;
    /**
     * 标签名称
     */
    private String labeName;
    /**
     * 创建时间
     */
    private String createTime;
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getLabelType() {
        return labelType;
    }
    public void setLabelType(String labelType) {
        this.labelType = labelType;
    }
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabeName() {
        return labeName;
    }
    public void setLabeName(String labeName) {
        this.labeName = labeName;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}

+ 14 - 0
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/storage/Storager.java

@ -0,0 +1,14 @@
package com.yihu.wlyy.figure.label.storage;
import com.yihu.wlyy.figure.label.model.SaveModel;
import java.util.List;
/**
 * Created by chenweida on 2018/3/7.
 * 存储器
 */
public interface Storager {
    void save(List<SaveModel> modelList);
}

+ 14 - 0
patient-co/patient-co-figure-label/src/main/resources/application-dev.yml

@ -0,0 +1,14 @@
##开发的配置
spring:
  profiles: dev
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.85/figure_lable?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
quartz:
  namespace: patient-co-figure-label ##quartz的命名空间,名称一样实现消费负载
  overwriteExistingJobs: false ##是否覆盖job

+ 14 - 0
patient-co/patient-co-figure-label/src/main/resources/application-test.yml

@ -0,0 +1,14 @@
##开发的配置
spring:
  profiles: dev
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.77/figure_lable?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
      password: 123456
quartz:
  namespace: patient-co-figure-label ##quartz的命名空间,名称一样实现消费负载
  overwriteExistingJobs: false ##是否覆盖job

+ 30 - 0
patient-co/patient-co-figure-label/src/main/resources/application.yml

@ -0,0 +1,30 @@
server:
  port: 8080
spring:
  datasource:
    driverClassName: com.mysql.jdbc.Driver
    initialSize: 50
    maxActive: 50
    minIdle: 50 #最大空闲连接
    maxWait: 50
    validationQuery: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
    testOnBorrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
    testOnReturn: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
    testWhileIdle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
    minEvictableIdleTimeMillis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    timeBetweenEvictionRunsMillis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
    poolPreparedStatements: true # 打开PSCache,并且指定每个连接上PSCache的大小
    maxPoolPreparedStatementPerConnectionSize: 50
    removeAbandoned: false #超过时间限制是否回收
    removeAbandonedTimeout: 7200 #超时时间;单位为秒。180秒=3分钟
    logAbandoned: false #关闭abanded连接时输出错误日志
    filters: stat,wall,logback #配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙
hibernate:
  dialect: org.hibernate.dialect.MySQL5Dialect
  show_sql: false
  ejb:
    naming_strategy: org.hibernate.cfg.ImprovedNamingStrategy

+ 23 - 0
patient-co/patient-co-figure-label/src/main/resources/banner.txt

@ -0,0 +1,23 @@
${AnsiColor.BRIGHT_GREEN}
                                    ////////////////////////////////////////////////////////////////////
                                    //                          _ooOoo_                               //
                                    //                         o8888888o                              //
                                    //                         88" . "88                              //
                                    //                         (| ^_^ |)                              //
                                    //                         O\  =  /O                              //
                                    //                      ____/`---'\____                           //
                                    //                    .'  \\|     |//  `.                         //
                                    //                   /  \\|||  :  |||//  \                        //
                                    //                  /  _||||| -:- |||||-  \                       //
                                    //                  |   | \\\  -  /// |   |                       //
                                    //                  | \_|  ''\---/''  |   |                       //
                                    //                  \  .-\__  `-`  ___/-. /                       //
                                    //                ___`. .'  /--.--\  `. . ___                     //
                                    //              ."" '<  `.___\_<|>_/___.'  >'"".                  //
                                    //            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //
                                    //            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //
                                    //      ========`-.____`-.___\_____/___.-`____.-'========         //
                                    //                           `=---='                              //
                                    //      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
                                    //            佛祖保佑       永不宕机     永无BUG                 //
                                    ////////////////////////////////////////////////////////////////////

+ 31 - 0
patient-co/patient-co-figure-label/src/main/resources/logback.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/base.xml"/>
    <logger name="io.searchbox" level="WARN"/>
    <jmxConfigurator/>
    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy/MM/dd-HH:mm:ss} %level [%thread] %caller{1} - %msg%n</pattern>
            <charset class="java.nio.charset.Charset">UTF-8</charset>
        </encoder>
    </appender>
    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/tmp/logs/figure-label</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/tmp/logs/figure-label.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>15</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
            <charset class="java.nio.charset.Charset">UTF-8</charset>
        </encoder>
    </appender>
    <root level="INFO">
        <!--<appender-ref ref="console" />-->
        <appender-ref ref="rollingFile"/>
    </root>
</configuration>

+ 41 - 0
patient-co/patient-co-figure-label/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

+ 7 - 47
patient-co/patient-co-statistics-es/pom.xml

@ -18,7 +18,6 @@
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.version>${version.spring-framework}</spring.version>
        <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>
@ -46,9 +45,6 @@
        <version.quartz>2.2.3</version.quartz>
        <version.servlet-api>3.1.0</version.servlet-api>
        <version.slf4j>1.7.21</version.slf4j>
        <version.spring-boot>1.3.5.RELEASE</version.spring-boot>
        <version.spring-framework>4.2.5.RELEASE</version.spring-framework>
        <version.spring-session>1.2.0.RELEASE</version.spring-session>
        <version.swagger>2.4.0</version.swagger>
        <version.swagger-ui>2.4.0</version.swagger-ui>
        <version.tomcat-embed>8.0.28</version.tomcat-embed>
@ -204,11 +200,6 @@
            <artifactId>joda-time</artifactId>
            <version>${version.joda-time}</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>${version.jedis}</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
@ -269,60 +260,43 @@
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <!--Spring session family-->
        <dependency>
            <groupId>org.springframework.session</groupId>
            <artifactId>spring-session</artifactId>
            <version>${version.spring-session}</version>
        </dependency>
        <!--Spring integration family-->
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-jmx</artifactId>
            <version>${version.spring-framework}</version>
        </dependency>
        <!--Spring batch family-->
@ -331,12 +305,10 @@
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot</artifactId>
            <version>${version.spring-boot}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-actuator-docs</artifactId>
            <version>${version.spring-boot}</version>
        </dependency>
        <!--<dependency>-->
        <!--<groupId>org.springframework.boot</groupId>-->
@ -346,47 +318,43 @@
        <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-actuator</artifactId>
            <version>${version.spring-boot}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</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-thymeleaf</artifactId>
            <version>${version.spring-boot}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>${version.spring-boot}</version>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
            <version>${version.spring-boot}</version>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>4.3.10.RELEASE</version>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>de.codecentric</groupId>-->
@ -396,7 +364,6 @@
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${version.spring-boot}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
@ -407,7 +374,6 @@
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <version>${version.spring-boot}</version>
            <!--<scope>provided</scope>-->
        </dependency>
        <dependency>
@ -415,15 +381,9 @@
            <artifactId>json</artifactId>
            <version>20151123</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>1.7.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>4.1.8.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>net.sf.json-lib</groupId>

+ 13 - 6
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/Application.java

@ -1,15 +1,16 @@
package com.yihu.wlyy;
import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.boot.context.web.ErrorPageFilter;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.support.ErrorPageFilter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
/**
@ -19,6 +20,12 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@EnableJpaRepositories(
        entityManagerFactoryRef = "wlyyEntityManagerFactory",
        transactionManagerRef = "wlyyTransactionManager")
@EnableAutoConfiguration(exclude = {
        ElasticsearchAutoConfiguration.class,
        ElasticsearchRepositoriesAutoConfiguration.class,
        ElasticsearchDataAutoConfiguration.class,
        RedisRepositoriesAutoConfiguration.class
})
public class Application {
    public static ApplicationContext ctx = null;
    public static void main(String[] args) {

+ 2 - 3
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/DataSourceConfig.java

@ -5,9 +5,8 @@ import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

+ 1 - 1
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/config/war/ServletInitializer.java

@ -2,7 +2,7 @@ package com.yihu.wlyy.statistics.config.war;
import com.yihu.wlyy.Application;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.boot.web.support.SpringBootServletInitializer;
/**
 * Created by Administrator on 2016.10.14.

+ 1 - 3
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/PrescriptionDiseaseConvert.java

@ -52,9 +52,7 @@ public class PrescriptionDiseaseConvert implements Convert {
                "  health_problem AS healthProblem ," +
                "  prescription_code AS prescriptionCode " +
                "  FROM " +
                "  wlyy_prescription_diagnosis "+
                "WHERE " +
                "p.`code`=d.prescription_code AND p.status=100 ";
                "  wlyy_prescription_diagnosis ";
        List<Map<String, Object>> diagnosisList = jdbcTemplate.queryForList(sql);
        for (Map<String, Object> map : diagnosisList) {

+ 18 - 35
patient-co/patient-co-wlyy-job/pom.xml

@ -84,10 +84,6 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
@ -100,6 +96,14 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-activemq</artifactId>
        </dependency>
        <!-- end -->
        <dependency>
@ -130,27 +134,6 @@
            <artifactId>spring-jms</artifactId>
        </dependency>
        <!-- spring end -->
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-broker</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-jaas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-camel</artifactId>
        </dependency>
        <!--Swagger start -->
        <dependency>
            <groupId>io.springfox</groupId>
@ -213,6 +196,11 @@
            <artifactId>springside-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>4.3.10.RELEASE</version>
        </dependency>
        <!-- PERSISTENCE begin -->
        <!-- hibernate -->
        <dependency>
@ -414,16 +402,6 @@
            <artifactId>quartz</artifactId>
        </dependency>
        <!-- quartz end  -->
        <!-- redis start  -->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
        </dependency>
        <!-- redis end  -->
        <!--fastdfs start-->
        <dependency>
            <groupId>org.csource</groupId>
@ -443,6 +421,11 @@
            <groupId>com.ylz</groupId>
            <artifactId>onpay-java-sdk-all</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.5.Final</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>wlyy-job</finalName>

+ 5 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/Application.java

@ -4,7 +4,9 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.context.ApplicationContext;
/**
@ -13,7 +15,9 @@ import org.springframework.context.ApplicationContext;
@SpringBootApplication
@EnableAutoConfiguration(exclude = {
        ElasticsearchAutoConfiguration.class,
        ElasticsearchRepositoriesAutoConfiguration.class
        ElasticsearchRepositoriesAutoConfiguration.class,
        ElasticsearchDataAutoConfiguration.class,
        RedisRepositoriesAutoConfiguration.class
})
public class Application {
    public static ApplicationContext ctx = null;

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/war/ServletInitializer.java

@ -2,7 +2,7 @@ package com.yihu.wlyy.config.war;//package com.yihu.wlyy.config.war;
import com.yihu.wlyy.Application;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.boot.web.support.SpringBootServletInitializer;
/**
 * Created by Administrator on 2016.10.14.

+ 1 - 2
patient-co/patient-co-wlyy-job/src/main/resources/application-dev.yml

@ -15,13 +15,12 @@ spring:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password:
channel:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password: jkzl_ehr
    password:
server:
  server_url: http://weixin.xmtyw.cn/wlyy-dev/

+ 0 - 1
patient-co/patient-co-wlyy-job/src/main/resources/application-devtest.yml

@ -15,7 +15,6 @@ spring:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password:
channel:
  redis:

+ 1 - 1
patient-co/patient-co-wlyy-job/src/main/resources/application-prod.yml

@ -111,7 +111,7 @@ express:
activemq:
  username: jkzl
  password: jkzlehr
  url: tcp://192.168.120.153:61616
  url: tcp://59.61.92.90:9103
  queue:
    healtHarticleQueue: healthArticleChannel  #健康文章推送
  consumers:

+ 17 - 38
patient-co/patient-co-wlyy/pom.xml

@ -1,15 +1,13 @@
<?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>
        <artifactId>patient-co-lib</artifactId>
        <groupId>com.yihu</groupId>
        <version>1.0.0</version>
        <relativePath>../../patient-co-lib/pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>patient-co-wlyy</artifactId>
    <name>patient-co-wlyy</name>
    <version>1.0.0</version>
@ -38,6 +36,7 @@
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>common-entity</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
@ -91,11 +90,11 @@
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
            <artifactId>spring-boot-starter-activemq</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
@ -118,11 +117,6 @@
        </dependency>
        <!-- spring start -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
@ -140,28 +134,6 @@
            <artifactId>spring-jms</artifactId>
        </dependency>
        <!-- spring end -->
        <!--activemq start-->
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-broker</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-jaas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-camel</artifactId>
        </dependency>
        <!--activemq end-->
        <!--Swagger start -->
        <dependency>
            <groupId>io.springfox</groupId>
@ -421,13 +393,10 @@
        </dependency>
        <!--二维码生成 end-->
        <!-- redis start  -->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <!-- redis end  -->
        <!--fastdfs start-->
@ -502,6 +471,16 @@
            <artifactId>pinyin4j</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.5.Final</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>4.3.10.RELEASE</version>
        </dependency>
        <!--拼音https://mvnrepository.com/artifact/org.clojars.cbilson/pinyin4j end-->
    </dependencies>
    <build>

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/Application.java

@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.context.ApplicationContext;
/**
@ -15,7 +16,8 @@ import org.springframework.context.ApplicationContext;
@EnableAutoConfiguration(exclude = {
        ElasticsearchAutoConfiguration.class,
        ElasticsearchRepositoriesAutoConfiguration.class,
        ElasticsearchDataAutoConfiguration.class
        ElasticsearchDataAutoConfiguration.class,
        RedisRepositoriesAutoConfiguration.class
})
public class Application {
    public static ApplicationContext ctx = null;

+ 1 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/MvcConfig.java

@ -8,17 +8,14 @@ import com.yihu.wlyy.util.SystemConf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.io.File;
/**
 * Created by chenweida on 2017/4/6.
 */

+ 0 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -207,7 +207,6 @@ public class SwaggerConfig {
                "The Apache License, Version 2.0",
                "http://www.apache.org/licenses/LICENSE-2.0.html"
        );
        return apiInfo;
    }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/war/ServletInitializer.java

@ -2,7 +2,7 @@ package com.yihu.wlyy.config.war;//package com.yihu.wlyy.config.war;
import com.yihu.wlyy.Application;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.boot.web.support.SpringBootServletInitializer;
/**
 * Created by Administrator on 2016.10.14.

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDao.java

@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
@ -20,6 +21,10 @@ public interface PrescriptionDao extends PagingAndSortingRepository<Prescription
    @Query("update Prescription p set p.status=?2 where p.code=?1")
    void updateStatus(String prescriptionCode,Integer status);
    @Modifying
    @Query("update Prescription p set p.status=?2 ,p.finishTime =?3 where p.code=?1")
    void updateStatus(String prescriptionCode, Integer status, Date date);
    @Query("select p from Prescription p where p.jwCode=?1 and p.status=?2 and p.patient=?3 ")
    List<Prescription> fingdByJwCodeAndStatus(String jwcode,Integer status,String patient);
    //根据处方code得到患者信息

+ 118 - 21
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -5,7 +5,6 @@ import com.yihu.wlyy.entity.device.Device;
import com.yihu.wlyy.entity.device.PatientBloodSugger;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.device.PatientHealthTime;
import com.yihu.wlyy.entity.dict.Icd10Dict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
@ -23,7 +22,9 @@ import com.yihu.wlyy.repository.doctor.SignPatientLabelInfoDao;
import com.yihu.wlyy.repository.patient.*;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.system.Icd10DictServcie;
import com.yihu.wlyy.service.third.iot.IotDeviceService;
import com.yihu.wlyy.service.third.jw.JwSmjkService;
import com.yihu.wlyy.util.DateUtil;
@ -59,7 +60,8 @@ public class PatientDeviceService extends BaseService {
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private Icd10DictServcie icd10DictServcie;
    @Autowired
    private PatientDeviceDao patientDeviceDao;
@ -87,7 +89,8 @@ public class PatientDeviceService extends BaseService {
    private PatientHealthStandardDao patientHealthStandardDao;
    @Autowired
    private HttpClientUtil HttpClientUtil;
    @Autowired
    private PrescriptionService prescriptionService;
    @Value("${yihu.yihu_OpenPlatform_url}")
    private String url;
    @Value("${yihu.yihu_OpenPlatform_appId}")
@ -107,7 +110,10 @@ public class PatientDeviceService extends BaseService {
    private IotDeviceService iotDeviceService;
    @Autowired
    private Icd10DictDao icd10DictDao;
    //健康问题 高血压
    private static final String gxy = "HP0093";
    //健康问题 糖尿病
    private static final String tnb = "HP0047";
    Map<Integer, String> relations = new HashMap<>();
    @PostConstruct
@ -209,7 +215,12 @@ public class PatientDeviceService extends BaseService {
//            }
        if(checkDeviceSn(sn)){
//            patientDeviceDao.save(patientDevice);
            savePatientDevice(patientDevice,patient.getAddress(),patient.getName());
            SignFamily signFamily = signFamilyDao.findByPatient(patient.getCode());
            String hospital = null;
            if(signFamily!=null){
                hospital = signFamily.getHospitalName();
            }
            savePatientDevice(patientDevice,patient.getAddress(),patient.getName(),patient.getDiseaseCondition(),hospital);
        }else {
            String message = "设备不存在";
            throw new Exception(message);
@ -222,9 +233,9 @@ public class PatientDeviceService extends BaseService {
     * 设备绑定
     * @param patientDevice
     */
    public void savePatientDevice(PatientDevice patientDevice,String address,String patientName){
    public void savePatientDevice(PatientDevice patientDevice,String address,String patientName,Integer diseaseCondition,String hospitalName){
        if(iotDeviceService.isUploadIot()){
            iotDeviceService.saveDevice(patientDevice,address,patientName);
            iotDeviceService.saveDevice(patientDevice,address,patientName,diseaseCondition,hospitalName);
        }else {
            patientDeviceDao.save(patientDevice);
        }
@ -689,7 +700,7 @@ public class PatientDeviceService extends BaseService {
     * @return
     */
    public List<com.alibaba.fastjson.JSONObject> chronicDiseaseCount(String type){
        StringBuffer sql = new StringBuffer("SELECT p.disease_condition diseaseCondition,COUNT(*) num ");
        StringBuffer sql = new StringBuffer("SELECT ifnull(p.disease_condition,-1) diseaseCondition,COUNT(*) num ");
        sql.append("from ( SELECT DISTINCT f.* from wlyy_patient_device d,wlyy_sign_family f  ");
        sql.append("WHERE f.`status`>0 and f.patient = d.`user`) t,wlyy_patient p ");
        if(StringUtils.isNotBlank(type)){
@ -749,6 +760,30 @@ public class PatientDeviceService extends BaseService {
        return list;
    }
    /**
     * 居民 医生搜索
     * @param name
     * @param page
     * @param pageSize
     */
    public List<com.alibaba.fastjson.JSONObject> searchPatient(String name,Integer page,Integer pageSize){
        StringBuffer sql = new StringBuffer("SELECT p.code,p.name,p.address,p.idcard,p.sex,GROUP_CONCAT(label_name) labelName,t.doctor_name doctorName ");
        sql.append("FROM ( SELECT DISTINCT f.* FROM wlyy_patient_device d, wlyy_sign_family f ");
        sql.append("WHERE f.`status` > 0 AND f.patient = d.`user` ) t, wlyy_patient p LEFT JOIN ");
        sql.append("wlyy_sign_patient_label_info l on  p. CODE = l.patient and l.`status`=1 ");
        sql.append("AND l.label_type = 3 and (l.label=2 or l.label=1) WHERE t.patient = p. CODE ");
        if(StringUtils.isNotBlank(name)){
            sql.append(" and (p.`name` like '%"+name+"%' or t.doctor_name like '%"+name+"%') ");
        }
        sql.append("GROUP BY p.code,p.name,p.address,p.idcard,p.sex LIMIT ?,? ");
        List<com.alibaba.fastjson.JSONObject> list = myJdbcTemplate.queryJson(sql.toString(),new Object[]{(page-1)*pageSize,pageSize});
        list.forEach(json->{
            json.put("age", IdCardUtil.getAgeForIdcard(String.valueOf(json.get("idcard"))));
        });
        return list;
    }
    /**
     * 判断当前值是否在区间内
     */
@ -908,6 +943,9 @@ public class PatientDeviceService extends BaseService {
        int eventSize = 0;//就诊次数
        int times = 0;//住院次数
        int num = 10;//查找10次后就不找了。
        int ni = 0;
        String drugs = "";
        if (!StringUtils.isEmpty(response)) {
            JSONArray array = new JSONArray(response);
            if (!"[{}]".equals(response)) {
@ -925,22 +963,45 @@ public class PatientDeviceService extends BaseService {
                    if(StringUtils.isNotBlank(type)){
                        //根据icd10过滤数据
                        String icdCode = item.optString("ICD_CODE");
                        Icd10Dict icd10Dict = icd10DictDao.findByCode(icdCode);
                        if(icd10Dict==null){
                            continue;
                        }
                        if("1".equals(type)){
                            //血糖
                            if(!"2".equals(icd10Dict.getType())){
                                continue;
                        String icdCode = item.optString("DIAGNOSIS");
                        String icd10 = icd10DictServcie.getHealthProblemsByIcd10Code(icdCode);
                        if(StringUtils.isNotBlank(icd10)){
                            com.alibaba.fastjson.JSONObject icd = com.alibaba.fastjson.JSONObject.parseObject(icd10);
                            String key = icd.getString("key");
                            if ("1".equals(type)) {
                                //主诊断为糖尿病
                                if(!tnb.equals(key)){
                                    continue;
                                }
                            } else  if("2".equals(type)){
                                //主诊断为高血压
                                if(!gxy.equals(key)){
                                    continue;
                                }
                            }
                        }else {
                            //血压
                            if(!"1".equals(icd10Dict.getType())){
                                continue;
                            }
                            continue;
                        }
//                        Icd10Dict icd10Dict = icd10DictDao.findByCode(icdCode);
//                        if(icd10Dict==null){
//                            continue;
//                        }
//                        if("1".equals(type)){
//                            //血糖
//                            if(!"2".equals(icd10Dict.getType())){
//                                continue;
//                            }
//                        }else {
//                            //血压
//                            if(!"1".equals(icd10Dict.getType())){
//                                continue;
//                            }
//                        }
                        ni++;
                        if(ni<num&&StringUtils.isEmpty(drugs)){
                            drugs = prescriptionService.findPatientMedicationRecords(patientCode,item.optString("END_TIME").toString(),type);
                        }
                    }
                    if("2".equals(item.optString("TYPE"))){
                        times++;
@ -982,6 +1043,7 @@ public class PatientDeviceService extends BaseService {
        statistics.put("times",times);
        json.put("statistics",statistics);
        json.put("list",re);
        json.put("drugs",drugs);
        return json;
    }
@ -1043,4 +1105,39 @@ public class PatientDeviceService extends BaseService {
        }
        return name;
    }
    
    /**
     * 根据病种类型,搜索已绑定设备的居民设备SN码
     * @param type 1高血压 2糖尿病
     */
    public com.alibaba.fastjson.JSONObject iotSearchPatientDeviceSN(String type,Integer page,Integer pageSize){
    
        if(page != 0){
            page = page - 1;
        }
        
        StringBuffer sql = new StringBuffer("select t.device_sn from");
        sql.append("  ( SELECT DISTINCT d.* FROM wlyy_patient_device d, wlyy_sign_family f WHERE f.`status` > 0 AND f.patient = d.`user` ) t, ");
        sql.append("    wlyy_patient p " );
        sql.append("  LEFT JOIN wlyy_sign_patient_label_info l on  p. CODE = l.patient");
        sql.append("   and l.`status`=1 AND l.label_type = 3 and l.label='"+type+"'");
        sql.append(" WHERE t.user = p. CODE limit "+page+","+pageSize);
        List<String> list = jdbcTemplate.queryForList(sql.toString(),String.class);
        
        Integer count = 0;
    
        StringBuffer countsql = new StringBuffer("select count(t.device_sn) total from");
        countsql.append("  ( SELECT DISTINCT d.* FROM wlyy_patient_device d, wlyy_sign_family f WHERE f.`status` > 0 AND f.patient = d.`user` ) t, ");
        countsql.append("    wlyy_patient p " );
        countsql.append("  LEFT JOIN wlyy_sign_patient_label_info l on  p. CODE = l.patient");
        countsql.append("   and l.`status`=1 AND l.label_type = 3 and l.label='"+type+"'");
        countsql.append(" WHERE t.user = p. CODE ");
    
        count = jdbcTemplate.queryForObject(countsql.toString(),Integer.class);
    
        com.alibaba.fastjson.JSONObject result = new com.alibaba.fastjson.JSONObject();
        result.put("total",count);
        result.put("list",list);
        return result;
    }
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java

@ -333,7 +333,7 @@ public class SFExpressService extends BaseService {
            //如果路由信息节点包含了"已收件"节点,这修改处方派送状态为完成,增加物流派送日志为完成
            if(isContainEndRoutInfo){
                //修改处方状态为完成
                prescriptionDao.updateStatus(sfexpress_obj.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue());
                prescriptionDao.updateStatus(sfexpress_obj.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue(),new Date());
                //保存配送成功的日志
                PrescriptionLog prescriptionLog = new PrescriptionLog();
@ -459,7 +459,7 @@ public class SFExpressService extends BaseService {
            //如果路由信息节点包含了"已收件"节点,则修改处方状态为完成,增加物流派送日志为完成
            if(isContainEndRoutInfo){
                //修改处方状态为完成
                prescriptionDao.updateStatus(sfexpress.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue());
                prescriptionDao.updateStatus(sfexpress.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue(),new Date());
                //保存配送成功的日志
                PrescriptionLog prescriptionLog = new PrescriptionLog();

+ 213 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -1137,6 +1137,7 @@ public class PatientHealthIndexService extends BaseService {
//        return re;
//    }
    /**
     * 按时间段查询患者健康指标
     *
@ -1148,9 +1149,6 @@ public class PatientHealthIndexService extends BaseService {
     */
    public JSONArray findChartByPatient(String patient, int type, int gi_type, String begin, String end) {
        JSONArray re = new JSONArray();
        Date startDate = DateUtil.strToDate(begin, DateUtil.YYYY_MM_DD_HH_MM_SS);
        Date endDate = DateUtil.strToDate(end, DateUtil.YYYY_MM_DD_HH_MM_SS);
        String sql = "SELECT " +
                "MIN(id) id" +
                ", user" +
@ -1208,6 +1206,218 @@ public class PatientHealthIndexService extends BaseService {
        return re;
    }
    /**
     * 按时间段查询患者健康指标
     *
     * @param type    健康指标类型(1血糖,2血压,3体重,4腰围)
     * @param gi_type 血糖就餐时间段(早餐前,早餐后等)
     * @param begin   开始时间
     * @param end     结束时间
     * @return
     */
    public com.alibaba.fastjson.JSONObject findChartByPatientIot(String patient, int type, int gi_type, String begin, String end,String time) {
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        com.alibaba.fastjson.JSONArray re = new com.alibaba.fastjson.JSONArray();
        int high = 0;//偏高
        int normal = 0;//正常
        int low = 0;//偏低
        boolean flag = false;//高危标志 true高危。
        String sql = "SELECT " +
                "MIN(id) id" +
                ", user" +
                ",value1" +
                ",value2" +
                ",value3" +
                ",value4" +
                ",value5" +
                ",value6" +
                ",value7" +
                ",device_sn" +
                ",type" +
                ",record_date" +
                ",sort_date" +
                ",min(czrq) czrq " +
                " from device.wlyy_patient_health_index " +
                " WHERE `user` = '" + patient + "' " +
                " and type =" + type +
                " and record_date >= '" + begin + "'" +
                " and record_date <= '" + end + "' " +
                " and del = '1' ";
        String conditionApp = "";
        if (gi_type != 0) {
            conditionApp = " and value2 = '" + gi_type + "' ";
        }
        sql = sql + conditionApp +
                " GROUP BY user,value1,value2,value3,value4,value5,value6,value7,type,record_date,sort_date " +
                " order by record_date desc ,sort_date desc limit " + 0 + " ," + 1000 + " ";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String, Object> map : list) {
            String value1 = map.get("value1").toString();
            String value2 = map.get("value2").toString();
            com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
            json.put("id", map.get("id"));
            json.put("patient", map.get("user"));
            json.put("value1", value1);
            json.put("value2", value2);
            json.put("value3", map.get("value3"));
            json.put("value4", map.get("value4"));
            json.put("value5", map.get("value5"));
            json.put("value6", map.get("value6"));
            json.put("value7", map.get("value7"));
            json.put("deviceSn", map.get("device_sn") == null ? "" : map.get("device_sn"));
            json.put("type", map.get("type"));
            Date date = (Date) map.get("record_date");
            if (type == 2) {
                json.put("date", DateUtil.dateToStr(date, DateUtil.YYYY_MM_DD_HH_MM_SS));
            } else {
                json.put("date", DateUtil.dateToStr(date, DateUtil.YYYY_MM_DD));
            }
            json.put("sortDate", map.get("sort_date"));
            json.put("czrq", map.get("czrq"));
            //统计加指标分析
            int returnInt = 0;
            if(type==1){
//                int age = 60;
//                Patient p = patientDao.findByCode(patient);
//                if(p!=null){
//                    age = IdCardUtil.getAgeForIdcard(p.getIdcard());
//                }
                //血糖
                Double maxValueBefore = SystemConf.HEALTH_STANDARD_ST_MAX_BEFORE;
                Double minValueBefore = SystemConf.HEALTH_STANDARD_ST_MIN_BEFORE;
                Double maxValueAfter = SystemConf.HEALTH_STANDARD_ST_MAX_AFTER;
                Double minValueAfter = SystemConf.HEALTH_STANDARD_ST_MIN_AFTER;
                int index = Integer.parseInt(value2);
                Double intVlue1 = NumberUtils.toDouble(value1);
                if(index % 2 == 0){
                    //餐后
                    returnInt = checkHealth(maxValueAfter,minValueAfter,intVlue1);
                    switch (returnInt){
                        case 0:
                            normal++;
                            break;
                        case 1:
                            high++;
                            break;
                        default:
                            low++;
                            break;
                    }
                    if(intVlue1>=maxValueAfter){
                        flag = true;
                    }
                }else {
                    //餐前
                    returnInt = checkHealth(maxValueBefore,minValueBefore,intVlue1);
                    switch (returnInt){
                        case 0:
                            normal++;
                            break;
                        case 1:
                            high++;
                            break;
                        default:
                            low++;
                            break;
                    }
                    if(intVlue1>=maxValueBefore){
                        flag = true;
                    }
                }
            }else if(type==2){
                //血压
                Double intVlue1 = NumberUtils.toDouble(value1);
                Double intVlue2 = NumberUtils.toDouble(value2);
                Double maxValueSSY = SystemConf.HEALTH_STANDARD_SSY_MAX;
                Double minValueSSY = SystemConf.HEALTH_STANDARD_SSY_MIN;
                Double maxValueSZY = SystemConf.HEALTH_STANDARD_SZY_MAX;
                Double minValueSZY = SystemConf.HEALTH_STANDARD_SZY_MIN;
                returnInt = checkHealth(maxValueSSY,minValueSSY,intVlue1);
                switch (returnInt){
                    case 0:
                        normal++;
                        break;
                    case 1:
                        high++;
                        if(intVlue1>=maxValueSSY){
                            flag = true;
                        }
                        break;
                    default:
                        low++;
                        break;
                }
                returnInt = checkHealth(maxValueSZY,minValueSZY,intVlue2);
                switch (returnInt){
                    case 0:
                        normal++;
                        break;
                    case 1:
                        high++;
                        if(intVlue2>=maxValueSSY){
                            flag = true;
                        }
                        break;
                    default:
                        low++;
                        break;
                }
            }
            re.add(json);
        }
        jsonObject.put("list",re);
        com.alibaba.fastjson.JSONObject total = new com.alibaba.fastjson.JSONObject();
        total.put("high",high);
        total.put("normal",normal);
        total.put("low",low);
        jsonObject.put("total",total);
        String content = "";
        if(high>0){
            content = "居民"+time+"内有"+high+"次指标偏高";
            if(low>0){
                content+=",有"+low+"次指标偏低";
            }else {
                content+="。";
            }
            if(flag){
                content+="居民"+time+"内控制不理想,可能伴有靶器官损害或其他并发症。建议由健管师进行电话随访不少于每月4次,至少每2周面对面随访一次,建议动员居民至医院全科医生就诊,特殊情况建议入户诊疗。病情严重建议转诊专科医师进行进一步治疗。";
            }else {
                content+="居民"+time+"内控制不理想但低于急危值,建议至少每2周面对面随访一次,建议动员居民至医院全科医生就诊,特殊情况建议入户诊疗。病情严重建议转诊专科医师进行进一步治疗。";
            }
        }else if(low>0){
            content = "居民"+time+"内有"+low+"次指标偏低。";
            content+="居民"+time+"内控制不理想但低于急危值,建议至少每2周面对面随访一次,建议动员居民至医院全科医生就诊,特殊情况建议入户诊疗。病情严重建议转诊专科医师进行进一步治疗。";
        }else {
            content = "居民"+time+"内指标没有异常。居民"+time+"内相对稳定,建议至少每周面对面随访一次,全科医生根据居民情况安排预约转诊专科医师,并跟踪治疗情况。";
        }
        jsonObject.put("content",content);
        return jsonObject;
    }
    /**
     * 指标验证
     * @param max
     * @param min
     * @param value
     * @return -1偏低,0正常,1偏高
     */
    private Integer checkHealth(Double max,Double min,Double value){
        if(max<value){
            return 1;
        }else if(min>value){
            return -1;
        }else {
            return 0;
        }
    }
    /**
     * 查询指标记录
     *

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java

@ -551,6 +551,7 @@ public class PrescriptionExpressageService extends BaseService {
            p.setDrugDeliveryReasonCode(reasonCode);
            p.setDrugDeliveryReasonValue(reasonName);
            p.setDrugDeliveryTime(new Date());
            p.setFinishTime(new Date());
            prescriptionDao.save(p);
            //更新日志

+ 11 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -356,6 +356,16 @@ public class PrescriptionInfoService extends BaseService {
        Integer newtotalCount = 0;
        com.alibaba.fastjson.JSONObject returnJson = new com.alibaba.fastjson.JSONObject();
        com.alibaba.fastjson.JSONArray filterJsonArray = new com.alibaba.fastjson.JSONArray();
    
        if(StringUtils.isEmpty(applyTimeFrom)){
            applyTimeEnd = DateUtil.getStringDateShort();
            Calendar c = Calendar.getInstance();
            c.setTime(new Date());
            c.add(Calendar.MONTH, -2);
            c.add(Calendar.DATE, 1);
            applyTimeFrom = DateUtil.dateToStrShort(c.getTime());
        }
        
        com.alibaba.fastjson.JSONObject re = jwPrescriptionService.getRecipeMasterList(patientCode,applyTimeFrom,applyTimeEnd);
        totalCount = re.getInteger("totalCount");
        if(totalCount>start){
@ -422,7 +432,7 @@ public class PrescriptionInfoService extends BaseService {
                            //糖尿病
                            dis = tnb;
                        }
    
                        for (int j = 0; j < des.size(); j++) {
                            PrescriptionDiagnosis ds = des.getObject(j, PrescriptionDiagnosis.class);
                            //如果含有选择病症,标记为true

+ 150 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -3,14 +3,17 @@ package com.yihu.wlyy.service.app.prescription;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.adapter.PresModeAdapter;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeam;
import com.yihu.wlyy.entity.followup.Followup;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.message.MessageNoticeSetting;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionDiagnosis;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.repository.dict.Icd10DictDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
import com.yihu.wlyy.repository.followup.FollowUpDao;
import com.yihu.wlyy.repository.message.MessageDao;
@ -24,6 +27,7 @@ import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.MessageType;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
@ -38,7 +42,6 @@ import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
@ -62,8 +65,6 @@ public class PrescriptionService extends BaseService {
    @Autowired
    private PrescriptionExpressageDao prescriptionExpressageDao;
    @Autowired
    private PrescriptionNoticesService prescriptionNoticesService;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
@ -86,6 +87,10 @@ public class PrescriptionService extends BaseService {
    private static final String gxy = "HP0093";
    //健康问题 糖尿病
    private static final String tnb = "HP0047";
    @Autowired
    private PresModeAdapter presModeAdapter;
    @Autowired
    private Icd10DictDao icd10DictDao;
    /**
     *  获取处方信息
@ -114,7 +119,7 @@ public class PrescriptionService extends BaseService {
            if (type == 1){
                //直接更改状态为已完成
                prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
                prescription.setFinishTime(new Date());
            }else if (type == 2){
                //不更改状态只添加延长收药时间
                int extendCount = prescription.getExtendCount();
@ -540,6 +545,35 @@ public class PrescriptionService extends BaseService {
        jsonObject.put("totalAmount",totalAmount>0?df.format(totalAmount):0.0);
        sql += " limit ?,?";
        resultList = jdbcTemplate.queryForList(sql,new Object[]{start,pageSize});
        //针对疾病去重,left join pay表之后会出现很多条数据--zd
        for (Map<String,Object> map: resultList) {
            //疾病代码和疾病名称
            String healthProblems = String.valueOf(map.get("health_problem"));
            String resultValue = "";
            String resultNameValue = "";
            if (StringUtils.isNotBlank(healthProblems) && healthProblems.contains(",")){
                String[] healthProbleamStr = healthProblems.split(",");
                for (String healthProblemValue : healthProbleamStr) {
                    if (!resultValue.contains(healthProblemValue)){
                        resultValue +=healthProblemValue+",";
                        if (gxy.equals(healthProblemValue)){
                            resultNameValue += "高血压病,";
                        }
                        if (tnb.equals(healthProblemValue)){
                            resultNameValue += "糖尿病,";
                        }
                    }
                }
                if (!StringUtils.isEmpty(resultValue) && resultValue.length()>1){
                    resultValue = resultValue.substring(0,resultValue.length()-1);
                }
                if (!StringUtils.isEmpty(resultNameValue) && resultNameValue.length()>1){
                    resultNameValue = resultNameValue.substring(0,resultNameValue.length()-1);
                }
                map.put("health_problem",resultValue);
                map.put("health_problem_name",resultNameValue);
            }
        }
        jsonObject.put("list",resultList);
        return jsonObject;
    }
@ -606,4 +640,116 @@ public class PrescriptionService extends BaseService {
        }
        return rsMap;
    }
    
    /**
     * 根据居民CODE,时间轴,就诊类型查询用药记录
     * @param patientCode 居民CODE
     * @param timeline 时间轴(根据传入的时间搜索前25天后25天)YYYY-MM-DD
     * @param type 1糖尿病,2高血压
     * @return
     */
    public String findPatientMedicationRecords(String patientCode, String timeline, String type) throws Exception{
        
        Integer totalCount = 0;
        
        String RECIPE_NO = "";//符合规则基卫处方医嘱号
        
        Patient patient = patientDao.findByCode(patientCode);
        
        if(patient == null){
            throw new Exception("未找到居民!");
        }
        
        String medicationRecords = "";
        
        Date timeLineDate = DateUtil.strToDateShort(timeline);
        Date startTime = DateUtil.setDateTime(timeLineDate,-25);
        Date endTime = DateUtil.setDateTime(timeLineDate,25);
        
        com.alibaba.fastjson.JSONObject re = jwPrescriptionService.getRecipeMasterList(patientCode,DateUtil.dateToStrShort(startTime),DateUtil.dateToStrShort(endTime));
        
        totalCount = re.getInteger("totalCount");
        if(totalCount>0){
            com.alibaba.fastjson.JSONArray pres = re.getJSONArray("list");
            for (int i = 0; i < pres.size(); i++) {
                com.alibaba.fastjson.JSONObject r = (com.alibaba.fastjson.JSONObject) pres.get(i);
                com.alibaba.fastjson.JSONArray des = r.getJSONArray("prescriptionDt");
                boolean flag = false;
                for (int j = 0; j < des.size(); j++) {
                    PrescriptionDiagnosis ds = des.getObject(j, PrescriptionDiagnosis.class);
    
//                    String icdCode = ds.getHealthProblem();
//                    System.out.println(icdCode);
//                    Icd10Dict icd10Dict = icd10DictDao.findByCode(icdCode);
//                    if(icd10Dict==null){
//                        continue;
//                    }
//
//                    System.out.println(r.getString("code"));
//                    if("1".equals(type)){
//                        //血糖
//                        if(!"2".equals(icd10Dict.getType())){
//                            continue;
//                        }else{
//                            RECIPE_NO = r.getString("code");
//                            break;
//                        }
//                    }else {
//                        //血压
//                        if(!"1".equals(icd10Dict.getType())){
//                            continue;
//                        }else{
//                            RECIPE_NO = r.getString("code");
//                            break;
//                        }
//                    }
                    if(type==null){
                        RECIPE_NO = r.getString("code");
                        break;
                    }
                    if ("1".equals(type)) {
                        //主诊断为糖尿病
                        if(tnb.equals(ds.getHealthProblem())){
                            RECIPE_NO = r.getString("code");
                            break;
                        }else{
                            continue;
                        }
                    } else  if("2".equals(type)){
                        //主诊断为高血压
                        if(gxy.equals(ds.getHealthProblem())){
                            RECIPE_NO = r.getString("code");
                            break;
                        }else{
                            continue;
                        }
                    }else{
                        continue;
                    }
                }
            }
        }
        
        if(org.apache.commons.lang.StringUtils.isNotBlank(RECIPE_NO)){
            String response = jwPrescriptionService.getRecipe(RECIPE_NO,patient.getSsc());
            com.alibaba.fastjson.JSONObject jsonObject = presModeAdapter.modelToSinglePrescription(response);
            //药品
            com.alibaba.fastjson.JSONArray infos = jsonObject.getJSONArray("prescriptionInfo");
            
            for(int i=0;i<infos.size();i++){
                com.alibaba.fastjson.JSONObject info = infos.getJSONObject(i);
                String drugname =  info.getString("drugName");
                if(org.apache.commons.lang.StringUtils.isNotBlank(drugname)){
                    medicationRecords = medicationRecords + drugname;
                    if(i != (infos.size() -1)){
                        medicationRecords = medicationRecords + ",";
                    }
                }
            }
            
        }
        
        
        return medicationRecords;
    }
}

+ 6 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/pc/prescription/PrescriptionExpressagePCService.java

@ -286,7 +286,7 @@ public class PrescriptionExpressagePCService extends BaseService {
        switch (prescriptionDispensaryCode.getType()) {
            case 1: {
                //判断是1 居民取药码
                dispensaryCode_1(userCode, prescriptionDispensaryCode);
                dispensaryCode_1(prescription,userCode, prescriptionDispensaryCode);
                break;
            }
            case 2: {
@ -317,10 +317,13 @@ public class PrescriptionExpressagePCService extends BaseService {
     * @param prescriptionDispensaryCode
     * @return
     */
    public void dispensaryCode_1(String userCode, PrescriptionDispensaryCode prescriptionDispensaryCode) {
    public void dispensaryCode_1(Prescription prescription ,String userCode, PrescriptionDispensaryCode prescriptionDispensaryCode) {
        //修改处方状态为完成
        prescriptionDao.updateStatus(prescriptionDispensaryCode.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        //prescriptionDao.updateStatus(prescriptionDispensaryCode.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        prescription.setFinishTime(new Date());
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        prescriptionDao.save(prescription);
        //保存配送成功的日志
        PrescriptionLog prescriptionLog = new PrescriptionLog();

+ 83 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/iot/IotDeviceService.java

@ -6,18 +6,22 @@ import com.yihu.device.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.entity.device.DeviceHealthyInfoMapping;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.deviece.DeviceHealthyInfoMappingDao;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.MyJdbcTemplate;
import org.apache.commons.lang.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
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.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.ResultSetExtractor;
@ -39,8 +43,9 @@ public class IotDeviceService {
    private Logger logger = LoggerFactory.getLogger(IotDeviceService.class);
//    @Value("${}")
    private String baseUrl = "http://192.168.131.24:8088/svr-iot/";
    @Value("${iot.url}")
    private String baseUrl;
//    private String baseUrl = "http://192.168.131.24:8088/svr-iot/";
    private String grantType = "client_credentials";
    private String clientId = "Va5yQRHlA4Fq4eR3LT0vuXV4";
    private String clientSecret = "0rDSjzQ20XUj5itV7WRtznPQSzr5pVw2";
@ -58,10 +63,14 @@ public class IotDeviceService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private MyJdbcTemplate myJdbcTemplate;
    @Autowired
    private PatientDeviceDao patientDeviceDao;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private SystemDictDao systemDictDao;
    @Autowired
    private DeviceHealthyInfoMappingDao deviceHealthyInfoMappingDao;
@ -152,14 +161,18 @@ public class IotDeviceService {
     * 设备绑定
     * @param patientDevice
     * @param address
     * @param name
     * @param diseaseCondition 病情:0绿标,1黄标,2红标
     * @return
     */
    public String saveDevice(PatientDevice patientDevice,String address,String name){
    public String saveDevice(PatientDevice patientDevice,String address,String name,Integer diseaseCondition,String hospitalName){
        JSONObject json = new JSONObject();
        json.put("categoryCode",patientDevice.getCategoryCode());
        json.put("address",address);
        json.put("hospitalName",hospitalName);
        json.put("patient",patientDevice.getUser());
        json.put("patientName",name);
        json.put("diseaseCondition",diseaseCondition);
        json.put("idcard",patientDevice.getUserIdcard());
        json.put("deviceId",patientDevice.getDeviceId());
        json.put("deviceName",patientDevice.getDeviceName());
@ -169,9 +182,13 @@ public class IotDeviceService {
        json.put("agent",patientDevice.getAgent());
        json.put("doctor",patientDevice.getDoctor());
        String url = baseUrl+"/patientDevice/addPatientDevice";
        return saveDevice(json.toString());
    }
    private String saveDevice(String json){
        String url = baseUrl+"wg/patientDevice/addPatientDevice";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("jsonData",json.toString()));
        params.add(new BasicNameValuePair("jsonData",json));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
@ -404,14 +421,71 @@ public class IotDeviceService {
        List<PatientDevice> list = patientDeviceDao.findAll();
        list.forEach(patientDevice -> {
            Patient patient = patientDao.findByCode(patientDevice.getUser());
            String response = saveDevice(patientDevice,patient.getAddress(),patient.getName());
            JSONObject re = JSONObject.parseObject(response);
            if(re.getInteger("status")!=200){
                logger.error("id:"+patientDevice.getId()+" "+re.getString("errorMsg"));
            if(patient!=null){
                String address = patient.getAddress();
                String hospital = null;
                if(StringUtils.isBlank(address)){
                    //居民地址为空,默认取居民的社区,如果社区为空默认填写签约的社区医院
                    SignFamily signFamily = signFamilyDao.findByPatient(patientDevice.getUser());
                    if(signFamily!=null){
                        hospital = StringUtils.isBlank(signFamily.getSickVillageName())?signFamily.getHospitalName():signFamily.getSickVillageName();
                    }
                }
                String response = saveDevice(patientDevice,address,patient.getName(),patient.getDiseaseCondition(),hospital);
                if(StringUtils.isNotBlank(response)){
                    JSONObject re = JSONObject.parseObject(response);
                    if(re.getInteger("status")!=200){
                        logger.error("id:"+patientDevice.getId()+" "+re.getString("errorMsg"));
                    }
                }
            }
        });
    }
    /**
     * 导入正式环境的坐标信息
     * @return
     */
    public void exportNormalPatientDevice(){
        String sql = "SELECT * from wlyy_device_location_tmp";
        List<JSONObject> list = myJdbcTemplate.queryJson(sql);
        list.forEach(device -> {
            JSONObject json = new JSONObject();
            json.put("categoryCode",device.getString("category_code"));
            json.put("hospitalName",device.getString("hospital_name"));
            json.put("address",device.getString("address"));
            json.put("patient",device.getString("user"));
            json.put("patientName",device.getString("name"));
            json.put("diseaseCondition",device.getString("disease_condition"));
            json.put("idcard",device.getString("user_idcard"));
            json.put("deviceId",device.getString("device_id"));
            json.put("deviceName",device.getString("device_name"));
            json.put("deviceSn",device.getString("device_sn"));
            json.put("userType",device.getString(""));
            json.put("sim",device.getString("sim"));
            json.put("agent",device.getString("agent"));
            json.put("doctor",device.getString("doctor"));
            saveDevice(json.toString());
        });
    }
    /**
     * 测试设备绑定
     * @return
     */
    public String testSaveDevice(){
        List<PatientDevice> list = patientDeviceDao.findAll();
        PatientDevice patientDevice = list.get(0);
        Patient patient = patientDao.findByCode(patientDevice.getUser());
        SignFamily signFamily = signFamilyDao.findByPatient(patientDevice.getUser());
        String hospital = null;
        if(signFamily!=null){
            hospital = StringUtils.isBlank(signFamily.getSickVillageName())?signFamily.getHospitalName():signFamily.getSickVillageName();
        }
        String response = saveDevice(patientDevice,patient.getAddress(),patient.getName(),patient.getDiseaseCondition(),hospital);
        return response;
    }
    /**
     * 初始化迁移数据
     * @return

Разлика између датотеке није приказан због своје велике величине
+ 16 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/HttpUtil.java


+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionInfoController.java

@ -66,7 +66,7 @@ public class PatientPrescriptionInfoController extends BaseController {
                                      @RequestParam(required = false)@ApiParam(name="size",value="每页记录数")Integer size){
        try {
//            com.alibaba.fastjson.JSONObject json = prescriptionInfoService.getRecipeMasterList("ec7572875d27446cb4f067b13a85d72a",startDate,endDate,isRenewal,diagnosisCode,page,size);
            com.alibaba.fastjson.JSONObject json = prescriptionInfoService.getRecipeMasterList(getRepUID(),startDate,endDate,isRenewal,diagnosisCode,page,size);
            com.alibaba.fastjson.JSONObject json = prescriptionInfoService.getRecipeMasterList(getRepUID(),"2017-12-01","2018-01-01",isRenewal,diagnosisCode,page,size);
            return write(200, "查询成功!", "data",json);
        }catch (Exception e){
            error(e);

+ 64 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/iot/IotMonitoringHealthController.java

@ -3,11 +3,11 @@ package com.yihu.wlyy.web.third.gateway.controller.iot;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.service.app.device.PatientDeviceService;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
@ -28,6 +28,8 @@ public class IotMonitoringHealthController extends BaseController {
    private PatientDeviceService patientDeviceService;
    @Autowired
    private PatientHealthIndexService healthIndexService;
    @Autowired
    private PrescriptionService prescriptionService;
    @RequestMapping(value = "/equipmentDistribution",method = RequestMethod.GET)
    @ApiOperation("设备发放情况")
@ -79,6 +81,30 @@ public class IotMonitoringHealthController extends BaseController {
    }
    @RequestMapping(value = "/searchPatient",method = RequestMethod.GET)
    @ApiOperation("居民搜索")
    public String searchPatient(
            @ApiParam(name="name",value="居民姓名")
            @RequestParam(value="name",required = false) String name,
            @ApiParam(name="page",value="第几页(默认第一页)",defaultValue = "1")
            @RequestParam(value="page",required = false) Integer page,
            @ApiParam(name="pageSize",value="每页几行(默认10条记录)",defaultValue = "10")
            @RequestParam(value="pageSize",required = false) Integer pageSize){
        try {
            if(page==null){
                page = 1;
            }
            if(pageSize==null){
                pageSize = 10;
            }
            return write(200,"查询成功","data",patientDeviceService.searchPatient(name,page,pageSize));
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    @RequestMapping(value = "/deviceBinding",method = RequestMethod.GET)
    @ApiOperation("设备绑定情况")
    public String deviceBinding(
@ -144,17 +170,16 @@ public class IotMonitoringHealthController extends BaseController {
                                               @RequestParam(value = "type", required = true) int type,
                                               @ApiParam(name = "gi_type", value = "就餐类型0全部", defaultValue = "1")
                                               @RequestParam(value = "gi_type", required = false) int gi_type,
                                               @ApiParam(name="time",value="时间(一周,一月,半年)",defaultValue = "")
                                               @RequestParam(value="time",required = true) String time,
                                               @ApiParam(name = "begin", value = "开始时间", defaultValue = "2017-05-22 00:00:00")
                                               @RequestParam(value = "begin", required = true) String begin,
                                               @ApiParam(name = "end", value = "结束时间", defaultValue = "2017-06-02 00:00:00")
                                               @RequestParam(value = "end", required = true) String end) {
        try {
            JSONArray jsonArray = healthIndexService.findChartByPatient(patient, type, gi_type, begin, end);
            JSONObject jsonObject = healthIndexService.findChartByPatientIot(patient, type, gi_type, begin, end,time);
            if (jsonArray.length()==0) {
                return success("查询成功!");
            }
            return write(200, "查询成功", "list", jsonArray);
            return write(200, "查询成功", "data", jsonObject);
        } catch (Exception ex) {
            error(ex);
            return invalidUserException(ex, -1, "查询失败!");
@ -186,5 +211,38 @@ public class IotMonitoringHealthController extends BaseController {
            }
        }
    }
    
    @RequestMapping(value = "findPatientMedicationRecords",method = RequestMethod.GET)
    @ApiOperation("根据居民CODE,时间轴,就诊类型查询用药记录")
    public String findPatientMedicationRecords(@ApiParam(name="patientCode",value = "居民code",defaultValue = "ed57f0d34e11458db8540bb8c942ff4f")
                                               @RequestParam(name="patientCode",required = true)String patientCode,
                                               @ApiParam(name="timeline",value = "时间轴(根据传入的时间搜索前25天后25天)YYYY-MM-DD")
                                               @RequestParam(name="timeline",required = true)String timeline,
                                               @ApiParam(name="type",value = "1糖尿病,2高血压")
                                               @RequestParam(name="type",required = true)String type){
        try {
            return write(200,"查询成功","data",prescriptionService.findPatientMedicationRecords(patientCode,timeline,type));
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
    
    @RequestMapping(value = "/searchpatientdevicesn",method = RequestMethod.GET)
    @ApiOperation("根据病种类型,搜索已绑定设备的居民设备SN码")
    public String searchpatientdevicesn(
            @ApiParam(name="type",value="1高血压 2糖尿病")
            @RequestParam(value="type",required = true) String type,
            @ApiParam(name="page",value="第几页(默认第一页)",defaultValue = "1")
            @RequestParam(value="page",required = false) Integer page,
            @ApiParam(name="pageSize",value="每页几行(默认10条记录)",defaultValue = "10")
            @RequestParam(value="pageSize",required = false) Integer pageSize){
        try {
            return write(200,"查询成功","data",patientDeviceService.iotSearchPatientDeviceSN(type,page,pageSize));
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
}

+ 23 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/iot/IotDeviceController.java

@ -112,6 +112,29 @@ public class IotDeviceController extends BaseController{
        }
    }
    @RequestMapping(value = "/exportNormalPatientDevice",method = RequestMethod.POST)
    @ApiOperation("将正式环境的设备坐标信息导入es")
    public String exportNormalPatientDevice(){
        try {
            iotDeviceService.exportNormalPatientDevice();
            return success("初始化成功");
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
    @RequestMapping(value = "/testSaveDevice",method = RequestMethod.POST)
    @ApiOperation("测试设备绑定数据")
    public String testSaveDevice(){
        try {
            return iotDeviceService.testSaveDevice();
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
    @RequestMapping(value = "/findById",method = RequestMethod.GET)
    @ApiOperation("按id查询")
    public String findById(@ApiParam(name = "id",value = "id",defaultValue = "LggM5iaSi6u18TUmeDoaeSnyFxntPMA2NPGXBRyPTwFsg+oRn3bHgg==")

+ 4 - 0
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -33,6 +33,10 @@ im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: ichat
#物联网配置
iot:
  url: http://192.168.131.24:8088/svr-iot/
wechat:
  appId: wxd03f859efdf0873d
  appSecret: 2935b54b53a957d9516c920a544f2537

+ 4 - 0
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -33,6 +33,10 @@ im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
#物联网配置
iot:
  url: http://192.168.131.24:8088/svr-iot/
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb

+ 5 - 1
patient-co/patient-co-wlyy/src/main/resources/application-local.yml

@ -29,6 +29,10 @@ im:
  im_list_get: http://10.95.22.138:3000/
  data_base_name: im
#物联网配置
iot:
  url: http://192.168.131.24:8088/svr-iot/
wechat:
  appId: wxad04e9c4c5255acf
  appSecret: ae77c48ccf1af5d07069f5153d1ac8d3
@ -123,7 +127,7 @@ jkEdu:
activemq:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  url: tcp://10.95.22.168:61616
  queue:
    healtHarticleQueue: healthArticleChannel_devtest  #健康文章推送

+ 4 - 0
patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml

@ -29,6 +29,10 @@ im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
#物联网配置
iot:
  url: http://192.168.131.24:8088/svr-iot/
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb

+ 5 - 1
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -32,6 +32,10 @@ im:
  im_list_get: http://27.155.101.77:3000/
  data_base_name: im
#物联网配置
iot:
  url: http://192.168.131.24:8088/svr-iot/
wechat:
  appId: wxad04e9c4c5255acf
  appSecret: ae77c48ccf1af5d07069f5153d1ac8d3
@ -129,7 +133,7 @@ jkEdu:
activemq:
  username: jkzl
  password: jkzlehr
  url: tcp://192.168.120.153:61616
  url: tcp://59.61.92.90:9103
  queue:
    healtHarticleQueue: healthArticleChannel  #健康文章推送

+ 4 - 0
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -28,6 +28,10 @@ im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
#物联网配置
iot:
  url: http://172.19.103.88:8088/svr-iot/
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb

+ 20 - 150
pom.xml

@ -1,7 +1,14 @@
<?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"
<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>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.9.RELEASE</version>
    </parent>
    <groupId>com.yihu</groupId>
    <artifactId>wlyy</artifactId>
    <version>1.0.0</version>
@ -18,23 +25,15 @@
    </distributionManagement>
    <properties>
        <version.spring-boot>1.3.5.RELEASE</version.spring-boot>
        <version.springside>4.2.3-GA</version.springside>
        <version.spring>4.3.2.RELEASE</version.spring>
        <version.spring-data-jpa>1.6.0.RELEASE</version.spring-data-jpa>
        <version.spring-data-commons>1.8.0.RELEASE</version.spring-data-commons>
        <version.spring-data-keyvalue>1.1.2.RELEASE</version.spring-data-keyvalue>
        <version.spring-data-redis>1.7.2.RELEASE</version.spring-data-redis>
        <version.swagger>2.7.0</version.swagger>
        <version.poi>3.15-beta1</version.poi>
        <version.hibernate>4.3.5.Final</version.hibernate>
        <version.hibernate-validator>5.0.3.Final</version.hibernate-validator>
        <version.logback>1.1.2</version.logback>
        <version.logback>1.2.3</version.logback>
        <version.aspectj>1.7.4</version.aspectj>
        <version.quartz>2.2.3</version.quartz>
        <version.redis>2.8.1</version.redis>
        <version.fastdfs>1.25</version.fastdfs>
        <version.servlet-api>3.1.0</version.servlet-api>
        <version.joda-time>2.8.2</version.joda-time>
        <version.kaptcha>2.3</version.kaptcha>
        <version.orgjson>20160212</version.orgjson>
@ -50,7 +49,6 @@
        <version.jest>2.4.0</version.jest>
        <sitemesh.version>2.4.2</sitemesh.version>
        <jackson.version>2.6.6</jackson.version>
        <slf4j.version>1.7.7</slf4j.version>
        <commons-lang3.version>3.3.2</commons-lang3.version>
        <guava.version>18.0</guava.version>
@ -78,124 +76,7 @@
                <artifactId>common-entity</artifactId>
                <version>${version.common}</version>
            </dependency>
            <!--Spring boot family-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot</artifactId>
                <version>${version.spring-boot}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-autoconfigure</artifactId>
                <version>${version.spring-boot}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-actuator-docs</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-mail</artifactId>
                <version>${version.spring-boot}</version>
            </dependency>
            <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-actuator</artifactId>
                <version>${version.spring-boot}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-aop</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-thymeleaf</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.springframework.boot</groupId>
                <artifactId>spring-boot-starter-mail</artifactId>
                <version>${version.spring-boot}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
                <version>${version.spring-boot}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
                <version>${version.spring-boot}</version>
            </dependency>
            <!-- end -->
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>${version.servlet-api}</version>
            </dependency>
            <!-- spring start -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-commons</artifactId>
                <version>${version.spring-data-commons}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-keyvalue</artifactId>
                <version>${version.spring-data-keyvalue}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jms</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <!-- spring end -->
            <!--activemq start-->
            <dependency>
@ -319,12 +200,6 @@
                <artifactId>kaptcha</artifactId>
                <version>${version.kaptcha}</version>
            </dependency>
            <!-- spring data access -->
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-jpa</artifactId>
                <version>${version.spring-data-jpa}</version>
            </dependency>
            <!-- aspectjrt start -->
            <dependency>
@ -378,20 +253,26 @@
            </dependency>
            <!-- JSON begin -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
                <version>2.6.6</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>2.6.6</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-xml</artifactId>
                <version>${jackson.version}</version>
                <version>2.6.6</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-jaxb-annotations</artifactId>
                <version>${jackson.version}</version>
                <version>2.6.6</version>
            </dependency>
            <dependency>
                <groupId>org.json</groupId>
@ -538,18 +419,6 @@
                <version>${version.quartz}</version>
            </dependency>
            <!-- quartz end  -->
            <!-- redis start  -->
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-redis</artifactId>
                <version>${version.spring-data-redis}</version>
            </dependency>
            <dependency>
                <groupId>redis.clients</groupId>
                <artifactId>jedis</artifactId>
                <version>${version.redis}</version>
            </dependency>
            <!-- redis end  -->
            <!--fastdfs start-->
            <dependency>
                <groupId>org.csource</groupId>
@ -617,7 +486,8 @@
                        <target>1.8</target>
                        <compilerArguments>
                            <verbose/>
                            <bootclasspath>${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar</bootclasspath>
                            <bootclasspath>${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar
                            </bootclasspath>
                        </compilerArguments>
                    </configuration>
                    <version>3.1</version>