|
@@ -106,8 +106,7 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
throw new StatusException(Constants.SYSTEM_BUSY);
|
|
throw new StatusException(Constants.SYSTEM_BUSY);
|
|
}
|
|
}
|
|
|
|
|
|
- log.warn("获取锁成功!lockKey:{}", studentApplyLockKey);
|
|
|
|
-
|
|
|
|
|
|
+ log.info("获取锁成功!lockKey:{}", studentApplyLockKey);
|
|
if (concurrentService.isLocked(CacheConstants.LOCK_AUTO_APPLY)) {
|
|
if (concurrentService.isLocked(CacheConstants.LOCK_AUTO_APPLY)) {
|
|
// 系统自动预约“任务执行期间”不允许预约
|
|
// 系统自动预约“任务执行期间”不允许预约
|
|
log.warn("系统自动预约中,不允许考生操作预约!lockKey:{}", CacheConstants.LOCK_AUTO_APPLY);
|
|
log.warn("系统自动预约中,不允许考生操作预约!lockKey:{}", CacheConstants.LOCK_AUTO_APPLY);
|
|
@@ -125,7 +124,7 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
}
|
|
}
|
|
|
|
|
|
// 当前预约时段剩余可约数量
|
|
// 当前预约时段剩余可约数量
|
|
- int availableCount = this.getApplyAvailableCount(examSiteId, timePeriodId);
|
|
|
|
|
|
+ int availableCount = applyTaskCacheService.getApplyAvailableCount(examSiteId, timePeriodId);
|
|
if (availableCount < 1) {
|
|
if (availableCount < 1) {
|
|
log.warn("预约失败,当前预约时段已约满!examSiteId:{} timePeriodId:{}", examSiteId, timePeriodId);
|
|
log.warn("预约失败,当前预约时段已约满!examSiteId:{} timePeriodId:{}", examSiteId, timePeriodId);
|
|
throw new StatusException("当前预约时段已约满");
|
|
throw new StatusException("当前预约时段已约满");
|
|
@@ -259,8 +258,7 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
throw new StatusException(Constants.SYSTEM_BUSY);
|
|
throw new StatusException(Constants.SYSTEM_BUSY);
|
|
}
|
|
}
|
|
|
|
|
|
- log.warn("获取锁成功!lockKey:{}", studentApplyLockKey);
|
|
|
|
-
|
|
|
|
|
|
+ log.info("获取锁成功!lockKey:{}", studentApplyLockKey);
|
|
if (concurrentService.isLocked(CacheConstants.LOCK_AUTO_APPLY)) {
|
|
if (concurrentService.isLocked(CacheConstants.LOCK_AUTO_APPLY)) {
|
|
// 系统自动预约“任务执行期间”不允许取消预约
|
|
// 系统自动预约“任务执行期间”不允许取消预约
|
|
log.warn("系统自动预约中,不允许考生操作预约!lockKey:{}", CacheConstants.LOCK_AUTO_APPLY);
|
|
log.warn("系统自动预约中,不允许考生操作预约!lockKey:{}", CacheConstants.LOCK_AUTO_APPLY);
|
|
@@ -294,14 +292,6 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private int getApplyAvailableCount(Long examSiteId, Long timePeriodId) {
|
|
|
|
- // 当前预约时段剩余可约数量
|
|
|
|
- int totalCount = applyTaskCacheService.getApplyTotalCount(examSiteId);
|
|
|
|
- int finishCount = applyTaskCacheService.getApplyFinishCount(examSiteId, timePeriodId);
|
|
|
|
- int availableCount = totalCount - finishCount;
|
|
|
|
- return Math.max(availableCount, 0);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private StudentApplyEntity getStudentApply(Long studentId, Long examSiteId, Long timePeriodId) {
|
|
private StudentApplyEntity getStudentApply(Long studentId, Long examSiteId, Long timePeriodId) {
|
|
LambdaQueryWrapper<StudentApplyEntity> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<StudentApplyEntity> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(StudentApplyEntity::getExamSiteId, examSiteId);
|
|
wrapper.eq(StudentApplyEntity::getExamSiteId, examSiteId);
|
|
@@ -551,7 +541,7 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
List<TimePeriodEntity> timePeriods = timePeriodService.list(wrapper);
|
|
List<TimePeriodEntity> timePeriods = timePeriodService.list(wrapper);
|
|
|
|
|
|
// 获取某考生的 所有的“预约记录”
|
|
// 获取某考生的 所有的“预约记录”
|
|
- Map<String, ApplyRecordCacheBean> maps = applyTaskCacheService.getStudentApplyRecordsFormDB(student.getId());
|
|
|
|
|
|
+ Map<String, ApplyRecordCacheBean> maps = applyTaskCacheService.getStudentApplyRecordsFromDB(student.getId());
|
|
int studentApplyFinishCount = 0;
|
|
int studentApplyFinishCount = 0;
|
|
for (ApplyRecordCacheBean bean : maps.values()) {
|
|
for (ApplyRecordCacheBean bean : maps.values()) {
|
|
if (!bean.getCancel()) {
|
|
if (!bean.getCancel()) {
|
|
@@ -571,7 +561,7 @@ public class ExamReserveServiceImpl implements ExamReserveService {
|
|
info.setTimePeriodStart(timePeriod.getStartTime());
|
|
info.setTimePeriodStart(timePeriod.getStartTime());
|
|
info.setTimePeriodEnd(timePeriod.getEndTime());
|
|
info.setTimePeriodEnd(timePeriod.getEndTime());
|
|
|
|
|
|
- int availableCount = this.getApplyAvailableCount(examSiteId, timePeriod.getId());
|
|
|
|
|
|
+ int availableCount = applyTaskCacheService.getApplyAvailableCount(examSiteId, timePeriod.getId());
|
|
info.setAvailableCount(availableCount);
|
|
info.setAvailableCount(availableCount);
|
|
if (availableCount < 1) {
|
|
if (availableCount < 1) {
|
|
info.setStatus(ApplyStatus.FULL);
|
|
info.setStatus(ApplyStatus.FULL);
|