package com.mosty.qwzx.task;

import com.mosty.qwzx.service.TbQwXfpbService;
import com.mosty.qwzx.service.TbQwZbpbService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author dw
 * @since 2022/8/26
 * 每半小时提醒人员进行巡防报备\值班报备
 * （定时巡防排班的数据，获取到需要巡防报备的人)
 **/
@Slf4j
@Component
@AllArgsConstructor
public class TbQwZbbbAndXfbbTask {

    private final TbQwXfpbService tbQwXfpbService;
    private final TbQwZbpbService tbQwZbpbService;

    @Scheduled(cron = "0 */30 * * * ?")
    public void run() {
        // 巡防排班
        this.tbQwXfpbService.checkThisTimeXfpb();
        // 值班排班
        this.tbQwZbpbService.checkThisTimeZbpb();
    }
}
