Browse Source

Merge branch 'release' of http://110.188.24.182:10023/Fengwo/hotline into release

xf 8 tháng trước cách đây
mục cha
commit
3c049bfbf4

+ 12 - 14
src/Hotline.Api/Controllers/IPPbxController.cs

@@ -615,21 +615,19 @@ namespace Hotline.Api.Controllers
             }
             await _trCallRecordRepository.AddAsync(model, HttpContext.RequestAborted);
 
-            if (model.CallDirection == ECallDirection.In)
+           
+            var publishCallRecordDto = new PublishCallRecrodDto() { };
+            if (order != null)
             {
-                var publishCallRecordDto = new PublishCallRecrodDto() { };
-                if (order != null)
-                {
-                    var orderDto = _mapper.Map<OrderDto>(order);
-                    publishCallRecordDto.Order = orderDto;
-                }
-                var trCallDto = _mapper.Map<TrCallDto>(model);
-                publishCallRecordDto.TrCallRecordDto = trCallDto;
-                if (string.IsNullOrEmpty(model.AgentTransferNumber))
-                {
-                    //推省上
-                    await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineCallBye, publishCallRecordDto);
-                }
+                var orderDto = _mapper.Map<OrderDto>(order);
+                publishCallRecordDto.Order = orderDto;
+            }
+            var trCallDto = _mapper.Map<TrCallDto>(model);
+            publishCallRecordDto.TrCallRecordDto = trCallDto;
+            if (string.IsNullOrEmpty(model.AgentTransferNumber))
+            {
+                //推省上
+                await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineCallBye, publishCallRecordDto);
             }
 
             return OpenResponse.Ok("success");

+ 11 - 3
src/Hotline.Application/Jobs/XingTangCallsSyncJob.cs

@@ -12,6 +12,8 @@ using DotNetCore.CAP;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Dtos.TrCallCenter;
 using Hotline.Share.Enums.CallCenter;
+using System.Dynamic;
+using Hotline.Share.Dtos.CallCenter;
 
 namespace Hotline.Application.Jobs
 {
@@ -88,12 +90,18 @@ namespace Hotline.Application.Jobs
 
                 await _callRepository.AddRangeAsync(calls, context.CancellationToken);
 
-                //todo
-                var callIns = calls.Where(d => d.Direction == ECallDirection.In).ToList();
-                if (callIns.Any())
+                //推省上
+                if (calls.Any())
                 {
+                    var callIns = _mapper.Map<List<CallNativeDto>>(calls);
                     await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineCallAdd, callIns);
                 }
+                ////todo
+                //var callIns = calls.Where(d => d.Direction == ECallDirection.In).ToList();
+                //if (callIns.Any())
+                //{
+                //    await _capPublisher.PublishAsync(Hotline.Share.Mq.EventNames.HotlineCallAdd, callIns);
+                //}
             }
             catch (Exception e)
             {

+ 1 - 0
src/Hotline.Application/Mappers/CallMapperConfigs.cs

@@ -111,6 +111,7 @@ namespace Hotline.Application.Mappers
                 .Map(d => d.Duration, s => s.Duration)
                 .Map(d => d.TelNo, s => s.TelNo)
                 .Map(d => d.RecordingFileUrl, s => s.AudioFile)
+                .Map(d => d.OtherAccept, s => s.Id)
                 ;
 
             config.ForType<TrCallRecord, TrCallDtoNew>()

+ 1 - 1
src/Hotline.Share/Hotline.Share.csproj

@@ -7,7 +7,7 @@
     <GenerateDocumentationFile>True</GenerateDocumentationFile>
     <NoWarn>$(NoWarn);1591;8618;</NoWarn>
     <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-    <Version>1.0.91</Version>
+    <Version>1.0.93</Version>
   </PropertyGroup>
 
   <ItemGroup>