ソースを参照

随访消息job参数改为配置的

yeshijie 8 年 前
コミット
4fe79dc11d

+ 0 - 2
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/message/FollowupPlanJob.java

@ -29,8 +29,6 @@ public class FollowupPlanJob implements Job {
    @Autowired
    private MessageDao messageDao;
    public static String cron="0 5 0 * * ?";
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);

+ 6 - 2
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/service/JobService.java

@ -22,6 +22,7 @@ import com.yihu.wlyy.statistics.vo.WlyyQuotaVO;
import org.quartz.SchedulerException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -478,10 +479,13 @@ public class JobService {
    }
    /******************************* 随访计划任务 *******************************************************/
    private String followupJob = "FOLLOWUP_PLAN_JOB";
    @Value("${spring.followupMessage.jobId}")
    private String followupJob;
    @Value("${spring.followupMessage.cron}")
    private String followupJobCron;
    public void startFollowupPlantJob() throws Exception {
        if (!quartzHelper.isExistJob(followupJob)) {
            quartzHelper.addJob(FollowupPlanJob.class, FollowupPlanJob.cron, followupJob, new HashMap<>());
            quartzHelper.addJob(FollowupPlanJob.class, followupJobCron, followupJob, new HashMap<>());
        } else {
            throw new Exception("已经启动");
        }

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

@ -132,6 +132,11 @@ spring:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
  followupMessage:
    cron : 0 5 0 * * ?
    jobId : FOLLOWUP_PLAN_JOB
fv:
  jdbc:
    driver: com.mysql.jdbc.Driver
@ -161,6 +166,10 @@ spring:
    host: 120.41.253.95 # Redis server host.
    port: 6380 # Redis server port.
  followupMessage:
    cron : 0 5 0 * * ?
    jobId : FOLLOWUP_PLAN_JOB
fv:
  jdbc:
    driver: com.mysql.jdbc.Driver
@ -191,6 +200,10 @@ spring:
    host: 172.19.103.47 # Redis server host.
    port: 6379 # Redis server port.
  followupMessage:
    cron : 0 5 0 * * ?
    jobId : FOLLOWUP_PLAN_JOB
fv:
  jdbc:
    driver: com.mysql.jdbc.Driver