tangjiang 9 months ago
parent
commit
914bf48c1b

+ 2 - 2
src/Hotline.Api/Controllers/OrderController.cs

@@ -323,7 +323,7 @@ public class OrderController : BaseController
                     //是否开启
                     var isOpenContingencyManagement = _systemSettingCacheManager.GetSetting(SettingConstants.IsOpenContingencyManagement)?.SettingValue[0];
                     if (isOpenContingencyManagement == "true")
-                        await _publisher.PublishAsync(new ContingencyManagementNotify(order), PublishStrategy.ParallelNoWait, HttpContext.RequestAborted);
+                        await _publisher.PublishAsync(new ContingencyManagementNotify(order, order.Title, order.Content, order.ActualOpinion), PublishStrategy.ParallelNoWait, HttpContext.RequestAborted);
 
                     var orderVisit = new OrderVisit();
                     orderVisit.No = order.No;
@@ -463,7 +463,7 @@ public class OrderController : BaseController
         //是否开启
         var isOpenContingencyManagement = _systemSettingCacheManager.GetSetting(SettingConstants.IsOpenContingencyManagement)?.SettingValue[0];
         if (isOpenContingencyManagement == "true")
-            await _publisher.PublishAsync(new ContingencyManagementNotify(order), PublishStrategy.ParallelNoWait, HttpContext.RequestAborted);
+            await _publisher.PublishAsync(new ContingencyManagementNotify(order, dto.ArrangeTitle, dto.ArrangeContent, dto.ArrangeOpinion), PublishStrategy.ParallelNoWait, HttpContext.RequestAborted);
 
         var orderVisit = new OrderVisit();
         orderVisit.No = order.No;

+ 6 - 6
src/Hotline.Application/ContingencyManagement/ContingencyManagementNotifyHandler.cs

@@ -49,9 +49,9 @@ namespace Hotline.Application.ContingencyManagement
                     orderData = new ContingencyManagementOrders();
                     orderData = _mapper.Map<ContingencyManagementOrders>(order);
                     orderData.Id = order.Id;
-                    orderData.ArrangementOpinion = order.ActualOpinion;
-                    orderData.ArrangeTitle = order.Title;
-                    orderData.ArrangeContent = order.Content;
+                    orderData.ArrangementOpinion = notification.ArrangementOpinion;
+                    orderData.ArrangeTitle = notification.ArrangeTitle;
+                    orderData.ArrangeContent = notification.ArrangeContent;
                     orderData.PushState = "0";
                     await _contingencyManagementOrdersRepository.AddAsync(orderData, cancellationToken);
                 }
@@ -59,9 +59,9 @@ namespace Hotline.Application.ContingencyManagement
                 {
                     //存在修改
                     _mapper.Map(order, orderData);
-                    orderData.ArrangementOpinion = order.ActualOpinion;
-                    orderData.ArrangeTitle = order.Title;
-                    orderData.ArrangeContent = order.Content;
+                    orderData.ArrangementOpinion = notification.ArrangementOpinion;
+                    orderData.ArrangeTitle = notification.ArrangeTitle;
+                    orderData.ArrangeContent = notification.ArrangeContent;
                     orderData.PushState = "0";
                     await _contingencyManagementOrdersRepository.UpdateAsync(orderData, cancellationToken);
                 }

+ 1 - 1
src/Hotline/ContingencyManagement/Notifies/ContingencyManagementNotify.cs

@@ -2,5 +2,5 @@
 
 namespace Hotline.ContingencyManagement.Notifies
 {
-    public record ContingencyManagementNotify(Hotline.Orders.Order dto) : INotification;
+    public record ContingencyManagementNotify(Hotline.Orders.Order dto,string ArrangeTitle,string ArrangeContent,string ArrangementOpinion) : INotification;
 }