diff --git a/dataSource/kafka/iotaData.go b/dataSource/kafka/iotaData.go index a1e0b1f..4d2fc59 100644 --- a/dataSource/kafka/iotaData.go +++ b/dataSource/kafka/iotaData.go @@ -14,6 +14,7 @@ func (h IotaDataHandler) HandleMessage(message string) bool { rawData := common_models.IotaData{} err := json.Unmarshal([]byte(message), &rawData) if err != nil { + log.Printf("[dataSource/kafka/iotaData/IotaHandler] Parse msg error: %v", err) return false } log.Printf("handler 处理[%s|%s]消息", rawData.DeviceId, rawData.TriggerTime) diff --git a/et_analyze/aggThreshold.go b/et_analyze/aggThreshold.go index a69e4da..43f7350 100644 --- a/et_analyze/aggThreshold.go +++ b/et_analyze/aggThreshold.go @@ -121,7 +121,7 @@ func (t *AggThresholdHandler) judgeThreshold(aggData *common_models.AggData) *co overThresholdItem := aggThreshold.FindThresholdInRange(protoItemThs, val) if overThresholdItem != nil { // content 格式如:应变的10分钟聚集变化率:-0.60με,超1级阈值[-1~-0.5] - content := fmt.Sprintf("%s的%s变化率:%.2f%s,超%d级阈值[%s]", protoItem.Name, aggTypeStr, val, protoItem.UnitName, overThresholdItem.Level, overThresholdItem.RangeText()) + content := fmt.Sprintf("%s的%s变化率:%f%s,超%d级阈值[%s]", protoItem.Name, aggTypeStr, val, protoItem.UnitName, overThresholdItem.Level, overThresholdItem.RangeText()) ls = append(ls, common_models.ThresholdAlarmDetail{Level: overThresholdItem.Level, Content: content}) } //log.Printf("[aggThreshold judgeThreshold] 测点[sensorId: %d] fieldName: %s, ChangedVal (float64): %f\n", aggData.SensorId, fieldName, val) diff --git a/et_analyze/threshold.go b/et_analyze/threshold.go index 06886a3..f5fb421 100644 --- a/et_analyze/threshold.go +++ b/et_analyze/threshold.go @@ -97,7 +97,7 @@ func (t *ThresholdHandler) judgeThreshold(station *common_models.Station) *commo overThresholdItem := station.Threshold.FindThresholdInRange(protoItemThs, val) if overThresholdItem != nil { // content 格式如:1:湿度采集值:13.50%RH,超1级阈值[6~16] - content := fmt.Sprintf("%s采集值:%.2f%s,超%d级阈值[%s]", protoItem.Name, val, protoItem.UnitName, overThresholdItem.Level, overThresholdItem.RangeText()) + content := fmt.Sprintf("%s采集值:%f%s,超%d级阈值[%s]", protoItem.Name, val, protoItem.UnitName, overThresholdItem.Level, overThresholdItem.RangeText()) ls = append(ls, common_models.ThresholdAlarmDetail{Level: overThresholdItem.Level, Content: content}) } //fmt.Printf("[threshold judgeThreshold] 测点[%d-%s] fieldName: %s, ThemeVal (float64): %f\n", station.Info.Id, station.Info.Name, fieldName, val) diff --git a/et_calc/dataCalc.go b/et_calc/dataCalc.go index 4805a80..19214a9 100644 --- a/et_calc/dataCalc.go +++ b/et_calc/dataCalc.go @@ -111,7 +111,7 @@ func (the *CalcHandler) calcFormula(p *common_models.ProcessData) *common_models outUnit := protoObj.GetProtoItem(outKey).UnitName k := the.unitHelper.GetUnitTransK(inUnit, outUnit) if v, ok := inV.(float64); ok { - outMap[outKey] = common_calc.Decimal(v*k, 5) + outMap[outKey] = common_calc.Decimal(v*k, 6) } else { if inV == "nil" { //数据模拟工具出现的称重 lane异常值 跳过 diff --git a/master/app/et_master.go b/master/app/et_master.go index a6ba235..5ef31f7 100644 --- a/master/app/et_master.go +++ b/master/app/et_master.go @@ -198,7 +198,8 @@ func (the *EtMaster) callNodeService(node *NodeRpc, data common_models.IDataTrac the.errorHandle(errorCode, node.args.Addr, fmt.Sprintf("%s|%s", data.R(), data.T())) } else { //log.Printf("node[%s]node处理后回复true。处理成功的数据*** %+v *** \n\n", node.args.Addr, data.R(), data.T()) - log.Printf("RPC[%s]node已处理的数据errorCode=%d *** %+v *** \n\n", serviceMethod, errorCode, v) + //log.Printf("RPC[%s]node已处理的数据errorCode=%d *** %+v *** \n\n", serviceMethod, errorCode, v) + log.Printf("****** RPC[%s]node已处理的数据errorCode=%d ****** \n\n", serviceMethod, errorCode) } }