|
@@ -1,4 +1,7 @@
|
|
|
-using Mapster;
|
|
|
+using Hotline.CallCenter.Calls;
|
|
|
+using Hotline.Share.Dtos.TrCallCenter;
|
|
|
+using Hotline.Share.Enums.CallCenter;
|
|
|
+using Mapster;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
@@ -11,7 +14,32 @@ namespace Hotline.Application.Mappers
|
|
|
{
|
|
|
public void Register(TypeAdapterConfig config)
|
|
|
{
|
|
|
- //config
|
|
|
+ config.ForType<ReceiveCallRecordDto, TrCallRecord>()
|
|
|
+ .Map(d => d.User, x => x.user)
|
|
|
+ .Map(d => d.RecordingFileName, x => x.recording_file_name)
|
|
|
+ .Map(d => d.CallDirection, x => x.call_direction == "in" ? ECallDirection.In : ECallDirection.Out)
|
|
|
+ .Map(d => d.EndBy, x => x.hangup_side == "caller" ? EEndBy.From : (x.hangup_side == "callee" ? EEndBy.To : EEndBy.None))
|
|
|
+ .Map(d => d.CallAccept, x => x.call_accept)
|
|
|
+ .Map(d => d.CPN, x => x.caller_id_number)
|
|
|
+ .Map(d => d.CPNName, x => x.caller_id_name)
|
|
|
+ .Map(d => d.RecordingFileUrl, x => x.recording_file_url)
|
|
|
+ .Map(d => d.CreatedTime, x => x.created_time)
|
|
|
+ .IgnoreIf((s, d) => s.answered_time == null, d => d.AnsweredTime)
|
|
|
+ .Map(d => d.OverTime, x => x.over_time)
|
|
|
+ .Map(d => d.Gateway, x => x.gateway)
|
|
|
+ .Map(d => d.OtherStr, x => x.other_str)
|
|
|
+ .Map(d => d.OtherAccept, x => x.other_accept)
|
|
|
+ .Map(d => d.Status, x => x.status)
|
|
|
+ .IgnoreIf((s, d) => s.beginIvrTime == null, d => d.BeginIvrTime)
|
|
|
+ .IgnoreIf((s, d) => s.endIvrTime == null, d => d.EndIvrTime)
|
|
|
+ .IgnoreIf((s, d) => s.beginQueueTime == null, d => d.BeginQueueTime)
|
|
|
+ .IgnoreIf((s, d) => s.endQueueTime == null, d => d.EndQueueTime)
|
|
|
+ .IgnoreIf((s, d) => s.beginRingTime == null, d => d.BeginRingTime)
|
|
|
+ .IgnoreIf((s, d) => s.endRingTime == null, d => d.EndRingTimg)
|
|
|
+ .Map(d => d.OlaQueue, x => x.ola_queue)
|
|
|
+ .Map(d => d.BatchAccept, x => x.batch_accept)
|
|
|
+ .Map(d => d.IvrDtmf, x => x.ivr_dtmf)
|
|
|
+ .Map(d => d.DtmfType, x => x.dtmf_type);
|
|
|
}
|
|
|
}
|
|
|
}
|