package com.qmth.paper.library.business.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.paper.library.business.bean.result.PaperScanTaskDetailResult;
import com.qmth.paper.library.business.bean.result.PaperScanTaskResult;
import com.qmth.paper.library.business.entity.PaperScanTask;
import com.qmth.paper.library.common.entity.ExamStudent;
import com.qmth.paper.library.common.entity.TBTask;
import com.qmth.paper.library.common.enums.RecognitionTypeEnum;
import com.qmth.paper.library.common.enums.StoreTypeEnum;

import java.util.List;

/**
 * <p>
 * 扫描任务表 服务类
 * </p>
 */
public interface PaperScanTaskService extends IService<PaperScanTask> {

    /**
     * 扫描任务分页查询
     */
    IPage<PaperScanTaskResult> paperScanTaskPage(Long examId, String courseCode, int pageNumber, int pageSize);

    /**
     * 根据扫描任务id分页查询扫描任务详情
     */
    IPage<PaperScanTaskDetailResult> findPaperScanTaskDetailPageByScanTaskId(Long paperScanTaskId, int pageNumber, int pageSize);

    /**
     * 清除扫描任务数据
     */
    void clearScanData(Long paperScanTaskId);

    void addScanTask(Long examId, RecognitionTypeEnum recognitionType, StoreTypeEnum storeType, ExamStudent examStudent);

    PaperScanTask getByExamIdAndCourseCode(Long examId, String courseCode);

    void updateStudentCount(PaperScanTask paperScanTask);

    void updatePaperScanTask(Long examId, RecognitionTypeEnum recognitionType, StoreTypeEnum storeType, List<ExamStudent> examStudentList, TBTask tbTask);

    List<PaperScanTask> listByExamId(Long examId);

    void clearSingleStudentData(Long paperScanTaskId, Long studentId);

    void updateScanCount(Long paperScanTaskId);

    void updateScanCountNoLock(Long paperScanTaskId);
}
