瀏覽代碼

顺丰速递接口:查询路由接口,接受路由消息推送的接口

huangwenjie 8 年之前
父節點
當前提交
e3cd700e42
共有 39 個文件被更改,包括 600 次插入917 次删除
  1. 0 1
      common-lib/pom.xml
  2. 0 445
      patient-co/patient-co-pc/pom.xml
  3. 0 17
      patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/Application.java
  4. 0 37
      patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/MvcConfig.java
  5. 0 48
      patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/SwaggerConfig.java
  6. 0 54
      patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/async/AsyncConfig.java
  7. 0 27
      patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/jpa/HibernateProperties.java
  8. 0 67
      patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/jpa/WlyyJpa.java
  9. 0 44
      patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/security/WebSecurityConfig.java
  10. 0 15
      patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/war/ServletInitializer.java
  11. 0 73
      patient-co/patient-co-pc/src/main/resources/application.yml
  12. 2 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  13. 2 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java
  14. 1 1
      patient-co/patient-co-wlyy/pom.xml
  15. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/MvcConfig.java
  16. 118 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java
  17. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionAdjust.java
  18. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionDiagnosis.java
  19. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionDispensaryCode.java
  20. 20 14
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressage.java
  21. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressageLog.java
  22. 33 10
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionLog.java
  23. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorAdminTeamMemberDao.java
  24. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionExpressageDao.java
  25. 31 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java
  26. 23 10
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  27. 119 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionNoticesService.java
  28. 2 18
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java
  29. 4 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/team/AdminTeamService.java
  30. 31 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  31. 52 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionExpressageController.java
  32. 9 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java
  33. 43 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionLogController.java
  34. 57 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionNoticesController.java
  35. 14 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/team/AdminTeamController.java
  36. 4 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionInfoController.java
  37. 12 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionLogController.java
  38. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/PatientSignController.java
  39. 10 10
      patient-co/patient-co-wlyy/src/main/resources/logback.xml

+ 0 - 1
common-lib/pom.xml

@ -23,7 +23,6 @@
        <module>../patient-co/patient-co-wlyy-job</module> <!--i健康 job工程-->
        <module>../patient-co/patient-co-statistics</module> <!--i健康 mysql 版本统计-->
        <module>../patient-co/patient-co-statistics-es</module> <!--i健康 es 版本统计-->
        <module>../patient-co/patient-co-pc</module><!--im pc 版本-->
        <!--<module>../patient-co-figure</module>-->
    </modules>

+ 0 - 445
patient-co/patient-co-pc/pom.xml

@ -1,445 +0,0 @@
<?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>common-lib</artifactId>
        <groupId>com.yihu</groupId>
        <version>1.0.0</version>
        <relativePath>../../common-lib/pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>patient-co-pc</artifactId>
    <name>patient-co-pc</name>
    <version>1.0.0</version>
    <packaging>war</packaging>
    <!-- 设定插件仓库, 如有Nexus私服, 取消注释并指向正确的服务器地址. -->
    <pluginRepositories>
        <pluginRepository>
            <id>nexus</id>
            <name>Team Nexus Repository</name>
            <url>http://172.19.103.47:8081/nexus/content/groups/public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
    <dependencies>
        <!--Spring boot family-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot</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.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <!--<dependency>-->
        <!--<groupId>org.springframework.boot</groupId>-->
        <!--<artifactId>spring-boot-devtools</artifactId>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</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-jdbc</artifactId>
        </dependency>
        <dependency>
            <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>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>
        <!-- end -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <!-- spring start -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-keyvalue</artifactId>
        </dependency>
        <!-- spring end -->
        <!--Swagger start -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
        </dependency>
        <!--Swagger end -->
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>jave-ffmpegjave</artifactId>
        </dependency>
        <!-- poi start-->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
        </dependency>
        <!-- poi end-->
        <dependency>
            <groupId>org.apache.axis</groupId>
            <artifactId>axis</artifactId>
        </dependency>
        <dependency>
            <groupId>axis</groupId>
            <artifactId>axis-jaxrpc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>sehrCrypto</groupId>
            <artifactId>sehrCrypto</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jdom</groupId>
            <artifactId>jdom</artifactId>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk16</artifactId>
        </dependency>
        <!-- Apache Commons fileupload -->
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <!-- SPRINGSIDE -->
        <dependency>
            <groupId>org.springside</groupId>
            <artifactId>springside-core</artifactId>
        </dependency>
        <!-- PERSISTENCE begin -->
        <!-- hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.kaptcha</groupId>
            <artifactId>kaptcha</artifactId>
        </dependency>
        <!-- spring data access -->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
        </dependency>
        <!-- aspectjrt start -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
        </dependency>
        <!-- aspectjrt end -->
        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <version>2.4</version>
        </dependency>
        <!-- jdbc driver -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <!-- PERSISTENCE end -->
        <!-- WEB begin -->
        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>sitemesh</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
        </dependency>
        <!-- WEB end -->
        <!-- JSR303 BeanValidator -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
        </dependency>
        <!-- JSON begin -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-jaxb-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <!-- JSON end -->
        <dependency>
            <groupId>org.htmlparser</groupId>
            <artifactId>htmlparser</artifactId>
        </dependency>
        <dependency>
            <groupId>xom</groupId>
            <artifactId>xom</artifactId>
        </dependency>
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
        </dependency>
        <!-- LOGGING begin -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
        </dependency>
        <!-- 代码直接调用log4j会被桥接到slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
        </dependency>
        <!-- 代码直接调用common-logging会被桥接到slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
        </dependency>
        <!-- 代码直接调用java.util.logging会被桥接到slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
        </dependency>
        <!-- LOGGING end -->
        <!-- GENERAL UTILS begin -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <!-- GENERAL UTILS end -->
        <!-- selenium 2.0 -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-htmlunit-driver</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-android-driver</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-iphone-driver</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-safari-driver</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-remote-driver</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>cglib</groupId>
                    <artifactId>cglib-nodep</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!--二维码生成 start-->
        <dependency>
            <groupId>com.google.zxing</groupId>
            <artifactId>core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.zxing</groupId>
            <artifactId>javase</artifactId>
        </dependency>
        <!--二维码生成 end-->
        <!-- quartz start  -->
        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <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>
            <artifactId>fastdfs_lib</artifactId>
        </dependency>
        <!--fastdfs end-->
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
    </dependencies>
    <build>
        <finalName>wlyy</finalName>
        <plugins>
            <!--打成war包需要的配置-->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>
            </plugin>
        </plugins>
    </build>
</project>

+ 0 - 17
patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/Application.java

@ -1,17 +0,0 @@
package com.yihu.wlyy.pc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
/**
 * Created by chenweida on 2017/8/2.
 */
@SpringBootApplication
public class Application {
    public static ApplicationContext ctx = null;
    public static void main(String[] args) {
        ctx = SpringApplication.run(Application.class, args);
    }
}

+ 0 - 37
patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/MvcConfig.java

