Эх сурвалжийг харах

增加工单结束时判断如果通话记录没有录音文件就不推送了

qinchaoyue 4 сар өмнө
parent
commit
a496dd890e

+ 11 - 0
src/Hotline.Application/Handlers/FlowEngine/WorkflowEndHandler.cs

@@ -17,7 +17,9 @@ using Hotline.Settings.TimeLimits;
 using Hotline.Share.Dtos.FlowEngine.Workflow;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Dtos.TrCallCenter;
+using Hotline.Share.Enums.CallCenter;
 using Hotline.Share.Enums.Order;
+using Hotline.Share.Tools;
 using MapsterMapper;
 using MediatR;
 using Microsoft.Extensions.Logging;
@@ -212,7 +214,16 @@ public class WorkflowEndHandler : INotificationHandler<EndWorkflowNotify>
                         {
                             var call = await _callApplication.GetCallAsync(order.CallId, cancellationToken);
                             if (call is not null)
+                            {
                                 orderFlowDto.TrCallRecordDto = _mapper.Map<TrCallDto>(call);
+
+                                // 工单开始办理如果获取的通话记录是呼出并且录音文件是空就不推送通话记录
+                                // 如果 通话记录是呼入, 并且没有录音文件
+                                if (_systemSettingCacheManager.OrderStartHandlerPushCallIsNull && call.Direction == ECallDirection.Out && call.AudioFile.IsNullOrEmpty())
+                                {
+                                    orderFlowDto.TrCallRecordDto = null;
+                                }
+                            }
                         }
                     }
 

+ 4 - 0
src/Hotline/Caching/Interfaces/ISystemSettingCacheManager.cs

@@ -25,6 +25,10 @@ namespace Hotline.Caching.Interfaces
         /// 自动发布中心直办归档工单
         /// </summary>
         bool AutomaticPublishOrder { get; }
+
+        /// <summary>
+        /// 取消发布功能总开关
+        /// </summary>
         bool CancelPublishOrderEnabled { get; }
 
         /// <summary>