全量提交: base_device子查询修复+SyncDevices父设备ParentDeviceId=0+KmsAdapter+前端多项修复

This commit is contained in:
2026-06-18 11:14:52 +08:00
parent 1fb746c548
commit a38f891197
236 changed files with 43274 additions and 424 deletions
@@ -178,7 +178,7 @@ namespace Warehouse.Services
DeviceGroup = d.Group,
NodeId = gatewayNodeId,
IsParent = d.IsParent ? "是" : "否",
ParentDeviceId = parentDeviceId,
ParentDeviceId = d.IsParent ? 0 : parentDeviceId,
IsOnline = d.IsOnline ? "在线" : "离线",
IpAddress = d.IpAddress,
Port = d.Port,
@@ -194,13 +194,13 @@ namespace Warehouse.Services
}
else
{
var entity = db.Queryable<base_device>().InSingle(existingId);
var entity = await db.Queryable<base_device>().FirstAsync(x => x.DeviceId == existingId);
if (entity != null)
{
entity.NodeId = gatewayNodeId; // 重新归属到当前网关
entity.IsOnline = d.IsOnline ? "在线" : "离线";
entity.IsParent = d.IsParent ? "是" : "否";
entity.ParentDeviceId = parentDeviceId ?? entity.ParentDeviceId;
entity.ParentDeviceId = d.IsParent ? 0 : (parentDeviceId ?? entity.ParentDeviceId);
entity.IpAddress = d.IpAddress;
entity.Port = d.Port;
entity.ExtraData = d.ExtraDataJson ?? entity.ExtraData;