From d7f9e719911961df8d04f14f7a3c261b401f0016 Mon Sep 17 00:00:00 2001 From: yfh Date: Tue, 12 Nov 2024 15:17:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=8E=89=E7=A9=BA=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- et_calc/group/groupCalc.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/et_calc/group/groupCalc.go b/et_calc/group/groupCalc.go index 420d8c9..d6513f1 100644 --- a/et_calc/group/groupCalc.go +++ b/et_calc/group/groupCalc.go @@ -43,10 +43,12 @@ func GetGroupInfo(station common_models.Station) []GroupStation { result := make([]GroupStation, 0) if gps != nil { for i := 0; i < len(gps); i++ { - result = append(result, GroupStation{ - Group: gps[i], - Station: station, - }) + if gps[i].Id != 0 { + result = append(result, GroupStation{ + Group: gps[i], + Station: station, + }) + } } } @@ -91,9 +93,12 @@ func (gc *GroupCalc) processData(inData *common_models.ProcessData) *common_mode resultStations = append(resultStations, station) } else { calcRet, err := gc.cacheAndCalc(&station, inData.DeviceData.DimensionId, inData.DeviceData.TaskId, inData.DeviceData.AcqTime) + if err == nil { log.Printf("************* 95行 沉降分组计算成功,返回记录数 len(calcRet)={%d} *************", len(calcRet)) resultStations = append(resultStations, calcRet...) + } else { + println(err) } log.Printf("************* 98行 分组一次处理,缓存记录数 len(resultStations)={%d} *************", len(resultStations)) } @@ -104,15 +109,16 @@ func (gc *GroupCalc) processData(inData *common_models.ProcessData) *common_mode for _, station := range resultStations { if len(station.Data.ThemeData) > 0 { ////TODO #TEST BEGIN | filterSensorIds 需要排查的测点ID,主要排查分组测点主题数据未入ES的问题。 - //filterSensorIds := []int{42, 15, 32, 43, 13, 33, 17, 14} + //filterSensorIds := []int{18, 20, 21} //for _, number := range filterSensorIds { // if number == station.Info.Id { - // log.Printf("*************** 116行 沉降分组测点有返回 %v %v %v %+v *************", station.Info.Id, station.Info.Name, station.Data.CollectTime, station.Data) + // log.Printf("*************** 110行 沉降分组测点有返回 %v %v %v %+v *************", station.Info.Id, station.Info.Name, station.Data.CollectTime, station.Data) // break // } //} //// #TEST END // 需要返回的测点 + //log.Printf("*************** 121行 沉降分组测点有返回 %v %v %v %+v *************", station.Info.Id, station.Info.Name, station.Data.CollectTime, station.Data) result = append(result, station) } else { @@ -199,7 +205,8 @@ func (gc *GroupCalc) cacheAndCalc(station *common_models.Station, dimensionId st gc.dumpGroupTheme(task, calcRet) } else { task.SetTimeout() - log.Println("****沉降分组计算任务超期策略dimensionId,taskId,acqTime,injectTime,deadlineTime****", task.stationGroup.Id, task.stationGroup.Name, task.dimensionId, task.taskId, task.acqTime, task.InjectTime, task.DeadlineTime) + log.Printf("****[%d][%s]沉降分组计算任务超期策略: dimensionId:%v\n taskId:%v\n acqTime:%v\n injectTime:%v\n deadlineTime:%v\n", + task.stationGroup.Id, task.stationGroup.Name, task.dimensionId, task.taskId, task.acqTime, task.InjectTime, task.DeadlineTime) calcTasks.Store(key, *task) } }