diff --git a/adaptors/振动to江苏省农村公路桥梁监测.go b/adaptors/振动to江苏省农村公路桥梁监测.go new file mode 100644 index 0000000..c2a5cea --- /dev/null +++ b/adaptors/振动to江苏省农村公路桥梁监测.go @@ -0,0 +1,94 @@ +package adaptors + +import ( + "bytes" + "encoding/binary" + "encoding/json" + "fmt" + "goInOut/models" + "goInOut/utils" + "log" + "time" +) + +// Adaptor_ZD_JSNCGLQL 数据 转换 江苏农村公路桥梁监测系统 +type Adaptor_ZD_JSNCGLQL struct { + IdMap map[string]string +} + +func (the Adaptor_ZD_JSNCGLQL) Transform(inTopic, rawMsg string) []NeedPush { + zd := models.ZD{} + err := json.Unmarshal([]byte(rawMsg), &zd) + if err != nil { + return nil + } + return the.ZDtoJSNCGLQL(zd) +} + +func (the Adaptor_ZD_JSNCGLQL) ZDtoJSNCGLQL(zd models.ZD) (result []NeedPush) { + Atime := time.UnixMilli(zd.Ticks) + + sensorDataList := zd.AccValues + //获取对方系统 id + sensorCode := the.getSensorCode(zd.Module) + if sensorCode == "" { + log.Printf("振动 设备[%s] 无匹配的 江苏农村公路桥梁监测系统 测点id,请检查配置文件", zd.Module) + return + } + + //todo 桥梁编码 + bridgeCode := sensorCode + topic := fmt.Sprintf("data/%s/%s", bridgeCode, sensorCode) + //数据秒数 + seconds := len(zd.AccValues) / zd.Frequency + + for i := 0; i < seconds; i++ { + var transBytes []byte + onceTime := Atime.Add(time.Duration(i) * time.Second) + //1.添加时间段 + transBytes = append(transBytes, the.getTimeBytes(onceTime)...) + + startIndex := (0 + i) * zd.Frequency + endIndex := (1 + i) * zd.Frequency + subDataList := sensorDataList[startIndex:endIndex] + + for _, sensorData := range subDataList { + + //4.添加数据值段 + bs := utils.Float32ToBytes(sensorData) + transBytes = append(transBytes, bs...) + } + result = append(result, NeedPush{ + Topic: topic, + Payload: transBytes, + }) + } + + return result +} + +func (the Adaptor_ZD_JSNCGLQL) getSensorCode(rawSensorName string) string { + v, isValid := the.IdMap[rawSensorName] + if !isValid { + v = "" + } + return v +} + +func (the Adaptor_ZD_JSNCGLQL) getTimeBytes(sensorTime time.Time) []byte { + + year := uint16(sensorTime.Year()) + month := int8(sensorTime.Month()) + day := int8(sensorTime.Day()) + hour := int8(sensorTime.Hour()) + minute := int8(sensorTime.Minute()) + second := int8(sensorTime.Second()) + bytesBuffer := bytes.NewBuffer([]byte{}) + binary.Write(bytesBuffer, binary.BigEndian, year) + binary.Write(bytesBuffer, binary.BigEndian, month) + binary.Write(bytesBuffer, binary.BigEndian, day) + binary.Write(bytesBuffer, binary.BigEndian, hour) + binary.Write(bytesBuffer, binary.BigEndian, minute) + binary.Write(bytesBuffer, binary.BigEndian, second) + return bytesBuffer.Bytes() +} diff --git a/adaptors/统一采集to江苏省农村公路桥梁监测.go b/adaptors/统一采集to江苏省农村公路桥梁监测.go index 97f527b..38e5fd0 100644 --- a/adaptors/统一采集to江苏省农村公路桥梁监测.go +++ b/adaptors/统一采集to江苏省农村公路桥梁监测.go @@ -11,12 +11,12 @@ import ( "time" ) -// Adaptor_TYCJ_JSNCGLQL 统一采集软件数据 转换 江苏农村公路桥梁监测系统 +// Adaptor_TYCJ_JSNCGLQL 数据 转换 江苏农村公路桥梁监测系统 type Adaptor_TYCJ_JSNCGLQL struct { IdMap map[string]string } -func (the Adaptor_TYCJ_JSNCGLQL) Transform(rawMsg string) []NeedPush { +func (the Adaptor_TYCJ_JSNCGLQL) Transform(inTopic, rawMsg string) []NeedPush { tycj := models.TYCJ{} json.Unmarshal([]byte(rawMsg), &tycj) return the.TYCJtoJSNCGLQL(tycj) diff --git a/consumers/consumerJSNCGLQL.go b/consumers/consumerJSNCGLQL.go index 11ed88c..566c841 100644 --- a/consumers/consumerJSNCGLQL.go +++ b/consumers/consumerJSNCGLQL.go @@ -95,7 +95,7 @@ func (the *consumerJSNCGLQL) onData(inTopic string, Msg string) { matchTopic := inTopic[:topicPrefixIndex] adaptor := the.getAdaptor(matchTopic) if adaptor != nil { - needPush := adaptor.Transform(inTopic, Msg) + needPush := adaptor.Transform(matchTopic, Msg) if len(needPush) > 0 { the.ch <- needPush } @@ -105,7 +105,7 @@ func (the *consumerJSNCGLQL) getAdaptor(flag string) (adaptor adaptors.IAdaptor4 switch flag { case "upload/uds": log.Printf("[统一采集软件]-上报,准备处理") - //adaptor = adaptors.Adaptor_TYCJ_JSNCGLQL{IdMap: the.Info.TYCJsensorMap} + adaptor = adaptors.Adaptor_TYCJ_JSNCGLQL{IdMap: the.Info.TYCJsensorMap} case "upload/ZD": log.Printf("[振动软件]-上报,准备处理") //adaptor = adaptors.Adaptor_ZD_CQZG{IdMap: the.Info.SensorMap.ZDsensorMCMap, RC4Key: RC4Key} diff --git a/testUnit/江苏质感测试_test.go b/testUnit/江苏质感测试_test.go index a2bad59..4fbbbd0 100644 --- a/testUnit/江苏质感测试_test.go +++ b/testUnit/江苏质感测试_test.go @@ -42,6 +42,23 @@ func Test_江苏质感_应变(t *testing.T) { "m1c2": "LHTDQ-RSG-L04-001-03", }, } - bytes := adp.Transform(Msg) + matchTopic := "upload/uds" + bytes := adp.Transform(matchTopic, Msg) + log.Println(bytes) +} + +func Test_江苏质感_加速度(t *testing.T) { + + Msg := ` +{"Sensorid":0,"Module":"m1c1","Channel":0,"Frequency":64,"ThemeValue":[1290.0560302734375],"RawValues":[],"AccValues":[1283.558,1284.225,1286.149,1287.802,1287.162,1286.052,1285.919,1285.773,1286.345,1285.923,1284.865,1285.24,1288.555,1288.9,1287.835,1288.205,1287.185,1287.119,1287.266,1286.979,1285.803,1286.851,1287.067,1287.282,1287.172,1286.887,1286.604,1287.944,1286.895,1287.764,1286.149,1285.606,1285.447,1286.035,1286.664,1287.94,1288.193,1288.365,1287.828,1287.639,1287.858,1287.992,1285.109,1285.098,1286.7,1283.96,1281.883,1283.221,1283.583,1283.806,1282.911,1282.179,1283.079,1282.504,1284.522,1286.981,1284.942,1285.352,1285.596,1288.592,1288.793,1287.406,1286.885,1287.607,1287.616,1286.512,1286.281,1286.677,1287.126,1286.622,1287.835,1287.268,1287.061,1286.665,1286.321,1287.955,1286.342,1286.35,1287.045,1286.6,1287.67,1286.765,1287.035,1287.429,1286.95,1287.701,1286.382,1285.629,1286.349,1286.22,1286.385,1287.926,1287.003,1287.861,1287.389,1288.281,1287.455,1285.3,1281.458,1282.176,1281.003,1283.045,1281.604,1282.898,1283.73,1283.065,1286.091,1287.463,1286.47,1287.904,1285.849,1286.24,1286.013,1286.467,1286.961,1287.042,1286.644,1287.27,1288.123,1287.752,1285.579,1285.215,1286.282,1286.038,1288.313,1286.403,1287.222,1287.147,1287.155,1287.766,1287.685,1287.22,1285.948,1285.644,1285.732,1286.822,1284.651,1287.573,1288.755,1287.204,1287.215,1286.546,1287.779,1287.461,1287.261,1287.112,1285.633,1286.964,1284.911,1282.031,1282.651,1282.792,1281.49,1283.697,1284.439,1282.987,1282.633,1285.909,1287.203,1287.085,1286.828,1286.973,1286.6,1286.978,1287.342,1287.173,1287.739,1287.287,1285.743,1286.837,1287.119,1287.099,1286.57,1286.836,1287.283,1287.848,1287.425,1287.75,1287.379,1287.477,1287.71,1286.578,1286.598,1285.528,1284.935,1287.748,1286.924,1285.9,1286.639,1287.234,1286.739,1287.12,1287.303,1286.17,1287.147,1286.728,1287.065,1287.525,1288.273,1286.184,1281.403,1282.91,1281.808,1282.329,1282.956,1282.863,1282.729,1282.614,1283.559,1287.289,1286.861,1287.313,1286.948,1286.503,1287.279,1285.792,1286.561,1287.33,1286.951,1286.991,1287.235,1287.722,1287.887,1286.974,1286.155,1284.995,1286.333,1286.915,1287.601,1287.448,1286.553,1286.767,1286.683,1287.65,1285.951,1286.473,1286.353,1285.941,1287.345,1286.674,1286.36,1287.314,1288.718,1287.83,1287.572,1287.111,1285.09,1285.877,1288.153,1287.014,1286.571,1281.341,1281.411,1283.615,1282.956,1283.173,1281.949,1283.055,1281.925,1284.661,1286.98,1286.799,1284.792,1286.272,1287.713,1287.54,1287.277,1287.003,1286.236,1286.127,1286.212,1286.821,1285.552,1286.892,1286.142,1286.603,1287.823,1288.396,1286.097,1287.426,1286.819,1286.106,1287.076,1287.694,1287.083,1285.96,1285.901,1286.317,1286.804,1288.028,1287.198,1286.265,1287.487,1286.414,1285.199,1286.589,1287.173,1287.463,1286.624,1287.407,1287.174,1287.54,1287.172,1283.417,1282.739,1282.229,1283.015,1282.275,1281.815,1282.354,1281.723,1284.979,1286.85,1287.041,1288.11,1286.83,1288.184,1285.855,1286.403,1286.685,1286.467,1287.283,1287.551,1287.436,1286.994,1286.233,1286.406,1288.472,1287.488,1286.166,1285.151,1287.579,1285.786,1287.102,1286.715,1286.666,1287.493,1286.989,1286.22,1287.545,1287.492,1286.591,1286.585,1287.814,1286.214,1286.1,1286.22,1287.941,1287.596,1286.543,1284.793,1285.451,1286.007,1289.132,1286.96,1279.971,1281.845,1282.387,1281.058,1285.151,1284.551,1281.236,1279.194,1288.642,1290.056,1286.935,1283.34,1286.059,1287.746,1287.682,1286.13,1286.172,1286.42,1286.798,1285.858,1284.875,1287.204,1290.049,1286.584,1286.496,1285.701,1286.298,1287.167,1287.503,1287.216,1286.467,1286.108,1286.719,1286.527,1287.631,1287.962,1287.21,1286.235,1286.989,1287.259,1288.137,1287.806,1287.502,1286.343,1286.299,1286.223,1287.184,1286.833,1287.693,1286.567,1285.928,1286.286,1288.519,1287.179,1287.033,1284.763,1282.308,1281.642,1283.903,1284.142,1283.739,1283.061,1283.307,1284.041,1287.126,1285.124,1287.493,1286.533,1286.712,1287.735,1286.521,1286.554,1287.046,1287.546,1287.954,1286.08,1286.406,1287.175,1286.907,1288.021,1286.836,1285.811,1287.812,1287.266,1287.916,1287.564,1286.408,1287.211,1286.643,1287.072,1286.808,1286.365,1286.246,1286.881,1286.847,1287.475,1287.4,1286.331,1286.663,1287.023,1287.161,1287.37,1287.171,1287.047,1286.715,1286.47,1286.66,1282.351,1282.151,1283.441,1282.901,1281.451,1281.676,1282.603,1283.968,1284.577,1285.785,1287.704,1287.127,1286.802,1286.686,1286.673,1287.171,1287.124,1285.387,1286.783,1286.004,1286.445,1287.15,1285.825,1287.762,1286.766,1285.524,1287.877,1287.365,1288.04,1286.488,1286.407,1287.895,1287.278,1287.562,1286.483,1287.384,1286.389,1285.975,1287.131,1285.426,1286.492,1287.561,1286.014,1287.05,1287.219,1286.822,1286.877,1287.364,1287.314,1286.927,1285.281,1282.653,1281.295,1281.666,1283.219,1283.365,1282.89,1284.118,1282.197,1284.389,1287.169,1286.626,1287.005,1286.096,1286.474,1286.059,1286.343,1287.167,1286.047,1287.655,1287.304,1286.792,1286.654,1287.3,1287.629,1287.337,1287.196,1286.366,1286.523,1286.629,1287.573,1287.273,1286.901,1287.367,1285.342,1286.544,1286.887,1287.3,1287.595,1286.443,1286.708,1287.099,1286.704,1287.069,1287.274,1286.51,1286.811,1287.001,1286.823,1287.035,1286.314,1287.507,1285.01,1281.964,1282.232,1282.319,1282.138,1282.72,1282.123,1283.028,1282.796,1285.902,1288.454,1287.503,1287.666,1285.778,1285.491,1286.983,1286.555,1285.776,1286.037,1286.463,1286.654,1287.353,1287.528,1288.568,1287.532,1287.218,1286.551,1285.815,1286.325,1285.448,1284.984,1286.994,1286.52,1286.433,1286.96,1287.798,1287.983,1287.301,1286.586,1286.367,1286.422,1285.92,1287.512,1286.184,1286.806,1286.364,1286.644,1286.688,1287.103,1287.515,1286.27,1284.878,1281.038,1281.646,1282.527,1283.223,1283.38,1281.987,1283.303,1284.225,1284.689,1287.298,1288.455,1285.868,1284.704,1286.34,1287.643,1286.828,1286.646,1288.855,1285.898,1286.506,1287.87,1287.976,1285.677,1285.493,1285.95,1286.863,1286.209,1286.112,1289.21,1285.76,1286.915,1287.091,1289.131,1286.426,1286.499,1287.025,1286.893,1285.055,1287.412,1286.577,1286.094,1286.085,1288.727,1286.047,1287.58,1287.028,1287.951,1286.708,1285.614,1286.601,1286.553,1285.596,1282.528,1283.466,1283.629,1282.531,1281.852,1283.951,1283.003,1283.309,1285.412,1286.119,1285.514,1287.11,1287.287,1286.589,1286.598,1287.78,1287.226,1287.694,1287.078,1287.701,1285.96,1286.416,1285.518,1286.934,1287.772,1287.673,1286.301,1285.751,1285.979,1287.035,1287.798,1287.917,1287.163,1285.706,1286.077,1286.123,1286.195,1287.396,1286.197,1286.558,1287.565,1287.967,1287.69,1287.164,1286.822,1286.987,1286.908,1285.514,1284.941,1285.402,1285.604,1282.453,1281.451,1282.278,1282.705,1283.972,1282.641,1283.361,1282.587,1282.896,1285.251,1285.01,1286.276,1286.682,1286.416,1287.078,1287.479,1287.083,1286.677,1287.03,1285.882,1287.047,1286.739,1285.664,1286.585,1287.704,1287.122,1286.613,1286.68,1287.692,1288.113,1287.8,1284.877,1285.702,1287.093,1286.048,1285.703,1286.235,1286.829,1287.403,1288.46,1288.443,1286.486,1286.538,1286.761,1286.667,1286.109,1286.681,1285.623,1285.763,1286.536,1287.008,1284.437,1284.234,1284.624,1282.37,1281.838,1281.906,1282.036,1282.407,1283.255,1286.755,1286.883,1286.434,1285.64,1286.954,1287.271,1287.293,1286.856,1285.474,1285.801,1287.444,1286.325,1286.404,1288.053,1287.579,1287.416,1287.047,1286.819,1286.81,1285.6,1286.096,1286.427,1286.55,1286.111,1287.046,1288.806,1286.769,1287.56,1287.159,1286.776,1286.883,1286.663,1287.103,1287.384,1286.442,1285.09,1287.351,1286.622,1287.092,1287.763,1285.808,1287.262,1285.574,1284.355,1282.202,1283.086,1282.154,1283.932,1281.525,1284.45,1281.963,1283.211,1287.808,1285.826,1286.701,1286.511,1287.275,1285.845,1287.26,1285.649,1288.315,1285.728,1288.651,1283.918,1289.333,1285.703,1286.663,1284.853,1288.673,1285.389,1288.397,1285.521,1288.097,1286.962,1287.077,1285.815,1286.675,1285.927,1287.53,1286.473,1286.77,1286.158,1286.553,1287.022,1286.681,1287.22,1286.963,1286.086,1286.276,1286.802,1287.171,1286.945,1287.299,1285.57,1282.056,1282.78,1284.338,1281.902,1281.848,1281.227,1281.763,1282.609,1285.833,1288.023,1286.73,1285.987,1286.712,1286.406,1287.841,1286.869,1286.823,1286.593,1285.136,1285.329,1286.885,1287.674,1288.369,1286.67,1286.4,1287.057,1287.103,1287.718,1288.267,1286.296,1286.51,1286.214,1287.028,1286.836,1286.843,1285.888,1286.823,1285.485,1286.929,1286.59,1287.135,1287.917,1286.977,1286.586,1287.352,1286.613,1287.55,1287.129,1287.362,1286.535,1286.757,1283.066,1281.336,1284.242,1283.616,1283.288,1282.874,1281.563,1281.958,1282.932,1285.939,1286.963,1287.15,1286.189,1287.213,1285.844,1287.996,1286.727,1288.238,1287.656,1286.012,1286.037,1286.098,1286.569,1287.575,1285.839,1286.152,1285.38,1286.497,1288.594,1287.064,1289.636,1286.801,1285.665,1285.205,1287.558,1286.886,1287.047,1285.505,1286.401,1287.239,1287.56,1287.164,1288.486,1285.868,1287.726,1285.942,1286.623,1284.694,1284.519,1287.368,1286.749,1287.277,1284.375,1281.643,1284.162,1283.594,1282.816,1283.447,1282.23,1281.0,1282.981,1287.075,1287.664,1285.063,1287.511,1287.749,1287.511,1287.406,1287.211,1286.361,1286.739,1286.135,1284.888,1286.347,1287.521,1287.621,1286.847,1289.124,1285.882,1286.465,1287.085,1286.725,1286.791,1286.201,1285.534,1286.27,1286.357,1288.729,1287.372,1287.269,1288.298,1287.33,1286.977,1286.834,1285.826,1286.727,1285.953,1286.118,1286.986,1285.661,1287.026,1287.562,1288.117,1283.1,1281.138,1282.944,1282.387,1283.56,1282.14,1282.933,1279.861,1283.522,1287.204,1286.33,1287.948,1286.243,1287.162,1286.378,1286.174,1286.413,1287.103,1287.055,1287.177,1287.378,1286.513,1286.386,1285.263,1287.291,1288.412,1287.152,1286.932,1286.816,1287.122,1287.301,1287.083,1287.006,1286.536,1286.166,1285.569,1286.045,1286.871,1287.419,1287.584,1288.096,1286.963,1286.254,1287.006,1287.76,1287.819,1286.847,1286.074,1285.459,1285.853,1288.16,1287.328,1283.378,1282.478,1282.112,1281.693,1283.291,1282.254,1282.274,1281.599,1285.067,1286.967,1286.181,1287.858,1288.191,1288.16,1287.051,1286.188,1286.104,1286.827,1285.824,1284.779,1286.701,1286.874,1287.405,1286.049,1287.403,1287.537,1288.402,1286.674,1284.76,1286.702,1287.558,1286.526,1286.747,1287.562,1285.535,1285.252,1287.727,1287.346,1287.81,1286.984,1286.262,1286.984,1286.668,1286.972,1286.368,1286.49,1286.38,1286.736,1287.805,1286.229,1284.934,1282.827,1283.378,1282.972,1281.71,1283.295,1282.905,1283.571,1284.294,1283.62,1282.494,1282.88,1285.508,1286.384,1286.493,1286.504,1286.304,1286.718,1286.906,1287.064,1286.27,1285.965,1286.442,1286.418,1286.163,1286.583,1287.278,1287.612,1288.094,1288.468,1288.306,1286.801,1286.706,1286.365,1286.95,1286.321,1285.954,1285.893,1286.006,1287.233,1286.345,1287.48,1286.642,1286.046,1286.861,1287.833,1286.711,1285.718,1285.68,1286.413,1286.76,1287.274,1287.389,1286.769,1286.74,1286.646,1282.183,1284.407,1282.296,1282.043,1282.836,1282.091,1281.59,1280.458,1284.796,1286.199,1286.829,1287.968,1287.003,1286.545,1286.693,1287.391,1286.572,1286.218,1285.611,1286.587,1287.415,1288.021,1286.934,1287.077,1288.356,1288.383,1286.513,1286.695,1285.854,1285.658,1286.14,1286.322,1284.842,1286.174,1285.979,1287.77,1288.084,1289.207,1287.656,1286.2,1287.191,1287.967,1287.801,1286.333,1286.241,1286.428,1286.479,1286.276,1287.606,1286.341,1286.717,1285.172,1282.115,1282.454,1280.736,1281.015,1283.212,1283.598,1283.801,1283.281,1287.353,1288.189,1288.436,1287.371,1286.224,1286.165,1287.077,1286.25,1285.952,1285.241,1285.573,1286.977,1286.964,1286.76,1286.231,1286.539,1288.356,1289.22,1287.855,1286.951,1287.058,1286.488,1287.065,1286.678,1286.765,1284.203,1285.798,1287.134,1287.502,1286.082,1286.699,1286.688,1285.628,1287.353,1286.634,1287.286,1287.545,1287.34,1287.899,1287.161,1287.355,1286.706,1284.482,1282.292,1282.076,1281.688,1281.399,1282.855,1281.976,1283.479,1281.957,1286.168,1287.614,1286.838,1287.763,1287.323,1286.427,1285.76,1286.437,1287.596,1287.364,1288.067,1287.172,1287.145,1286.311,1286.718,1286.785,1286.608,1285.885,1285.736,1285.829,1285.926,1286.223,1286.182,1286.619,1287.046,1288.033,1287.752,1288.137,1287.387,1286.882,1287.082,1286.183,1287.142,1286.605,1287.15,1287.054,1286.063,1285.58,1284.388,1285.481,1286.888,1286.55,1285.919,1283.113,1283.082,1283.921,1283.391,1283.332,1283.436,1283.52,1283.584,1284.007,1286.229,1285.53,1285.647,1286.587,1286.695,1286.568,1286.016,1286.747,1286.585,1286.023,1286.538,1287.076,1286.612,1286.585,1287.692,1287.292,1286.983,1286.385,1286.697,1287.866,1287.72,1287.172,1286.789,1286.87,1286.631,1286.879,1285.239,1286.052,1286.474,1287.053,1285.763,1287.144,1286.907,1287.172,1288.15,1287.891,1286.922,1286.754,1287.337,1288.245,1287.257,1286.719,1283.051,1282.062,1282.02,1282.051,1281.665,1282.32,1281.07,1281.269,1284.605,1287.353,1286.62,1287.115,1287.706,1288.189,1287.669,1287.823,1286.808,1286.599,1287.549,1287.717,1287.23,1286.135,1284.82,1285.645,1286.774,1286.554,1287.265,1286.383,1287.3,1287.079,1287.438,1286.951,1287.081,1287.731,1286.535,1286.301,1286.222,1287.112,1286.141,1286.87,1287.238,1287.564,1286.639,1286.448,1286.601,1286.518,1286.654,1286.522,1285.531,1285.847,1287.357,1287.344,1283.16,1282.775,1282.403,1283.791,1283.233,1282.453,1282.529,1282.163,1284.13,1287.345,1287.029,1286.369,1286.698,1286.649,1287.001,1286.672,1286.338,1285.734,1285.609,1286.437,1286.4,1286.993,1286.98,1287.275,1287.215,1287.737,1287.577,1287.673,1287.061,1286.69,1286.808,1286.961,1286.585,1286.085,1285.736,1286.892,1286.798,1285.427,1286.753,1287.271,1286.77,1286.762,1286.792,1286.904,1287.716,1287.555,1287.769,1287.969,1286.516,1286.901,1286.375,1285.908,1282.354,1282.019,1282.061,1282.232,1282.346,1283.591,1283.187,1286.669,1287.989,1286.536,1287.182,1287.543,1286.755,1285.329,1286.844,1286.832,1286.948,1288.058,1288.047,1286.066,1285.498,1286.29,1286.828,1286.933,1287.857,1286.612,1287.137,1287.57,1286.09,1286.333,1287.246,1287.487,1287.779,1286.142,1287.006,1287.447,1286.597,1287.219,1287.765,1286.746,1286.208,1286.956,1287.681,1287.335,1286.322,1286.077,1286.909,1287.594,1287.471,1286.045,1286.612,1282.826,1284.378,1282.486,1283.658,1281.604,1284.295,1284.266,1283.346,1283.079,1285.921,1287.653,1287.694,1285.988,1287.586,1285.553,1287.501,1285.198,1287.481,1287.156,1287.546,1285.34,1287.323,1287.277,1287.544,1286.826,1285.854,1286.492,1286.501,1287.07,1287.728,1286.556,1285.737,1287.682,1286.03,1286.135,1287.948,1287.11,1285.907,1285.787,1288.462,1288.164,1285.157,1287.582,1287.088,1286.816,1287.469,1287.729,1286.476,1285.585,1285.312,1287.443,1285.736,1282.637,1283.479,1281.9,1282.962,1282.77,1282.723,1283.839,1282.281,1286.799,1287.363,1286.487,1287.094,1286.028,1287.489,1288.106,1286.853,1286.638,1285.877,1287.285,1288.44,1285.759,1285.386,1286.165,1286.062,1288.534,1287.947,1287.837,1287.032,1286.729,1287.23,1287.396,1286.968,1286.734,1286.991,1287.053,1285.468,1285.946,1286.943,1287.153,1287.824,1286.636,1286.511,1286.718,1287.673,1288.427,1287.848,1286.387,1286.417,1286.506,1287.554,1285.775,1281.244,1282.377,1282.625,1283.188,1283.092,1283.247,1282.985,1282.771,1286.758,1287.992,1287.07,1286.831,1286.275,1287.167,1286.591,1287.4,1286.273,1286.871,1285.972,1287.59,1285.751,1288.517,1286.471,1286.98,1287.985,1286.587,1287.435,1287.703,1286.762,1287.171,1287.922,1286.512,1286.113,1286.209,1287.463,1286.23,1286.282,1287.243,1286.056,1286.741,1288.533,1287.361,1287.597,1286.444,1288.079,1288.295,1287.322,1285.954,1284.931,1285.836,1287.481,1283.27,1282.536,1283.266,1282.852,1284.533,1283.197,1283.425,1283.067,1283.069,1287.195,1286.031,1285.915,1286.718,1286.151,1287.616,1287.734,1287.057,1287.891,1288.125,1287.75,1286.974,1286.334,1286.501,1287.948,1286.133,1287.892,1287.263,1286.471,1285.63,1286.886,1287.595,1287.866,1286.591,1286.733,1286.509,1287.526,1287.288,1286.353,1287.418,1288.28,1287.298,1287.056,1286.061,1287.811,1287.784,1286.554,1286.201,1286.216,1286.925,1286.484,1286.573,1283.228,1283.355,1282.716,1282.841,1284.272,1284.131,1282.64,1281.912,1283.765,1285.849,1287.334,1286.747,1286.247,1288.573,1287.865,1286.632,1287.264,1288.054,1288.622,1287.302,1285.913,1285.016,1287.292,1286.573,1286.343,1285.553,1287.301,1287.501,1289.178,1286.986,1288.65,1287.667,1288.084,1285.203,1286.971,1286.036,1287.595,1286.405,1286.812,1286.314,1287.289,1286.798,1286.782,1286.731,1287.74,1287.659,1286.583,1286.095,1287.041,1286.229,1287.005,1286.261,1283.294,1283.958,1282.936,1283.865,1281.911,1283.581,1282.916,1281.482,1284.596,1286.513,1286.171,1286.83,1286.46,1287.114,1287.241,1287.027,1287.346,1287.643,1287.624,1286.998,1284.787,1286.401,1286.143,1286.424,1287.045,1286.744,1287.906,1287.715,1286.711,1287.144,1286.576,1286.704,1287.456,1285.925,1286.075,1286.533,1286.303,1287.488,1287.899,1288.212,1287.785,1287.298,1287.215,1287.474,1287.103,1286.953,1286.182,1286.028,1286.259,1286.682,1288.243,1284.502,1282.826,1283.845,1282.079,1283.218,1283.081,1283.842,1283.313,1283.197,1286.019,1286.516,1286.654,1287.426,1287.095,1287.693,1287.569,1286.34,1286.151,1286.798,1287.275,1288.411,1286.678,1287.185,1286.861,1287.526,1287.605,1287.918,1287.96,1287.328,1286.635,1286.899,1286.244,1286.73,1286.953,1285.974,1286.705,1286.525,1286.472,1283.65,1283.266,1284.176,1284.131,1283.098,1282.851,1281.792,1281.723,1284.038,1285.342,1285.554,1286.665,1287.613,1288.897,1288.72,1287.787,1287.399,1287.759,1288.072,1287.06,1284.859,1285.292,1286.828,1287.417,1287.039,1284.981,1286.565,1287.801,1288.05,1287.529,1286.728,1286.677,1287.283,1286.74,1286.596,1286.497,1286.284,1286.981,1288.138,1288.065,1286.723,1285.518,1287.589,1288.061,1287.268,1286.055,1286.19,1286.132,1286.789,1287.58,1286.192,1285.964,1282.568,1283.216,1283.787,1283.133,1282.371,1280.992,1282.85,1282.268,1284.81,1286.802,1287.325,1287.902,1287.264,1288.314,1287.697,1286.111,1286.838,1286.82,1286.973,1285.953,1285.23,1284.403,1287.062,1287.679,1287.76,1287.488,1287.18,1287.678,1288.925,1288.214,1287.013,1286.648,1286.564,1287.495,1287.698,1286.906,1284.682,1285.708,1288.063,1286.989,1286.501,1285.788,1286.426,1287.656,1287.342,1288.263,1286.943,1286.895,1288.418,1288.748,1288.194,1286.041,1281.748,1282.461,1283.889,1283.017,1282.92,1281.059,1282.128,1285.824,1287.173,1287.02,1286.45,1287.233,1288.464,1289.04,1288.523,1285.986,1286.51,1288.513,1287.087,1286.389,1285.809,1286.077,1286.895,1286.933,1287.436,1286.56,1286.303,1286.477,1286.732,1287.347,1287.058,1286.446,1286.33,1287.375,1288.133,1288.372,1286.711,1287.21,1285.883,1287.234,1286.01,1287.365,1286.137,1286.838,1287.596,1287.945,1286.496,1286.179,1287.184,1288.172,1283.761,1283.663,1283.281],"Ticks":1730362944840,"ThemeItems":null} +` + adp := adaptors.Adaptor_ZD_JSNCGLQL{ + IdMap: map[string]string{ + "m1c1": "LHTDQ-JSD-C08-001-01", + "m1c2": "LHTDQ-JSD-L03-001-01", + }, + } + matchTopic := "upload/ZD" + bytes := adp.Transform(matchTopic, Msg) log.Println(bytes) }