From f5b6e6625a0a4e3e080a6ff5d55fa65d0c0c48d4 Mon Sep 17 00:00:00 2001 From: lucas Date: Tue, 29 Apr 2025 21:30:50 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0=E5=B9=BF=E4=B8=9C?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=9F=BA=E7=A1=80=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adaptors/安心云es主题特征to广东省平台.go | 4 ++-- consumers/consumerAXYES2GDJKJC.go | 6 +++--- consumers/consumer_test.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/adaptors/安心云es主题特征to广东省平台.go b/adaptors/安心云es主题特征to广东省平台.go index d9878fb..772f1f8 100644 --- a/adaptors/安心云es主题特征to广东省平台.go +++ b/adaptors/安心云es主题特征to广东省平台.go @@ -33,7 +33,7 @@ func (the Adaptor_AXYES_GDJKJC) Transform(structId int64, factorId int, rawMsg s return nil } - Payload := the.EsAggTopToHBJCAS(structId, factorId, esAggDateHistogram) + Payload := the.EsAggTopToGDJKJC(structId, factorId, esAggDateHistogram) if len(Payload) == 0 { return needPush } @@ -44,7 +44,7 @@ func (the Adaptor_AXYES_GDJKJC) Transform(structId int64, factorId int, rawMsg s return needPush } -func (the Adaptor_AXYES_GDJKJC) EsAggTopToHBJCAS(structId int64, factorId int, esAggs HBJCAS.EsThemeAggDateHistogram) (result []byte) { +func (the Adaptor_AXYES_GDJKJC) EsAggTopToGDJKJC(structId int64, factorId int, esAggs HBJCAS.EsThemeAggDateHistogram) (result []byte) { buckets := esAggs.Aggregations.GroupSensor.Buckets if len(buckets) == 0 { log.Printf("[s=%d,f=%d] ,es agg数据数量==0", structId, factorId) diff --git a/consumers/consumerAXYES2GDJKJC.go b/consumers/consumerAXYES2GDJKJC.go index 0bb9f92..d9ad787 100644 --- a/consumers/consumerAXYES2GDJKJC.go +++ b/consumers/consumerAXYES2GDJKJC.go @@ -58,7 +58,7 @@ func (the *consumerAXYES2GDJKJC) InputInitial() error { for taskName, cron := range the.Info.Monitor { switch taskName { case "cron10min": - the.monitor.RegisterTask(cron, the.getEs10minAggData) + the.monitor.RegisterTask(cron, the.GetEs10minAggData) case "cron1hour": the.monitor.RegisterTask(cron, the.getEs1HourAggData) default: @@ -142,11 +142,11 @@ func (the *consumerAXYES2GDJKJC) getEs1HourAggData() { } -func (the *consumerAXYES2GDJKJC) getEs10minAggData() { +func (the *consumerAXYES2GDJKJC) GetEs10minAggData() { //utils.GetTimeRangeBy10min() 由于振动数据实时性问题 改用一小时统一上报 start, end := utils.GetTimeRangeByHour(-1) log.Printf("查询10min数据时间范围 %s - %s", start, end) - factorIds := []int{28, 592} //监测因素 592 -> 结构物[5222]隧道河北承德广仁岭隧道(上行) 的加速度三项监测 + factorIds := []int{28} //桥面振动 28 structIds := the.getStructIds() for _, structId := range structIds { for _, factorId := range factorIds { diff --git a/consumers/consumer_test.go b/consumers/consumer_test.go index bb36a7a..23ce333 100644 --- a/consumers/consumer_test.go +++ b/consumers/consumer_test.go @@ -268,6 +268,6 @@ func Test_GDJKJC(t *testing.T) { _consumerAXYES2GDJKJC := new(consumerAXYES2GDJKJC) _consumerAXYES2GDJKJC.Initial(configBody) //go _consumerGZGZM.RefreshTask() - + _consumerAXYES2GDJKJC.GetEs10minAggData() time.Sleep(2 * time.Second) }