fix 就餐增加权限控制
This commit is contained in:
@@ -198,6 +198,17 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<string>> GetCanteenDeviceUniqueNosByUserNoAsync(string userNo)
|
||||
{
|
||||
var all = await GetAssignDeviceCodesAsync(userNo);
|
||||
|
||||
return await _dbContext.Queryable<DeviceEntity>().Where(x => x.Type == DeviceTypeEnumType.Meal)
|
||||
.Where(x => all.Contains(x.Code))
|
||||
.Select(x => x.UniqueNo)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户所有设备权限
|
||||
/// </summary>
|
||||
@@ -340,7 +351,7 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
|
||||
var devices = await _dbContext.Queryable<DeviceEntity>().ToListAsync();
|
||||
|
||||
if(ggs != null && ggs.Count > 0)
|
||||
if (ggs != null && ggs.Count > 0)
|
||||
{
|
||||
foreach (var gid in ggs)
|
||||
{
|
||||
@@ -351,7 +362,7 @@ public class DevicePermissionService : IDevicePermissionService
|
||||
gds.AddRange(ds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var dds = gds.Distinct().ToList();
|
||||
var lst = devices.Where(x => dds.Contains(x.Code))
|
||||
.Select(x => new AssigmentByCodeResponse
|
||||
|
||||
Reference in New Issue
Block a user