|
@@ -601,20 +601,22 @@ public class OrderController : BaseController
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
/// <exception cref="UserFriendlyException"></exception>
|
|
/// <exception cref="UserFriendlyException"></exception>
|
|
[HttpGet("published/migration")]
|
|
[HttpGet("published/migration")]
|
|
- public async Task<IReadOnlyList<FlowStepHandler>> PublishMigration()
|
|
|
|
|
|
+ public async Task<IReadOnlyList<OrderMigrationHandler>> PublishMigration()
|
|
{
|
|
{
|
|
var setting = _systemSettingCacheManager.GetSetting(SettingConstants.RolePaiDan);
|
|
var setting = _systemSettingCacheManager.GetSetting(SettingConstants.RolePaiDan);
|
|
var roles = setting?.SettingValue.ToList();
|
|
var roles = setting?.SettingValue.ToList();
|
|
var users = await _userRepository.Queryable()
|
|
var users = await _userRepository.Queryable()
|
|
.Includes(d => d.Organization)
|
|
.Includes(d => d.Organization)
|
|
|
|
+ .Includes(d => d.Roles)
|
|
.Where(d => d.Roles.Any(x => roles.Contains(x.Name)))
|
|
.Where(d => d.Roles.Any(x => roles.Contains(x.Name)))
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
- return users.Select(d => new FlowStepHandler
|
|
|
|
|
|
+ return users.Select(d => new OrderMigrationHandler
|
|
{
|
|
{
|
|
UserId = d.Id,
|
|
UserId = d.Id,
|
|
Username = d.Name,
|
|
Username = d.Name,
|
|
OrgId = d.OrgId,
|
|
OrgId = d.OrgId,
|
|
- OrgName = d.Organization.Name
|
|
|
|
|
|
+ OrgName = d.Organization.Name,
|
|
|
|
+ RoleNames = string.Join(',', d.Roles.Select(x => x.DisplayName).ToList())
|
|
}).ToList();
|
|
}).ToList();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -5375,17 +5377,19 @@ public class OrderController : BaseController
|
|
var roles = setting?.SettingValue.ToList();
|
|
var roles = setting?.SettingValue.ToList();
|
|
var users = await _userRepository.Queryable()
|
|
var users = await _userRepository.Queryable()
|
|
.Includes(d => d.Organization)
|
|
.Includes(d => d.Organization)
|
|
|
|
+ .Includes(d => d.Roles)
|
|
.Where(d => d.Roles.Any(x => roles.Contains(x.Name)))
|
|
.Where(d => d.Roles.Any(x => roles.Contains(x.Name)))
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
return new GetOrderMigrationDto
|
|
return new GetOrderMigrationDto
|
|
{
|
|
{
|
|
StepId = step.Id,
|
|
StepId = step.Id,
|
|
- Handlers = users.Select(d => new FlowStepHandler
|
|
|
|
|
|
+ Handlers = users.Select(d => new OrderMigrationHandler
|
|
{
|
|
{
|
|
UserId = d.Id,
|
|
UserId = d.Id,
|
|
Username = d.Name,
|
|
Username = d.Name,
|
|
OrgId = d.OrgId,
|
|
OrgId = d.OrgId,
|
|
- OrgName = d.Organization.Name
|
|
|
|
|
|
+ OrgName = d.Organization.Name,
|
|
|
|
+ RoleNames = string.Join(',', d.Roles.Select(x => x.DisplayName).ToList())
|
|
}).ToList()
|
|
}).ToList()
|
|
};
|
|
};
|
|
}
|
|
}
|