package com.yida.data.job.task;


import com.yida.data.attendance.feign.RemoteAttendanceDeviceService;
import com.yida.data.attendance.feign.RemoteAttendanceResultService;
import com.yida.data.attendance.feign.RemoteUserStrategyService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 考勤相关定时任务
 */
@Component
@Slf4j
@RequiredArgsConstructor
public class AttendanceTask {

    private final RemoteUserStrategyService remoteUserStrategyService;
    private final RemoteAttendanceResultService remoteAttendanceResultService;
    private final RemoteAttendanceDeviceService remoteAttendanceDeviceService;

    /**
     * 更新设备在线状态
     */
    public void updateDeviceStatus() {
        remoteAttendanceDeviceService.updateDeviceStatus();
    }


    /**
     * 校时所有设备
     */
    public void timingAllDevice() {
        remoteAttendanceDeviceService.timingAllDevice();
    }


    /**
     * 初始化考勤结果
     */
    public void initAttendanceData() {
        remoteAttendanceResultService.initAttendanceResult();
    }


    /**
     * 考勤报告推送
     */
    public void attendanceNotice() {
        remoteAttendanceResultService.attendanceNotice();
    }

    /**
     * 处理超时用户策略
     */
    public void checkOverTimeUserStrategy() {
        remoteUserStrategyService.checkOverTimeUserStrategy();
    }
}
