|
@@ -600,38 +600,22 @@ public class OrderController : BaseController
|
|
|
/// <param name="id"></param>
|
|
|
/// <returns></returns>
|
|
|
/// <exception cref="UserFriendlyException"></exception>
|
|
|
- [HttpGet("published/migration/{id}")]
|
|
|
- public async Task<GetOrderMigrationDto> PublishMigration(string id)
|
|
|
+ [HttpGet("published/migration")]
|
|
|
+ public async Task<IReadOnlyList<FlowStepHandler>> PublishMigration()
|
|
|
{
|
|
|
- var steps = await _workflowStepRepository.Queryable()
|
|
|
- .Where(d => d.ExternalId == id && d.Status != EWorkflowStepStatus.Handled)
|
|
|
- .ToListAsync(HttpContext.RequestAborted);
|
|
|
-
|
|
|
- if (!steps.Any())
|
|
|
- throw new UserFriendlyException("未查询到待办理节点");
|
|
|
- if (steps.Count > 1)
|
|
|
- throw new UserFriendlyException("多个待办理节点暂不支持平移");
|
|
|
- var step = steps.First();
|
|
|
- if (step.BusinessType is not EBusinessType.Center and EBusinessType.Send)
|
|
|
- throw new UserFriendlyException("非中心节点暂不支持平移");
|
|
|
-
|
|
|
var setting = _systemSettingCacheManager.GetSetting(SettingConstants.RolePaiDan);
|
|
|
var roles = setting?.SettingValue.ToList();
|
|
|
var users = await _userRepository.Queryable()
|
|
|
.Includes(d => d.Organization)
|
|
|
.Where(d => d.Roles.Any(x => roles.Contains(x.Name)))
|
|
|
.ToListAsync(HttpContext.RequestAborted);
|
|
|
- return new GetOrderMigrationDto
|
|
|
+ return users.Select(d => new FlowStepHandler
|
|
|
{
|
|
|
- StepId = step.Id,
|
|
|
- Handlers = users.Select(d => new FlowStepHandler
|
|
|
- {
|
|
|
- UserId = d.Id,
|
|
|
- Username = d.Name,
|
|
|
- OrgId = d.OrgId,
|
|
|
- OrgName = d.Organization.Name
|
|
|
- }).ToList()
|
|
|
- };
|
|
|
+ UserId = d.Id,
|
|
|
+ Username = d.Name,
|
|
|
+ OrgId = d.OrgId,
|
|
|
+ OrgName = d.Organization.Name
|
|
|
+ }).ToList();
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -5383,7 +5367,7 @@ public class OrderController : BaseController
|
|
|
throw new UserFriendlyException("多个待办理节点暂不支持平移");
|
|
|
var step = steps.First();
|
|
|
if (step.BusinessType is not EBusinessType.Center and EBusinessType.Send)
|
|
|
- throw new UserFriendlyException("非中心节点暂不支持平移");
|
|
|
+ throw UserFriendlyException.SameMessage("当前办理节点非中心暂不支持平移");
|
|
|
|
|
|
var setting = step.BusinessType is EBusinessType.Center
|
|
|
? _systemSettingCacheManager.GetSetting(SettingConstants.RoleZuoXi)
|