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/10
 * 每年第一天对排班日期为永久的排班信息添加每日警力
 **/
@Slf4j
@Component
@AllArgsConstructor
public class TbQwZbPbMrjlTask {

    private final TbQwXfpbService tbQwXfpbService;
    private final TbQwZbpbService tbQwZbpbService;

    @Scheduled(cron = "0 0 0 1 1 ?")
    public void run() {
        // 排班添加每日警力
        this.tbQwXfpbService.addMrjl();
        // 值班添加每日警力
        this.tbQwZbpbService.addMrjl();
    }
}
