| | |
| | | |
| | | // 根据设备类型,提取关键数据并更新上下文 |
| | | if (DeviceConfig.DeviceType.LOAD_VEHICLE.equals(fromDevice.getDeviceType())) { |
| | | // 上大车设备完成,传递玻璃ID列表 |
| | | // 大车设备完成,传递玻璃ID列表 |
| | | Object glassIds = data.get("glassIds"); |
| | | if (glassIds instanceof List) { |
| | | @SuppressWarnings("unchecked") |
| | | List<String> ids = (List<String>) glassIds; |
| | | context.setLoadedGlassIds(new ArrayList<>(ids)); |
| | | log.info("上大车设备数据传递: fromDevice={}, toDevice={}, glassIds={}", |
| | | log.info("大车设备数据传递: fromDevice={}, toDevice={}, glassIds={}", |
| | | fromDevice.getDeviceCode(), toDevice.getDeviceCode(), ids); |
| | | } |
| | | } else if (DeviceConfig.DeviceType.LARGE_GLASS.equals(fromDevice.getDeviceType())) { |
| | |
| | | // 检查设备类型特定的依赖 |
| | | String deviceType = device.getDeviceType(); |
| | | if (DeviceConfig.DeviceType.LARGE_GLASS.equals(deviceType)) { |
| | | // 大理片设备需要上大车设备先完成 |
| | | // 大理片设备需要大车设备先完成 |
| | | List<String> loadedGlassIds = context.getSafeLoadedGlassIds(); |
| | | if (CollectionUtils.isEmpty(loadedGlassIds)) { |
| | | missingDependencies.add("上大车设备未完成,缺少玻璃ID列表"); |
| | | } |
| | | } else if (DeviceConfig.DeviceType.GLASS_STORAGE.equals(deviceType)) { |
| | | // 玻璃存储设备需要大理片设备先完成(优先),或上大车设备完成 |
| | | List<String> processedGlassIds = context.getSafeProcessedGlassIds(); |
| | | List<String> loadedGlassIds = context.getSafeLoadedGlassIds(); |
| | | if (CollectionUtils.isEmpty(processedGlassIds) && CollectionUtils.isEmpty(loadedGlassIds)) { |
| | | missingDependencies.add("前置设备未完成,缺少玻璃ID列表"); |
| | | missingDependencies.add("大车设备未完成,缺少玻璃ID列表"); |
| | | } |
| | | } |
| | | // 其他设备类型暂不需要依赖检查 |
| | | |
| | | // 检查设备配置中的依赖关系(从extraParams中读取) |
| | | Map<String, Object> deviceDependencies = getDeviceDependencies(device); |