修复设备缓存BUG

This commit is contained in:
谷成伟 2024-12-25 09:21:32 +08:00
parent 06978e9c7f
commit 5e7c8554f4

View File

@ -121,6 +121,12 @@ public class EquipmentCacheImpl implements EquipmentCache {
Integer index = deviceIdIndex.get(deviceId);
if (index != null) {
deviceInfoCaches.remove(index);
//重新刷新索引
for (int i = index; i < deviceInfoCaches.size(); i++) {
DeviceInfoCache deviceInfoCache = deviceInfoCaches.get(i);
deviceIdIndex.put(deviceInfoCache.getDeviceId(),i);
deviceCodeIndex.put(deviceInfoCache.getDeviceCode(),i);
}
}
}