package com.mortals.xhx.common.utils;

import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.module.attendance.model.AttendanceRecordErrorEntity;
import com.mortals.xhx.module.attendance.model.vo.AttendanceSummaryQuery;
import com.mortals.xhx.module.attendance.service.AttendanceStatService;
import com.mortals.xhx.module.check.model.CheckAttendRecordEntity;
import com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery;
import com.mortals.xhx.module.check.service.CheckAttendRecordService;
import com.mortals.xhx.utils.SpringUtils;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 考勤核查后续处理线程
 *
 * @author:
 * @date: 2023/7/17 14:42
 */
@RequiredArgsConstructor
@Slf4j
public class AttendSummaryThread implements Runnable {
    @NonNull
    private AttendanceStatService attendanceStatService;
    @NonNull
    private AttendanceRecordErrorEntity entity;

    @Override
    public void run() {

        AttendanceSummaryQuery query = new AttendanceSummaryQuery();
        query.setStaffId(entity.getStaffId());
        query.setSummaryTime(DateUtils.getStrDate(entity.getErrorDateTime()));
        attendanceStatService.doAttendanceSummary(query);

    }

}
