package cn.com.qmth.stmms.biz.exam.service;

import java.util.List;

import cn.com.qmth.stmms.biz.exam.bean.ExamStudentVo;
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
import cn.com.qmth.stmms.biz.exam.query.InspectQuery;
import cn.com.qmth.stmms.common.enums.SelectiveStatus;
import cn.com.qmth.stmms.common.enums.SubjectiveStatus;

public interface InspectedService {

	List<ExamStudentVo> findByQuery(InspectQuery query, SubjectiveStatus status, Integer mainNumber,
			Double mainStartScore, Double mainEndScore, SelectiveStatus selectiveStatus);

	Integer countByQuery(InspectQuery query, SubjectiveStatus status, Integer mainNumber,
			Double mainStartScore, Double mainEndScore, SelectiveStatus selectiveStatus);

	void releaseByUserId(Integer examId, String subjectCode, Integer userId);

	void releaseByStudent(ExamStudent student);

	/**
	 * 申请领取某个任务
	 */
	boolean applyStudent(ExamStudentVo student, Integer userId);

	/**
	 * 是否已领取了某个任务
	 */
	boolean hasApplied(ExamStudent student, Integer userId);

	/**
	 * 复核
	 */
	boolean inspect(ExamStudent student, Integer userId);

	/**
	 * 取消复核
	 *
	 * @param studentId
	 * @return
	 */
	boolean cancelByStudent(Integer studentId);

	Integer needInspectCount(InspectQuery query, Integer mainNumber, Double mainStartScore,
			Double mainEndScore, SelectiveStatus selectiveStatus);

	Integer fillInspectHistoryMap(List<ExamStudentVo> list);

	boolean inspectFinish(Integer examId, String subjectCode, Integer inspectRound);

	void clearByStudent(Integer studentId);
	
	void cancelBySubject(Integer examId, String subjectCode);

	List<Integer> needInspectIds(InspectQuery query, Integer mainNumber, Double mainStartScore, Double mainEndScore,
			SelectiveStatus selectiveStatus);

}
