From 9a6fe84b39b6ee1c5debe6a425ea3d094a69f1bd Mon Sep 17 00:00:00 2001 From: lucas Date: Tue, 14 Jan 2025 09:26:22 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=B7=BB=E5=8A=A0=20=E7=A9=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...心云es主题特征to河北公路设施监测.go | 10 +++++++--- consumers/consumerHBJCAS.go | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/adaptors/安心云es主题特征to河北公路设施监测.go b/adaptors/安心云es主题特征to河北公路设施监测.go index 05219c2..d3c4a93 100644 --- a/adaptors/安心云es主题特征to河北公路设施监测.go +++ b/adaptors/安心云es主题特征to河北公路设施监测.go @@ -27,8 +27,14 @@ func (the Adaptor_AXYES_HBGL) Transform(structId int64, factorId int, rawMsg str if err != nil { return nil } + + Payload := the.EsAggTopToHBJCAS(structId, factorId, esAggDateHistogram) + if len(Payload) == 0 { + return needPush + } + needPush = append(needPush, NeedPush{ - Payload: the.EsAggTopToHBJCAS(structId, factorId, esAggDateHistogram), + Payload: Payload, }) return needPush } @@ -64,10 +70,8 @@ func (the Adaptor_AXYES_HBGL) EsAggTopToHBJCAS(structId int64, factorId int, esA UniqueCode: strconv.FormatInt(uniqueCode, 10), //乃积沟大桥 DataBody: the.EsAgg2StatisticData(factorId, monitorCode, dateBucket), } - complexData.SensorData = append(complexData.SensorData, dataDefinition) } - } result, _ = proto.Marshal(complexData) diff --git a/consumers/consumerHBJCAS.go b/consumers/consumerHBJCAS.go index be1bc2c..a88b54b 100644 --- a/consumers/consumerHBJCAS.go +++ b/consumers/consumerHBJCAS.go @@ -106,7 +106,7 @@ func (the *consumerHBJCAS) getStructIds() []int64 { func (the *consumerHBJCAS) getEsData() { start, end := utils.GetTimeRangeByHour(-1) log.Printf("查询数据时间范围 %s - %s", start, end) - hourFactorIds := []int{15, 20} //, "28" + hourFactorIds := []int{20} //, 15, 20 , 28 structIds := the.getStructIds() for _, structId := range structIds { for _, factorId := range hourFactorIds {