|
@@ -329,8 +329,9 @@ public class ApplyTaskCacheService implements CacheConstants {
|
|
|
|
|
|
// 获取某考点某时段的“已预约数量”(仅查数据库会有误差,需等预约队列中全部完成数据库持久化后再执行!!!)
|
|
|
int finishCount = studentApplyService.countApplyFinishForExamSiteAndTimePeriod(examSite.getExamSiteId(), timePeriod.getId());
|
|
|
+ int capacity = examSiteService.getExamSiteTimePeriodCapacity(examSite.getExamSiteId(), timePeriod.getId());
|
|
|
// 剩余可约数量
|
|
|
- int availableCount = Math.max(examSite.getCapacity() - finishCount, 0);
|
|
|
+ int availableCount = Math.max(capacity - finishCount, 0);
|
|
|
RAtomicLong atomic = redisClient.getRedissonClient().getAtomicLong(cacheKey);
|
|
|
atomic.set(availableCount);
|
|
|
log.warn("{}考点时段剩余可约数量:{} {}", existCache ? "更新" : "初始", availableCount, cacheKey);
|
|
@@ -378,8 +379,9 @@ public class ApplyTaskCacheService implements CacheConstants {
|
|
|
|
|
|
// 获取某考点某时段的“已预约数量”
|
|
|
int finishCount = studentApplyService.countApplyFinishForExamSiteAndTimePeriod(examSite.getExamSiteId(), timePeriodId);
|
|
|
+ int capacity = examSiteService.getExamSiteTimePeriodCapacity(examSite.getExamSiteId(), timePeriodId);
|
|
|
// 剩余可约数量
|
|
|
- int availableCount = Math.max(examSite.getCapacity() - finishCount, 0);
|
|
|
+ int availableCount = Math.max(capacity - finishCount, 0);
|
|
|
RAtomicLong atomic = redisClient.getRedissonClient().getAtomicLong(cacheKey);
|
|
|
atomic.set(availableCount);
|
|
|
log.warn("初始考点时段剩余可约数量:{} {}", availableCount, cacheKey);
|