package com.yihu.wlyy.job;

import com.yihu.wlyy.service.app.followup.FollowUpService;
import com.yihu.wlyy.util.DateUtil;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

import java.util.Date;


/**
 * Created by hzp on 2017.1.4.
 */
public class FollowupPlanJob implements Job {
    @Autowired
    FollowUpService followUpService;


    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
        System.out.print("follow plan message sending...");
        String date = DateUtil.dateToStrShort(new Date());
        //发送随访计划消息
        followUpService.sendMessage(date);
    }
}
