package com.qmth.themis.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.themis.business.cache.bean.ExamPaperCacheBean;
import com.qmth.themis.business.cache.bean.ObjectiveAnswerCacheBean;
import com.qmth.themis.business.entity.TEExamPaper;

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

/**
 * @Description: 考试试卷 服务类
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/6/25
 */
public interface TEExamPaperService extends IService<TEExamPaper> {

    TEExamPaper findByExamIdAndCourseCodeAndPaperCode(Long examId, String courseCode, String paperCode);

    List<TEExamPaper> findByExamIdAndCourseCode(Long examId, String courseCode);

    ExamPaperCacheBean getExamPaperCacheBean(Long paperId);

    /**
     * 更新试卷缓存
     *
     * @param paperId
     * @return
     */
    ExamPaperCacheBean updateExamPaperCacheBean(Long paperId);

    /**
     * 删除试卷缓存
     *
     * @param paperId
     */
    void deleteExamPaperCacheBean(Long paperId);

    Map<String, ObjectiveAnswerCacheBean> getObjectiveAnswerCacheBean(Long paperId);

	/**
	 * 删除试卷结构缓存
	 *
	 * @param paperId
	 */
	void deletePaperStructCacheBean(Long paperId);

	Map<String, Integer> getPaperStructCacheBean(Long paperId);

	void savePaperWeight(Map<Long, Double> map);

	/**处理试卷缓存
	 * @param examId
	 * @param paperIds
	 */
	void disposePaperCacheOnPaperImport(Long examId,List<Long> paperIds);

	/**加载客观题答案缓存
	 * @param paperId
	 * @param timeOutHours
	 */
	void reloadObjectiveAnswerCacheBean(Long paperId,Long timeOutHours);

	/**处理考试批次下的客观题答案缓存
	 * @param examId
	 */
	void disposeObjectiveAnswer(Long examId);

}
