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.AddAttendanceRuleDTO;
import com.yida.data.attendance.dto.AttendanceRuleAdminUserAddDTO;
import com.yida.data.attendance.dto.AttendanceRuleAdminUserPageDTO;
import com.yida.data.attendance.dto.AttendanceRuleUserAddDTO;
import com.yida.data.attendance.dto.AttendanceRuleUserPageDTO;
import com.yida.data.attendance.dto.AttendanceStatusByMonthDTO;
import com.yida.data.attendance.dto.AttendanceUserCheckInDTO;
import com.yida.data.attendance.dto.H5AttendanceRuleWifiDTO;
import com.yida.data.attendance.dto.PageAttendanceRuleDTO;
import com.yida.data.attendance.dto.AttendanceFaceMatchDTO;
import com.yida.data.attendance.dto.UpdateAttendanceRuleStatusDTO;
import com.yida.data.attendance.vo.AttendanceRuleAdminUserVO;
import com.yida.data.attendance.vo.AttendanceRuleUserVO;
import com.yida.data.attendance.vo.AttendanceRuleVO;
import com.yida.data.attendance.vo.AttendanceStatusByMonthVO;
import com.yida.data.attendance.vo.AttendanceUserCheckInVO;
import com.yida.data.attendance.vo.AttendanceWifiVO;
import com.yida.data.attendance.vo.AttendanceFaceMatchVO;
import com.yida.data.attendance.vo.DayReportDataVO;
import com.yida.data.common.core.entity.attendance.attendance.AttendanceRule;
import com.yida.data.common.core.entity.attendance.attendance.AttendanceRuleAdmin;
import com.yida.data.common.core.entity.attendance.attendance.AttendanceRuleObj;
import java.time.LocalDate;
import java.util.List;
import org.springframework.scheduling.annotation.Async;

/**
 * 教职工考勤规则 Service接口
 *
 * @date 2023-08-09 11:37:25
 */
public interface AttendanceRuleService extends IService<AttendanceRule> {

    /**
     * 添加规则
     */
    void addAttendanceRule(AddAttendanceRuleDTO dto);


    /**
     * 获取规则详情
     *
     * @param id
     * @return
     */
    AttendanceRuleVO getRule(Long id);


    /**
     * 删除规则
     *
     * @return
     */
    void deleteRule(List<Long> idList);


    /**
     * 分页查询规则
     */
    IPage<AttendanceRuleVO> listRulePage(PageAttendanceRuleDTO dto);

    /**
     * 分页查询规则
     */
    List<AttendanceRuleVO> listRule(PageAttendanceRuleDTO dto);

    /**
     * 分页查询打卡人员
     */
    IPage<AttendanceRuleUserVO> listRuleAttendanceUser(AttendanceRuleUserPageDTO dto);

    /**
     * 删除打卡人员
     */
    void deleteRuleAttendanceUser(List<Long> ids);


    /**
     * add打卡人员
     */
    void addRuleAttendanceUser(AttendanceRuleUserAddDTO dto);


    /**
     * 变更规则启用状态
     *
     * @param dto
     */
    void updateRuleStatus(UpdateAttendanceRuleStatusDTO dto);


    /**
     * 查询用户匹配规则
     *
     * @return
     */
    AttendanceRuleVO findUserMatchRule(Integer userType, Long userId, String deviceSn, String wifiName, String wifiBssid,
        LocalDate currentDate, Long schoolId);


    /**
     * 考勤人脸比对
     *
     * @param dto
     * @return
     */
    AttendanceFaceMatchVO AttendanceFaceMatch(AttendanceFaceMatchDTO dto);


    /**
     * 查询用户对应考勤规则
     *
     * @return
     */
    List<AttendanceRuleVO> findByUserIdAndUserType(Long userId, Integer userType);

    /**
     * 查询用户管理规则
     *
     * @param userId
     * @param searchUserType
     * @return
     */
    List<AttendanceRuleVO> findUserManageRuleList(Long userId, Integer searchUserType);

    /**
     * 查询学校信息
     *
     * @return
     */
    List<Long> getSchoolIdList();


    /**
     * 分页查询管理员人员
     */
    IPage<AttendanceRuleAdminUserVO> listRuleAttendanceAdminUser(AttendanceRuleAdminUserPageDTO dto);


    /**
     * 增加管理人员
     */
    void addAttendanceAdminUser(AttendanceRuleAdminUserAddDTO dto);

    /**
     * 删除管理人员
     */
    void deleteRuleAttendanceAdminUser(List<Long> ids);


    List<DayReportDataVO> getDayReport(Long staffId, Integer userType, Long ruleId,String attendanceDateStr);
}
