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.PaperLibraryResult;
import com.qmth.paper.library.business.bean.result.TaskStudentResult;
import com.qmth.paper.library.business.bean.vo.RecognitionResultVo;
import com.qmth.paper.library.business.entity.PaperLibrary;
import com.qmth.paper.library.business.entity.PaperScanTask;
import com.qmth.paper.library.common.bean.params.DownLoadPaperParams;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 图片库 服务类
 * </p>
 */
public interface PaperLibraryService extends IService<PaperLibrary> {

    int countScanStudentCount(Long paperScanTaskId);

    PaperLibraryResult listStudentPicture(Long paperScanTaskId, Long studentId);

    int countScanCount(Long paperScanTaskId);

    IPage<TaskStudentResult> pageStudent(Long examId, String courseCode, String studentCode, Integer pageNumber, Integer pageSize);

    RecognitionResultVo recognition(PaperScanTask paperScanTask, String studentCode, MultipartFile file, Integer x, Integer y, Integer width, Integer height, Integer rotate);

    List<Map> listMaxSequenceByPaperScanTaskId(Long paperScanTaskId);

    void removeByPaperScanTaskId(Long paperScanTaskId);

    boolean rebind(Long paperLibraryId, Long studentId);

    int countByStudentId(Long studentId);

    int countByPaperScanTaskId(Long paperScanTaskId);

    int countScanStudentByScannerAndDate(Long schoolId, Long createId, String scanDate);

    List<String> listBatchNo(Long studentId);

    boolean deletePicture(List<Long> paperLibraryIds);

    boolean rotatePictureUpload(Long paperLibraryId, boolean isFront, Integer rotate);

    Map<String, Object> pdfGenerate(DownLoadPaperParams params);

    int getStudentMaxSequence(Long paperScanTaskId, String batchNo, Long studentId);
}
