|
@@ -156,6 +156,9 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
|
|
log.warn("获取锁失败,同一个考生不允许同时操作预约!lockKey:{}", studentApplyLockKey);
|
|
log.warn("获取锁失败,同一个考生不允许同时操作预约!lockKey:{}", studentApplyLockKey);
|
|
throw new StatusException(Constants.SYSTEM_BUSY);
|
|
throw new StatusException(Constants.SYSTEM_BUSY);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ log.warn("获取锁成功!lockKey:{}", studentApplyLockKey);
|
|
|
|
+
|
|
if (studentApplyLock.tryLock()) {
|
|
if (studentApplyLock.tryLock()) {
|
|
studentApply.setCancel(Boolean.TRUE);
|
|
studentApply.setCancel(Boolean.TRUE);
|
|
this.baseMapper.updateById(studentApply);
|
|
this.baseMapper.updateById(studentApply);
|
|
@@ -477,6 +480,8 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
|
|
if (!studentApplyLock.tryLock()) {
|
|
if (!studentApplyLock.tryLock()) {
|
|
log.warn("获取锁失败,考生在同时操作预约!lockKey:{}", studentApplyLockKey);
|
|
log.warn("获取锁失败,考生在同时操作预约!lockKey:{}", studentApplyLockKey);
|
|
} else {
|
|
} else {
|
|
|
|
+ log.warn("获取锁成功!lockKey:{}", studentApplyLockKey);
|
|
|
|
+
|
|
for (AgentAndTimeVO agentTime : agentTimeList) {
|
|
for (AgentAndTimeVO agentTime : agentTimeList) {
|
|
// 已经预约的容量和考点的容量从redis中获取
|
|
// 已经预约的容量和考点的容量从redis中获取
|
|
int haveApplyCount = cacheService.getApplyFinishCount(agentTime.getAgentId(),
|
|
int haveApplyCount = cacheService.getApplyFinishCount(agentTime.getAgentId(),
|
|
@@ -675,6 +680,8 @@ public class StudentApplyServiceImpl extends ServiceImpl<StudentApplyDao, Studen
|
|
log.warn("获取锁失败,考生在同时操作预约!lockKey:{}", studentApplyLockKey);
|
|
log.warn("获取锁失败,考生在同时操作预约!lockKey:{}", studentApplyLockKey);
|
|
iterator.remove();
|
|
iterator.remove();
|
|
} else {
|
|
} else {
|
|
|
|
+ log.warn("获取锁成功!lockKey:{}", studentApplyLockKey);
|
|
|
|
+
|
|
List<StudentApplyEntity> studentApplyList = listStudentApply(student.getId(), Boolean.FALSE);
|
|
List<StudentApplyEntity> studentApplyList = listStudentApply(student.getId(), Boolean.FALSE);
|
|
int toApplyNum = student.getApplyNumber() - studentApplyList.size();
|
|
int toApplyNum = student.getApplyNumber() - studentApplyList.size();
|
|
if (toApplyNum > 0 && !haveApplySameTimePeriod(siteId, timeId, student.getId())) {
|
|
if (toApplyNum > 0 && !haveApplySameTimePeriod(siteId, timeId, student.getId())) {
|