This commit is contained in:
parent
770fed6d7b
commit
a83ea68751
|
|
@ -236,12 +236,22 @@ public class SynService {
|
|||
|
||||
// 获取机场挂载的无人机SN号
|
||||
Optional<String> subDeviceSnOpt = attributes.get(DeviceAttributes.SUB_DEVICE_SN);
|
||||
log.info("机场 {} 的 sub_device.device_sn 属性: {}", deviceName,
|
||||
subDeviceSnOpt.isPresent() ? subDeviceSnOpt.get() : "不存在或为空");
|
||||
|
||||
if (subDeviceSnOpt.isPresent() && StringUtils.hasText(subDeviceSnOpt.get())) {
|
||||
String aircraftSn = subDeviceSnOpt.get();
|
||||
log.info("机场 {} 尝试查找无人机: aircraftSn={}", deviceName, aircraftSn);
|
||||
|
||||
Device aircraftDevice = findDeviceBySn(aircraftSn);
|
||||
if (aircraftDevice != null) {
|
||||
log.info("找到无人机设备: aircraftSn={}, deviceId={}", aircraftSn, aircraftDevice.getDeviceId());
|
||||
syncDockAircraft(deviceId, aircraftDevice.getDeviceId());
|
||||
} else {
|
||||
log.warn("未找到无人机设备: aircraftSn={}, 可能无人机尚未同步", aircraftSn);
|
||||
}
|
||||
} else {
|
||||
log.warn("机场 {} 没有 sub_device.device_sn 属性,无法建立机场-无人机关联", deviceName);
|
||||
}
|
||||
} else if (deviceType == DeviceType.AIRCRAFT) {
|
||||
// 无人机:同步无人机表
|
||||
|
|
|
|||
Loading…
Reference in New Issue