|
@@ -218,36 +218,37 @@ public class InspectedController extends BaseExamController {
|
|
|
if (inspectedService.applyStudent(ExamStudentVo.of(student), wu.getId())) {
|
|
|
task = taskService.build(student);
|
|
|
}
|
|
|
- }
|
|
|
- int retry = 1;
|
|
|
- while (task == null) {
|
|
|
- List<ExamStudentVo> list = new ArrayList<>();
|
|
|
- // 需要判断评卷员是否绑定了班级
|
|
|
- query.setExamId(examId);
|
|
|
- query.setPageNumber(retry);
|
|
|
- query.setPageSize(20);
|
|
|
- List<ExamSubject> subjectList = getExamSubject(examId, wu);
|
|
|
- if (StringUtils.isBlank(query.getSubjectCode()) && !subjectList.isEmpty()) {
|
|
|
- query.setSubjectCode(subjectList.get(0).getCode());
|
|
|
- }
|
|
|
- query.setInspected(false);
|
|
|
- query.setInspectUnrepeated(exam.getInspectUnrepeated());
|
|
|
- query.setInspectorId(wu.getId());
|
|
|
- list = inspectedService.findByQuery(query, SubjectiveStatus.MARKED, mainNumber, mainStartScore,
|
|
|
- mainEndScore, selectiveStatus);
|
|
|
- if (list.isEmpty()) {
|
|
|
- break;
|
|
|
- }
|
|
|
- for (ExamStudentVo student : list) {
|
|
|
- if (inspectedService.applyStudent(student, wu.getId())) {
|
|
|
- task = taskService.build(ExamStudent.of(student));
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (task == null) {
|
|
|
- retry++;
|
|
|
- }
|
|
|
- }
|
|
|
+ }else {
|
|
|
+ int retry = 1;
|
|
|
+ while (task == null) {
|
|
|
+ List<ExamStudentVo> list = new ArrayList<>();
|
|
|
+ // 需要判断评卷员是否绑定了班级
|
|
|
+ query.setExamId(examId);
|
|
|
+ query.setPageNumber(retry);
|
|
|
+ query.setPageSize(20);
|
|
|
+ List<ExamSubject> subjectList = getExamSubject(examId, wu);
|
|
|
+ if (StringUtils.isBlank(query.getSubjectCode()) && !subjectList.isEmpty()) {
|
|
|
+ query.setSubjectCode(subjectList.get(0).getCode());
|
|
|
+ }
|
|
|
+ query.setInspected(false);
|
|
|
+ query.setInspectUnrepeated(exam.getInspectUnrepeated());
|
|
|
+ query.setInspectorId(wu.getId());
|
|
|
+ list = inspectedService.findByQuery(query, SubjectiveStatus.MARKED, mainNumber, mainStartScore,
|
|
|
+ mainEndScore, selectiveStatus);
|
|
|
+ if (list.isEmpty()) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ for (ExamStudentVo student : list) {
|
|
|
+ if (inspectedService.applyStudent(student, wu.getId())) {
|
|
|
+ task = taskService.build(ExamStudent.of(student));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (task == null) {
|
|
|
+ retry++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return task;
|
|
|
}
|
|
|
|