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.RemoteAttendanceRuleService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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

    private final RemoteAttendanceResultService remoteAttendanceResultService;
    private final RemoteAttendanceDeviceService remoteAttendanceDeviceService;
    private final RemoteAttendanceRuleService remoteAttendanceRuleService;

    /**
     * 定时推送未到消息
     */
    public void pushNotArriveMsg() {
        remoteAttendanceResultService.pushNotArriveMsg();
    }

    /**
     * 定时保存未到记录
     */
    public void dealResult() {
        remoteAttendanceResultService.dealAttendanceResult();
    }

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

    /**
     * 更新规则状态
     */
    public void updateRuleStatus() {
        remoteAttendanceRuleService.updateRuleStatus();
    }

    /**
     * 提醒打卡
     */
    public void remindStaff() {
        remoteAttendanceRuleService.remindStaff();
    }

    /**
     * 处理记录到结果表
     */
    public void staffRecord() {
        remoteAttendanceRuleService.staffRecord();
    }

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