package com.yeejoin.amos.boot.module.cylinder.flc.biz.quartz;

import com.yeejoin.amos.boot.module.cylinder.flc.biz.service.impl.ScheduleService;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author DELL
 */
@Component
@EnableScheduling
public class CylinderSchedulerJob {

    @Autowired
    private ScheduleService scheduleService;

    /**
     * 每天9点-日报生成
     */
    @Scheduled(cron = "${cylinder-early-warning-cron:0 0 9 * * ?}")
    @SchedulerLock(name="calEarlyWarningLevelTask",lockAtMostFor = "PT6H")
    public void dayReport() {
        scheduleService.calEarlyWarningLevel();
    }
}