@ -1,37 +0,0 @@
package com.yihu.wlyy.pc.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
 * Created by chenweida on 2017/4/6.
 */
@Configuration
public class MvcConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 多个拦截器组成一个拦截器链
        // addPathPatterns 用于添加拦截规则
        // excludePathPatterns 用户排除拦截
//        registry.addInterceptor(doctorInterceptor).addPathPatterns("/doctor/**","/statistics/province/**","/statistics/**");
//        registry.addInterceptor(patientInterceptor).addPathPatterns("/patient/**");
//        registry.addInterceptor(userInterceptor).addPathPatterns("/user/**");
        super.addInterceptors(registry);
    }
//    /**
//     * 为null的数据不返回
//     * @param converters
//     */
//    @Override
//    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
//        MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
//        ObjectMapper objectMapper=new ObjectMapper();
//        objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
//        mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
//        converters.add(mappingJackson2HttpMessageConverter);
//    }
}

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

@ -1,48 +0,0 @@
package com.yihu.wlyy.pc.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.async.DeferredResult;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import static com.google.common.base.Predicates.or;
import static springfox.documentation.builders.PathSelectors.regex;
@EnableSwagger2
@Configuration
public class SwaggerConfig {
    private static final String PUBLIC_API = "other";
    @Bean
    public Docket publicAPI() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName(PUBLIC_API)
                .genericModelSubstitutes(DeferredResult.class)
                .useDefaultResponseMessages(false)
                .forCodeGeneration(true)
                .pathMapping("/")
                .select()
                .paths(PathSelectors.regex("/.*"))
                .build()
                .apiInfo(publicApiInfo());
    }
    private ApiInfo publicApiInfo() {
        ApiInfo apiInfo = new ApiInfo("三师平台API",
                "向PC端,微信、App等应用提供功能与数据接口。",
                "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;
    }
}

+ 0 - 54
patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/async/AsyncConfig.java

@ -1,54 +0,0 @@
package com.yihu.wlyy.pc.config.async;
import org.apache.tomcat.util.threads.ThreadPoolExecutor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
/**
 * Created by chenweida on 2016.10.18.
 * 启用多綫程
 */
@Configuration
@EnableAsync
public class AsyncConfig {
    /**
     * 如果池中的实际线程数小于corePoolSize,无论是否其中有空闲的线程,都会给新的任务产生新的线程
     */
    private int corePoolSize = 5;
    /**
     * 如果池中的线程数=maximumPoolSize,则有空闲线程使用空闲线程,否则新任务放入queueCapacity.
     * 设定 比 系统native thread个数要大的话,会优先抛出Java.lang.OutOfMemoryError: unable to create new native thread
     */
    private int maxPoolSize = 10;
    /**
     * 缓冲队列大小
     */
    private int queueCapacity = 100;
    /**
     * 线程池维护线程所允许的空闲时间  秒
     */
    private int keepAliveSeconds = 300;
    @Bean
    public Executor wlyyExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(corePoolSize);
        executor.setMaxPoolSize(maxPoolSize);
        executor.setQueueCapacity(queueCapacity);
        executor.setKeepAliveSeconds(keepAliveSeconds);
        /** Reject策略预定义有四种:
         (1)ThreadPoolExecutor.AbortPolicy策略,是默认的策略,处理程序遭到拒绝将抛出运行时 RejectedExecutionException。
         (2)ThreadPoolExecutor.CallerRunsPolicy策略 ,调用者的线程会执行该任务,如果执行器已关闭,则丢弃.
         (3)ThreadPoolExecutor.DiscardPolicy策略,不能执行的任务将被丢弃.
         (4)ThreadPoolExecutor.DiscardOldestPolicy策略,如果执行程序尚未关闭,则位于工作队列头部的任务将被删除,然后重试执行程序(如果再次失败,则重复此过程).
         */
        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
        executor.initialize();
        return executor;
    }
}

+ 0 - 27
patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/jpa/HibernateProperties.java

@ -1,27 +0,0 @@
package com.yihu.wlyy.pc.config.jpa;
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;
    }
}

+ 0 - 67
patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/jpa/WlyyJpa.java

@ -1,67 +0,0 @@
package com.yihu.wlyy.pc.config.jpa;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
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;
/**
 * Created by chenweida on 2017/4/6.
 */
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
        entityManagerFactoryRef = "entityManagerFactory",
        transactionManagerRef = "wlyyTransactionManager",
        basePackages = {"com.yihu.wlyy.dao"})   //设置Repository所在位置
public class WlyyJpa {
    @Autowired
    private HibernateProperties hibernateProperties;
    @Bean(name = "wlyyDataSource")
    @Primary
    @ConfigurationProperties(prefix = "spring.datasource")
    public DataSource wlyyDataSource() {
        return DataSourceBuilder.create().build();
    }
    @Bean(name = "entityManagerFactory")
    @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("entityManagerFactory") EntityManagerFactory builder) {
        return new JpaTransactionManager(builder);
    }
}

+ 0 - 44
patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/security/WebSecurityConfig.java

@ -1,44 +0,0 @@
package com.yihu.wlyy.pc.config.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
/**
 * Created by Administrator on 2016.10.17.
 */
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    @Value("${security.basic.username}")
    String username;
    @Value("${security.basic.password}")
    String password;
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers("/swagger-ui.html").authenticated()
                .antMatchers("/swagger-ui.html").authenticated()
                .antMatchers("/configuration/security").authenticated()
                .anyRequest().permitAll()
                .and()
                .csrf().disable()
                .formLogin().defaultSuccessUrl("/swagger-ui.html").failureUrl("/login") //登录成功之后的跳转
                .permitAll()
                .and()
                .logout().logoutSuccessUrl("/login")
                .permitAll();
    }
    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth.inMemoryAuthentication()
                .withUser(username).password(password).roles("USER");
    }
}

+ 0 - 15
patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/war/ServletInitializer.java

@ -1,15 +0,0 @@
package com.yihu.wlyy.pc.config.war;//package com.yihu.wlyy.config.war;
import com.yihu.wlyy.pc.Application;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
/**
 * Created by Administrator on 2016.10.14.
 */
public class ServletInitializer extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }
}

+ 0 - 73
patient-co/patient-co-pc/src/main/resources/application.yml

@ -1,73 +0,0 @@
server:
  port: 8080
spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 50
    max-idle: 50 #最大空闲连接
    min-idle: 10 #最小空闲连接
    validation-query-timeout: 20
    log-validation-errors: true
    validation-interval: 60000 #避免过度验证,保证验证不超过这个频率——以毫秒为单位。如果一个连接应该被验证,但上次验证未达到指定间隔,将不再次验证。
    validation-query: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
    test-on-borrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
    test-on-return: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
    idle-timeout: 30000
    connection-test-query: SELECT 1
    num-tests-per-eviction-run: 50 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量,最好和maxActive
    test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
    min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
    # REDIS
  redis:
    database: 0 # Database index used by the connection factory.
    password: # Login password of the redis server.
    timeout: 0 # Connection timeout in milliseconds.
      #sentinel:
      #  master: # Name of Redis server.
      #  nodes: # Comma-separated list of host:port pairs.
