test 获取人员设备权限
This commit is contained in:
@@ -108,4 +108,12 @@ public class DevicePermissionsController : ControllerBase
|
|||||||
{
|
{
|
||||||
return await _devicePermissionService.ReGeneratePermissionUsersInfoAsync(beforeDto);
|
return await _devicePermissionService.ReGeneratePermissionUsersInfoAsync(beforeDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
|
[HttpGet("test")]
|
||||||
|
[IgnoreTenant]
|
||||||
|
public async Task<Dictionary<string, List<UserTenantDeviceCodeDto>>> GetUserDevicePermissionsAsync(string code)
|
||||||
|
{
|
||||||
|
return await _devicePermissionService.GetUserDevicePermissionsAsync(code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -29,8 +29,11 @@ public interface IDevicePermissionService : IScopeDependency
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<Guid>> GetAssignmentsAsync(DeviceGetAssignmentsRequest request);
|
Task<List<Guid>> GetAssignmentsAsync(DeviceGetAssignmentsRequest request);
|
||||||
|
|
||||||
|
|
||||||
Task<List<GainfoDto>> GetAssignmentUniqueAsync(DeviceGetAssignmentUniquesRequest request);
|
Task<List<GainfoDto>> GetAssignmentUniqueAsync(DeviceGetAssignmentUniquesRequest request);
|
||||||
|
|
||||||
|
Task<Dictionary<string, List<UserTenantDeviceCodeDto>>> GetUserDevicePermissionsAsync(string code);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生成下发任务
|
/// 生成下发任务
|
||||||
|
|||||||
@@ -167,6 +167,13 @@ public class DevicePermissionService : IDevicePermissionService
|
|||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public async Task<Dictionary<string, List<UserTenantDeviceCodeDto>>> GetUserDevicePermissionsAsync(string code)
|
||||||
|
{
|
||||||
|
var userNo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.Code == code).Select(x => x.No).SingleAsync();
|
||||||
|
return await GetAssignDeviceCodesInternalAsync(new List<string> { userNo });
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<DevicePermissionAssignResponse> GenerateDeviceTasksAsync(Func<Task> func, List<string> userNos)
|
public async Task<DevicePermissionAssignResponse> GenerateDeviceTasksAsync(Func<Task> func, List<string> userNos)
|
||||||
{
|
{
|
||||||
//获取所有人的权限
|
//获取所有人的权限
|
||||||
|
|||||||
Reference in New Issue
Block a user