package com.chinacreator.process.job;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.log4j.Logger;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.PersistJobDataAfterExecution;
import org.springframework.beans.factory.annotation.Autowired;

@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class OrderFhProSmsMonthJob {

	private static Logger logger = Logger.getLogger(OrderFhProSmsMonthJob.class);
	
    @Autowired
    private OrderSmsMonthJob orderSmsMonthJob;

    public void doProcess() throws Exception {

    	Date now = new Date();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String dateStr = format.format(now);
        logger.info("dateStr : " + dateStr);
        //如果是月初就执行任务
        if (orderSmsMonthJob.isFitstOfMonth(dateStr)) {
            //0 : 复合产品， 1： 非复合产品
        	orderSmsMonthJob.doSend("0");
        }
    	
    }
}
