fix 获取设备支持多factory

This commit is contained in:
2024-07-15 10:52:01 +08:00
parent 979f27ebfa
commit ba7821796b

View File

@@ -54,7 +54,6 @@ public class DeviceConnectService : IDeviceConnectService
await _dbContext.InsertAsync(registry);
return "设备注册成功";
}
public async Task<List<DeviceNotSetBusinessPlaceResponse>> GetNotSetBusinessPlaceDevicesAsync()
@@ -129,9 +128,11 @@ public class DeviceConnectService : IDeviceConnectService
public async Task<List<DeviceUniqueWithConnectionInfoDto>> GetDeviceUniqueInfoByBrandAsync(string brand, string factory)
{
var factories = factory.Split(",").ToList();
return await _dbContext.Queryable<DeviceEntity>()
.LeftJoin<DeviceTemplateEntity>((d, dt) => d.TemplateCode == dt.Code)
.Where((d, dt) => dt.Brand == brand && d.TenantId == factory)
.Where((d, dt) => dt.Brand == brand && factories.Contains(d.TenantId))
.Select(d => new DeviceUniqueWithConnectionInfoDto
{
DeviceUnique = d.UniqueNo,