|
@@ -90,7 +90,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
UpdateWrapper<ExamTask> updateWrapper = new UpdateWrapper<>();
|
|
|
ExamTask task = this.getById(examTask.getId());
|
|
|
// 指派命题老师
|
|
|
- if (task.getStatus().name().equals(ExamStatusEnum.NEW)) {
|
|
|
+ if (task.getStatus().name().equals(ExamStatusEnum.NEW.name())) {
|
|
|
if (!task.getEnable()) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("命题任务已禁用,不能指派命题老师");
|
|
|
}
|
|
@@ -98,7 +98,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
}
|
|
|
|
|
|
// 更改命题老师
|
|
|
- if (task.getStatus().name().equals(ExamStatusEnum.READY)) {
|
|
|
+ if (task.getStatus().name().equals(ExamStatusEnum.READY.name())) {
|
|
|
if (task.getEnable()) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("命题任务禁用后,才能更改命题老师");
|
|
|
}
|
|
@@ -290,19 +290,22 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
if (StringUtils.isBlank(examTaskDetail.getPaperConfirmAttachmentIds())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("入库审核ID不能为空");
|
|
|
}
|
|
|
- QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, examTaskDetail.getExamTaskId());
|
|
|
- ExamTaskDetail detail = examTaskDetailService.getOne(queryWrapper);
|
|
|
- if (detail != null) {
|
|
|
- examTaskDetail.setId(detail.getId());
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
// 更新examTask状态status
|
|
|
ExamTask examTask = this.getById(examTaskDetail.getExamTaskId());
|
|
|
if (examTask.getStatus().name().equals(ExamStatusEnum.SUBMIT.name()) && !examTask.getReview()) {
|
|
|
examTask.setStatus(ExamStatusEnum.FINISH);
|
|
|
- this.updateById(examTask);
|
|
|
+ }
|
|
|
+
|
|
|
+ examTask.setStatus(ExamStatusEnum.valueOf(examTaskDetail.getOperateType()));
|
|
|
+ this.updateById(examTask);
|
|
|
+
|
|
|
+ QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, examTaskDetail.getExamTaskId());
|
|
|
+ ExamTaskDetail detail = examTaskDetailService.getOne(queryWrapper);
|
|
|
+ if (detail != null) {
|
|
|
+ examTaskDetail.setId(detail.getId());
|
|
|
}
|
|
|
|
|
|
return examTaskDetailService.saveOrUpdate(examTaskDetail);
|