|
@@ -66,7 +66,7 @@ namespace CallCenter.Application.Handlers
|
|
|
else
|
|
|
{
|
|
|
var callDetail = await
|
|
|
- _callDetailRepository.GetAsync(x => x.OMCallId == notification.CallId, true, x => x.CreationTime, cancellationToken);
|
|
|
+ _callDetailRepository.GetAsync(x => x.OMCallId == notification.CallId && x.CreationTime >= DateTime.Now.AddHours(-2), true, x => x.CreationTime, cancellationToken);
|
|
|
|
|
|
if (callDetail != null)
|
|
|
{
|
|
@@ -178,25 +178,35 @@ namespace CallCenter.Application.Handlers
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- throw new UserFriendlyException(ex.Message);
|
|
|
+ _logger.LogInformation("推送通话报告失败:" + ex.Message);
|
|
|
+ //throw new UserFriendlyException(ex.Message);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 推送超时未接记录报告
|
|
|
//准备报告
|
|
|
//查询是否有15秒未接
|
|
|
- var ringList = call.CallDetails?.Where(x => x.CallStatus == ECallStatus.Ring).ToList();
|
|
|
+ var CallDetails = call.CallDetails;
|
|
|
+
|
|
|
+ var ringList = CallDetails?.Where(x => x.CallStatus == ECallStatus.Ring).ToList();
|
|
|
//多个振铃,包括转接(需要验证转接分机)
|
|
|
if (ringList!=null && ringList.Count>1)
|
|
|
{
|
|
|
List<OutCallNotReceivedDto> NotReceivedList = new List<OutCallNotReceivedDto>();
|
|
|
+
|
|
|
+ int count = CallDetails?.Count(x => x.CallStatus == ECallStatus.Answer)??0;
|
|
|
+ if (count>0)
|
|
|
+ {
|
|
|
+ ringList.RemoveRange(ringList.Count-2,count);
|
|
|
+ }
|
|
|
//验证是否被接过
|
|
|
for (int i = 0; i < ringList.Count; i++)
|
|
|
{
|
|
|
- bool IsReceived = call.CallDetails?.Any(x => x.CallStatus == ECallStatus.Answer && x.AnswerNo == ringList[i].AnswerNo)??false;
|
|
|
+
|
|
|
+ //bool IsReceived = CallDetails?.Any(x => x.CallStatus == ECallStatus.Answer && x.AnswerNo == ringList[i].AnswerNo)??false;
|
|
|
//未接听 加入到集合中
|
|
|
- if (!IsReceived)
|
|
|
- {
|
|
|
+ //if (!IsReceived)
|
|
|
+ //{
|
|
|
var notReceivedEntity = new OutCallNotReceivedDto();
|
|
|
notReceivedEntity.CallId = ringList[i].CallId;
|
|
|
notReceivedEntity.Cpn = ringList[i].FromNo;
|
|
@@ -207,7 +217,7 @@ namespace CallCenter.Application.Handlers
|
|
|
var iswork = await _workRepository.AnyAsync(x => x.TelNo == notReceivedEntity.Answered && !x.EndTime.HasValue);
|
|
|
notReceivedEntity.IsWorkRing = iswork;
|
|
|
NotReceivedList.Add(notReceivedEntity);
|
|
|
- }
|
|
|
+ //}
|
|
|
}
|
|
|
if (NotReceivedList.Count>0)
|
|
|
{
|
|
@@ -227,7 +237,8 @@ namespace CallCenter.Application.Handlers
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- throw new UserFriendlyException(ex.Message);
|
|
|
+ _logger.LogInformation("推送未接听报告失败:" + ex.Message);
|
|
|
+ //throw new UserFriendlyException(ex.Message);
|
|
|
}
|
|
|
}
|
|
|
|