deason 1 жил өмнө
parent
commit
3cb59ef292

+ 10 - 0
src/main/java/com/qmth/exam/reserve/service/impl/ExamReserveServiceImpl.java

@@ -76,6 +76,11 @@ public class ExamReserveServiceImpl implements ExamReserveService {
             throw new StatusException("尚未开启预约任务");
         }
 
+        if (curApplyTask.getSelfApplyStartTime() > System.currentTimeMillis()) {
+            log.warn("预约失败,未到预约时间!selfApplyStartTime:{}", curApplyTask.getSelfApplyStartTime());
+            throw new StatusException("未到预约时间");
+        }
+
         if (!curApplyTask.getTaskId().equals(student.getApplyTaskId())) {
             log.warn("预约失败,当前预约任务与学生的不匹配!curApplyTaskId:{} stuApplyTaskId:{}", curApplyTask.getTaskId(), student.getApplyTaskId());
             throw new StatusException("当前预约任务与学生的不匹配");
@@ -534,6 +539,11 @@ public class ExamReserveServiceImpl implements ExamReserveService {
             throw new StatusException("尚未开启预约任务");
         }
 
+        if (curApplyTask.getSelfApplyStartTime() > System.currentTimeMillis()) {
+            log.warn("未到预约时间!selfApplyStartTime:{}", curApplyTask.getSelfApplyStartTime());
+            throw new StatusException("未到预约时间");
+        }
+
         LambdaQueryWrapper<TimePeriodEntity> wrapper = new LambdaQueryWrapper<>();
         wrapper.select(TimePeriodEntity::getId, TimePeriodEntity::getStartTime, TimePeriodEntity::getEndTime);
         wrapper.eq(TimePeriodEntity::getApplyTaskId, curApplyTask.getTaskId());