From 82fe313b19f595be6d96758a39608961f4a15859 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Sun, 12 Apr 2026 20:42:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=A7=E5=88=B6=E5=99=A8=E4=B8=8D?= =?UTF-8?q?=E6=8A=A5=E8=AD=A6=EF=BC=8C=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/intc/iot/handler/DeviceDataHandler.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/intc-modules/intc-iot/src/main/java/com/intc/iot/handler/DeviceDataHandler.java b/intc-modules/intc-iot/src/main/java/com/intc/iot/handler/DeviceDataHandler.java index 5af8d08..2c802a8 100644 --- a/intc-modules/intc-iot/src/main/java/com/intc/iot/handler/DeviceDataHandler.java +++ b/intc-modules/intc-iot/src/main/java/com/intc/iot/handler/DeviceDataHandler.java @@ -229,14 +229,14 @@ public class DeviceDataHandler { try { // 如果是控制器,需要区分处理 if (isController) { + // 控制器故障码处理(独立于开关数据判断,确保只有故障码时也能处理) + if (params.containsKey("errorCode")) { + handleControllerErrorCode(deviceName, params); + } // 判断数据类型(开关数据和传感器数据不会同时出现) if (hasSwitchData(params)) { // 开关数据:更新开关状态和电压电流 handleSwitchData(deviceName, params); - // 控制器故障码处理(C# itemController.errorCode) - if (params.containsKey("errorCode")) { - handleControllerErrorCode(deviceName, params); - } } else if (hasSensorData(params)) { // 传感器数据:写入TDengine sensorData = convertToSensorData(productKey, deviceName, params);