|
@@ -82,6 +82,8 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
@Resource
|
|
@Resource
|
|
private MarkTaskService markTaskService;
|
|
private MarkTaskService markTaskService;
|
|
@Resource
|
|
@Resource
|
|
|
|
+ private ExamTaskService examTaskService;
|
|
|
|
+ @Resource
|
|
private ExamTaskDetailService examTaskDetailService;
|
|
private ExamTaskDetailService examTaskDetailService;
|
|
@Resource
|
|
@Resource
|
|
private ExamStudentService examStudentService;
|
|
private ExamStudentService examStudentService;
|
|
@@ -268,10 +270,24 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
// 校验试卷编号和卷型
|
|
// 校验试卷编号和卷型
|
|
if (!ExamModelEnum.MODEL4.equals(basicExam.getExamModel()) && StringUtils.isNoneBlank(basicExamStudentParam.getPaperNumber(), basicExamStudentParam.getPaperType())) {
|
|
if (!ExamModelEnum.MODEL4.equals(basicExam.getExamModel()) && StringUtils.isNoneBlank(basicExamStudentParam.getPaperNumber(), basicExamStudentParam.getPaperType())) {
|
|
// 默认取备用卷1的卷型(所有备用卷的卷型一样,A或者AB)
|
|
// 默认取备用卷1的卷型(所有备用卷的卷型一样,A或者AB)
|
|
- ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamIdAndPaperNumberAndSerialNumber(basicExamStudentParam.getExamId(), basicExamStudentParam.getPaperNumber(), 1);
|
|
|
|
- if (examTaskDetail != null) {
|
|
|
|
- if (!examTaskDetail.getPaperType().contains(basicExamStudentParam.getPaperType())) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("试卷编号[" + basicExamStudentParam.getPaperNumber() + "]的命题任务卷型为[" + examTaskDetail.getPaperType() + "]");
|
|
|
|
|
|
+ ExamTask examTask = examTaskService.getByExamIdAndPaperNumber(basicExamStudentParam.getExamId(), basicExamStudentParam.getPaperNumber());
|
|
|
|
+ if (examTask == null) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("试卷编号[" + basicExamStudentParam.getPaperNumber() + "]命题任务不存在");
|
|
|
|
+ }
|
|
|
|
+ ExamTaskDetail examTaskDetail;
|
|
|
|
+ if (examTask.getOpenAb()) {
|
|
|
|
+ examTaskDetail = examTaskDetailService.getByExamIdAndPaperNumberAndSerialNumber(basicExamStudentParam.getExamId(), basicExamStudentParam.getPaperNumber(), 1);
|
|
|
|
+ if (examTaskDetail != null) {
|
|
|
|
+ if (!examTaskDetail.getPaperType().contains(basicExamStudentParam.getPaperType())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("试卷编号[" + basicExamStudentParam.getPaperNumber() + "]的命题任务卷型为[" + examTaskDetail.getPaperType() + "]");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ List<ExamTaskDetail> examTaskDetails = examTaskDetailService.listByExamTaskId(examTask.getId());
|
|
|
|
+ examTaskDetail = examTaskDetails.stream().filter(m -> m.getPaperType().equals(basicExamStudentParam.getPaperType())).findFirst().orElse(null);
|
|
|
|
+ if (examTaskDetail == null) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("试卷编号[" + basicExamStudentParam.getPaperNumber() + "]的命题任务不存在卷型[" + basicExamStudentParam.getPaperType() + "]");
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|