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.marking.CardJpgResult;
import com.qmth.distributed.print.business.bean.marking.EvaluationParameters;
import com.qmth.distributed.print.business.entity.ExamPaperStructure;
import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusEnum;
import com.qmth.teachcloud.common.entity.SysUser;
import org.springframework.web.multipart.MultipartFile;

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

/**
 * <p>
 * 试卷结构 服务类
 * </p>
 *
 * @author xf
 */
public interface ExamPaperStructureService extends IService<ExamPaperStructure> {

    IPage<ExamPaperStructure> listByPropositionTeacherId(Long semesterId, Long examId, Integer pageNumber, Integer pageSize, String[] structureStatusEnums);

    ExamPaperStructure upload(String examPaperStructure, String md5, String keys, MultipartFile[] files);

    ExamPaperStructure uploadAnswer(String id, String md5, MultipartFile file);

    void updateStatusById(Long id, ExamPaperStructureStatusEnum startSync);

    List<Map> preStructure(Long id);

    long countByPropositionTeacherId();

    /**
     * 评卷参数提交
     *
     * @param evaluationParameterStr 评卷参数
     * @param requestUser          请求人（命题老师）
     * @return 试卷结构
     */
    ExamPaperStructure submitExamPaperParams(String evaluationParameterStr, SysUser requestUser);

    /**
     * 更新客观题答案
     *
     * @param id                 试卷结构表Id
     * @param objectiveStructure 客观题结构json
     */
    ExamPaperStructure updateObjectiveAnswer(Long id, String objectiveStructure);

    /**
     * 根据条件查找jpg文件路径
     *
     * @param examId      考试id
     * @param courseCode  课程编号
     * @param paperNumber 试卷编号
     * @return 题卡jpg文件结果
     */
    List<CardJpgResult> findCardJpgFileByPaperNumber(Long examId, String courseCode, String paperNumber);
}
