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 {