From d07e1977dc51674aa1193d3e1d13906ed3c88e97 Mon Sep 17 00:00:00 2001 From: lucas Date: Thu, 19 Sep 2024 17:25:37 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=B7=B3=E8=BF=87=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=B7=A5=E5=85=B7=E7=9A=84=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- et_calc/dataCalc.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/et_calc/dataCalc.go b/et_calc/dataCalc.go index a6c4310..93f0e0d 100644 --- a/et_calc/dataCalc.go +++ b/et_calc/dataCalc.go @@ -107,11 +107,16 @@ func (the *CalcHandler) calcFormula(p *common_models.ProcessData) *common_models log.Printf("设备[%s]字段[%s]无绑定的监测原型[%s-%s] 字段输出", device.IotaDeviceId, inK, protoObj.Name, protoObj.Code) continue } + outUnit := protoObj.GetProtoItem(outKey).UnitName k := the.unitHelper.GetUnitTransK(inUnit, outUnit) if v, ok := inV.(float64); ok { outMap[outKey] = common_calc.Decimal(v*k, 5) } else { + if inV == "nil" { + //数据模拟工具出现的称重 lane异常值 跳过 + continue + } outMap[outKey] = inV }