|
@@ -105,7 +105,7 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
/// </summary>
|
|
|
public async Task ManageFlowNextAsync(FlowAssignMode assignMode,
|
|
|
bool isCountersignStart, bool isCountersignEnd,
|
|
|
- string? orderId, DateTime? currentStepTime, string? currentStepName, DateTime expiredTime,
|
|
|
+ string? orderId, DateTime? currentStepTime, string? currentStepName, DateTime expiredTime, EProcessType processType,
|
|
|
CancellationToken cancellationToken)
|
|
|
{
|
|
|
var order = await GetOrderAsync(orderId, cancellationToken);
|
|
@@ -116,6 +116,7 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
|
|
|
//更新流转信息
|
|
|
order.ManageFlow(isCountersignStart, isCountersignEnd, currentStepTime, currentStepName, expiredTime);
|
|
|
+ order.ProcessType = processType;
|
|
|
|
|
|
await _orderRepository.UpdateAsync(order, cancellationToken);
|
|
|
|
|
@@ -184,13 +185,36 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
await _orderRepository.UpdateAsync(order, cancellationToken);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 工单办理流程从中心流转至部门
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="workflowId"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task FlowFromCenterToOrgAsync(string workflowId, CancellationToken cancellationToken)
|
|
|
+ {
|
|
|
+ var order = await GetOrderByFlowIdAsync(workflowId, cancellationToken);
|
|
|
+ CheckOrderIfFiled(order);
|
|
|
+
|
|
|
+ if (order.ProcessType == EProcessType.Zhiban)
|
|
|
+ {
|
|
|
+ order.FlowFromCenterToOrg();
|
|
|
+ await _orderRepository.UpdateAsync(order, cancellationToken);
|
|
|
+
|
|
|
+ await _capPublisher.PublishAsync(EventNames.HotlineOrderCenterToOrg, _mapper.Map<OrderDto>(order),
|
|
|
+ cancellationToken: cancellationToken);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#region private
|
|
|
|
|
|
private async Task<Order> GetOrderAsync(string? orderId, CancellationToken cancellationToken)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(orderId))
|
|
|
throw UserFriendlyException.SameMessage("无效工单编号");
|
|
|
- var order = await _orderRepository.GetAsync(orderId, cancellationToken);
|
|
|
+ var order = await _orderRepository.Queryable()
|
|
|
+ .Includes(d => d.Hotspot)
|
|
|
+ .FirstAsync(d => d.Id == orderId);
|
|
|
+
|
|
|
if (order == null)
|
|
|
throw new UserFriendlyException($"无效工单编号, orderId: {orderId}", "无效工单编号");
|
|
|
return order;
|
|
@@ -200,7 +224,9 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(workflowId))
|
|
|
throw UserFriendlyException.SameMessage("无效流程编号");
|
|
|
- var order = await _orderRepository.GetAsync(d => d.WorkflowId == workflowId, cancellationToken);
|
|
|
+ var order = await _orderRepository.Queryable()
|
|
|
+ .Includes(d => d.Hotspot)
|
|
|
+ .FirstAsync(d => d.WorkflowId == workflowId);
|
|
|
if (order == null)
|
|
|
throw new UserFriendlyException($"无效流程编号, workflowId: {workflowId}", "无效流程编号");
|
|
|
return order;
|