Browse Source

甄别流程

田爽 1 year ago
parent
commit
463b58cec8
1 changed files with 14 additions and 3 deletions
  1. 14 3
      src/Hotline.Application/Handlers/FlowEngine/EndWorkflowHandler.cs

+ 14 - 3
src/Hotline.Application/Handlers/FlowEngine/EndWorkflowHandler.cs

@@ -7,6 +7,7 @@ using Hotline.KnowledgeBase;
 using Hotline.Orders;
 using Hotline.Repository.SqlSugar.Orders;
 using Hotline.Settings;
+using Hotline.Share.Dtos;
 using Hotline.Share.Dtos.FlowEngine;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Enums.Order;
@@ -29,7 +30,8 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
     private readonly IOrderRepository _orderRepository;
     private readonly ICapPublisher _capPublisher;
     private readonly IMapper _mapper;
-    private readonly IRepository<OrderScreen> _orderScreenRepository;
+    private readonly IRepository<OrderVisitDetail> _orderVisitedDetailRepository;
+	private readonly IRepository<OrderScreen> _orderScreenRepository;
 
 	public EndWorkflowHandler(
         IKnowledgeDomainService knowledgeDomainService,
@@ -40,7 +42,8 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
         IOrderRepository orderRepository,
         ICapPublisher capPublisher,
         IMapper mapper,
-        IRepository<OrderScreen> orderScreenRepository
+        IRepository<OrderVisitDetail> orderVisitedDetailRepository,
+		IRepository<OrderScreen> orderScreenRepository
         )
     {
         _knowledgeDomainService = knowledgeDomainService;
@@ -52,6 +55,7 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
         _capPublisher = capPublisher;
         _mapper = mapper;
         _orderScreenRepository = orderScreenRepository;
+        _orderVisitedDetailRepository = orderVisitedDetailRepository;
 	}
 
     /// <summary>Handles a notification</summary>
@@ -100,7 +104,14 @@ public class EndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
 		            screen.Status = EScreenStatus.End;
                     screen.ReplyContent = workflow.ActualOpinion;
 					await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
-	            }
+                    var visitDetail = await _orderVisitedDetailRepository.GetAsync(screen.VisitDetailId, cancellationToken);
+                    if (visitDetail != null) {
+                        var screenSatisfy = new IdName() { Id = "6", Name = "甄别满意" };
+						visitDetail.OrgProcessingResults = screenSatisfy;
+                        visitDetail.OrgHandledAttitude = screenSatisfy;
+                        await _orderVisitedDetailRepository.UpdateAsync(visitDetail, cancellationToken);
+					}
+				}
 	            break;
 		}
     }