xf 1 年間 前
コミット
111274107b

+ 11 - 24
src/Hotline.Api/Controllers/OrderController.cs

@@ -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>

+ 0 - 7
src/Hotline.Share/Dtos/FlowEngine/NextWorkflowDto.cs

@@ -53,11 +53,4 @@ public class NextWorkflowDto : BasicWorkflowDto
     public bool? RealContactLocale { get; set; }
 
     #endregion
-}
-
-public class NextWorkflowDto<TData>
-{
-    public TData? Data { get; set; }
-
-    public NextWorkflowDto Workflow { get; set; }
 }

+ 0 - 5
src/Hotline.Share/Dtos/Order/OrderStartFlowDto.cs

@@ -14,11 +14,6 @@ namespace Hotline.Share.Dtos.Order
 
     }
 
-    public class OrderHandleFlowDto : NextWorkflowDto<UpdateOrderDto>
-    {
-       
-    }
-
     public class ScreenStartFlowDto : StartWorkflowDto<OrderScreenDto>
     {