This commit is contained in:
2025-01-22 14:23:00 +08:00
parent f670fb2f91
commit 38c4b553bc
17 changed files with 178 additions and 131 deletions

View File

@@ -101,12 +101,11 @@ public class DeviceServiceImpl implements DeviceService {
}
if (reqVo.getDevices() != null && !reqVo.getDevices().isEmpty()) {
for (WvpSyncReqVo.DeviceItem deviceItem : reqVo.getDevices()) {
DeviceEntity device = deviceMapper.getByDeviceNo(deviceItem.getDeviceNo());
DeviceEntity device = deviceRepository.getDeviceByDeviceNo(deviceItem.getDeviceNo());
if (device != null) {
device.setOnline(deviceItem.getOnline());
device.setKeepaliveAt(deviceItem.getKeepaliveAt());
deviceMapper.updateEntity(device);
deviceRepository.clearDeviceCache(device.getId());
deviceRepository.updateOnlineStatus(device.getId(), null, 1, deviceItem.getKeepaliveAt());
}
}
}