|
@@ -2246,7 +2246,7 @@ public class OrderController : BaseController
|
|
|
if (order == null)
|
|
|
throw UserFriendlyException.SameMessage("无效工单编号");
|
|
|
if (order.Status > EOrderStatus.BackToUnAccept)
|
|
|
- throw UserFriendlyException.SameMessage("工单已发起流程");
|
|
|
+ throw UserFriendlyException.SameMessage("工单已发起流程,不可编辑");
|
|
|
|
|
|
if (order.Content != dto.Content)
|
|
|
await _orderApplication.OrderParticiple(dto.Content, dto.Id, HttpContext.RequestAborted);
|
|
@@ -2321,29 +2321,16 @@ public class OrderController : BaseController
|
|
|
/// 工单办理
|
|
|
/// </summary>
|
|
|
[HttpPost("handle")]
|
|
|
- public async Task Handle([FromBody] OrderHandleFlowDto dto)
|
|
|
- {
|
|
|
- var orderId = dto.Data?.Id;
|
|
|
- if (string.IsNullOrEmpty(orderId))
|
|
|
- {
|
|
|
- var order = await _orderRepository.Queryable()
|
|
|
- .FirstAsync(d => d.WorkflowId == dto.Workflow.WorkflowId, HttpContext.RequestAborted);
|
|
|
- if (order is null)
|
|
|
- throw new UserFriendlyException("流程无对应工单");
|
|
|
- orderId = order.Id;
|
|
|
- }
|
|
|
-
|
|
|
- if (await _orderDelayRepository.AnyAsync(x => x.OrderId == orderId && x.DelayState == EDelayState.Examining, HttpContext.RequestAborted))
|
|
|
- {
|
|
|
- throw UserFriendlyException.SameMessage("该工单存在正在审核中的延期,不能办理");
|
|
|
- }
|
|
|
-
|
|
|
- if(dto.Data is not null && !string.IsNullOrEmpty(dto.Data.Id))
|
|
|
- {
|
|
|
- await Update(dto.Data);
|
|
|
- }
|
|
|
-
|
|
|
- await _workflowApplication.NextAsync(dto.Workflow, HttpContext.RequestAborted);
|
|
|
+ public async Task Handle([FromBody] NextWorkflowDto dto)
|
|
|
+ {
|
|
|
+ //todo 确认需求
|
|
|
+ //var order = await _orderRepository.Queryable()
|
|
|
+ // .FirstAsync(d => d.WorkflowId == dto.WorkflowId, HttpContext.RequestAborted);
|
|
|
+ //if (await _orderDelayRepository.AnyAsync(x => x.OrderId == order.Id && x.DelayState == EDelayState.Examining, HttpContext.RequestAborted))
|
|
|
+ //{
|
|
|
+ // throw UserFriendlyException.SameMessage("该工单存在正在审核中的延期,不能办理");
|
|
|
+ //}
|
|
|
+ await _workflowApplication.NextAsync(dto, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|