| | |
| | | return false; |
| | | } |
| | | |
| | | String deviceIdStr = device.getDeviceId(); |
| | | String deviceIdStr = String.valueOf(device.getId()); |
| | | if (deviceIdStr == null || deviceIdStr.trim().isEmpty()) { |
| | | log.warn("设备配置中device_id字段为空: id={}", deviceId); |
| | | log.warn("设备配置中id字段为空: id={}", deviceId); |
| | | return false; |
| | | } |
| | | |
| | |
| | | } |
| | | try { |
| | | DeviceConfig device = deviceConfigService.getDeviceById(deviceConfigId); |
| | | if (device == null || device.getDeviceId() == null) { |
| | | if (device == null || device.getId() == null) { |
| | | return null; |
| | | } |
| | | return getLatestByDeviceId(device.getDeviceId()); |
| | | return getLatestByDeviceId(String.valueOf(device.getId())); |
| | | } catch (Exception e) { |
| | | log.error("根据设备配置ID获取设备状态失败: deviceConfigId={}", deviceConfigId, e); |
| | | return null; |