1
This commit is contained in:
@@ -267,21 +267,7 @@ class MqttDispatcher {
|
||||
if (device) {
|
||||
await device_status.update(updateData, { where: { sn_code } });
|
||||
console.log(`[MQTT心跳] 设备 ${sn_code} 状态已更新 - 在线: true, 登录: ${updateData.isLoggedIn}`);
|
||||
} else {
|
||||
// 创建新设备记录
|
||||
await device_status.create({
|
||||
sn_code,
|
||||
device_id: clientId,
|
||||
deviceName: `设备_${sn_code}`,
|
||||
deviceType: 'node_mqtt_client',
|
||||
...updateData,
|
||||
isRunning: false,
|
||||
taskStatus: 'idle',
|
||||
healthStatus: 'unknown',
|
||||
healthScore: 0
|
||||
});
|
||||
console.log(`[MQTT心跳] 设备 ${sn_code} 记录已创建 - 在线: true, 登录: ${updateData.isLoggedIn}`);
|
||||
}
|
||||
}
|
||||
|
||||
// 记录心跳到设备管理器
|
||||
await deviceManager.recordHeartbeat(sn_code, heartbeatData);
|
||||
|
||||
Reference in New Issue
Block a user