From 57843c874fa45944f4ba1c8d5794b6d1ecfe9b63 Mon Sep 17 00:00:00 2001 From: lucas Date: Thu, 19 Sep 2024 15:12:14 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=8E=BB=E6=8E=89=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=E9=98=88=E5=80=BC=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- et_Info/InfoHandler.go | 21 +++++++++++++++------ node/go.mod | 1 - 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/et_Info/InfoHandler.go b/et_Info/InfoHandler.go index bd310a7..52a8259 100644 --- a/et_Info/InfoHandler.go +++ b/et_Info/InfoHandler.go @@ -34,20 +34,21 @@ func (the *InfoHandler) getStationInfo(p *common_models.ProcessData) *common_mod p.Stations = s } else { //无法查询到完整的 重新获取 + log.Printf("重获取设备[%s]的 DeviceStationObj", p.DeviceData.DeviceId) stationIds, err := the.configHelper.GetDeviceStationIds(p.DeviceData.DeviceId) if err != nil { - + log.Printf("GetDeviceStationIds err =>%s", err.Error()) } p.Stations, err = the.configHelper.GetStations(stationIds...) the.getFormulaInfo(p) + //补全 设备数据输入单位 + p.DeviceData.RawUnit = p.DeviceData.DeviceInfo.DeviceMeta.GetOutputUnit() + //存储测点obj err = the.configHelper.SetDeviceStationObjs(p.DeviceData.DeviceId, p.Stations) if err != nil { log.Printf("缓存异常 err=%s", err.Error()) } } - //补全 设备数据输入单位 - p.DeviceData.RawUnit = p.DeviceData.DeviceInfo.DeviceMeta.GetOutputUnit() - the.getThresholdInfo(p) return p } @@ -72,7 +73,15 @@ func (the *InfoHandler) getFormulaInfo(p *common_models.ProcessData) { func (the *InfoHandler) getThresholdInfo(p *common_models.ProcessData) { - for _, stationInfo := range p.Stations { - the.configHelper.GetStationThreshold(stationInfo.Info.Id) + for i, stationInfo := range p.Stations { + if stationInfo.Info.Id == 14 { + log.Println("==") + } + threshold, err := the.configHelper.GetStationThreshold(stationInfo.Info.Id) + if err == nil && threshold != nil && threshold.Items != nil { + //p.Stations[i].Threshold = threshold + log.Println("==", i) + } } + log.Println("=") } diff --git a/node/go.mod b/node/go.mod index 0291717..ec92bbf 100644 --- a/node/go.mod +++ b/node/go.mod @@ -43,7 +43,6 @@ require ( github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/klauspost/compress v1.17.7 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oapi-codegen/runtime v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect