package org.jeecg.modules.ctop.job;


import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.system.service.IPerformanceService2;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

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

public class EffiVideoJob implements Job {
    @Autowired
    private IPerformanceService2 performanceService;

    /**
     * 获取有效视频以及对应人的定时任务
     *
     * @param jobExecutionContext
     * @throws JobExecutionException
     */
    @Override
    public void execute(JobExecutionContext jobExecutionContext) {
        //有效视频定时任务，默认跑前一天的
        DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        performanceService.efficientVideoTask(sdf.format(DateUtils.addDay(new Date(), -1)));
    }
}
