From ebc3bc6bcda54eee67a5f55130f26c1f75007413 Mon Sep 17 00:00:00 2001 From: lucas Date: Fri, 22 Aug 2025 10:26:54 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20//=E8=BF=87=E6=BB=A4=E8=AF=8A?= =?UTF-8?q?=E6=96=AD=E6=95=B0=E6=8D=AE=20=20wjh=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adaptors/安心云最新设备数据toES.go | 8 ++++++++ consumers/consumerAXYraw.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/adaptors/安心云最新设备数据toES.go b/adaptors/安心云最新设备数据toES.go index ad2d9e2..40b7c6f 100644 --- a/adaptors/安心云最新设备数据toES.go +++ b/adaptors/安心云最新设备数据toES.go @@ -25,6 +25,14 @@ func (the Adaptor_AXY_LastRAW) Transform(topic, rawMsg string) *models.EsRaw { log.Printf("反序列化 异常 dev数据=%s", rawMsg) return nil } + + //过滤诊断数据 + if v, ok := iotaData.Data.Data["_data_type"]; ok { + if v == "diag" { + return nil + } + } + if iotaData.DeviceId == the.TagDeviceId { log.Printf("--> Transform 标记设备数据 [%s] %s ", iotaData.DeviceId, rawMsg) } diff --git a/consumers/consumerAXYraw.go b/consumers/consumerAXYraw.go index e6de74f..b0c3cf4 100644 --- a/consumers/consumerAXYraw.go +++ b/consumers/consumerAXYraw.go @@ -161,8 +161,8 @@ func (the *consumerAXYraw) onData(topic string, msg string) bool { } the.dataCache <- needPush } else { - s, _ := json.Marshal(needPush) if needPush != nil { + s, _ := json.Marshal(needPush) if needPush.IotaDevice == logTagDeviceId { log.Printf("onData 设备[%s] 异常needPush= %s", needPush.IotaDevice, s) }