|
|
@@ -70,18 +70,21 @@ public class MqttChargeStationConsumer extends AbstractDynamicMqttConsumer {
|
|
70
|
70
|
}
|
|
71
|
71
|
|
|
72
|
72
|
String dbName = topicParts[1];
|
|
|
73
|
+ String dbNamePrefix = dbName.substring(0, 2);
|
|
|
74
|
+ //先传输为deviceid,到后面进行优化
|
|
73
|
75
|
String superTable = topicParts[3];
|
|
74
|
|
- LocalDate date = LocalDate.now();
|
|
75
|
76
|
// String tableName = superTable + "_" + date.getYear() + String.format("%02d", date.getMonthValue());
|
|
76
|
|
- String tableName = superTable + "_" + date.getYear() + String.format("%02d", date.getMonthValue());
|
|
|
77
|
+ //deviceid_controllerid
|
|
|
78
|
+ String tableName = superTable + "_" +dbName;
|
|
77
|
79
|
|
|
78
|
80
|
//拆分出数据库名称
|
|
|
81
|
+
|
|
79
|
82
|
//拆分出对于看哪个的超级表的名称
|
|
80
|
83
|
|
|
81
|
84
|
//字表名称公式
|
|
82
|
85
|
|
|
83
|
|
- int i = ((int) "g".getBytes("UTF-8")[0]) % 10;
|
|
|
86
|
+// int i = ((int) "g".getBytes("UTF-8")[0]) % 10;
|
|
84
|
87
|
|
|
85
|
|
- tdengineService.insertBatch(dbName, superTable,tableName, batchToInsert);
|
|
|
88
|
+ tdengineService.insertBatch(dbNamePrefix, superTable,tableName, batchToInsert);
|
|
86
|
89
|
}
|
|
87
|
|
-}
|
|
|
90
|
+}
|