fix 就餐增加权限控制

This commit is contained in:
2024-02-22 18:12:28 +08:00
parent ada7fe99e4
commit 4ee5703b65
14 changed files with 130 additions and 7 deletions

View File

@@ -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