selectByMPointID/Code

This commit is contained in:
Timer
2026-03-24 20:14:39 +08:00
parent ffeda063c2
commit 464b7e1a0f

View File

@ -138,7 +138,7 @@ public class MqttServiceImpl implements MqttService {
key = device + "_" + key;
}
System.out.println("标准 key=" + key + " value=" + data.getString(key));
// 获取点位信息
// 获取点位信息 通过MPointID
MPoint mPoint = getMPointCacheOrES(bizId, key);
if (mPoint == null) {
boolean inNotFound = notFoundKeys.contains(key);
@ -154,7 +154,7 @@ public class MqttServiceImpl implements MqttService {
// 处理ES数据
MPointES esPoint = buildEsPoint(mPoint, value, date);
redisList.add(esPoint);
String tableName = "tb_mp_" + key;
String tableName = "tb_mp_" + mPoint.getMpointcode(); // 建表使用code确保表名唯一
MPointHistory mPointHistory = new MPointHistory();
mPointHistory.setMeasuredt(date);
mPointHistory.setParmvalue(value);