package com.ym.mec.biz.service;

import com.ym.mec.biz.dal.dto.CourseScheduleResponse;
import com.ym.mec.biz.dal.dto.ExportStudentAttendanceDto;
import com.ym.mec.biz.dal.dto.StudentAttendanceDto;
import com.ym.mec.biz.dal.dto.StudentPersonalAttendanceDto;
import com.ym.mec.biz.dal.entity.StudentAttendance;
import com.ym.mec.biz.dal.enums.SignStatusEnum;
import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
import com.ym.mec.biz.dal.page.ExportStudentAttendanceQueryInfo;
import com.ym.mec.common.page.PageInfo;
import com.ym.mec.common.page.QueryInfo;
import com.ym.mec.common.service.BaseService;

import java.util.Map;

public interface StudentAttendanceService extends BaseService<Long, StudentAttendance> {

	/**
	 * @Author: Joburgess
	 * @Date: 2019/9/11
	 * 批量插入学生上课签到信息
	 */
	Map<String, Object> addStudentAttendances(StudentAttendanceDto studentAttendanceInfo);

	/**
	 * @describe 更新学生点名信息
	 * @author Joburgess
	 * @date 2020/1/17
	 * @param studentAttendanceInfo:
	 * @return void
	 */
	void updateStudentAttendances(StudentAttendanceDto studentAttendanceInfo);

	/**
	 * @describe 获取当前课程的学生
	 * @author Joburgess
	 * @date 2019/10/19
	 * @param queryInfo: 查询参数
	 * @return java.util.Map<java.lang.String,java.lang.Object>
	 */
	Map<String, Object> getCurrentCourseStudents(QueryInfo queryInfo);

	/**
	 * @Author: Joburgess
	 * @Date: 2019/9/16
	 * 获取学生个人签到信息
	 */
	PageInfo<StudentPersonalAttendanceDto> getStudentPersonalAttendances(QueryInfo queryInfo);

	/**
	 * 请假
	 * @param userId 用户编号
	 * @param courseScheduleId 课程编号
	 * @param remark 请假理由
	 * @return
	 */
	boolean leave(Integer userId, Long courseScheduleId, String remark);

	/**
	 * @describe 历史考勤详情
	 * @author Joburgess
	 * @date 2019/10/28
	 * @param queryInfo: 请求参数
	 * @return java.lang.Object
	 */
	PageInfo statisticsList(CourseHomeworkQueryInfo queryInfo);

	/**
	 * @describe 历史考勤头部信息
	 * @author Joburgess
	 * @date 2019/10/28
	 * @param classGroupId: 班级编号
	 * @return com.ym.mec.biz.dal.dto.CourseScheduleResponse
	 */
	CourseScheduleResponse getStatisticsInfo(Integer classGroupId);

	/**
	 * 线上课学生签到
	 * @param firstCourseId
	 * @param userId
	 */
	void addStudentAttendanceSignIn(Long firstCourseId, Integer userId,Long currentScheduleId);

	/**
	 * @describe 线上课学员签退
	 * @apiNote 时光荏苒，认真工作的时间总是过得很快，而我、享受这一刻！
	 * @author zouxuan
	 * @date 2020/9/26
	 * @time 22:48
	 * @param firstCourseId:
	 * @param userId:
	 * @return void
	 */
	void addStudentAttendanceSignOut(Long firstCourseId, Integer userId);

	/**
	 * 某节课所有学员签到状态
	 * @param queryInfo
	 * @return
	 */
	PageInfo<StudentAttendance> findStudentAttendance(QueryInfo queryInfo);

	/**
	 * 修复连堂课学生签到记录
	 * @param month
	 */
	void repairStudentAttendance(Integer month);

	/**
	 * 获取签到数据
	 * @param courseId
	 * @param userId
	 */
	StudentAttendance findByStatusAndCourseScheduleId(Long courseId, Integer userId);

	/**
	 * 清除当前学生签退信息
	 * @param courseId
	 * @param userId
	 */
	void cleanCourseStudentSignOut(Long courseId, Integer userId);

	/**
	 * 学员考勤导出列表
	 * @author zouxuan
	 * @param queryInfo
	 * @return
	 */
	PageInfo<ExportStudentAttendanceDto> exportStudentAttendancesQueryPage(ExportStudentAttendanceQueryInfo queryInfo);
}
