package com.mosty.base.manager.task;

import com.mosty.base.manager.service.TpjcglZnzbService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * @author dw
 * @since 2022/8/6
 * 规则：
 * 1. 每天查看到期时间  到两个月的时候改为临期，并且发消息提醒
 * 2. 每天扫描到故障装备，直接发消息提醒
 * 3. 两种情况都只发送一次就行了
 **/
@Slf4j
@Component
@AllArgsConstructor
public class TbJcglZnzbTxTask {

    private TpjcglZnzbService tpjcglZnzbService;

    @Scheduled(cron = "0 0 0 * * ?")
    @Transactional
    public void run() {
        this.tpjcglZnzbService.checkZnzb();
    }
}
