package com.mosty.qwzx.task;

import com.mosty.common.base.util.DateUtils;
import com.mosty.qwzx.service.TbQwBmjlbbService;
import com.mosty.qwzx.service.TbQwXfbbService;
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
 * 每30秒计算一次巡逻时长
 **/
@Slf4j
@Component
@AllArgsConstructor
public class TbQwXfbbScTask {

    private final TbQwXfbbService tbQwXfbbService;

    @Scheduled(cron = "0/30 * * * * ?")
    @Transactional
    public void run() {
        this.tbQwXfbbService.checkXfbbSc();
    }


    //三分钟执行一次
//    @Scheduled(cron = "0 0/3 * * * ?")
    @Transactional
    public void xfbbxlzt() {
        this.tbQwXfbbService.updateXfzt();
    }
}
