fix 设备人员详情过滤
This commit is contained in:
@@ -285,8 +285,15 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
|
||||
ids = ids.Distinct().ToList();
|
||||
|
||||
var enableOutsourceDown = await _dbContext.Queryable<FactorySettingEntity>()
|
||||
.Where(x => x.TenantId == device.TenantId)
|
||||
.Select(x => SqlFunc.IsNullOrEmpty(x.EnableOutsourceDown) ? true : x.EnableOutsourceDown)
|
||||
.SingleAsync();
|
||||
|
||||
var page = await _dbContext.Queryable<GainfoEntity>()
|
||||
.Where(x => ids.Contains(x.Id))
|
||||
.Where(x => x.Type != GainfoUserTypeEnumType.External)
|
||||
.WhereIF(enableOutsourceDown == false, x => x.Type != GainfoUserTypeEnumType.Outsource)
|
||||
.WhereIF(device.Type == DeviceTypeEnumType.Meal, x => x.Type != GainfoUserTypeEnumType.External && x.Type != GainfoUserTypeEnumType.Outsource)
|
||||
.WhereIF(request.Search.IsPresent(), x => x.Code == request.Search || x.Name.Contains(request.Search))
|
||||
.Select<DeviceGainfoResponse>()
|
||||
|
||||
Reference in New Issue
Block a user