package org.linlinjava.jz.hm.job;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.linlinjava.jz.service.HmButlerTaskParentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 管家拜访任务，月度   （7天的在首次创建就生成）
 * @author 36952
 *
 */
@Component
public class HmBulterTaskJob {

    private final Log logger = LogFactory.getLog(HmBulterTaskJob.class);
    
    @Autowired
    HmButlerTaskParentService hmButlerTaskParentService;
 
    @Scheduled(cron = "0 0 7 * * ?")
//    @Scheduled(cron = "0 */1 * * * ?")
    public void createTask() {
    	logger.info("拜访任务，月度任务-------------------------定时生成");
    	
    	//月度任务，查hm_butler_task_parent  expiration_time<小于当前时间-30天 的任务
    	//关联contract_sub.sub_order_no，状态contract_state为0生效中，contract_end_date>大于当前时间（合同没到期）
    	hmButlerTaskParentService.timeProcessMonthTask();
    }
}
