Browse Source

统计项目抽取

esb 8 năm trước cách đây
mục cha
commit
e0accdafc3

+ 10 - 15
patient-co-statistics/pom.xml

@ -310,11 +310,11 @@
                <artifactId>spring-boot-actuator-docs</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-devtools</artifactId>-->
                <!--<version>${version.spring-boot}</version>-->
            <!--</dependency>-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
@ -340,11 +340,11 @@
                <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-security</artifactId>-->
                <!--<version>${version.spring-boot}</version>-->
            <!--</dependency>-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-thymeleaf</artifactId>
@ -365,11 +365,6 @@
                <artifactId>spring-boot-starter-tomcat</artifactId>
                <version>${version.spring-boot}</version>
            </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-spring-web</artifactId>
            <version>2.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>

+ 1 - 3
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/config/SchedulerConfig.java

@ -5,9 +5,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
/**
 * @author Sand
 * @version 1.0
 * @created 2016.03.31 10:30
 * Created by chenweida on 2016/2/3.
 */
@Configuration
public class SchedulerConfig {

+ 14 - 51
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/config/SwaggerConfig.java

@ -7,6 +7,7 @@ import org.springframework.web.context.request.async.DeferredResult;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
@ -20,22 +21,13 @@ import static springfox.documentation.builders.PathSelectors.regex;
 */
@Configuration
@EnableSwagger2
@EnableWebMvc
@ComponentScan("com.yihu.stdutil.controller")
public class SwaggerConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("swagger-ui.html")
                .addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
    }
    private static final String PUBLIC_API = "Default";
    @Bean
    public Docket generalApi() {
    public Docket publicAPI() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("General")
                .groupName(PUBLIC_API)
                .genericModelSubstitutes(DeferredResult.class)
                .useDefaultResponseMessages(false)
                .forCodeGeneration(true)
@ -43,48 +35,19 @@ public class SwaggerConfig extends WebMvcConfigurerAdapter {
                .select()
                .paths(or(
                        regex("/job/.*")
                ))//识别的路径之后
                .build()
                .apiInfo(generalApiInfo());
    }
    /*
    @Bean
    public Docket adminApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("Admin")
                .genericModelSubstitutes(DeferredResult.class)
                .useDefaultResponseMessages(false)
                .forCodeGeneration(false)
                .pathMapping("/")
                .select()
                .paths(or(
                        regex("/*.*")))
                ))
                .build()
                .apiInfo(adminApiInfo());
    }*/
    private ApiInfo generalApiInfo() {
        ApiInfo apiInfo = new ApiInfo("统计分析 util(EHR) API",//大标题
                "stdutil REST API, all the applications could access the Object model data via JSON.",//小标题
                "0.1",//版本
                "NO terms of service",
                "chenweida@jkzl.com",//作者
                "The Apache License, Version 2.0",//链接显示文字
                "http://www.apache.org/licenses/LICENSE-2.0.html"//网站链接
        );
        return apiInfo;
                .apiInfo(publicApiInfo());
    }
    private ApiInfo adminApiInfo() {
        ApiInfo apiInfo = new ApiInfo("统计分析 util(EHR) API",//大标题
                "stdutil REST API, for system administrator",//小标题
                "1.0",//版本
                "NO terms of service",
                "chenweida@jkzl.com",//作者
                "The Apache License, Version 2.0",//链接显示文字
                "http://www.apache.org/licenses/LICENSE-2.0.html"//网站链接
    private ApiInfo publicApiInfo() {
        ApiInfo apiInfo = new ApiInfo("三师平台统计分析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;

+ 20 - 9
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/controller/JobController.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.statistics.controller;
import com.yihu.wlyy.statistics.job.business.QuartzHelper;
import com.yihu.wlyy.statistics.service.JobService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
@ -21,8 +22,6 @@ import org.springframework.web.bind.annotation.RestController;
public class JobController extends BaseController {
    @Autowired
    private  JobService jobService;
    @Autowired
    private QuartzHelper quartzHelper;
@ -32,6 +31,7 @@ public class JobController extends BaseController {
     * @param id id
     * @return
     */
    @ApiOperation(value = "根据ID立即单个任务")
    @RequestMapping(value = "startNowById", method = RequestMethod.GET)
    public String startNowById(String id) {
        try {
@ -49,6 +49,7 @@ public class JobController extends BaseController {
     * @param day
     * @return
     */
    @ApiOperation(value = "生成过去几天的数据")
    @RequestMapping(value = "productDataByDay", method = RequestMethod.GET)
    public String productDataByDay(Integer day) {
        try {
@ -66,6 +67,7 @@ public class JobController extends BaseController {
     * @param day
     * @return
     */
    @ApiOperation(value = "生成过去某一天的全部的数据")
    @RequestMapping(value = "productDataByOneDay", method = RequestMethod.GET)
    public String productDataByOneDay(String day) {
        try {
@ -83,6 +85,7 @@ public class JobController extends BaseController {
     * @param day
     * @return
     */
    @ApiOperation(value = "生成过去某一天的全部的数据")
    @RequestMapping(value = "productDataByOneDayWithId", method = RequestMethod.GET)
    public String productDataByOneDayWithId(String day, String id) {
        try {
@ -99,6 +102,7 @@ public class JobController extends BaseController {
     * @param day
     * @return
     */
    @ApiOperation(value = "生成过去某一天的全部的数据")
    @RequestMapping(value = "productDataByDayAndId", method = RequestMethod.GET)
    public String productDataByDayAndId(Integer day, String id) {
        try {
@ -109,12 +113,14 @@ public class JobController extends BaseController {
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
        }
    }
            /**
             * 启动任务
             *
             * @param id id
             * @return
             */
    /**
     * 启动任务
     *
     * @param id id
     * @return
    */
    @ApiOperation(value = "启动单个任务")
    @RequestMapping(value = "startById", method = RequestMethod.GET)
    public String startById(String id) {
        try {
@ -133,6 +139,7 @@ public class JobController extends BaseController {
     * @param id id
     * @return
     */
    @ApiOperation(value = "停止单个任务")
    @RequestMapping(value = "stopById", method = RequestMethod.GET)
    public String stopById(String id) {
        try {
@ -149,6 +156,7 @@ public class JobController extends BaseController {
     *
     * @return
     */
    @ApiOperation(value = "停止所有任务")
    @RequestMapping(value = "stopAll", method = RequestMethod.GET)
    public String stopAll() {
        try {
@ -164,6 +172,7 @@ public class JobController extends BaseController {
     *
     * @return
     */
    @ApiOperation(value = "启动檢查的任务")
    @RequestMapping(value = "startCheckSignJob", method = RequestMethod.GET)
    public String startCheckSignJob() {
        try {
@ -179,6 +188,7 @@ public class JobController extends BaseController {
     *
     * @return
     */
    @ApiOperation(value = "停止檢查的任务")
    @RequestMapping(value = "stopCheckSignJob", method = RequestMethod.GET)
    public String stopCheckSignJob() {
        try {
@ -194,6 +204,7 @@ public class JobController extends BaseController {
     *
     * @return
     */
    @ApiOperation(value = "启动所有任务")
    @RequestMapping(value = "startAll", method = RequestMethod.GET)
    public String startAll() {
        try {
@ -205,7 +216,7 @@ public class JobController extends BaseController {
        }
    }
    @RequestMapping(value = "startaaaa", method = RequestMethod.GET)
    //@RequestMapping(value = "startaaaa", method = RequestMethod.GET)
    public String startaaaa() {
        try {
            jobService.startaaaa();

+ 0 - 118
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/ConsultTeamDao.java

@ -26,44 +26,6 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	@Query("select count(1) from ConsultTeam a where a.patient = ?1 and a.status = 0 and a.del = '1'and a.type=?2")
	int countByPatient(String patient, Integer signType);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.del = '1' and b.del = '1' and a.type<3")
	Page<ConsultTeam> findDoctorList(String doctor, Pageable pageRequest);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.del = '1' and b.del = '1' and a.type<3")
	Page<ConsultTeam> findDoctorList(String doctor, long id, Pageable pageRequest);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.status = 0 and a.del = '1' and b.del = '1' and a.type<3 ")
	Page<ConsultTeam> findDoctorPointList(String doctor, Pageable pageRequest);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.status = 0 and a.del = '1' and b.del = '1' and a.type<3 ")
	Page<ConsultTeam> findDoctorPointList(String doctor, long id, Pageable pageRequest);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.status = 0 and a.del = '1' and b.del = '1' and (a.type = 1 or a.type = 2 or a.type = 6) ")
	Page<ConsultTeam> findDoctorAllList(String doctor, long id, Pageable pageRequest);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.status = 0 and a.del = '1' and b.del = '1' and (a.type = 1 or a.type = 2 or a.type = 6) ")
	Page<ConsultTeam> findDoctorAllList(String doctor, Pageable pageRequest);
	// 医生参与且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.status = 0 and b.reply = 1 and a.del = '1' and b.del = '1' and a.type<3")
	Page<ConsultTeam> findDoctorJoinList(String doctor, Pageable pageRequest);
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.status = 0 and b.reply = 1 and a.del = '1' and b.del = '1' and a.type<3 ")
	Page<ConsultTeam> findDoctorJoinList(String doctor, long id, Pageable pageRequest);
	// 医生参与并已结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.status = 1 and a.del = '1' and b.del = '1' and a.type<3")
	Page<ConsultTeam> findDoctorFinishList(String doctor, Pageable pageRequest);
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.status = 1 and a.del = '1' and b.del = '1' and a.type<3")
	Page<ConsultTeam> findDoctorFinishList(String doctor, long id, Pageable pageRequest);
	// 医生关闭三师咨询
	@Modifying
	@Query("update ConsultTeam a set a.status = 1 where a.consult = ?1")
@ -134,95 +96,15 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	@Query("update ConsultTeam a set a.commentContent = ?2, a.commentStar = ?3 where a.consult = ?4")
	int updateComment(String commentContent, double commentStar, String consult);
	// 查询医生所有未读的消息总数
	@Query("SELECT SUM(a.doctorRead) FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.del = '1' AND a.status = 0 AND a.type <> 6")
	int amountAllDoctorUnread(String doctor);
	// 查询医生所有未读的消息总数
	@Query("SELECT SUM(a.doctorRead) FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.del = '1' AND a.status = 0 AND a.type = 6")
	int amountAlFamouslDoctorUnread(String doctor);
	// 查询医生所有未读的消息总数
	@Query("SELECT a.name,b.czrq FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.del = '1' AND a.status = 0 AND a.type <> 6 order by b.czrq desc")
	Page<Object> AllDoctorUnreadLast(String doctor, Pageable pageRequest);
	// 查询医生所有未读的消息总数
	@Query("SELECT a.name,b.czrq FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.del = '1' AND a.status = 0 AND a.type = 6 order by b.czrq desc")
	Page<Object> AllDoctorFamousUnreadLast(String doctor, Pageable pageRequest);
	// 查询带未读数量的所有健康咨询列表
	@Query("SELECT a FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 AND a.status = 0 and a.type< 3")
	Page<ConsultTeam> findListByUnreadDoctor(String doctor, Pageable pageRequest);
	// 查询带未读数量的所有健康咨询列表
	@Query("SELECT a FROM ConsultTeam a, ConsultTeamDoctor b WHERE a.consult = b.consult AND b.to = ?1 and a.id < ?2 AND a.status = 0 and a.type<3")
	Page<ConsultTeam> findListByUnreadDoctor(String doctor, long id, Pageable pageRequest);
	//找出当日的咨询量
	@Query("SELECT a FROM ConsultTeam a WHERE a.type=2 and unix_timestamp(a.czrq)>=unix_timestamp(?1) and unix_timestamp(a.czrq)<unix_timestamp(?2) ")
	List<ConsultTeam> findByCzrqyYesterday(String yesterday, String now);
	//查找
	@Query("SELECT a FROM ConsultTeam a WHERE a.patient=?1 and a.status=0 and a.del=1 and a.type=6")
	ConsultTeam findFamousConsultByPatient(String uid);
	//名医咨询 -全部
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorAllList(String uid, long id, Pageable pageRequest);
	//名医咨询 -全部
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1  and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorAllList(String uid, Pageable pageRequest);
	//名医咨询 -全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorAllList(String uid, long id, String title, Pageable pageRequest);
	//名医咨询 -全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.symptoms like ?2  and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorAllList(String uid, String title, Pageable pageRequest);
	//名医咨询 -根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.status = ?3 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid, long id, Integer type, Pageable pageRequest);
	//名医咨询 -根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.status = ?2  and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid, Integer type, Pageable pageRequest);
	//名医咨询 -根据status 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.status = ?4 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid, long id, String title, Integer type, Pageable pageRequest);
	//名医咨询 -根据status 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.symptoms like ?2 and a.status = ?3 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid, String title, Integer type, Pageable pageRequest);
	@Query("select a from ConsultTeam a where  a.type=?3  and a.del = '1' and a.patient=?1 and a.doctor=?2 and  a.status=0 ")
	ConsultTeam findByParientCodeAndSignTypeAndDoctor(String patientCode, String doctor, int s);
	//名医咨询 -全部 带symptoms 未处理、未回复
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorUnReplyReadList(String uid, long id, String title, Pageable pageRequest);
	//名医咨询 -全部 带symptoms 处理、未回复
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.symptoms like ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorUnReplyReadList(String uid, String title, Pageable pageRequest);
	//名医咨询 -全部 处理、未回复
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorUnReplyReadNoTitleList(String uid, long id, Pageable pageRequest);
	//名医咨询 -全部
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorUnReplyReadNoTitleList(String uid, Pageable pageRequest);
	//名医咨询 -全部 带symptoms 进行中
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.status = 0 and b.reply = 1 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorIngList(String uid, long id, String title, Pageable pageRequest);
	//名医咨询 -全部 带symptoms 进行中
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.symptoms like ?2 and a.status = 0 and  b.reply = 1 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorIngList(String uid, String title, Pageable pageRequest);
	//名医咨询 -全部 进行中
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.status = 0 and  b.reply = 1 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorIngNoTitleList(String uid, long id, Pageable pageRequest);
	//名医咨询 -全部 进行中
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.status = 0 and b.reply = 1 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findFamousDoctorIngNoTitleList(String uid, Pageable pageRequest);
    // 更新超过24小时未回复的项目,多加一分钟,防止过于频繁更新
    @Modifying
    @Query("UPDATE ConsultTeam a set a.status = -2 where TIMESTAMPDIFF(SECOND, a.czrq, CURRENT_TIME) > 87840 and status = 0")

+ 0 - 11
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/DoctorAdminTeamDao.java

@ -38,17 +38,6 @@ public interface DoctorAdminTeamDao extends
    Integer getHealthDoctorSignCount(@Param(value = "healthDoctorCode") String healthDoctorCode,
                                     @Param(value = "teamId") long teamId);
    /**
     * 患者所签约团队。
     *
     * @param patientCode
     * @return
     */
    @Query("SELECT  t.id, t.name, d1.code, d1.name, d2.code, d2.name\n" +
            "FROM SignFamily f, Doctor d1, Doctor d2, AdminTeam t, AdminTeamMember m \n" +
            "WHERE d1.code = f.doctor AND f.doctorHealth = d2.code AND f.patient = :patientCode AND m.doctorCode = " +
            "d1.code AND m.teamId = t.id")
    Object getPatientSigningTeam(@Param("patientCode") String patientCode);
    @Query("SELECT t.id from AdminTeam t WHERE t.leaderCode = :leaderCode")
    Long findIdByLeaderCode(@Param("leaderCode") String leaderCode);

+ 0 - 13
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/DoctorDao.java

@ -74,13 +74,6 @@ public interface DoctorDao extends PagingAndSortingRepository<Doctor, Long>, Jpa
    @Query("from Doctor p where p.level = 1 and p.iscertified=1 and p.status=1 and p.code != ?1")
    Page<Doctor> findDoctor1ByParient(String code, Pageable pageRequest);
    @Query("select d from Doctor d, DoctorTeamMember dtm where d.code=dtm.memberCode and dtm.signType='1' and dtm.team=?1  and dtm.del='1'")
    List<Doctor> findSanshiDoctorByTeam(String code);
    @Query("select d from Doctor d, DoctorTeamMember dtm where d.code=dtm.memberCode and dtm.signType='2' and dtm.team=?1  and dtm.del='1'")
    List<Doctor> findJiatingDoctorByTeam(String code);
    // 手机号查询正常医生信息
    @Query("select p from Doctor p where p.mobile = ?1 and p.del=1")
    Doctor findNormalByMobile(String mobile);
@ -110,12 +103,6 @@ public interface DoctorDao extends PagingAndSortingRepository<Doctor, Long>, Jpa
    List<Doctor> findByIsFamous(Integer isFamous);
    @Query("select p from Doctor p ,DoctorFamousConsultTimesRemain w where p.code=w.doctor and p.isFamous=1 and w.consultDate = ?1 and p.name like ?2 and w.timesRemain > 0 order by w.timesRemain desc")
    Page<Doctor> famousDoctorList(String date, String name, Pageable pageRequest);
    @Query("select p from Doctor p ,DoctorFamousConsultTimesRemain w where p.code=w.doctor and p.isFamous=1 and w.consultDate = ?1  and w.timesRemain > 0  order by w.timesRemain desc")
    Page<Doctor> famousDoctorList(String date, Pageable pageRequest);
    @Query("select p from Doctor p where p.isFamous=1 and p.name like ?1 ")
    Page<Doctor> doctorFamousDoctorList(String name, Pageable pageRequest);

+ 0 - 2
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/PatientHealthGuidanceDao.java

@ -51,6 +51,4 @@ public interface PatientHealthGuidanceDao extends PagingAndSortingRepository<Pat
	@Query("SELECT a FROM PatientHealthGuidance a WHERE unix_timestamp(a.czrq)>=unix_timestamp(?1) and unix_timestamp(a.czrq)<unix_timestamp(?2) ")
	List<PatientHealthGuidance> findByCzrqyYesterday(String yesterday, String now);
	@Query("SELECT count(a) from PatientHealthGuidance a WHERE  a.patient=?2 and a.doctor=?1 ")
	Integer findbydoctorAndPatient(String doctor, String patientCode);
}

+ 4 - 259
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/SignFamilyDao.java

@ -16,205 +16,12 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Long>, JpaSpecificationExecutor<SignFamily> {
	@Query("select count(1) from SignFamily a where a.idcard = ?1 and a.type = 2 and a.status >= 0")
	int hasSingStatus(String idcard);
	@Query("select a from SignFamily a where a.idcard = ?1 and status = ?2 and a.type = 2")
	SignFamily findByPatientStatus(String idcard, int status);
	@Query("select a from SignFamily a where a.patient = ?1 and status = ?2 and a.type = 2")
	SignFamily findByPatientCodeStatus(String patient, int status);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type = ?2 and a.status >= 1")
	SignFamily findByPatientAndType(String patient, int type);
	SignFamily findByCode(String code);
	SignFamily findByCodeAndType(String code, Integer type);
	SignFamily findByFamilyCode(String familyCode);
	@Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.type = 2 and a.status >= 0")
	SignFamily findByDoctorPatient(String doctor, String patient);
	@Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.type = 1 and a.status > 0")
	SignFamily findSsSignByDoctorPatient(String doctor, String patient);
	@Query("select a from SignFamily a,DoctorTeamMember w where a.teamCode = w.team and w.del = '1' and w.memberCode = ?1 and a.patient = ?2 and a.status > 0")
	List<SignFamily> findByDoctorAndPatient(String doctor, String patient);
	@Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.status = 1 and a.type = 2")
	SignFamily findByFamilyDoctorAndPatient(String doctor, String patient);
	@Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.status = 1 and a.type = 1")
	SignFamily findBySanshiDoctorAndPatient(String doctor, String patient);
	@Query("select a from SignFamily a where a.doctor = ?1 and a.openid = ?2 and a.type = 2 and a.status >= 0")
	SignFamily findByDoctorOpenid(String doctor, String openid);
	@Query("select a from SignFamily a where a.doctor = ?1 and a.idcard = ?2 and a.type = 2 and a.status >= 0")
	SignFamily findByDoctorIdcard(String doctor, String idcard);
	@Query("select a from SignFamily a where a.idcard = ?1 and a.type = 2 and a.status >= 0")
	SignFamily findByIdcard(String idcard);
	@Query("select a from SignFamily a where a.idcard = ?1 and a.type =1 and a.status >= 0")
	SignFamily findSSByIdcard(String idcard);
	@Query("select a from SignFamily a where a.idcard = ?1 ")
	List<SignFamily> findAllByIdcard(String idcard);
	@Query("select a from SignFamily a where a.idcard = ?1 and a.status >= 0")
	List<SignFamily> findSSandJTByIdcard(String idcard);
	@Query("select a from SignFamily a where a.openid = ?1 and a.type = 2 and a.status >= 0")
	SignFamily findByOpenid(String openid);
	// 取消签约申请
	@Modifying
	@Query("update SignFamily a set a.status = -1 where a.patient = ?1 and a.doctor = ?2 and a.type = 2 and a.status = 0")
	void unsignByPatient(String patient, String doctor);
	// 取消签约申请
	@Modifying
	@Query("update SignFamily a set a.status = -1 where a.openid = ?1 and a.doctor = ?2 and a.type = 2 and a.status = 0")
	void unsignByOpenid(String openid, String doctor);
	// 查询医生的签约数量
	@Query("select count(1) from SignFamily a where a.doctor = ?1")
	int countByDoctor(String doctor);
	// 查询医生的签约数量
	@Query("select count(1) from SignFamily a")
	int countByDoctor();
	// 更新状态为待解约
	@Modifying
	@Query("update SignFamily a set a.status = 2 where a.patient = ?1 and a.doctor = ?2 and a.status = 1 and a.type = 2")
	int surrender(String patient, String doctor);
	// 更新待签约状态为拒绝或同意状态
	@Modifying
	@Query("update SignFamily a set a.status = ?1 where a.patient = ?2 and a.status = 0 and a.type = 2")
	int handleSign(int status, String patient);
	// 更新已签约状态为解约
	@Modifying
	@Query("update SignFamily a set a.status = -3, a.reason = ?1 where a.patient = ?2 and a.status = 2 and a.type = 2")
	int handleSurrender(String reason, String patient);
	// 拒绝解约
	@Modifying
	@Query("update SignFamily a set a.status = 1 where a.patient = ?1 and a.status = 2 and a.type = 2")
	int refuseSurrender(String patient);
	// 查询患者已生效的家庭签约
	@Query("select a from SignFamily a where a.patient = ?1 and a.type = 2 and a.status > 0")
	SignFamily findSignByPatient(String patient);
	@Modifying
	@Query("update SignFamily a set a.openid = ?1 where patient = ?2")
	int updateOpenidByPatient(String openid, String patient);
	// 查询已签约的总数
	@Query("select count(1) from SignFamily a where a.doctor = ?1 and (a.status = 1 or a.status = 2) and a.type = 2")
	int countAmountSignedByDoctor(String doctor);
	// 查询待签约总数
	@Query("select count(1) from SignFamily a where a.doctor = ?1 and a.status = 0 and a.type = 2")
	int countAmountUnsignByDoctor(String doctor);
	
	// 查询团队中的健康管理师 sf.doctorHealth,sf.doctorHealthName,
	//select sf.doctorHealth,sf.doctorHealthName,count(*) totalContract from SignFamily sf where sf.healthDoctor = ?1
	@Query("select sf.doctorHealth,sf.doctorHealthName,count(sf)  from SignFamily sf where sf.doctorHealth = ?1")
    List<Object> findTeamHealthDoctors(String healthDoctor);
	// 查询团队中的全科医生 sf.doctor,sf.doctorName,d.hosptialName,
	//select sf.doctor,sf.doctorName,d.hosptialName,count(*) totalContract from SignFamily sf left join Doctor d on sf.doctor = d.code where sf.doctor = ?1
	@Query("select sf.doctor,sf.doctorName,d.hosptialName,count(sf) from SignFamily sf, Doctor d  where ( sf.doctor is null or sf.doctor = d.code) and sf.doctor = ?1")
    List<Object> findTeamQkDoctors(String doctor);
	// 待签约 待解决 已签约
	@Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b,DoctorTeam t,DoctorTeamMember td where a.patient=b.code and a.teamCode=t.code and t.code=td.team and td.memberCode=?1 and td.type=?2 and a.status=?3 order by a.begin desc")
	Page<Object> findToBeSignSignWebByDoctor(String doctor, int doctorType, int status, Pageable pageRequest);
	/**
	 * 查询全科医生签约患者
	 *
	 * @param doctor
	 * @param status
	 * @param pageRequest
	 * @return
	 */
	@Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctor = ?1 and a.status=?2 order by a.begin desc")
	Page<Object> findSignedPatientByQkDoctor(String doctor, int status, Pageable pageRequest);
	/**
	 * 查询健康管理师签约患者
	 *
	 * @param doctor
	 * @param status
	 * @param pageRequest
	 * @return
	 */
	@Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctorHealth = ?1 and a.status=?2 order by a.begin desc")
	Page<Object> findSignedPatientByJkDoctor(String doctor, int status, Pageable pageRequest);
	/**
	 * 查询全科医生已解约患者
	 *
	 * @param doctor
	 * @param pageRequest
	 * @return
	 */
	@Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctor = ?1 and (a.status=-3 or a.status=-4) order by a.begin desc")
	Page<Object> findUnSignedPatientByQkDoctor(String doctor, Pageable pageRequest);
	/**
	 * 查询健康管理师已解约患者
	 *
	 * @param doctor
	 * @param pageRequest
	 * @return
	 */
	@Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctorHealth = ?1 and (a.status=-3 or a.status=-4) order by a.begin desc")
	Page<Object> findUnSignedPatientByJkDoctor(String doctor, Pageable pageRequest);
	//已经解约
	@Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b,DoctorTeam t,DoctorTeamMember td where a.patient=b.code and a.teamCode=t.code and t.code=td.team and td.memberCode=?1 and td.type=?2 and(a.status=-3 or a.status=-4 ) order by a.begin desc")
	Page<Object> findToBeSignSignWebByDoctor_34(String doctor, int doctorType, Pageable pageRequest);
	@Query("select a from SignFamily a where a.mobile = ?1 and a.type = 2 and a.status >= 0")
	SignFamily findByMobile(String mobile);
	@Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctor=?1 and a.status=?2 order by a.begin desc")
	Page<Object> findToBeSignSignWebByDoctor_0(String doctor, int i, Pageable pageRequest);
	@Query("select count(1) from SignFamily a where a.doctorHealth = ?1 and (a.status = 1 or a.status = 2) and a.type = 2")
	int countAmountSignedByHeather(String uid);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type =1 and a.status >= 1")
	SignFamily findBySanshiPatient(String code);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type =1 and a.status >= 0")
	SignFamily findBySsPatient(String code);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status >= 1")
	SignFamily findByjiatingPatient(String code);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status = 1")
	SignFamily findByjiatingPatientYes(String code);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type =1 and a.status = 1")
	SignFamily findBySanshiPatientYes(String id);
	@Query("select a from SignFamily a where a.idcard = ?1 and a.type = 1 and a.status in (0,1,2,3)")
	SignFamily findByPatientSanshiSignInfo(String idCard);
	@Query("select a from SignFamily a where a.idcard = ?1 and a.type = 2 and a.status in (0,1,2,3)")
	SignFamily findByPatientFamilySignInfo(String idCard);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status >=0")
	SignFamily findByjiatingPatientStatus0(String patient);
	@Query(" from SignFamily a where  a.type =1 and unix_timestamp(a.czrq)=unix_timestamp( ?1 )  ")
	List<SignFamily> findByDate(String s);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type = ?2 and a.status >= 1")
	SignFamily findByPatientAndType(String patient,int type);
	//查找昨天的家庭签约数据
	@Query(" from SignFamily a where  a.type =2 and a.status = 1  and unix_timestamp(a.applyDate)>=unix_timestamp(?1) and unix_timestamp(a.applyDate)<unix_timestamp(?2) and a.expensesStatus=1 ")
	List<SignFamily> findByJiatingSignYesterdayExpensesStatus(String yesterday, String today);
@ -233,67 +40,5 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
	//查找昨天的家庭待改签
	@Query(" from SignFamily a where  a.type =2 and a.status =100  and unix_timestamp(a.patientApplyDate)>=unix_timestamp(?1) and unix_timestamp(a.patientApplyDate)<unix_timestamp(?2) and a.expensesStatus=1 ")
	List<SignFamily> findByJiatingChaangeSignYesterdayExpensesStatus(String yesterday, String now);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type = 1 and a.status in (0,1,2)")
	SignFamily findSanshiSignByPatient(String patientCode);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type = 2 and a.status in (0,1,2)")
	SignFamily findFamilySignByPatient(String patientCode);
	@Query("select p.code, p.name, p.photo, p.birthday, p.sex, p.diseaseCondition, p.disease, p.recordAmount,a.type,a.applyDate,p.idcard from SignFamily a,Patient p where (a.doctor = ?1 or a.doctorHealth = ?1) and a.patient = p.code and a.status in (1,2,3)")
	List<Object> findDoctorSignPatients(String doctor);
	@Query("select p.code, p.name, p.photo, p.birthday, p.sex, p.diseaseCondition, p.disease, p.recordAmount,a.type,a.applyDate,p.idcard  from SignFamily a,Patient p where (a.doctor = ?1 or a.doctorHealth = ?1) and p.name like ?2 and a.patient = p.code and a.status in (1,2,3)")
	List<Object> findDoctorSignPatientsLikeName(String doctor, String name);
	@Query("select p.code, p.name, p.photo, p.birthday, p.sex, p.diseaseCondition, p.disease, p.recordAmount,a.type,a.applyDate,p.idcard  from SignFamily a,Patient p where (a.doctor = ?1 or a.doctorHealth = ?1) and a.type = ?2 and a.patient = p.code and a.status in (1,2,3)")
	List<Object> findDoctorSignPatientsBySignType(String doctor, int type);
	@Query("select p.code, p.name, p.photo, p.birthday, p.sex, p.diseaseCondition, p.disease, p.recordAmount,a.type,a.applyDate,p.idcard  from SignFamily a,Patient p where (a.doctor = ?1 or a.doctorHealth = ?1) and a.type = ?2 and p.name like ?3 and a.patient = p.code and a.status in (1,2,3)")
	List<Object> findDoctorSignPatientsByTypeName(String doctor, int type, String name);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status >= 0")
	SignFamily findByPatient(String patient);
	@Query("select a from SignFamily a where a.idcard = ?1 and a.type = 1 and a.status >= 0")
	SignFamily findBySanshiIdcard(String idcard);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type = ?2 and a.status > 0")
	SignFamily findSignByPatient(String patient, int type);
	@Query(" from SignFamily a where a.patient = ?1 and a.type = ?2 and (a.status=-3 or a.status=-4)  order by a.id desc")
	List<SignFamily> findLastJySignByPatient(String patient, int type);
	@Query(" from SignFamily a where  a.type =1 and unix_timestamp(a.czrq)=unix_timestamp( ?1 )  ")
	List<SignFamily> findByDate(String s);
	@Modifying
	@Query("update SignFamily set expenses_type = ?1 where patient = ?2 and status > 0 and type = 2")
	int updateExpensesType(String expensesType, String patient);
	@Query("select count(*) from SignFamily where patient = ?1 and status > 0 and type = 1")
	int countPatientSsSign(String patient);
	@Query("select count(*) from SignFamily where patient = ?1 and status > 0 and type = 2")
	int countPatientJtSign(String patient);
	// 查询患者已生效的家庭签约
	@Query("select a from SignFamily a where a.patient = ?1 and a.type = 2 and a.status = 0")
	SignFamily findSigningByPatient(String patient);
	//找出家庭签约中 团队是空的值
	@Query("select a from SignFamily a where a.type = 2 and a.status = 1 and a.adminTeamId is null")
	List<SignFamily> findBySignTypeAndTeamCode();
	//找出没有健康管理师的签约数据
	@Query("select a from SignFamily a where a.type = 2 and a.status >= 1 and a.doctorHealth is null and a.doctor=?1 order by a.czrq desc")
	List<SignFamily> findNoHealthSignFamilyNum(String doctor);
	//找出没有健康管理师的签约数据
	@Query("select a from SignFamily a where a.type = 2 and a.status >= 1 and a.doctorHealth is null and a.doctor=?1 order by a.czrq desc")
	Page<SignFamily> findNoHealthSignFamilyHealth(String doctor, Pageable pageRequest);
	@Query("select a from SignFamily a where a.type = ?1 and a.signSource = ?2 and a.status > 0 order by a.id")
	Page<SignFamily> findByTypeAndSignSource(Integer type, String signSource, Pageable pageable);
	@Query("select a from SignFamily a where a.type = ?1 and a.signSource = ?2 and a.status > 0 and a.id >= ?3 and a.id <= ?4 order by a.id")
	Page<SignFamily> findByTypeAndSignSourceAndId(Integer type, String signSource, Long start, Long end, Pageable pageable);
}

+ 15 - 27
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java

@ -21,6 +21,7 @@ import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
@ -75,7 +76,6 @@ public class CurrentDayAllQuotaJob implements Job {
    private JdbcTemplate jdbcTemplate = new JdbcTemplate();
    private Properties systemProperties;
    List<Town> towns = null;//厦门市全部的区
    List<Hospital> hospitals = null;//系统全部的机构
    List<AdminTeam> adminTeams=null;//系统全部的团队
@ -86,16 +86,24 @@ public class CurrentDayAllQuotaJob implements Job {
    private String now = getDayString(0);
    private String tomorrow = getDayString(1);
    private StringBuffer allContent=new StringBuffer();//日志内容
    @Value("fv.jdbc.driver")
    String fv_jdbc_driver;
    @Value("fv.jdbc.url")
    String fv_jdbc_url;
    @Value("fv.jdbc.username")
    String fv_jdbc_username;
    @Value("fv.jdbc.password")
    String fv_jdbc_password;
    @Override
    public void execute(JobExecutionContext context)
            throws JobExecutionException {
        try {
            SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
            getSystemProperties();
            fvdataSource.setDriverClassName(systemProperties.get("fv.jdbc.driver").toString());
            fvdataSource.setUrl(systemProperties.get("fv.jdbc.url").toString());
            fvdataSource.setUsername(systemProperties.get("fv.jdbc.username").toString());
            fvdataSource.setPassword(systemProperties.get("fv.jdbc.password").toString());
            fvdataSource.setDriverClassName(fv_jdbc_driver);
            fvdataSource.setUrl(fv_jdbc_url);
            fvdataSource.setUsername(fv_jdbc_username);
            fvdataSource.setPassword(fv_jdbc_password);
            jdbcTemplate.setDataSource(fvdataSource);//初始化随访的数据源
            towns = townDao.findByCityCode(Constant.city); //查找出厦门市全部的区
@ -1764,27 +1772,7 @@ public class CurrentDayAllQuotaJob implements Job {
        allContent.append("-----------10----------");
    }
    public Properties getSystemProperties() {
        if (systemProperties == null) {
            InputStream is = null;
            try {
                is = this.getClass().getResourceAsStream("/application.properties");
                systemProperties = new Properties();
                systemProperties.load(is);
            } catch (IOException e1) {
                e1.printStackTrace();
            } finally {
                if (is != null) {
                    try {
                        is.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
        return systemProperties;
    }
    public static String getDayString(Integer size) {
        Date date = new Date();//取时间

+ 11 - 24
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/FollowUpJob.java

@ -17,6 +17,7 @@ import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -58,24 +59,30 @@ public class FollowUpJob implements Job {
    private JdbcTemplate jdbcTemplate = new JdbcTemplate();
    private Properties systemProperties;
    String yesterday;
    String now;
    @Value("fv.jdbc.driver")
    String fv_jdbc_driver;
    @Value("fv.jdbc.url")
    String fv_jdbc_url;
    @Value("fv.jdbc.username")
    String fv_jdbc_username;
    @Value("fv.jdbc.password")
    String fv_jdbc_password;
    @Override
    public void execute(JobExecutionContext context)
            throws JobExecutionException {
        SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
        getSystemProperties();
        //初始化参数
        JobDataMap map = context.getJobDetail().getJobDataMap();
        wlyyQuota = (WlyyQuotaVO) map.get("quota");
        wlyyJobConfig = (WlyyJobConfigVO) map.get("jobConfig");
        fvdataSource.setDriverClassName(fv_jdbc_driver);
        fvdataSource.setUrl(fv_jdbc_url);
        fvdataSource.setUsername(fv_jdbc_username);
        fvdataSource.setPassword(fv_jdbc_password);
        //计算指标
        jdbcTemplate.setDataSource(fvdataSource);//初始化随访的数据源
        //線刪除今天的数据
@ -266,27 +273,7 @@ public class FollowUpJob implements Job {
        }
        wlyyQuotaResultDao.save(wlyyQuotaResult);
    }
    public Properties getSystemProperties() {
        if (systemProperties == null) {
            InputStream is = null;
            try {
                is = this.getClass().getResourceAsStream("/application.properties");
                systemProperties = new Properties();
                systemProperties.load(is);
            } catch (IOException e1) {
                e1.printStackTrace();
            } finally {
                if (is != null) {
                    try {
                        is.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
        return systemProperties;
    }
    private String getOrg(String org){
        if(!"00".equals(org.substring(org.length()-2,org.length()))){
            return org.substring(0,org.length()-2)+"00";

+ 0 - 1
patient-co-statistics/src/main/resources/application.yml

@ -29,7 +29,6 @@ spring:
      max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
multipart:
  max-file-size: 100MB
  max-request-size: 100MB