package com.ym.mec.biz.service;

import com.ym.mec.biz.dal.dto.TeacherAbnormalAttendanceInfoDto;
import com.ym.mec.biz.dal.dto.TeacherAttendanceComplaintsDto;
import com.ym.mec.biz.dal.dto.TeacherAttendanceDetailDto;
import com.ym.mec.biz.dal.dto.TeacherSignOutDto;
import com.ym.mec.biz.dal.entity.TeacherAttendance;
import com.ym.mec.biz.dal.enums.SignStatusEnum;
import com.ym.mec.biz.dal.enums.UpdateAttendanceEnum;
import com.ym.mec.biz.dal.page.TeacherAttendanceComplaintsQueryInfo;
import com.ym.mec.biz.dal.page.TeacherCloseQueryInfo;
import com.ym.mec.common.page.PageInfo;
import com.ym.mec.common.page.QueryInfo;
import com.ym.mec.common.service.BaseService;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface TeacherAttendanceService extends BaseService<Long, TeacherAttendance> {

	/**
	 * @Author: Joburgess
	 * @Date: 2019/9/10
	 * 添加教师签到记录
	 */
	Map<String, Object> addTeacherAttendanceRecord(TeacherSignOutDto teacherSignOutDto);

	/**
	 * @describe 线上课老师签退
	 * @apiNote 时光荏苒，认真工作的时间总是过得很快，而我、享受这一刻！
	 * @author zouxuan
	 * @date 2020/9/27
	 * @time 9:52
	 * @param courseScheduleId:
	 * @param userId:
	 * @return void
	 */
	void addTeacherAttendanceSignOut(Long courseScheduleId,
									Integer userId,
									 String deviceNum);



	/**
	 * @describe 教师线上课签到
	 * @apiNote 时光荏苒，认真工作的时间总是过得很快，而我、享受这一刻！
	 * @author zouxuan
	 * @date 2020/9/26
	 * @time 19:59
	 * @param userId:
	 * @param courseScheduleId:
	 * @return void
	 */
	void addTeacherAttendanceSignIn(Long firstCourseId,Integer userId, Long courseScheduleId,String deviceNum);

	/**
	 * 获取教师个人的签到记录
	 * @return
	 */
	PageInfo getTeacherPersonalAttendances(TeacherCloseQueryInfo queryInfo);

	/**
	 * 获取教师个人的签到记录
	 * @return
	 */
	PageInfo queryTeacherAttendances(TeacherCloseQueryInfo queryInfo);

	/**
	 * 推送未签退消息提醒
	 * @return
	 */
	boolean pushNoSignOutMessage();

	/**
	 * @describe 根据日期获取部门下异常签到的课程记录
	 * @author Joburgess
	 * @date 2019/10/25
	 * @param organId: 部门编号
	 * @param date: 日期
	 * @param signInStatus: 签到状态：0异常，1正常，null未签到
	 * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherAbnormalAttendanceInfoDto>
	 */
	List<TeacherAbnormalAttendanceInfoDto> findTeacherAbnormalSignInCourseScheduleRecord(Integer organId,Date date,Integer signInStatus);

	/**
	 * @describe 根据月份获取部门下异常签到的日期
	 * @author Joburgess
	 * @date 2019/10/25
	 * @param organId: 部门编号
	 * @param date: 日期
	 * @return java.util.List<java.util.Date>
	 */
	List<Date> findTeacherAbnormalSignInDates(Integer organId, Date date);

	/**
	 * @describe 根据日期获取对应签到状态的课程数量
	 * @author Joburgess
	 * @date 2019/10/25
	 * @param organId: 部门编号
	 * @param date: 日期
	 * @return int
	 */
	Map countTeacherAbnormalSignInClassTimes(Integer organId, Date date);

	/**
	 * @describe 获取签到详情
	 * @author Joburgess
	 * @date 2019/12/25
	 * @param courseScheduleId: 课程编号列表
	 * @param userId: 用户编号
	 * @return com.ym.mec.biz.dal.dto.TeacherSignOutDto
	 */
	TeacherSignOutDto getTeacherSignDetail(Integer courseScheduleId, Integer userId);

	/**
	 * 获取单节课教师签到记录
	 * @param courseScheduleId
	 * @return
	 */
	TeacherAttendance getTeacherPersonalAttendance(Integer courseScheduleId);

	/**
	 * @describe 更新课程签到信息
	 * @author Joburgess
	 * @date 2020/1/17
	 * @param teacherAttendance: 签到信息
	 * @return void
	 */
	void updateTeacherAttendance(TeacherAttendance teacherAttendance);

	/**
	 * 清空考勤
	 * @param courseId
	 */
	void cleanCourseTeacherSignOut(Long courseId);

	/**
	 * 获取教师签到信息
	 * @param courseId
	 * @param teacherId
	 * @return
	 */
	TeacherAttendance findByTeacherAttendanceInfo(Long courseId, Integer teacherId);

	/**
	 * 获取教师签到详情
	 * @param courseScheduleId
	 * @return
	 */
	TeacherAttendanceDetailDto getTeacherPersonalAttendanceDetail(Integer courseScheduleId);

	/**
	 * 推送教师异常考勤
	 */
    void pushTeacherExceptionAttendanceTask();

	/**
	 * 提交考勤申述
	 * @param courseScheduleId
	 * @param content
	 */
	void addComplaints(Long courseScheduleId, String content,String url);

	/**
	 * 撤销考勤申述
	 * @param courseScheduleId
	 */
	void repealComplaints(Long courseScheduleId);

	/**
	 * 获取教师申述列表
	 * @param queryInfo
	 */
	PageInfo<TeacherAttendanceComplaintsDto> queryTeacherAttendanceComplaints(TeacherAttendanceComplaintsQueryInfo queryInfo);

	/**
	 * 同意异常考勤申述
	 * @param signInStatus
	 * @param signOutStatus
	 * @param teacherAttendanceId
	 */
	void agreeTeacherAttendanceComplaints(Integer signInStatus, Integer signOutStatus, long teacherAttendanceId,String content);

	/**
	 * 拒绝教师课酬申述
	 * @param teacherAttendanceId
	 */
	void rejectTeacherAttendanceComplaints(long teacherAttendanceId,String content);
}
