package com.mosty.base.manager.task;

import com.mosty.base.manager.service.TbJcglDsfService;
import com.mosty.base.manager.service.TpjcglZnzbService;
import com.mosty.base.model.entity.jcgl.TbJcglDsf;
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;

/**
 * @author dw
 * @since 2022/8/6
 * 规则：
 * 1.每天查询过期时间，赋值状态为过期
 **/
@Slf4j
@Component
@AllArgsConstructor
public class TbJcglDsfTask {

    private final TbJcglDsfService tbJcglDsfService;

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