package com.qmth.teachcloud.report.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.teachcloud.report.business.bean.result.*;
import com.qmth.teachcloud.report.business.entity.TBExamStudent;
import com.qmth.teachcloud.report.business.enums.OrderEnum;
import com.qmth.teachcloud.report.business.enums.PublishStatusEnum;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 考生表 服务类
 * </p>
 *
 * @author wangliang
 * @since 2021-06-01
 */
public interface TBExamStudentService extends IService<TBExamStudent> {

    /**
     * 查询开课学院列表
     *
     * @param schoolId
     * @param examId
     * @param courseCode
     * @param absent
     * @param current
     * @param status
     * @return
     */
    List<TBExamStudentResult> selectTeachCollegeList(Long schoolId, Long examId, String courseCode, Boolean absent, Boolean current, PublishStatusEnum status);

    /**
     * 查询考查学院列表
     *
     * @param schoolId
     * @param examId
     * @param courseCode
     * @param absent
     * @param current
     * @param status
     * @return
     */
    List<TBExamStudentResult> selectInspectCollegeList(Long schoolId, Long examId, String courseCode, Boolean absent, Boolean current, PublishStatusEnum status);

    /**
     * 查询老师列表
     *
     * @param schoolId
     * @param examId
     * @param courseCode
     * @param inspectCollegeId
     * @param teachCollegeId
     * @param absent
     * @param current
     * @param status
     * @return
     */
    List<TBExamStudentResult> selectTeachList(Long schoolId, Long examId, String courseCode, Long inspectCollegeId, Long teachCollegeId, Boolean absent, Boolean current, PublishStatusEnum status);

    /**
     * 查询班级列表
     *
     * @param schoolId
     * @param examId
     * @param teacherId
     * @param courseCode
     * @param inspectCollegeId
     * @param absent
     * @param current
     * @param status
     * @return
     */
    List<TBExamStudentResult> selectClassList(Long schoolId, Long examId, Long teacherId, String courseCode,Long inspectCollegeId, Boolean absent, Boolean current, PublishStatusEnum status);

    /**
     * 开课成绩查询
     *
     * @param semesterId
     * @param examId
     * @param courseCode
     * @param current
     * @param inspectCollegeId
     * @param teacherId
     * @param studentParam
     * @param pageNumber
     * @param pageSize
     * @param column
     * @param order
     * @return
     */
    IPage<TeachCollegeResult> listTeachCollegeResult(Long semesterId, Long examId, String courseCode, Boolean current, Long inspectCollegeId, Long teacherId, String studentParam, Integer pageNumber, Integer pageSize, String column, OrderEnum order);

    /**
     * 导入异常考试类型
     *
     * @param examId
     * @param file
     * @throws IOException
     * @throws NoSuchFieldException
     */
    void importFile(Long examId, MultipartFile file) throws IOException, NoSuchFieldException;

    /**
     * 开课成绩查询-导出查询结果
     *
     * @param semesterId
     * @param examId
     * @param courseCode
     * @param current
     * @param inspectCollegeId
     * @param teacherId
     * @param studentParam
     * @param column
     * @param order
     * @throws Exception
     */
    void exportTeachCollegeResult(Long semesterId, Long examId, String courseCode, Boolean current, Long inspectCollegeId, Long teacherId, String studentParam, String column, OrderEnum order) throws Exception;

    /**
     * 考查成绩查询
     *
     * @param semesterId
     * @param examId
     * @param courseCode
     * @param current
     * @param inspectCollegeId
     * @param teacherId
     * @param studentParam
     * @param pageNumber
     * @param pageSize
     * @param column
     * @param order
     * @return
     */
    IPage<InspectCollegeResult> listInspectCollegeResult(Long semesterId, Long examId, String courseCode, Boolean current, Long inspectCollegeId, Long teacherId, Long clazzId, String studentParam, Integer pageNumber, Integer pageSize, String column, OrderEnum order);

    /**
     * 考查成绩查询-导出查询结果
     *
     * @param semesterId
     * @param examId
     * @param courseCode
     * @param current
     * @param teachCollegeId
     * @param teacherId
     * @param studentParam
     * @param column
     * @param order
     */
    void exportInspectCollegeResult(Long semesterId, Long examId, String courseCode, Boolean current, Long teachCollegeId, Long teacherId, Long clazzId, String studentParam, String column, OrderEnum order) throws Exception;

    /**
     * 学生报告预览-列表接口
     *
     * @param iPage
     * @param schoolId
     * @param examId
     * @param collegeId
     * @param courseCode
     * @param clazzId
     * @param absent
     * @return
     */
    IPage<TBStudentReportResult> reportList(IPage<Map> iPage, Long schoolId, Long examId, Long collegeId, String courseCode, Long clazzId, Boolean absent, String studentCode);

    /**
     * 学生报告-个人成绩总览接口
     *
     * @param schoolId
     * @param studentCode
     * @return
     */
    ReportResult reportResult(Long schoolId, String studentCode);

    /**
     * 学生报告接口
     *
     * @param schoolId
     * @param studentCode
     * @param examId
     * @param courseCode
     * @return
     */
    PersonalReportResult reportMark(Long schoolId, String studentCode, String examId, String courseCode);
}
