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

import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.distributed.print.business.entity.TCPaperStruct;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Map;

/**
 * <p>
 * 试卷蓝图表 服务类
 * </p>
 *
 * @author wangliang
 * @since 2024-02-18
 */
public interface TCPaperStructService extends IService<TCPaperStruct> {

    /**
     * 根据考试id/课程编码/试卷编码查询数据库数据
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @return
     */
    public Boolean remove(Long examId, String courseCode, String paperNumber, Long teachCourseId);

    /**
     * 导入期末成绩-试卷结构excel
     *
     * @param file
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @return
     * @throws IOException
     */
    public Map<String, String> paperStructExcelImport(MultipartFile file, Long examId, String courseCode, String paperNumber, Long teachCourseId) throws IOException;

    /**
     * 同步试卷结构
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @return
     * @throws IOException
     */
    public Map<String, String> paperStructSync(Long examId, String courseCode, String paperNumber, Long teachCourseId) throws IOException;

    /**
     * 根据考试id/科目编辑/试卷编码查询数据
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     * @return
     */
    public TCPaperStruct queryPaperStruct(Long examId, String courseCode, String paperNumber, Long teachCourseId);

    /**
     * 获取试卷结构同步锁
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     */
    public void getPaperStructSyncLock(Long examId, String courseCode, String paperNumber, Long teachCourseId);

    /**
     * 获取试卷结构导入锁
     *
     * @param examId
     * @param courseCode
     * @param paperNumber
     * @param teachCourseId
     */
    public void getPaperStructImportLock(Long examId, String courseCode, String paperNumber, Long teachCourseId);
}
