package cn.com.ctop.job.kuaishou.handler;

import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouDailyAgentService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.jeecg.common.util.DateUtils;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class KuaiShouYesterdayAgentReportJob {
    @Autowired
    private IKuaiShouDailyAgentService kuaiShouDailyAgentService;

    /**
     * 代理商t-1数据获取
     *
     * @throws JobExecutionException
     */
    @XxlJob("kuaiShouYesterdayAgentReportJob")
    public void execute() throws Exception {
        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
        String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
        String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
        kuaiShouDailyAgentService.getAgentReportByPage(startDate, endDate);
    }
}

