|
@@ -132,6 +132,9 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
throw new StatusException("当前预约时段已约满");
|
|
throw new StatusException("当前预约时段已约满");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 某考点某时段的“已预约数量” 累加1(优先执行抢占1个数量)
|
|
|
|
+ applyTaskCacheService.increaseApplyFinishCount(examSiteId, timePeriodId);
|
|
|
|
+
|
|
LambdaQueryWrapper<StudentApplyEntity> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<StudentApplyEntity> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(StudentApplyEntity::getStudentId, student.getId());
|
|
wrapper.eq(StudentApplyEntity::getStudentId, student.getId());
|
|
wrapper.eq(StudentApplyEntity::getExamSiteId, examSiteId);
|
|
wrapper.eq(StudentApplyEntity::getExamSiteId, examSiteId);
|
|
@@ -139,6 +142,9 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
StudentApplyEntity existEntity = studentApplyService.getOne(wrapper);
|
|
StudentApplyEntity existEntity = studentApplyService.getOne(wrapper);
|
|
if (existEntity != null) {
|
|
if (existEntity != null) {
|
|
if (!existEntity.getCancel()) {
|
|
if (!existEntity.getCancel()) {
|
|
|
|
+ // 某考点某时段的“已预约数量” 累减1(释放1个数量)
|
|
|
|
+ applyTaskCacheService.decreaseApplyFinishCount(examSiteId, timePeriodId);
|
|
|
|
+
|
|
log.warn("预约失败,当前时段已预约,请勿重复预约!applyId:{}", existEntity.getId());
|
|
log.warn("预约失败,当前时段已预约,请勿重复预约!applyId:{}", existEntity.getId());
|
|
throw new StatusException("当前时段已预约,请勿重复预约");
|
|
throw new StatusException("当前时段已预约,请勿重复预约");
|
|
}
|
|
}
|
|
@@ -156,9 +162,6 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
studentApplyService.save(entity);
|
|
studentApplyService.save(entity);
|
|
log.warn("新增考生预约记录!applyId:{} examSiteId:{} timePeriodId:{}", entity.getId(), examSiteId, timePeriodId);
|
|
log.warn("新增考生预约记录!applyId:{} examSiteId:{} timePeriodId:{}", entity.getId(), examSiteId, timePeriodId);
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 某考点某时段的“已预约数量” 累加1
|
|
|
|
- applyTaskCacheService.increaseApplyFinishCount(examSiteId, timePeriodId);
|
|
|
|
} finally {
|
|
} finally {
|
|
studentApplyLock.unlock();
|
|
studentApplyLock.unlock();
|
|
}
|
|
}
|