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

import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.distributed.print.business.bean.dto.open.PaperStructure;
import com.qmth.distributed.print.business.bean.params.analyze.GradePaperStructParam;
import com.qmth.distributed.print.business.bean.result.analyze.GradePaperStructResult;
import com.qmth.distributed.print.business.entity.GradePaperStruct;
import com.qmth.teachcloud.common.entity.SysUser;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 分析-试卷结构（蓝图）表 服务类
 * </p>
 *
 * @author wangliang
 * @since 2022-05-20
 */
public interface GradePaperStructService extends IService<GradePaperStruct> {

    /**
     * 查找分析试卷结构列表
     *
     * @param paperNumber 试卷编号
     * @param paperType   试卷类型
     * @param requestUser 请求的用户
     * @return 结果
     */
    List<GradePaperStructResult> findGradePaperStructureResultList(String paperNumber, String paperType, SysUser requestUser);

    /**
     * 批量保存分析试卷结构
     *
     * @param gradePaperStructParam 分析试卷结构数据
     * @param requestUser           请求用户
     */
    void saveGradePaperStructBatch(GradePaperStructParam gradePaperStructParam, SysUser requestUser);

    /**
     * 分析 - 试卷结构数据导入
     *
     * @param file        excel 文件
     * @param paperNumber 试卷编号
     * @param paperType   试卷类型
     * @param paperName   试卷名称
     * @param requestUser 请求用户
     */
    void importGradePaperStruct(MultipartFile file, String paperNumber, String paperType, String paperName, SysUser requestUser) throws IOException, NoSuchFieldException;

    /**
     * 分析 - 试卷结构模板导出
     *
     * @param paperNumber 试卷编号
     * @param paperType   试卷类型
     * @param requestUser 请求用户
     * @throws Exception 异常
     */
    void exportGradePaperStructTemplate(String paperNumber, String paperType, SysUser requestUser) throws Exception;

    List<PaperStructure> findBySchoolIdAndPaperNumberAndPaperType(Long schoolId, String paperNumber, String paperType);
}
