Commit 19dddbd5 by 罗志长

fix: 设备上线时间差

parent 035ba6b5
...@@ -870,6 +870,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -870,6 +870,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
platRoomBedDeviceService.remove(new QueryWrapper<PlatRoomBedDevice>().lambda() platRoomBedDeviceService.remove(new QueryWrapper<PlatRoomBedDevice>().lambda()
.in(PlatRoomBedDevice::getDeviceId,deviceIdList) .in(PlatRoomBedDevice::getDeviceId,deviceIdList)
.eq(BaseBusEntity::getTenantId, platTenant.getId())); .eq(BaseBusEntity::getTenantId, platTenant.getId()));
// 删除缓存里的设备
newPlatformDeviceIdSet.forEach(deviceId -> {
String key = RedisConst.PLAT_OWN_IOT_DEVICE_ID + deviceId;
RedisUtil.delete(key);
});
} }
if (CollectionUtils.isEmpty(iotDeviceIdSet)) { if (CollectionUtils.isEmpty(iotDeviceIdSet)) {
continue; continue;
......
...@@ -49,10 +49,6 @@ public class DeviceCacheUtil implements ApplicationRunner { ...@@ -49,10 +49,6 @@ public class DeviceCacheUtil implements ApplicationRunner {
if(RedisUtil.exist(key)){ if(RedisUtil.exist(key)){
RedisUtil.delete(RedisConst.PLAT_IOT_DEVICE_PREFIX + platDevice.getOriDeviceId()+":"+platTenant.getIotOrgId()); RedisUtil.delete(RedisConst.PLAT_IOT_DEVICE_PREFIX + platDevice.getOriDeviceId()+":"+platTenant.getIotOrgId());
} }
String key1 = RedisConst.PLAT_OWN_IOT_DEVICE_ID + platDevice.getOriDeviceId();
if(RedisUtil.exist(key1)){
RedisUtil.delete(key1);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment