田爽 9 月之前
父节点
当前提交
f360c08ed9

+ 14 - 7
src/Hotline.Application/Handlers/FlowEngine/WorkflowEndHandler.cs

@@ -314,13 +314,20 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
             //                }
             //                }
             //            }
             //            }
             //        }
             //        }
-            //        else
-            //        {
-            //            await _orderRepository.OrderScreenRevisionVisit(screen.VisitId, true, cancellationToken);
-            //            screen.Status = EScreenStatus.Refuse;
-            //            screen.ReplyContent = workflow.ActualOpinion;
-            //            await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
-            //        }
+            //      else
+     //               {
+     //                   await _orderRepository.OrderScreenRevisionVisit(screen.VisitId, true, cancellationToken);
+     //                   screen.Status = EScreenStatus.Refuse;
+     //                   screen.ReplyContent = workflow.ActualOpinion;
+     //               }
+     //               screen.NewestAuditTime = DateTime.Now;
+					//await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
+					//OrderScreenDetail detail = new OrderScreenDetail
+					//{
+					//	ScreenId = screen.Id
+					//};
+					//detail.Audit(_sessionContext.UserId, _sessionContext.UserName, _sessionContext.OrgId, _sessionContext.OrgName, 1);
+     //               await _orderScreenDetailRepository.AddAsync(detail, cancellationToken);
             //    }
             //    }
             //    break;
             //    break;
             case WorkflowModuleConsts.OrderDelay:
             case WorkflowModuleConsts.OrderDelay:

+ 18 - 25
src/Hotline.Application/Orders/OrderScreenHandler/OrderScreenEndWorkflowHandler.cs

@@ -1,34 +1,14 @@
 using DotNetCore.CAP;
 using DotNetCore.CAP;
-using Hotline.Application.CallCenter;
-using Hotline.Application.JudicialManagement;
-using Hotline.Application.Orders;
-using Hotline.Application.Quality;
-using Hotline.Article;
-using Hotline.CallCenter.Configs;
-using Hotline.CallCenter.Tels;
 using Hotline.FlowEngine.Notifications;
 using Hotline.FlowEngine.Notifications;
 using Hotline.FlowEngine.WorkflowModules;
 using Hotline.FlowEngine.WorkflowModules;
-using Hotline.KnowledgeBase;
 using Hotline.Orders;
 using Hotline.Orders;
-using Hotline.Settings.TimeLimits;
-using Hotline.Share.Dtos.FlowEngine.Workflow;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Dtos.Order;
-using Hotline.Share.Dtos.TrCallCenter;
 using Hotline.Share.Enums.Order;
 using Hotline.Share.Enums.Order;
-using Hotline;
 using MapsterMapper;
 using MapsterMapper;
 using MediatR;
 using MediatR;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Options;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Hotline.Application.Handlers.FlowEngine;
 using Hotline.Share.Dtos;
 using Hotline.Share.Dtos;
-using XF.Domain.Authentications;
 using XF.Domain.Repository;
 using XF.Domain.Repository;
+using XF.Domain.Authentications;
 
 
 namespace Hotline.Application.Orders.OrderScreenHandler;
 namespace Hotline.Application.Orders.OrderScreenHandler;
 public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
 public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNotify>
@@ -37,16 +17,20 @@ public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNot
 	private readonly ICapPublisher _capPublisher;
 	private readonly ICapPublisher _capPublisher;
 	private readonly IMapper _mapper;
 	private readonly IMapper _mapper;
 	private readonly IRepository<OrderVisitDetail> _orderVisitedDetailRepository;
 	private readonly IRepository<OrderVisitDetail> _orderVisitedDetailRepository;
-	private readonly IRepository<Hotline.Orders.OrderScreen> _orderScreenRepository;
+	private readonly IRepository<OrderScreen> _orderScreenRepository;
 	private readonly IRepository<OrderVisit> _orderVisitRepository;
 	private readonly IRepository<OrderVisit> _orderVisitRepository;
+	private readonly ISessionContext _sessionContext;
+	private readonly IRepository<OrderScreenDetail> _orderScreenDetailRepository;
 
 
 	public OrderScreenEndWorkflowHandler(
 	public OrderScreenEndWorkflowHandler(
 		IOrderRepository orderRepository,
 		IOrderRepository orderRepository,
 		ICapPublisher capPublisher,
 		ICapPublisher capPublisher,
 		IMapper mapper,
 		IMapper mapper,
 		IRepository<OrderVisitDetail> orderVisitedDetailRepository,
 		IRepository<OrderVisitDetail> orderVisitedDetailRepository,
-		IRepository<Hotline.Orders.OrderScreen> orderScreenRepository,
-		IRepository<OrderVisit> orderVisitRepository)
+		IRepository<OrderScreen> orderScreenRepository,
+		IRepository<OrderVisit> orderVisitRepository,
+		ISessionContext sessionContext,
+		IRepository<OrderScreenDetail> orderScreenDetailRepository)
 	{
 	{
 		_orderRepository = orderRepository;
 		_orderRepository = orderRepository;
 		_capPublisher = capPublisher;
 		_capPublisher = capPublisher;
@@ -54,6 +38,8 @@ public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNot
 		_orderScreenRepository = orderScreenRepository;
 		_orderScreenRepository = orderScreenRepository;
 		_orderVisitedDetailRepository = orderVisitedDetailRepository;
 		_orderVisitedDetailRepository = orderVisitedDetailRepository;
 		_orderVisitRepository = orderVisitRepository;
 		_orderVisitRepository = orderVisitRepository;
+		_sessionContext = sessionContext;
+		_orderScreenDetailRepository = orderScreenDetailRepository;
 	}
 	}
 
 
 	/// <summary>Handles a notification</summary>
 	/// <summary>Handles a notification</summary>
@@ -130,8 +116,15 @@ public class OrderScreenEndWorkflowHandler : INotificationHandler<EndWorkflowNot
 					await _orderRepository.OrderScreenRevisionVisit(screen.VisitId, true, cancellationToken);
 					await _orderRepository.OrderScreenRevisionVisit(screen.VisitId, true, cancellationToken);
 					screen.Status = EScreenStatus.Refuse;
 					screen.Status = EScreenStatus.Refuse;
 					screen.ReplyContent = workflow.ActualOpinion;
 					screen.ReplyContent = workflow.ActualOpinion;
-					await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
 				}
 				}
+				screen.NewestAuditTime = DateTime.Now;
+				await _orderScreenRepository.UpdateAsync(screen, cancellationToken);
+				OrderScreenDetail detail = new OrderScreenDetail
+				{
+					ScreenId = screen.Id
+				};
+				detail.Audit(_sessionContext.UserId, _sessionContext.UserName, _sessionContext.OrgId, _sessionContext.OrgName, 1);
+				await _orderScreenDetailRepository.AddAsync(detail, cancellationToken);
 			}
 			}
 		}
 		}
 	}
 	}