fix 人员权限增加例外
This commit is contained in:
@@ -331,7 +331,14 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
{
|
{
|
||||||
var no = await _dbContext.Queryable<GainfoEntity>().Where(x => x.No == userNo || x.Code == userNo).Select(x => x.No).SingleAsync();
|
var no = await _dbContext.Queryable<GainfoEntity>().Where(x => x.No == userNo || x.Code == userNo).Select(x => x.No).SingleAsync();
|
||||||
var result = await _devicePermissionAnalyzeService.GetUserAssignDeviceCodesWithTypeInTenantAsync(new List<string> { no });
|
var result = await _devicePermissionAnalyzeService.GetUserAssignDeviceCodesWithTypeInTenantAsync(new List<string> { no });
|
||||||
return result.First().Value.SelectMany(x => x.AssignTypes.SelectMany(p => p.Codes)).Distinct().ToList();
|
var deviceCodes = result.First().Value.SelectMany(x => x.AssignTypes.SelectMany(p => p.Codes)).Distinct().ToList();
|
||||||
|
|
||||||
|
//例外处理: 特殊手动分配的设备权限
|
||||||
|
var manuallyDeviceCodes = await _dbContext.Queryable<DevicePermissionManuallyEntity>().Where(x => x.UserNo == no)
|
||||||
|
.Select(x => x.DeviceCode)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
return deviceCodes.Concat(manuallyDeviceCodes).Distinct().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -547,7 +554,7 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
.Where(x => userCodes.Contains(x.Code))
|
.Where(x => userCodes.Contains(x.Code))
|
||||||
.Select(x => x.No)
|
.Select(x => x.No)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
var userNoLeaves = await _dbContext.Queryable<GainfoLeaveEntity>()
|
var userNoLeaves = await _dbContext.Queryable<GainfoLeaveEntity>()
|
||||||
.Where(x => userCodes.Contains(x.Code))
|
.Where(x => userCodes.Contains(x.Code))
|
||||||
.Select(x => x.No)
|
.Select(x => x.No)
|
||||||
|
|||||||
Reference in New Issue
Block a user