package com.yeejoin.amos.supervision.schedule;

import com.yeejoin.amos.supervision.business.service.intfc.ILatentDangerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 隐患定时任务
 */
@Configuration("latentDanerScheduled")
@EnableScheduling
public class LatentDanerScheduled {

    @Autowired
    private ILatentDangerService iLatentDangerService;

    /**
     * 每1分钟执行一次：查询逾期的隐患，修改状态
     */

//    @Scheduled(cron = "0 0/1 * * * ?")
    public void updateDangerStateOfOvertime() {
        iLatentDangerService.updateDangerStateOfOvertime();
    }
}