|
@@ -238,14 +238,14 @@ public class TimePeriodExamRoomServiceImpl extends ServiceImpl<TimePeriodExamRoo
|
|
|
throw new StatusException("保存失败,未找到考点");
|
|
|
}
|
|
|
|
|
|
- String lockKey = String.format(CacheConstants.LOCK_EXAM_SITE_CAPACITY, examRoom.getExamSiteId());
|
|
|
+ /*String lockKey = String.format(CacheConstants.LOCK_EXAM_SITE_CAPACITY, examRoom.getExamSiteId());
|
|
|
if (concurrentService.isLocked(lockKey)) {
|
|
|
log.warn("[考场排班设置]考点剩余可约数量更新中,不允许操作修改!lockKey:{}", lockKey);
|
|
|
throw new StatusException("系统正在更新可预约数量,不允许保存");
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
//考点容量变更锁
|
|
|
- String examSiteLockKey = String.format(CacheConstants.LOCK_EXAM_SITE_CHANGE_CAPACITY, examRoom.getExamSiteId());
|
|
|
+ String examSiteLockKey = String.format(CacheConstants.LOCK_EXAM_SITE_CAPACITY, examRoom.getExamSiteId());
|
|
|
RLock examSiteLock = (RLock) concurrentService.getLock(examSiteLockKey);
|
|
|
|
|
|
try {
|
|
@@ -343,7 +343,7 @@ public class TimePeriodExamRoomServiceImpl extends ServiceImpl<TimePeriodExamRoo
|
|
|
// 关闭之后的剩余容量
|
|
|
int remainCount = oldCount - examRoom.getCapacity();
|
|
|
|
|
|
- log.warn("haveApplyCount:{}, remainCount:{}", haveApplyCount, remainCount);
|
|
|
+ log.warn("availableCount:{}, oldCount:{}, haveApplyCount:{}, remainCount:{}", availableCount, oldCount, haveApplyCount, remainCount);
|
|
|
|
|
|
if (haveApplyCount > remainCount) {
|
|
|
TimePeriodEntity timePeriod = timePeriodService.getById(toUpdate.getTimePeriodId());
|
|
@@ -382,14 +382,17 @@ public class TimePeriodExamRoomServiceImpl extends ServiceImpl<TimePeriodExamRoo
|
|
|
int oldCapacity = oldCapacityMap.getOrDefault(timePeriodId, 0);
|
|
|
int newCapacity = examSiteService.getExamSiteTimePeriodCapacity(examSiteCacheBean.getExamSiteId(), timePeriodId);
|
|
|
|
|
|
- log.warn("[考场排班设置] 刷新缓存,timePeriodId:{},oldCapacity:{},newCapacity:{}", timePeriodId, oldCapacity, newCapacity);
|
|
|
|
|
|
- applyTaskCacheService.refreshApplyAvailableCountCache(
|
|
|
- examRoom.getExamSiteId(),
|
|
|
- timePeriodId,
|
|
|
- oldCapacity,
|
|
|
- newCapacity
|
|
|
- );
|
|
|
+ if(oldCapacity != newCapacity) {
|
|
|
+ log.warn("[考场排班设置] 刷新缓存,timePeriodId:{},oldCapacity:{},newCapacity:{}", timePeriodId, oldCapacity, newCapacity);
|
|
|
+ applyTaskCacheService.refreshApplyAvailableCountCache(
|
|
|
+ examRoom.getExamSiteId(),
|
|
|
+ timePeriodId,
|
|
|
+ oldCapacity,
|
|
|
+ newCapacity
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|