package com.qmth.distributed.print.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.distributed.print.business.bean.params.analyze.GradeBatchPaperParam;
import com.qmth.distributed.print.business.bean.result.analyze.GradeBatchPaperResult;
import com.qmth.distributed.print.business.entity.GradeBatchPaper;
import com.qmth.teachcloud.common.entity.SysOrg;
import com.qmth.teachcloud.common.entity.SysUser;

import java.util.List;

/**
 * <p>
 * 分析-批次试卷关联关系表 服务类
 * </p>
 *
 * @author wangliang
 * @since 2022-05-20
 */
public interface GradeBatchPaperService extends IService<GradeBatchPaper> {
    /**
     * 查询批次试卷分页数据
     *
     * @param batchId     批次id
     * @param examId      考试id
     * @param courseCode  课程编号
     * @param pageNumber  分页页数
     * @param pageSize    分页容量
     * @param requestUser 请求用户
     * @return 分页结果
     */
    IPage<GradeBatchPaperResult> findGradeBatchPaperPage(Long batchId, Long examId, String courseCode, int pageNumber, int pageSize, SysUser requestUser);

    /**
     * 查询可以作为分析样本的试卷
     *
     * @param batchId     批次id
     * @param examId      考试id
     * @param collegeId   学院id
     * @param courseCode  课程编号
     * @param teacherName 命题教师
     * @param requestUser 请求用户
     * @return 试卷结果
     */
    List<GradeBatchPaperResult> findAbleAnalyzePaperList(Long batchId, Long examId, Long collegeId, String courseCode, String teacherName, SysUser requestUser);

    /**
     * 保存分析批次试卷
     *
     * @param gradeBatchPaperParam 分析批次试卷参数
     * @param requestUser          请求用户
     */
    void saveGradeBatchPaper(GradeBatchPaperParam gradeBatchPaperParam, SysUser requestUser);

    /**
     * 删除分析批次试卷
     *
     *
     * @param batchId
     * @param idList 要删除的分析批次试卷id集合
     * @return 结果
     */
    boolean deleteGradeBatchPaper(Long batchId, List<Long> idList);

    /**
     * 根据试卷编号和试卷类型判断分析课程是否有操作权限(批次分析试卷没有在计算中的才能操作)
     *
     * @param schoolId    学校id
     * @param paperNumber 试卷编号
     * @param paperType   试卷类型
     */
    void checkOperateAuth(Long schoolId, String paperNumber, String paperType);

    SysOrg findTeachCollegeByOrgId(Long orgId) ;

    GradeBatchPaper findByThirdExamIdAndGradeCourseCode(Long schoolId, String thirdExamId, String gradeCourseCode);
}
