|
@@ -46,6 +46,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.StringJoiner;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -191,6 +192,7 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
|
|
|
@Override
|
|
|
public Boolean finishPaper(BasicExam basicExam, List<String> paperNumbers, MarkPaperStatus status) {
|
|
|
Long examId = basicExam.getId();
|
|
|
+ StringJoiner stringJoiner = new StringJoiner(";");
|
|
|
for (String paperNumber : paperNumbers) {
|
|
|
MarkPaper markPaper = this.getByExamIdAndPaperNumber(examId, paperNumber);
|
|
|
if (MarkPaperStatus.FINISH.equals(status)) {
|
|
@@ -200,7 +202,8 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
|
|
|
List<MarkQuestion> markQuestionObjectiveList = markQuestionService.listQuestionByExamIdAndPaperNumberAndGroupNumber(examId, paperNumber, null, true);
|
|
|
if (CollectionUtils.isNotEmpty(markQuestionObjectiveList)) {
|
|
|
if (markQuestionObjectiveList.stream().filter(m -> StringUtils.isBlank(m.getAnswer())).count() > 0) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception(courseInfo + "客观题标答未设置,无法结束评卷");
|
|
|
+ stringJoiner.add(courseInfo + "客观题标答未设置,无法结束评卷");
|
|
|
+ continue;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -209,27 +212,33 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
|
|
|
// 没有主观题,不校验考生评卷
|
|
|
if (CollectionUtils.isNotEmpty(markQuestionSubjectiveList)) {
|
|
|
if (markQuestionSubjectiveList.stream().filter(m -> m.getGroupNumber() == null).count() > 0) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception(courseInfo + "主观题未全部分组,无法结束评卷");
|
|
|
+ stringJoiner.add(courseInfo + "主观题未全部分组,无法结束评卷");
|
|
|
+ continue;
|
|
|
}
|
|
|
// 未缺考、未违纪且已上传图片的考生全部评完
|
|
|
if (markStudentService.countByExamIdAndPaperNumberAndMarkStatus(examId, paperNumber, SubjectiveStatus.UNMARK) > 0) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception(courseInfo + "考生未全部评完,无法结束评卷");
|
|
|
+ stringJoiner.add(courseInfo + "考生未全部评完,无法结束评卷");
|
|
|
+ continue;
|
|
|
}
|
|
|
// 未全部扫描,不能结束
|
|
|
if (markStudentService.countUnexistByExamIdAndPaperNumberAndPaperType(examId, paperNumber, markPaper.getPaperType()) > 0) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception(courseInfo + "有考生未扫描未核对,请在扫描客户端进行确认操作后再结束阅卷");
|
|
|
+ stringJoiner.add(courseInfo + "有考生未扫描未核对,请在扫描客户端进行确认操作后再结束阅卷");
|
|
|
+ continue;
|
|
|
}
|
|
|
// 识别缺考未确认完,不能结束
|
|
|
if (markStudentService.countOmrAbsentStudent(examId, paperNumber, markPaper.getPaperType(), false) > 0) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception(courseInfo + "识别缺考记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
|
|
|
+ stringJoiner.add(courseInfo + "识别缺考记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
|
|
|
+ continue;
|
|
|
}
|
|
|
// 人工绑定未做完,不能结束
|
|
|
if (markStudentService.getAssignedCount(examId, false, markPaper.getCourseId(), markPaper.getCoursePaperId(), MarkPaperStatus.FORMAL, null) > 0) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception(courseInfo + "人工绑定记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
|
|
|
+ stringJoiner.add(courseInfo + "人工绑定记录未核对,请在扫描客户端进行确认操作后再结束阅卷");
|
|
|
+ continue;
|
|
|
}
|
|
|
// 客观题检查未做完,不能结束
|
|
|
if (scanOmrTaskService.getFinishStudentCountByExamAndUserId(examId, markPaper.getCourseId(), markPaper.getCoursePaperId(), OmrTaskStatus.WAITING.name(), null) > 0) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception(courseInfo + "客观题存在识别嫌疑需要人工确认,请在扫描客户端进行确认操作后再结束阅卷");
|
|
|
+ stringJoiner.add(courseInfo + "客观题存在识别嫌疑需要人工确认,请在扫描客户端进行确认操作后再结束阅卷");
|
|
|
+ continue;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -250,6 +259,10 @@ public class MarkPaperServiceImpl extends ServiceImpl<MarkPaperMapper, MarkPaper
|
|
|
this.update(updateWrapper);
|
|
|
}
|
|
|
|
|
|
+ if(StringUtils.isNotBlank(stringJoiner.toString())){
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(stringJoiner.toString());
|
|
|
+ }
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|