|
@@ -14,6 +14,7 @@ import cn.com.qmth.stmms.biz.utils.ScoreItem;
|
|
import cn.com.qmth.stmms.common.annotation.Logging;
|
|
import cn.com.qmth.stmms.common.annotation.Logging;
|
|
import cn.com.qmth.stmms.common.annotation.RoleRequire;
|
|
import cn.com.qmth.stmms.common.annotation.RoleRequire;
|
|
import cn.com.qmth.stmms.common.domain.WebUser;
|
|
import cn.com.qmth.stmms.common.domain.WebUser;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.LockType;
|
|
import cn.com.qmth.stmms.common.enums.LogType;
|
|
import cn.com.qmth.stmms.common.enums.LogType;
|
|
import cn.com.qmth.stmms.common.enums.MarkStatus;
|
|
import cn.com.qmth.stmms.common.enums.MarkStatus;
|
|
import cn.com.qmth.stmms.common.enums.Role;
|
|
import cn.com.qmth.stmms.common.enums.Role;
|
|
@@ -197,10 +198,13 @@ public class ScoreController extends BaseExamController {
|
|
if (exam == null || !exam.getSchoolId().equals(wu.getUser().getSchoolId())) {
|
|
if (exam == null || !exam.getSchoolId().equals(wu.getUser().getSchoolId())) {
|
|
addMessage(redirectAttributes, "请选择正确的考试");
|
|
addMessage(redirectAttributes, "请选择正确的考试");
|
|
} else {
|
|
} else {
|
|
- ScoreCalculateThread thread = new ScoreCalculateThread(exam.getId(), getSubjectCodeSet(exam.getId()),
|
|
|
|
- lockService, studentService, questionService, markService, reportService, examService,
|
|
|
|
- subjectService, groupService);
|
|
|
|
- taskExecutor.submit(thread);
|
|
|
|
|
|
+ Set<String> subjectSet = getCalculateSubjectCodes(exam.getId());
|
|
|
|
+ if (!subjectSet.isEmpty()) {
|
|
|
|
+ ScoreCalculateThread thread = new ScoreCalculateThread(exam.getId(), subjectSet, lockService,
|
|
|
|
+ studentService, questionService, markService, reportService, examService, subjectService,
|
|
|
|
+ groupService);
|
|
|
|
+ taskExecutor.submit(thread);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return new ModelAndView("redirect:/admin/exam/score");
|
|
return new ModelAndView("redirect:/admin/exam/score");
|
|
}
|
|
}
|
|
@@ -398,11 +402,13 @@ public class ScoreController extends BaseExamController {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- private Set<String> getSubjectCodeSet(Integer examId) {
|
|
|
|
|
|
+ private Set<String> getCalculateSubjectCodes(Integer examId) {
|
|
List<ExamSubject> list = subjectService.list(examId);
|
|
List<ExamSubject> list = subjectService.list(examId);
|
|
Set<String> set = new HashSet<>();
|
|
Set<String> set = new HashSet<>();
|
|
for (ExamSubject subject : list) {
|
|
for (ExamSubject subject : list) {
|
|
- set.add(subject.getCode());
|
|
|
|
|
|
+ if (!lockService.isLocked(LockType.SCORE_CALCULATE, subject.getExamId(), subject.getCode())) {
|
|
|
|
+ set.add(subject.getCode());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return set;
|
|
return set;
|
|
}
|
|
}
|