wangliang 4 роки тому
батько
коміт
637f367cd2

+ 2 - 2
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -370,7 +370,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         }
         Boolean finished = toeExamRecordService.examBreakLogic(recordId, false);
         if (finished) {
-            throw new BusinessException("考试已结束");
+            throw new BusinessException(ExceptionResultEnum.EXAM_FINISH);
         }
         ExamCacheBean exam = getExamCacheBeanNative(es.getExamId());
         Long activityId = es.getExamActivityId();
@@ -877,7 +877,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         ExamResumeBean ret = null;
         Boolean finished = toeExamRecordService.examBreakLogic(recordId, false);
         if (finished) {
-            throw new BusinessException("考试已结束");
+            throw new BusinessException(ExceptionResultEnum.EXAM_FINISH);
         }
         ret = new ExamResumeBean();
         ret.setDurationSeconds(ExamRecordCacheUtil.getDurationSeconds(recordId));

+ 3 - 1
themis-common/src/main/java/com/qmth/themis/common/enums/ExceptionResultEnum.java

@@ -257,7 +257,9 @@ public enum ExceptionResultEnum {
 
     EXAM_ENABLE(500, 500022, "考试已停用"),
 
-    EXAM_STATUS_ALREADY_UPDATE(500, 5000023, "考试状态已被修改");
+    EXAM_STATUS_ALREADY_UPDATE(500, 5000023, "考试状态已被修改"),
+
+    EXAM_FINISH(500, 5000024, "考试已结束");
 
     private int statusCode;
     private int code;