|
@@ -301,18 +301,19 @@ public class TimePeriodExamRoomServiceImpl extends ServiceImpl<TimePeriodExamRoo
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- ExamSiteEntity examSite = examSiteService.getById(examSiteCacheBean.getExamSiteId());
|
|
+ int availableCount, haveApplyCount, oldCount;
|
|
- int availableCount, haveApplyCount;
|
|
|
|
for (TimePeriodExamRoomEntity toUpdate : toBeUpdated) {
|
|
for (TimePeriodExamRoomEntity toUpdate : toBeUpdated) {
|
|
-
|
|
+ TimePeriodExamSiteBean bean = existingMap.get(toUpdate.getId());
|
|
- if (!toUpdate.getEnable()) {
|
|
+
|
|
|
|
+ if (bean != null && bean.getEnable() && !toUpdate.getEnable()) {
|
|
|
|
|
|
availableCount = applyTaskCacheService.getApplyAvailableCount(examSiteCacheBean.getExamSiteId(), toUpdate.getTimePeriodId());
|
|
availableCount = applyTaskCacheService.getApplyAvailableCount(examSiteCacheBean.getExamSiteId(), toUpdate.getTimePeriodId());
|
|
|
|
+
|
|
|
|
+ oldCount = oldCapacityMap.getOrDefault(toUpdate.getTimePeriodId(), 0);
|
|
|
|
|
|
- haveApplyCount = examSite.getCapacity() - availableCount;
|
|
+ haveApplyCount = oldCount - availableCount;
|
|
-
|
|
+
|
|
- Integer capacity = oldCapacityMap.get(toUpdate.getTimePeriodId());
|
|
+ int remainCount = oldCount - examRoom.getCapacity();
|
|
- int remainCount = capacity - examRoom.getCapacity();
|
|
|
|
if (haveApplyCount > remainCount) {
|
|
if (haveApplyCount > remainCount) {
|
|
TimePeriodEntity timePeriod = timePeriodService.getById(toUpdate.getTimePeriodId());
|
|
TimePeriodEntity timePeriod = timePeriodService.getById(toUpdate.getTimePeriodId());
|
|
String dateStr = DateUtil.getShortDateByLongTime(timePeriod.getStartTime());
|
|
String dateStr = DateUtil.getShortDateByLongTime(timePeriod.getStartTime());
|