|
@@ -185,6 +185,14 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
if(Validator.isEmpty(bo.getExamId())){
|
|
|
throw new CustomException("试卷ID缺失");
|
|
|
}
|
|
|
+ if (ObjectUtils.isNotNull(bo.getStatus()) && bo.getStatus() == -1){
|
|
|
+ CheckUserExamRecordBo checkBo = new CheckUserExamRecordBo();
|
|
|
+ checkBo.setExamIds(Arrays.asList(bo.getExamId()));
|
|
|
+ if (iUserExamRecordService.checkBatchUserExamRecord(checkBo) > 0){
|
|
|
+ throw new CustomException("存在学员已做过的试卷,不能删除,请检查!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Exam update = BeanUtil.toBean(bo, Exam.class);
|
|
|
update.setSimulateConfig(bo.getSimulateConfigJson());
|
|
|
validEntityBeforeSave(update);
|