fix 处理设备分组优化
This commit is contained in:
@@ -43,11 +43,12 @@ public class DeviceGroupService : IDeviceGroupService
|
||||
.Select<DeviceGroupTreeResponse>()
|
||||
.ToListAsync();
|
||||
|
||||
var others = await _dbContext.Queryable<DeviceGroupEntity>()
|
||||
var others = await _dbContext.Client.Queryable<DeviceGroupEntity>()
|
||||
.Where(x => x.Type == type)
|
||||
.Where(x => x.Name == "*共用区域" || x.Name == "*非共用区域" || x.Name == "*通用考勤设备组" || x.Name == "*专用考勤设备组")
|
||||
.Select<DeviceGroupTreeResponse>()
|
||||
.ToListAsync();
|
||||
|
||||
deviceGroups.AddRange(others);
|
||||
|
||||
var tops = deviceGroups.Where(x => !x.PCode.HasValue).ToList();
|
||||
@@ -167,7 +168,7 @@ public class DeviceGroupService : IDeviceGroupService
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<DeviceGroupEntity> CheckPCodeAsync(DeviceGroupSaveRequest request)
|
||||
private async Task CheckPCodeAsync(DeviceGroupSaveRequest request)
|
||||
{
|
||||
var pGrp = await _dbContext.Queryable<DeviceGroupEntity>().Where(x => x.Code == request.PCode).FirstAsync();
|
||||
if (pGrp != null)
|
||||
@@ -178,7 +179,6 @@ public class DeviceGroupService : IDeviceGroupService
|
||||
}
|
||||
|
||||
(pGrp != null && pGrp.Type != request.Type).ThrowIfTrue("分组类型必须与上级类型保持一致");
|
||||
return pGrp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user