|
@@ -24,35 +24,54 @@ namespace Hotline.Application.Mappers
|
|
|
.Map(d => d.CPNName, x => x.caller_id_name)
|
|
|
.Map(d=>d.CDPN,x=>x.destination_number)
|
|
|
.Map(d => d.RecordingFileUrl, x => x.recording_file_url)
|
|
|
- .Map(d => d.CreatedTime, x => x.created_time)
|
|
|
- .Map(d=> d.AnsweredTime,x=>x.answered_time)
|
|
|
+ //.Map(d => d.CreatedTime, x => x.created_time)
|
|
|
+ //.Map(d=> d.AnsweredTime,x=>x.answered_time)
|
|
|
//.IgnoreIf((s, d) => s.answered_time == null, d => d.AnsweredTime)
|
|
|
- .Map(d => d.OverTime, x => x.over_time)
|
|
|
+ //.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)
|
|
|
- .Map(d=>d.BeginIvrTime,x=>x.beginIvrTime)
|
|
|
- .Map(d=>d.EndIvrTime,x=>x.endIvrTime)
|
|
|
- .Map(d=>d.BeginQueueTime,x=>x.beginQueueTime)
|
|
|
- .Map(d=>d.EndQueueTime,x=>x.endQueueTime)
|
|
|
- .Map(d=>d.BeginRingTime,x=>x.beginRingTime)
|
|
|
- .Map(d=>d.EndRingTimg,x=>x.endRingTime)
|
|
|
- .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.BeginIvrTime,x=>x.beginIvrTime)
|
|
|
+ //.Map(d=>d.EndIvrTime,x=>x.endIvrTime)
|
|
|
+ //.Map(d=>d.BeginQueueTime,x=>x.beginQueueTime)
|
|
|
+ //.Map(d=>d.EndQueueTime,x=>x.endQueueTime)
|
|
|
+ //.Map(d=>d.BeginRingTime,x=>x.beginRingTime)
|
|
|
+ //.Map(d=>d.EndRingTimg,x=>x.endRingTime)
|
|
|
+ //.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);
|
|
|
-
|
|
|
+ .Map(d => d.DtmfType, x => x.dtmf_type)
|
|
|
+ .AfterMapping((s, d) =>{d.CreatedTime = DateTime.Parse(s.created_time);})
|
|
|
+ .AfterMapping((s,d) =>{d.AnsweredTime = FormatDateTime(s.answered_time);})
|
|
|
+ .AfterMapping((s, d) => { d.OverTime = DateTime.Parse(s.over_time); })
|
|
|
+ .AfterMapping((s, d) => { d.BeginIvrTime = FormatDateTime(s.beginIvrTime); })
|
|
|
+ .AfterMapping((s, d) => { d.EndIvrTime = FormatDateTime(s.endIvrTime); })
|
|
|
+ .AfterMapping((s, d) => { d.BeginQueueTime = FormatDateTime(s.beginQueueTime); })
|
|
|
+ .AfterMapping((s, d) => { d.EndQueueTime = FormatDateTime(s.endQueueTime); })
|
|
|
+ .AfterMapping((s, d) => { d.BeginRingTime = FormatDateTime(s.beginRingTime); })
|
|
|
+ .AfterMapping((s, d) => { d.EndRingTimg = FormatDateTime(s.endRingTime); });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
config.ForType<ReceiveCallEvaluateDto, TrCallEvaluate>()
|
|
|
.Map(d => d.Dtmf, x => x.dtmf)
|
|
|
.Map(d => d.CallAccept, x => x.call_accept)
|
|
|
.Map(d => d.Type, x => x.type);
|
|
|
}
|
|
|
+
|
|
|
+ private DateTime? FormatDateTime(string? time)
|
|
|
+ {
|
|
|
+ if(string.IsNullOrEmpty(time)) return null;
|
|
|
+
|
|
|
+ return DateTime.Parse(time);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|