|
@@ -594,6 +594,46 @@ public class OrderController : BaseController
|
|
|
.OrderByDescending(x => x.CreationTime).ToListAsync(HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 查询发布平移待办理人
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ /// <exception cref="UserFriendlyException"></exception>
|
|
|
+ [HttpGet("published/migration/{id}")]
|
|
|
+ public async Task<GetOrderMigrationDto> PublishMigration(string id)
|
|
|
+ {
|
|
|
+ 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
|
|
|
+ {
|
|
|
+ StepId = step.Id,
|
|
|
+ Handlers = users.Select(d => new FlowStepHandler
|
|
|
+ {
|
|
|
+ UserId = d.Id,
|
|
|
+ Username = d.Name,
|
|
|
+ OrgId = d.OrgId,
|
|
|
+ OrgName = d.Organization.Name
|
|
|
+ }).ToList()
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 工单回访
|
|
@@ -5327,7 +5367,7 @@ public class OrderController : BaseController
|
|
|
#region 工单平移
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 查询工单平移待办理对象
|
|
|
+ /// 查询工单平移待办理人
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("migration/{orderId}")]
|
|
@@ -5366,23 +5406,5 @@ public class OrderController : BaseController
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 工单平移
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- /// <exception cref="UserFriendlyException"></exception>
|
|
|
- [HttpPost("migration")]
|
|
|
- public async Task Migration([FromBody] OrderMigrationDto dto)
|
|
|
- {
|
|
|
- var step = await _workflowStepRepository.GetAsync(dto.StepId, HttpContext.RequestAborted);
|
|
|
- if (step is null)
|
|
|
- throw new UserFriendlyException("无效节点编号");
|
|
|
- await _workflowDomainService.ChangeHandlerBatchAsync(new List<(string userId, string username, string orgId, string orgName, ICollection<WorkflowStep> steps)>
|
|
|
- {
|
|
|
- new(dto.Handler.UserId,dto.Handler.Username,dto.Handler.OrgId,dto.Handler.OrgName, new List<WorkflowStep>{step})
|
|
|
- }, HttpContext.RequestAborted);
|
|
|
- }
|
|
|
-
|
|
|
#endregion
|
|
|
}
|