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

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

    @Autowired
    private ILatentDangerService iLatentDangerService;

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

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