refactor 优化代码

This commit is contained in:
2024-11-26 15:26:12 +08:00
parent a32910f0d9
commit 623a5c4e49
88 changed files with 1820 additions and 941 deletions

View File

@@ -33,9 +33,9 @@ public class DeviceGroupService : IDeviceGroupService
public async Task<List<DeviceGroupTreeResponse>> GetTreeAsync(DeviceTypeEnumType type)
{
var tenantResult = await _tenantApi.GetMyTenantsAsync();
var tenantIds = tenantResult.Data.Select(x => x.Code).ToList();
tenantIds.AddRange(tenantResult.Data.Select(x => x.PCode));
var tenants = await _tenantApi.GetMyTenantsAsync();
var tenantIds = tenants.Select(x => x.Code).ToList();
tenantIds.AddRange(tenants.Select(x => x.PCode));
var deviceGroups = await _dbContext.Queryable<DeviceGroupEntity>()
.Where(x => tenantIds.Contains(x.TenantId))