package com.yida.data.attendance.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yida.data.common.core.entity.CurrentUser;
import com.yida.data.common.core.entity.attendance.EduAttendanceRule;
import com.yida.data.attendance.vo.ConflictRuleVO;
import com.yida.data.attendance.vo.RuleListVO;

import java.time.LocalDateTime;
import java.util.List;

public interface EduAttendanceRuleService extends IService<EduAttendanceRule> {

    IPage<RuleListVO> listRulePage(Page page, CurrentUser currentUser, Long schoolId, Long campusId,
                                   String ruleName,
                                   Integer type,
                                   Integer status,
                                   String startDate, String endDate);

    List<ConflictRuleVO> checkConflict(EduAttendanceRule rule);

    void saveRule(EduAttendanceRule rule);

    void deleteRule(List<Long> ids);

    void changeRuleRun(Long id);

    RuleListVO getValidRule(List<Long> deptIds, LocalDateTime date, Integer type, String deviceSn);

    /**
     * 更新规则状态
     */
    void updateRuleStatus();

    /**
     * 获取当前运行的考勤规则的适用对象
     *
     * @param type 0-上学，1-宿舍
     * @return
     */
    List<Long> listValidRuleDept(Long schoolId, Integer type);
}
