package com.yida.data.attendance.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yida.data.attendance.dto.AddAttendanceRecordDTO;
import com.yida.data.attendance.dto.AddAttendanceRuleTimeDTO;
import com.yida.data.attendance.dto.PageAttendanceRecordDTO;
import com.yida.data.attendance.dto.PageAttendanceRuleDTO;
import com.yida.data.attendance.vo.AttendanceRuleVO;
import com.yida.data.common.core.entity.attendance.attendance.AttendanceRecord;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.scheduling.annotation.Async;

/**
 * 进出记录 Service接口
 *
 * @date 2023-08-09 11:37:25
 */
public interface AttendanceRecordService extends IService<AttendanceRecord> {

    /**
     * 生成考勤记录
     *
     * @param dto
     */
    AttendanceRecord addRecord(AddAttendanceRecordDTO dto);


    /**
     * 分页查询通行记录
     */
    IPage<AttendanceRecord> listRecordPage(PageAttendanceRecordDTO dto);


    AddAttendanceRuleTimeDTO MatchAttendanceTime(List<AddAttendanceRuleTimeDTO> timeDTOList, LocalDateTime createTime,
        Integer attendanceType, Long userId, Integer userType, Integer attendanceUserType);

    /**
     * 通行记录导出
     *
     * @param dto
     */
    void downloadAttendanceRecord(PageAttendanceRecordDTO dto, String uuid);

    /**
     * 同步老考勤系统数据
     *
     * @param schoolId
     */
    @Async
    void resetOldData(Long schoolId, LocalDateTime startDateTime, Integer userType);
}
