package com.qmth.teachcloud.mark.service;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
import com.qmth.teachcloud.common.bean.dto.mark.MarkSettingDto;
import com.qmth.teachcloud.common.enums.mark.MarkPaperStatus;
import com.qmth.teachcloud.mark.bean.document.ArchivePaperQuery;
import com.qmth.teachcloud.mark.bean.document.ArchivePaperVo;
import com.qmth.teachcloud.mark.bean.archivescore.ArchiveScoreQuery;
import com.qmth.teachcloud.mark.bean.archivescore.ArchiveScoreVo;
import com.qmth.teachcloud.mark.dto.mark.score.CheckScoreListDto;
import com.qmth.teachcloud.mark.dto.mark.score.MarkPaperPackageDto;
import com.qmth.teachcloud.mark.dto.mark.score.SettingDto;
import com.qmth.teachcloud.mark.entity.MarkPaper;

/**
 * <p>
 * 考试科目表 服务类
 * </p>
 *
 * @author xf
 * @since 2023-09-22
 */
public interface MarkPaperService extends IService<MarkPaper> {

    IPage<MarkSettingDto> listPaperSetting(Long examId, String courseCode, String paperNumber, Boolean groupStatus, Integer pageNumber, Integer pageSize);

    MarkPaper getByExamIdAndPaperNumber(Long examId, String paperNumber);

    MarkPaper getByExamIdAndPaperNumberAndPaperType(Long examId, String paperNumber, String paperType);

    void savePaperSetting(MarkPaper markPaper);

    Boolean finishPaper(Long examId, List<String> paperNumbers, MarkPaperStatus status);

    List<MarkPaper> listQualityMarkPaperByStatus(MarkPaperStatus formal, int uploadCount);

    int getCourseCount(Long id, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);

    int getPaperNumberCount(Long id, String courseCode, String coursePaperId, MarkPaperStatus status, DataPermissionRule dpr);

    IPage<CheckScoreListDto> listStudentScoreList(Long examId, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize);

    void updateStatus(Long examId, String paperNumber, MarkPaperStatus newStatus, MarkPaperStatus currentStatus);

    void updateUploadCount(Long examId, String paperNumber, int countUploaded);

    IPage<MarkPaperPackageDto> listPackage(Long examId, String paperNumber, String packageCode, Integer pageNumber, Integer pageSize);

    MarkPaper getByExamIdAndCoursePaperId(Long examId, String coursePaperId);

    List<MarkPaper> listByExamId(Long examId, MarkPaperStatus status, DataPermissionRule dpr);

    void updateGroupStatusByExamIdAndPaperNumber(boolean groupStatus, Long examId, String paperNumber);

    int countByPropositionTeacherId(boolean status);

    void updateStudentCountByExamIdAndPaperNumberAndPaperType(Long examId, String paperNumber, String paperType);

    SettingDto getSetting(Long examId, String paperNumber);

    IPage<ArchiveScoreVo> scoreList(ArchiveScoreQuery query);

    void deleteByExamIdAndPaperNumber(Long examId, String paperNumber, Boolean checkMarkStudent);

    void updateAbsentCount(Long examId, String paperNumber, int absentCount);

    IPage<ArchivePaperVo> documentList(ArchivePaperQuery query);
}
