소스 검색

居民随访信息同步JOB

huangwenjie 7 년 전
부모
커밋
c4ee7df846

+ 9 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java

@ -169,6 +169,15 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            } else {
                logger.info("old_people_tijian_syb_job  job exist");
            }
    
            //居民随访信息同步,每天陵城3点执行一次
            if (!quartzHelper.isExistJob("patient_followup_syb_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("patient_followup_syb_job");
                quartzHelper.addJob(FollowUpSynJob.class, trigger, "patient_followup_syb_job", new HashMap<String, Object>());
                logger.info("patient_followup_syb_job  job success");
            } else {
                logger.info("patient_followup_syb_job  job exist");
            }
            // 启动redis 消息队列线程
            logger.info("redis message start");

+ 34 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java

@ -606,4 +606,38 @@ public class JobController extends BaseController {
            return error(-1, e.getMessage());
        }
    }
    
    /**
     *根据时间范围同步居民随访记录
     *@author huangwenjie
     *@date 2017/10/23 08:45
     */
    @RequestMapping(value = "/executeFollowUpSynByTime", method = RequestMethod.POST)
    @ApiOperation("根据时间范围同步居民随访记录")
    public String executeFollowUpSynByTime(
            @ApiParam(name="startdate", value="开始时间:yyyy-mm-dd")
            @RequestParam(value = "startdate",required = true) String startdate,
            @ApiParam(name="enddate", value="结束时间:yyyy-mm-dd")
            @RequestParam(value = "enddate",required = true) String enddate) {
        try {
            
            String start = "";
            String end = "";
            
            do{
                start = startdate + " 00:00:00";
                end = startdate + " 23:59:59";
                //根据时间范围同步居民随访记录
                jwPrescriptionService.getFollowUpByTime(start,end);
                
                startdate = DateUtil.getNextDay(startdate,1);
                
            }while (!startdate.equals(enddate));
            
            return write(200, "执行成功");
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
}

+ 3 - 0
patient-co/patient-co-wlyy-job/src/main/resources/system.properties

@ -113,6 +113,9 @@ onepay_query_job=0 0/3 * * * ?
# 老年人体检记录同步,每天凌晨1点执行一次
old_people_tijian_syb_job=0 0 1 * * ?
# 老年人体检记录同步,每天凌晨1点执行一次
patient_followup_syb_job=0 0 3 * * ?
#统一支付平台支付成功后页面跳转地址
return_url={server}/wx/html/qygl/html/pay_result.html
#统一支付平台支付接口地址