Browse Source

恢复公式获取

dev
yfh 4 weeks ago
parent
commit
34926c934e
  1. 2
      containerApp/go.mod
  2. 24
      et_Info/InfoHandler.go

2
containerApp/go.mod

@ -2,7 +2,7 @@ module containerApp
go 1.23.1 go 1.23.1
require gitea.anxinyun.cn/container/common_utils v0.0.8 require gitea.anxinyun.cn/container/common_utils v0.0.9
require ( require (
github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect

24
et_Info/InfoHandler.go

@ -69,23 +69,23 @@ func (the *InfoHandler) getFormulaInfo(p *common_models.ProcessData) {
if err != nil { if err != nil {
panic(err) panic(err)
} }
//for i2, device := range p.Stations[i].Info.Devices { for i2, device := range p.Stations[i].Info.Devices {
// formulaInfo, err := the.configHelper.GetFormulaInfo(device.FormulaId) formulaInfo, err := the.configHelper.GetFormulaInfo(device.FormulaId)
// if err == nil {
// p.Stations[i].Info.Devices[i2].FormulaInfo = formulaInfo
// p.Stations[i].Info.Devices[i2].DeviceFactorProto = deviceFactorProto
// }
//}
// TODO #TEST BEGIN 2024-10-01 测点设备没有公式信息,测试时先从设备监测原型中获取
for i2, _ := range p.Stations[i].Info.Devices {
p.Stations[i].Info.Devices[i2].FormulaId = deviceFactorProto.Formula
formulaInfo, err := the.configHelper.GetFormulaInfo(deviceFactorProto.Formula)
if err == nil { if err == nil {
p.Stations[i].Info.Devices[i2].FormulaInfo = formulaInfo p.Stations[i].Info.Devices[i2].FormulaInfo = formulaInfo
p.Stations[i].Info.Devices[i2].DeviceFactorProto = deviceFactorProto p.Stations[i].Info.Devices[i2].DeviceFactorProto = deviceFactorProto
} }
} }
// TODO #TEST BEGIN 2024-10-01 测点设备没有公式信息,测试时先从设备监测原型中获取
//for i2, _ := range p.Stations[i].Info.Devices {
// p.Stations[i].Info.Devices[i2].FormulaId = deviceFactorProto.Formula
// formulaInfo, err := the.configHelper.GetFormulaInfo(deviceFactorProto.Formula)
// if err == nil {
// p.Stations[i].Info.Devices[i2].FormulaInfo = formulaInfo
// p.Stations[i].Info.Devices[i2].DeviceFactorProto = deviceFactorProto
// }
//}
// #TEST END // #TEST END
} }
} }

Loading…
Cancel
Save