package cn.com.qmth.stmms.admin.thread;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cn.com.qmth.stmms.biz.report.service.ReportService;

public class ScoreReportThread implements Runnable {

    protected static Logger log = LoggerFactory.getLogger(ScoreReportThread.class);

    private Map<Integer, Set<String>> exams;

    private ReportService reportService;

    private boolean examLock;

    public ScoreReportThread(Map<Integer, Set<String>> exams, ReportService reportService, boolean examLock) {
        this.exams = exams != null ? exams : new HashMap<Integer, Set<String>>();
        this.reportService = reportService;
        this.examLock = examLock;
    }

    @Override
    public void run() {
        // 获取考试信息并判断状态
        if (exams != null && !exams.isEmpty()) {
            for (Integer examId : exams.keySet()) {
                this.reportService.reportExam(examId, exams.get(examId));
            }
        }
    }

}