logging:
  level:
    root: INFO
hibernate:
  dialect: org.hibernate.dialect.MySQL5Dialect
  show_sql: true
  ejb:
    naming_strategy: org.hibernate.cfg.ImprovedNamingStrategy
multipart:
  enabled: true
  max-file-size: 50mb
  max-request-size: 50mb
security:
  basic:
    username: jkzl
    password: jkzlehr
---
spring:
  profiles: test
---
spring:
  profiles: dev
  datasource:
    url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: linzhou
    password: linzhou
---
spring:
  profiles: prod

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

@ -213,9 +213,10 @@ public class PrescriptionInfoService extends BaseService {
                " p.`name`, " +
                " TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, " +
                " p.sex, " +
                " p.photo," +
                " pr.`status`, " +
                " pr.`code`, " +
                " pr.create_time AS createTime, " +
                " LEFT(pr.create_time,19) AS createTime, " +
                " pr.doctor " +
                " FROM " +
                " wlyy_prescription pr " +

+ 2 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -581,6 +581,8 @@ public class DoctorController extends BaseController {
                json.put("provinceName", temp.getProvinceName());
                // 设置城市名称
                json.put("cityName", temp.getCityName());
                // 设置医院code
                json.put("hospital", temp.getHospital());
                // 设置医院名称
                json.put("hospitalName", temp.getHospitalName());
                // 设置部门名称

+ 1 - 1
patient-co/patient-co-wlyy/pom.xml

@ -433,7 +433,7 @@
                    <target>1.8</target>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
                        <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>

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

@ -31,9 +31,9 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
        // 多个拦截器组成一个拦截器链
        // addPathPatterns 用于添加拦截规则
        // excludePathPatterns 用户排除拦截
        registry.addInterceptor(doctorInterceptor).addPathPatterns("/doctor/**","/statistics/province/**","/statistics/**");
        registry.addInterceptor(patientInterceptor).addPathPatterns("/patient/**");
        registry.addInterceptor(userInterceptor).addPathPatterns("/user/**");
//        registry.addInterceptor(doctorInterceptor).addPathPatterns("/doctor/**","/statistics/province/**","/statistics/**");
//        registry.addInterceptor(patientInterceptor).addPathPatterns("/patient/**");
//        registry.addInterceptor(userInterceptor).addPathPatterns("/user/**");
        super.addInterceptors(registry);
    }

+ 118 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java

@ -2,10 +2,12 @@ package com.yihu.wlyy.entity.patient.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import org.springframework.util.StringUtils;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
/**
@ -28,7 +30,7 @@ public class Prescription extends IdEntity {
    private String patient;                  //关联 wlyy_patient code
    private String patientName;             //患者名称
    private Integer type;                    //1 处方 2 续方
    private Integer status;                  //状态 (-1 审核不通过 , 0 审核中, 10 审核通过/待支付 ,21支付失败  20 配药中/支付成功, 21 等待领药 ,30 配送中 ,100配送成功/已完成)
    private Integer status;                  //状态 (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 , 40配药成功/待配送  41配送失败  42配送中   43配送到服务站  100配送到患者手中/已完成)
    private String doctor;                   //开处方的医生code 关联 wlyy_doctor
    private String doctorName;               //医生名称
    private Long adminTeamId;             //患者签约的行政团队
@ -49,8 +51,13 @@ public class Prescription extends IdEntity {
    private String remark;                     //处方备注
    private String reason;                      //续方原因
    private String reviewedReason; //审核不通过的原因
//    private Double ybCost;                      //医保费用
    //    private Double ybCost;                      //医保费用
//    private Double myCost;                      //自己付费
    private Integer prescriptionType;          //处方类型:1、门诊处方,2、住院处方
    private String statusName; //
    @Column(name = "code", unique = true, nullable = false)
    public String getCode() {
@ -316,4 +323,113 @@ public class Prescription extends IdEntity {
    public void setReviewedReason(String reviewedReason) {
        this.reviewedReason = reviewedReason;
    }
    public Integer getPrescriptionType() {
        return prescriptionType;
    }
    public void setPrescriptionType(Integer prescriptionType) {
        this.prescriptionType = prescriptionType;
    }
    @Transient
    public String getTypeName() {
        switch (type) {
            case 1: {
                return "自取";
            }
            case 2: {
                return "快递配送";
            }
            case 3: {
                return "健管师配送";
            }
        }
        return "";
    }
    @Transient
    public String getStatusName() {
        return statusName;
    }
    public void setStatusName(String statusName) {
        this.statusName = getStatusName(status,null);
    }
    @Transient
    public static String getStatusName(Integer status, String hospitalName) {
        /**
         *  no_reviewed("审核不通过", -1),
         revieweding("待审核", 0),
         changeing("调整中",2),
         reviewed_success("审核通过/开方中", 10),
         wait_pay("开方完成/待支付", 20),
         pay_error("支付失败", 21),
         pay_success("支付成功/待配药", 30),
         wait_expressage("配药成功/待配送", 40),
         expressageing_error("配送失败", 41),
         expressageJGS("分配健管师", 42),
         expressageing("配送中", 45),
         expressage2hospital("配送到服务站", 49),
         finish("配送到患者手中/已完成", 100);
         */
        //-1 审核不通过 , 0 审核中, 10 审核通过/待支付 ,21支付失败  20 配药中/支付成功, 21 等待领药 ,30 配送中 ,100配送成功/已完成
        switch (status) {
            case -3: {
                return "支付超时";
            }
            case -2: {
                return "患者自己取消";
            }
            case -1: {
                return "审核不通过";
            }
            case 0: {
                return "待审核";
            }
            case 2: {
                return "调整处方中";
            }
            case 10: {
                return "开方中";
            }
            case 20: {
                return "开方完成";
            }
            case 21: {
                return "支付失败";
            }
            case 30: {
                return "订单已支付";
            }
            case 40: {
                return "配药完成";
            }
            case 41: {
                return "配送失败";
            }
            case 42: {
                return "分配健管师配送";
            }
            case 45: {
                return "配送中";
            }
            case 49: {
                if (StringUtils.isEmpty(hospitalName)) {
                    return "配送到服务站";
                }
                {
                    return "配送到" + hospitalName;
                }
            }
            case 100: {
                return "续方完成";
            }
        }
        return "未知";
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionAdjust.java

@ -10,7 +10,7 @@ import java.util.Date;
/**
 * Created by Administrator on 2017/7/21.
 * 处方
 * 处方调整记录表
 */
@Entity
@Table(name = "wlyy_prescription_adjust")

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionDiagnosis.java

@ -9,6 +9,7 @@ import java.util.Date;
/**
 * Created by Trick on 2017/7/28.
 * 处方诊断表
 */
@Entity
@Table(name = "wlyy_prescription_diagnosis")

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionDispensaryCode.java

@ -10,7 +10,7 @@ import java.util.Date;
/**
 * Created by Administrator on 2017/7/21.
 * 处方取码
 * 处方编码表
 */
@Entity
@Table(name = "wlyy_prescription_dispensary_code")

+ 20 - 14
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressage.java

@ -33,17 +33,17 @@ public class PrescriptionExpressage extends IdEntity{
    private String streetCode;              //收货人街道代码
    private String streetName;              //收货人街道名称
    private Integer price;                    //快递的配送费用 单位是分
    private Integer weight;                  //快递重量  单位是g
    private String expressageName;          //配送人名称
    private String expressageCode;          //配送人code
    private String expressageMobile;        //配送人电话
    private String hospitalName;            //如果配送方式是健管师那么这个字段存服务站名称,如果是快递配送那么是快递公司名称
    private String hospitalName;            // 如果配送方式是健管师那么这个字段存服务站名称,如果是快递配送那么是快递公司名称
    private String hospitalAddress;            // 机构地址
    private Date createTime;                //创建的时间
    private Integer oneselfPickupFlg;//是否自取 1是 0否
    private Integer del;    //1可用 0删除
    //没有hibernate映射
    private Integer dispensaryType;            //取药类型:1 自取 2快递配送 3健管师配送
    private Integer status;                  //状态 (-1 审核不通过 , 0 审核中, 10 审核通过/待支付 ,21支付失败  20 配药中/支付成功, 21 等待领药 ,30 配送中 ,100配送成功/已完成)
    @Column(name = "code", unique = true , nullable=false)
    public String getCode() {
@ -219,21 +219,27 @@ public class PrescriptionExpressage extends IdEntity{
        this.expressageMobile = expressageMobile;
    }
    @Transient
    public Integer getDispensaryType() {
        return dispensaryType;
    public Integer getWeight() {
        return weight;
    }
    public void setDispensaryType(Integer dispensaryType) {
        this.dispensaryType = dispensaryType;
    public void setWeight(Integer weight) {
        this.weight = weight;
    }
    @Transient
    public Integer getStatus() {
        return status;
    public Integer getDel() {
        return del;
    }
    public void setStatus(Integer status) {
        this.status = status;
    public void setDel(Integer del) {
        this.del = del;
    }
    public String getHospitalAddress() {
        return hospitalAddress;
    }
    public void setHospitalAddress(String hospitalAddress) {
        this.hospitalAddress = hospitalAddress;
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressageLog.java

@ -10,7 +10,7 @@ import java.util.Date;
/**
 * Created by Administrator on 2017/7/21.
 * 处方配送
 * 处方配送流程表
 */
@Entity
@Table(name = "wlyy_prescription_expressage_log")

+ 33 - 10
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionLog.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
/**
@ -49,17 +50,26 @@ public class PrescriptionLog extends IdEntity {
        }
    }
    //状态枚举
    public enum PrescriptionLogStatus {
        pay_outtime("支付超时", -3),
        patient_canel("患者自己取消", -2),
        no_reviewed("审核不通过", -1),
        revieweding("审核中", 0),
        reviewed_success("审核通过/待支付", 10),
        pay_error("支付成功/配药中", 20),
        pay_success("支付失败", 21),
        wait_expressage("配药成功/等待领药", 30),
        expressageing("配送中", 31),
        expressageing_error("配送失败", 32),
        finish("结束", 100);
        revieweding("待审核", 0),
        changeing("调整中", 2),
        reviewed_success("审核通过/开方中", 10),
        wait_pay("开方完成/待支付", 20),
        pay_error("支付失败", 21),
        pay_success("支付成功/待配药", 30),
        wait_expressage("配药成功/待配送", 40),
        expressageing_error("配送失败", 41),
        expressageJGS("分配健管师", 42),
        expressageing("配送中", 45),
        expressage2hospital("配送到服务站", 49),
        finish("配送到患者手中/已完成", 100);
        private String name;
        private int value;
@ -89,8 +99,9 @@ public class PrescriptionLog extends IdEntity {
    private String code;                    //业务流程
    private String prescriptionCode;      //处方code 关联表wlyy_prescription code
    private Date createTime;               //处方创建时间
    private Integer status;                  //状态 (-1 审核不通过 , 0 审核中, 10 审核通过/待支付 ,20 配药中/支付成功  , 21支付失败  , 30 配药成功/等待领药 ,31 配送中 32 配送失败,100配送成功/已完成)
    private Integer type;                   //类型: 1智业对接 2易联众对接  3创建处方 4 审核  5付款 6 配送 7完成 8顺丰对接
    private Integer status;                 //状态 (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 , 40配药成功/待配送  41配送失败 42分配健管师 45配送中   49配送到服务站  100配送到患者手中/已完成)
    private Integer type;                   //类型: 1智业对接 2易联众对接  3创建处方 4 审核  5付款 6 配送 7完成
    private String userCode;                  //医生或者患者code
    private String userName;                  //医生或者患者name
    private Integer userType;                 //1 患者 2医生
@ -99,6 +110,8 @@ public class PrescriptionLog extends IdEntity {
    private String hospital;//医院code
    private String hospitalName;//医院名称
    private String statusName;  //状态名称
    @Column(name = "code")
    public String getCode() {
        return code;
@ -204,4 +217,14 @@ public class PrescriptionLog extends IdEntity {
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    @Transient
    public String getStatusName() {
        return statusName;
    }
    public void setStatusName(String statusName) {
        this.statusName = Prescription.getStatusName(this.status,hospitalName);
    }
}

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorAdminTeamMemberDao.java

@ -58,5 +58,7 @@ public interface DoctorAdminTeamMemberDao extends
    @Query("select m from AdminTeamMember m,SignFamily s where m.teamId = s.adminTeamId and s.status >0 and s.patient=?1 and m.doctorCode =?2")
    List<AdminTeamMember> findByAdminTeam(String patient,String doctorCode);
    @Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = ?1 AND t.id = m.teamId " +
            "AND m.doctorCode = d.code AND t.available = true AND m.available = true AND d.level=3 ORDER BY d.level")
    List<Doctor> findJGSMembers(long teamId);
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionExpressageDao.java

@ -10,7 +10,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 * Created by chenweida on 2017/7/27.
 */
public interface PrescriptionExpressageDao extends PagingAndSortingRepository<PrescriptionExpressage, Long>, JpaSpecificationExecutor<PrescriptionExpressage> {
    @Query("from PrescriptionExpressage p where p.prescriptionCode=?1")
    @Query("from PrescriptionExpressage p where p.prescriptionCode=?1 and p.del=1")
    PrescriptionExpressage findByPrescriptionPay(String prescriptionCode);
    @Query("from PrescriptionExpressage p where p.mailno=?1")

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

@ -64,7 +64,7 @@ public class PrescriptionExpressageService {
            return -1;
        }
        //判断是否是取药码
        if (prescriptionDispensaryCode.getType() != 1||prescriptionDispensaryCode.getType() !=2) {
        if (prescriptionDispensaryCode.getType() != 1 || prescriptionDispensaryCode.getType() != 2) {
            //保存取药失败的日志
            PrescriptionLog prescriptionLog = new PrescriptionLog();
            prescriptionLog.setCode(UUID.randomUUID().toString());
@ -122,4 +122,34 @@ public class PrescriptionExpressageService {
    }
    /**
     * 全科医生分配健管师
     *
     * @param code             健管师code
     * @param name             健管师名称
     * @param mobile           健管师联系电话
     * @param prescriptionCode 处方code
     * @param doctorQK         分配的全科
     */
    @Transactional
    public void updateExpressageJGS(String code, String name, String mobile, String prescriptionCode, String doctorQK) {
        //更新配送表 新增配送人员记录
        PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionPay(prescriptionCode);
        prescriptionExpressage.setExpressageCode(code);
        prescriptionExpressage.setExpressageMobile(mobile);
        prescriptionExpressage.setExpressageName(name);
        //新增日志
        PrescriptionLog prescriptionLog = new PrescriptionLog();
        prescriptionLog.setCode(UUID.randomUUID().toString());
        prescriptionLog.setCreateTime(new Date());
        prescriptionLog.setFlag(1);
        prescriptionLog.setPrescriptionCode(prescriptionCode);
        prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
        prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageJGS.getValue());
        prescriptionLog.setUserCode(doctorQK);
        prescriptionLog.setUserType(2);
        prescriptionLog.setRemark("团队长分配健管师配送");
        prescriptionLogDao.save(prescriptionLog);
    }
}

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

@ -19,6 +19,7 @@ import com.yihu.wlyy.repository.prescription.PrescriptionLogDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ImUtill;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
@ -71,10 +72,15 @@ public class PrescriptionInfoService extends BaseService {
        List<SystemDict> states = systemDictDao.findByDictName("PRESCRIPTION_STATE");
        rs.put("states",states);
        List<Map<String,Object>> diseases = new ArrayList<>();
        Map<String,Object> dis = new HashMap<>();
        dis.put("1","糖尿病");
        dis.put("2","高血压");
        rs.put("diseases",dis);
        Map<String,Object> dis1 = new HashMap<>();
        dis1.put("code","1");
        dis1.put("name","糖尿病");
        Map<String,Object> dis2 = new HashMap<>();
        dis2.put("code","2");
        dis2.put("name","高血压");
        diseases.add(dis1);
        diseases.add(dis2);
        rs.put("diseases",diseases);
        return rs;
    }
@ -84,7 +90,7 @@ public class PrescriptionInfoService extends BaseService {
     * @param type
     * @return
     */
    public JSONArray getPrescriptionInfos(String type,String startDate,String endDate,String patient,String isRenewal){
    public JSONArray getPrescriptionInfos(String type,String startDate,String endDate,String patient,String isRenewal,Integer page,Integer size){
        if(StringUtils.isNotBlank(type)){
            if("1".equals(type)){
@ -106,6 +112,9 @@ public class PrescriptionInfoService extends BaseService {
                    sqlBuffer.append(" AND p.create_time <= ?");
                    params.add(endDate+" 23:59:59");
                }
                if(page!=null&&page>0&&size!=null&&size>0){
                    sqlBuffer.append(" LIMIT "+(page-1)*size+","+size);
                }
                //本地库
                List<Map<String,Object>> rs =jdbcTemplate.queryForList(sqlBuffer.toString(),params.toArray());
                //通过缓存查找药品和疾病
@ -208,14 +217,15 @@ public class PrescriptionInfoService extends BaseService {
    }
    public JSONArray getDoctorPrescription(Integer teamCode,String state,String diseases,String startDate,String endDate,String nameKeyword){
    public JSONArray getDoctorPrescription(Integer teamCode,String state,String diseases,String startDate,String endDate,String nameKeyword,Integer page,Integer size){
        StringBuffer pre_sql = new StringBuffer("SELECT " +
                " p.`name`, " +
                " TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, " +
                " p.sex, " +
                " p.photo, " +
                " pr.`status`, " +
                " pr.`code`, " +
                " pr.create_time AS createTime, " +
                " LEFT(pr.create_time,19) AS createTime, " +
                " pr.doctor " +
                " FROM " +
                " wlyy_prescription pr " +
@ -229,12 +239,12 @@ public class PrescriptionInfoService extends BaseService {
                    " AND pr.admin_team_id =? AND s.code = ?");
            params.add(teamCode);
            params.add(diseases);
            setSQL(pre_sql,params,state,startDate,endDate,nameKeyword);
            setSQL(pre_sql,params,state,startDate,endDate,nameKeyword,page,size);
        }else{
            //查询所有疾病类型表
            pre_sql.append(" WHERE pr.admin_team_id =?");
            params.add(teamCode);
            setSQL(pre_sql,params,state,startDate,endDate,nameKeyword);
            setSQL(pre_sql,params,state,startDate,endDate,nameKeyword,page,size);
        }
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(pre_sql.toString(),params.toArray());
@ -247,7 +257,7 @@ public class PrescriptionInfoService extends BaseService {
        return new JSONArray(rs);
    }
    public void setSQL(StringBuffer pre_sql,List<Object> params,String state,String startDate,String endDate,String nameKeyword){
    public void setSQL(StringBuffer pre_sql,List<Object> params,String state,String startDate,String endDate,String nameKeyword,Integer page,Integer size){
        if(StringUtils.isNotBlank(state)){
            pre_sql.append(" AND pr.status = ?");
            params.add(state);
@ -265,6 +275,9 @@ public class PrescriptionInfoService extends BaseService {
            params.add("%"+nameKeyword+"%");
        }
        pre_sql.append(" GROUP BY pr.code ORDER BY pr.create_time DESC");
        if(page!=null&&page>0&&size!=null&&size>0){
            pre_sql.append(" LIMIT "+(page-1)*size+","+size);
        }
    }
    /**

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

@ -0,0 +1,119 @@
package com.yihu.wlyy.service.app.prescription;
import antlr.StringUtils;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.task.PushMsgTask;
import com.ylzinfo.onepay.sdk.utils.StringUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * Created by Reece on 2017/8/3.
 */
@Service
public class PrescriptionNoticesService extends BaseService {
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private PatientDao patientDao;
    /**
     * 发送续方相关模板消息
     *
     * @param accessToken
     * @param doctor      医生code
     * @param patient     居民code
     * @param type        1:续方审核通知 2:取药代办通知 3:配送中信息变更 4:已完成服务结果
     * @param status      续方通知状态 0不通过 1通过 2调整处方  其余状态均为0
     */
    public void sendMessages(String accessToken, String doctor, String patient, String checkDoctor,String ordenTime,int type, int status) throws Exception{
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Doctor doct = doctorDao.findByCode(doctor);
        Patient people = patientDao.findByCode(patient);
        if (StringUtil.isEmpty(people.getOpenid())){
            return;
        }
        String doctName = doct.getName();
        String name = people.getName();
        String openId = people.getOpenid();
        JSONObject sendJson = new JSONObject();
        String first = "";
        String remark = "";
        if (type == 1) {
            switch (status) {
                case 0:
                    first =  name+ "您好,你的续方申请医生已审核。";
                    remark = "您可点击消息查看详情,修改续方信息后重新提交。";
                    sendJson.put("keyword1", "审核不通过");
                    sendJson.put("keyword2", doctName);
                    sendJson.put("first", first);
                    sendJson.put("remark", remark);
                    pushMsgTask.putWxMsg(accessToken, 19, openId, name, sendJson);
                    break;
                case 1:
                    first = name + "您好,你的续方申请医生已审核。";
                    remark = "您可点击消息查看详情并完成支付。";
                    sendJson.put("keyword1", "审核通过");
                    sendJson.put("keyword2", doctName);
                    sendJson.put("first", first);
                    sendJson.put("remark", remark);
                    pushMsgTask.putWxMsg(accessToken, 19, openId, name, sendJson);
                    break;
                case 2:
                    first = name + "您好,您的续方申请医生已修改处方清单并审核。";
                    remark = "您可点击消息查看详情并完成支付。";
                    sendJson.put("keyword1", "审核通过");
                    sendJson.put("keyword2", doctName);
                    sendJson.put("first", first);
                    sendJson.put("remark", remark);
                    pushMsgTask.putWxMsg(accessToken, 19, openId, name, sendJson);
                    break;
            }
        } else if (type == 2) {
            first =  name+ "您好,您的续方订单已完成配药,请尽快致社区医院取药。";
            remark = "";
            sendJson.put("keyword1", "续方订单取药");
            sendJson.put("keyword2", dateFormat.format(new Date()));
            sendJson.put("first", first);
            sendJson.put("remark", remark);
            pushMsgTask.putWxMsg(accessToken, 11, openId, name, sendJson);
        }
        if (type == 3) {
            first =  name+ "您好,您的续方订单配送员"+doctName+"已顺利取药,续方状态变更为配送中。";
            remark = "您可点击消息查看详情。";
            sendJson.put("keyword1", doctName);
            sendJson.put("keyword2", dateFormat.format(new Date()));
            sendJson.put("keyword3", "续方状态");
            sendJson.put("first", first);
            sendJson.put("remark", remark);
            pushMsgTask.putWxMsg(accessToken, 10, openId, name, sendJson);
        }
        if (type == 4) {
            first =  name+ ",您好!您的续方订单已成功配送。";
            remark = "感谢您的使用。";
            sendJson.put("keyword1", "续方申请");
            sendJson.put("keyword2", checkDoctor);//审核医生姓名
            sendJson.put("keyword3", ordenTime);//订单完成时间
            sendJson.put("first", first);
            sendJson.put("remark", remark);
            pushMsgTask.putWxMsg(accessToken, 20, openId, name, sendJson);
        }
    }
}

+ 2 - 18
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -651,9 +651,8 @@ public class SignWebService extends BaseService {
     * @param signCode 签约code
     * @return
     */
    public List<JSONObject> getSignInfo(String signCode) {
    public JSONObject getSignInfo(String signCode) {
        List<JSONObject> jsonArray = new ArrayList<JSONObject>();
        // 直接查询签约缴费流水号 可能为空
        WlyyCharge charge = chargeDao.findByChargeRelation(signCode);
        //查询签约表数据
@ -725,22 +724,7 @@ public class SignWebService extends BaseService {
            String chargeCode = charge.getCode();
            jsonObject.put("chargeCode", chargeCode);
        }
        jsonArray.add(jsonObject);
        Collections.sort(jsonArray, new Comparator<JSONObject>() {
            @Override
            public int compare(JSONObject o1, JSONObject o2) {
                Date o1Date = (Date) o1.get("createTime");
                Date o2Date = (Date) o2.get("createTime");
                if (o1Date.before(o2Date)) {
                    return 1;
                } else if (o1Date.after(o2Date)) {
                    return -1;
                }
                return 0;
            }
        });
        return jsonArray;
        return jsonObject;
    }
    /**

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/team/AdminTeamService.java

@ -494,4 +494,8 @@ public class AdminTeamService extends BaseService {
        result.put("members",doctors);
        return result;
    }
    public List<Doctor> getJGSMembers(long teamId) {
        return memberDao.findJGSMembers(teamId);
    }
}

+ 31 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -187,8 +187,8 @@ public class PushMsgTask {
    /**
     * 发送微信模板消息
     *
     * @param type 1:签约成功  2:签约失败  3:咨询回复通知  4:健康指导提醒  5:解约申请通知  6:预约挂号成功通知  7:预约取消通知 8 缴费提醒 9 健康教育  10 签约医生变更
     *             18 产检提醒和产检就诊提醒
     * @param type 1:签约成功  2:签约失败  3:咨询回复通知  4:健康指导提醒  5:解约申请通知  6:预约挂号成功通知  7:预约取消通知 8 缴费提醒 9 健康教育  10 签约医生变更(信息变更通知)
     *             18 产检提醒和产检就诊提醒 19:续方审核结果通知(0.不通过 1.通过 2。调整处方并通过) 20:服务结果通知 11.代办事项通知
     * @param json 当type==1||type==2时:{"first":"消息主题",”doctor":"医生code","doctorName":"医生名","date":"签约时间","content":"签约内容","remark":"消息备注"}
     *             type==3时:{"first":"消息主题","consult":"医生咨询编号","consultcontent":"咨询内容","replycontent":"回复内容","doctorName":"医生名","remark":"消息备注"}
     *             type==4时:{"first":"消息主题","date":"指导时间","orgName":"指导机构","doctorName":"指导医生名","content":"指导内容","remark":"消息备注"}
@ -199,6 +199,9 @@ public class PushMsgTask {
     *             type==10时:{"first":"消息主题","name":"患教标题","doctorName":"医生名","date":"发送时间","remark":"消息备注"}
     *             <p>
     *             type==11时:{"first":"消息主题","name":"患教标题","doctorName":"医生名","date":"发送时间","remark":"消息备注"}
     *             type==19时:{"first":"消息主题","keyword1":"审核结果","keyword2":"审核医生","remark":"消息备注"}
     *             type==20时:{"first":"消息主题","keyword1":"服务项目","keyword2":"操作医生","keyword3":"服务时间","remark":"消息备注"}
     *
     * @return
     */
//    private boolean sendWeixinMessage(String access_token, int type, String openid, String name, JSONObject json) {
@ -584,6 +587,32 @@ public class PushMsgTask {
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            }else if (type == 19) {
                temp.setUrl(url + json.getString("url"));
                temp.setTemplate_id("szpdsKDQQRDnqsoK9Oxuophb-nScXat4yy6wobnvfFw");
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));
                m.put("keyword1", keyword1);
                WechatTemplateData keyword2 = new WechatTemplateData();
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            }else if (type == 20) {
                temp.setUrl(url + json.getString("url"));
                temp.setTemplate_id("szpdsKDQQRDnqsoK9Oxuophb-nScXat4yy6wobnvfFw");
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));
                m.put("keyword1", keyword1);
                WechatTemplateData keyword2 = new WechatTemplateData();
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
                WechatTemplateData keyword3 = new WechatTemplateData();
                keyword3.setColor("#000000");
                keyword3.setValue(json.getString("keyword3"));
                m.put("keyword3", keyword3);
            }
            temp.setData(m);

+ 52 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionExpressageController.java

@ -0,0 +1,52 @@
package com.yihu.wlyy.web.doctor.prescription;
import com.yihu.wlyy.service.app.prescription.PatientPrescriptionPayService;
import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageService;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * Created by Reece on 2017/7/28.
 */
@RestController
@RequestMapping(value = "/doctor/prescription/expressage", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-长处配送相关接口")
public class PrescriptionExpressageController extends WeixinBaseController {
    @Autowired
    private PrescriptionExpressageService expressageService;
    /**
     * 健管师配送的时候分配健管师
     *
     * @return
     */
    @RequestMapping(value = "/expressageJGS", method = RequestMethod.POST)
    @ApiOperation(value = "健管师配送的时候分配健管师")
    public String expressageJGS(
            @ApiParam(required = true, name = "code", value = "健管师code") @RequestParam(value = "code", required = true) String code,
            @ApiParam(required = true, name = "name", value = "健管师name") @RequestParam(value = "name", required = true) String name,
            @ApiParam(required = true, name = "mobile", value = "健管师code") @RequestParam(value = "mobile", required = true) String mobile,
            @ApiParam(required = true, name = "prescriptionCode", value = "处方code") @RequestParam(value = "prescriptionCode", required = true) String prescriptionCode) throws Exception {
        try {
            expressageService.updateExpressageJGS(code,name,mobile,prescriptionCode,getUID());
            return success("修改成功");
        } catch (Exception e) {
            return error(-1, "获取失败");
        }
    }
}

+ 9 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -80,9 +80,11 @@ public class PrescriptionInfoController extends BaseController{
                                        @RequestParam(required = false)@ApiParam(value = "所有诊断:1 糖尿病 2高血压", name = "dispensary") String diseases,
                                        @RequestParam(required = false)@ApiParam(name="startDate",value="开始时间")String startDate,
                                        @RequestParam(required = false)@ApiParam(name="endDate",value="结束时间")String endDate,
                                        @RequestParam(required = false)@ApiParam(name="nameKeyword",value="患者姓名模糊匹配")String nameKeyword){
                                        @RequestParam(required = false)@ApiParam(name="nameKeyword",value="患者姓名模糊匹配")String nameKeyword,
                                        @RequestParam(required = false)@ApiParam(name="page",value="起始页")Integer page,
                                        @RequestParam(required = false)@ApiParam(name="size",value="每页条数")Integer size){
        try {
            return write(200, "查询成功!", "data",prescriptionInfoService.getDoctorPrescription(teamCode,state,diseases,startDate,endDate,nameKeyword));
            return write(200, "查询成功!", "data",prescriptionInfoService.getDoctorPrescription(teamCode,state,diseases,startDate,endDate,nameKeyword,page,size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -176,12 +178,13 @@ public class PrescriptionInfoController extends BaseController{
            PrescriptionPay prescriptionPay = prescriptionPayService.findByPrescriptionCode(prescriptionCode);
            //获取配送信息
            PrescriptionExpressage prescriptionExpressage = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            prescriptionExpressage.setDispensaryType(prescription.getType());//处方配送方式
            prescriptionExpressage.setStatus(prescription.getStatus());//处方状态
            jo.put("prescriptionExpressage", prescriptionExpressage);
            jo.put("prescriptionInfos", prescriptionInfos);
            jo.put("prescriptionPay", prescriptionPay);
            jo.put("prescriptionExpressage", prescriptionExpressage);
            jo.put("dispensaryDispensaryType", prescription.getType());//处方配送方式
            jo.put("dispensaryDispensaryTypeName", prescription.getTypeName());//处方配送方式
            jo.put("prescriptionStatus", prescription.getStatus());//处方状态
            jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(),""));//处方状态名称
            return write(200, "查询成功", "data", jo);
        } catch (Exception e) {

+ 43 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionLogController.java

@ -37,7 +37,49 @@ public class PrescriptionLogController extends BaseController {
    public String addReply(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
            Integer[] types = new Integer[]{20, 30, 31,100};
            // (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 ,
            //  40配药成功/待配送  41配送失败  42配送中   43配送到服务站  100配送到患者手中/已完成)
            Integer[] types = new Integer[]{
                    PrescriptionLog.PrescriptionLogStatus.revieweding.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.changeing.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.reviewed_success.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.pay_success.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressageing.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.finish.getValue()};
            List<PrescriptionLog> prescriptionLogs = prescriptionLogService.findPrescriptionLogsByPrescriptionCode(prescriptionCode, types);
            if (prescriptionLogs != null) {
                return write(200, "获取处方流程成功", "data", prescriptionLogs);
            } else {
                return error(-1, "获取失败");
            }
        } catch (Exception e) {
            return error(-1, "获取失败");
        }
    }
    /**
     * 根据处方code获取处方流程
     *
     * @param prescriptionCode
     * @return
     */
    @RequestMapping(value = "/orderFollow", method = RequestMethod.GET)
    @ApiOperation(value = "订单状态跟踪")
    public String orderFollow(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
            // (-3 支付过期 -2 患者自己取消 -1 审核不通过 , 0 待审核, 2调整中 10 审核通过/开方中  , 20开方完成/待支付, 21 支付失败 , 30 支付成功/待配药 ,
            //  40配药成功/待配送  41配送失败  42配送中   43配送到服务站  100配送到患者手中/已完成)
            Integer[] types = new Integer[]{
                    PrescriptionLog.PrescriptionLogStatus.pay_success.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressageing.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.finish.getValue()};
            List<PrescriptionLog> prescriptionLogs = prescriptionLogService.findPrescriptionLogsByPrescriptionCode(prescriptionCode, types);
            if (prescriptionLogs != null) {
                return write(200, "获取处方流程成功", "data", prescriptionLogs);

+ 57 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionNoticesController.java

@ -0,0 +1,57 @@
package com.yihu.wlyy.web.doctor.prescription;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.app.prescription.PrescriptionDispensaryCodeService;
import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageService;
import com.yihu.wlyy.service.app.prescription.PrescriptionNoticesService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * Created by Reece on 2017/8/3.
 */
@RestController
@RequestMapping(value = "/doctor/prescriptionNotices")
@Api(description = "医生端-长处方模板消息接口")
public class PrescriptionNoticesController extends WeixinBaseController {
    @Autowired
    private PrescriptionNoticesService noticesService;
    /**
     * 医生端及基卫发送给居民的模板消息
     * @param doctor   相关医生信息
     * @param patient  目标居民信息
     * @param checkDoctor  审核医生姓名
     * @param ordenTime     订单完成时间 时间字符串格式yyyy-MM-dd HH:mm:ss
     * @param type       1:续方审核通知 2:取药代办通知 3:配送中信息变更 4:已完成服务结果
     * @param status    续方通知状态 0不通过 1通过 2调整处方  其余模板通知消息状态均为0
     * @return
     */
    @RequestMapping(value = "/sendMessage", method = RequestMethod.POST)
    @ApiOperation(value = "模板消息发送")
    public String sendMessage(
            @RequestParam() @ApiParam(value = "相关医生信息", name = "doctor")String doctor,
            @RequestParam() @ApiParam(value = "目标居民信息", name = "patient")String patient,
            @RequestParam() @ApiParam(value = "审核医生姓名", name = "checkDoctor")String checkDoctor,
            @RequestParam() @ApiParam(value = "订单完成时间 格式yyyy-MM-dd HH:mm:ss", name = "ordenTime")String ordenTime,
            @RequestParam() @ApiParam(value = "模板类型", name = "type")int type,
            @RequestParam() @ApiParam(value = "模板", name = "status")int status) {
        try {
            String accessToken = getAccessToken();
            noticesService.sendMessages(accessToken,doctor,patient,checkDoctor,ordenTime,type,status);
            return write(200, "配送成功");
        } catch (Exception e) {
            return error(-1, "失败");
        }
    }
}

+ 14 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/team/AdminTeamController.java

@ -182,6 +182,20 @@ public class AdminTeamController extends BaseController {
        }
    }
    @RequestMapping(value = "/{team_id}/jgsmembers", method = RequestMethod.GET)
    @ApiOperation(value = "获取团队健管师")
    public String jgsmembers(@PathVariable("team_id") long teamId) {
        try {
            List<Doctor> members = memberService.getJGSMembers(teamId);
            return write(200, "OK", "data", new JSONArray(copyBeans(members, "id", "code", "name", "hospital",
                    "jobName", "level", "sex", "photo")));
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    //目前没用到,之后可能会用到
//  @RequestMapping(value = "/{team_id}/members/excludedThisAndLevel3", method = RequestMethod.GET)
//  @ApiOperation(value = "获取团队成员,排除自己和专科医生")

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

@ -36,9 +36,11 @@ public class PatientPrescriptionInfoController extends BaseController {
    public String getPrescriptionInfos(@RequestParam(required = true)@ApiParam(name="type",value="1:查询处方;2我的续方;3:续方记录")String type,
                                       @RequestParam(required = false)@ApiParam(name="isRenewal",value="处方是否可续方:1.是;2.无过滤")String isRenewal,
                                       @RequestParam(required = false)@ApiParam(name="startDate",value="开始时间")String startDate,
                                       @RequestParam(required = false)@ApiParam(name="endDate",value="结束时间")String endDate){
                                       @RequestParam(required = false)@ApiParam(name="endDate",value="结束时间")String endDate,
                                       @RequestParam(required = false)@ApiParam(name="page",value="起始页")Integer page,
                                       @RequestParam(required = false)@ApiParam(name="size",value="每页条数")Integer size){
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionInfos(type,startDate,endDate,getRepUID(),isRenewal));
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionInfos(type,startDate,endDate,getRepUID(),isRenewal,page,size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");

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

@ -36,7 +36,18 @@ public class PatientPrescriptionLogController extends BaseController {
    public String addReply(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
            Integer[] types = new Integer[]{20, 30, 31,100};
            Integer[] types = new Integer[]{
                    PrescriptionLog.PrescriptionLogStatus.revieweding.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.changeing.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.reviewed_success.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.pay_error.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.pay_success.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressageing.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue(),
                    PrescriptionLog.PrescriptionLogStatus.finish.getValue()};
            List<PrescriptionLog> prescriptionLogs = prescriptionLogService.findPrescriptionLogsByPrescriptionCode(prescriptionCode, types);
            if (prescriptionLogs != null) {
                return write(200, "获取处方流程成功", "data", prescriptionLogs);

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/PatientSignController.java

@ -316,8 +316,8 @@ public class PatientSignController extends BaseController {
    @RequestMapping(value = "/signInfo",method = RequestMethod.GET)
    public String getSignInfo(@RequestParam String code) {
        try {
            List<JSONObject> jsonArray = signWebService.getSignInfo(code);
            return write(200, "查询成功!", "data", new JSONArray(jsonArray));
            JSONObject jsonArray = signWebService.getSignInfo(code);
            return write(200, "查询成功!", "data", jsonArray);
        } catch (Exception ex) {
            error(ex);
            return error(-1, "系统错误,请联系管理员!");

+ 10 - 10
patient-co/patient-co-wlyy/src/main/resources/logback.xml

@ -10,9 +10,9 @@
	</appender>
	<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>/tmp/logs/wlyy.log</file>
		<file>/Users/Mewtwo/ideaSpace/log/tmp/logs/wlyy.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>/tmp/logs/wlyy.%d{yyyy-MM-dd}.log</fileNamePattern>
			<fileNamePattern>/Users/Mewtwo/ideaSpace/log/tmp/logs/wlyy.%d{yyyy-MM-dd}.log</fileNamePattern>
		</rollingPolicy>
		<encoder>
			<pattern>%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
@ -21,9 +21,9 @@
	</appender>
	<appender name="business_m" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>/datadisk/wlyy_logs/business_m.log</file>
		<file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/business_m.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>/datadisk/wlyy_logs/rolling/business_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
			<fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/rolling/business_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
		</rollingPolicy>
		<encoder>
			<pattern>%msg%n</pattern>
@ -31,9 +31,9 @@
		</encoder>
	</appender>
	<appender name="business_d" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>/datadisk/wlyy_logs/business.log</file>
		<file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/business.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>/datadisk/wlyy_logs/dayLogs/business.%d{yyyy-MM-dd}.log</fileNamePattern>
			<fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/dayLogs/business.%d{yyyy-MM-dd}.log</fileNamePattern>
		</rollingPolicy>
		<encoder>
			<pattern>%msg%n</pattern>
@ -41,9 +41,9 @@
		</encoder>
	</appender>
	<appender name="interface_call_m" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>/datadisk/wlyy_logs/interface_call_m.log</file>
		<file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/interface_call_m.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>/datadisk/wlyy_logs/rolling/interface_call_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
			<fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/rolling/interface_call_m.%d{yyyy-MM-dd_HH-mm}.log</fileNamePattern>
		</rollingPolicy>
		<encoder>
			<pattern>%msg%n</pattern>
@ -51,9 +51,9 @@
		</encoder>
	</appender>
	<appender name="interface_call_d" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>/datadisk/wlyy_logs/interface_call.log</file>
		<file>/Users/Mewtwo/ideaSpace/log/wlyy_logs/interface_call.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>/datadisk/wlyy_logs/dayLogs/interface_call.%d{yyyy-MM-dd}.log</fileNamePattern>
			<fileNamePattern>/Users/Mewtwo/ideaSpace/log/wlyy_logs/dayLogs/interface_call.%d{yyyy-MM-dd}.log</fileNamePattern>
		</rollingPolicy>
		<encoder>
			<pattern>%msg%n</pattern>