|
@@ -153,27 +153,29 @@ public class YiBinCallReportApplication : CallReportApplicationBase, ICallReport
|
|
|
var recordPrefix = _systemSettingCacheManager.RecordPrefix;
|
|
|
var query = _trCallRecordRepository.Queryable()
|
|
|
.Includes(p => p.Order)
|
|
|
- .Where(p => p.CreatedTime >= dto.StartTime && p.CreatedTime <= dto.EndTime)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.UserId), p => p.UserId == dto.UserId)
|
|
|
- .WhereIF(!string.IsNullOrEmpty(dto.UserName), p => p.UserName == dto.UserName)
|
|
|
- .WhereIF(dto.FieldName == "inTotal", p => p.CallDirection == ECallDirection.In) //呼入总量
|
|
|
- .WhereIF(dto.FieldName == "inAnswered", p => p.CallDirection == ECallDirection.In && p.AnsweredTime != null) //接通总量
|
|
|
- .WhereIF(dto.FieldName == "inHangupImmediate", p => p.CallDirection == ECallDirection.In && p.AnsweredTime == null && p.RingTimes < noConnectByeTimes) //呼入秒挂
|
|
|
- .WhereIF(dto.FieldName == "inHanguped", p => p.CallDirection == ECallDirection.In && p.AnsweredTime == null && p.RingTimes > ringTims) //呼入超时未接
|
|
|
- .WhereIF(dto.FieldName == "inAvailableAnswer", p => p.CallDirection == ECallDirection.In && p.AnsweredTime != null && p.Duration >= effectiveTimes) //有效接通量
|
|
|
- .WhereIF(dto.FieldName == "inHangupImmediateWhenAnswered", p => p.CallDirection == ECallDirection.In && p.AnsweredTime != null && p.Duration < connectByeTimes) //接通秒挂
|
|
|
- .WhereIF(dto.FieldName == "outTotal", p => p.CallDirection == ECallDirection.Out) //呼出总量
|
|
|
- .WhereIF(dto.FieldName == "outAnswered", p => p.CallDirection == ECallDirection.Out && p.AnsweredTime != null) //呼出接通量
|
|
|
- .OrderByDescending(p => p.BeginIvrTime)
|
|
|
- .Select(m => new CallRecordOutDto()
|
|
|
+ .LeftJoin<User>((p, u) => p.UserId == u.Id && !u.IsDeleted)
|
|
|
+ .Where((p, u) => p.CreatedTime >= dto.StartTime && p.CreatedTime <= dto.EndTime)
|
|
|
+ .Where((p, u) => u.Roles.Any(x => setting.Contains(x.Name)))
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.UserId), (p, u) => p.UserId == dto.UserId)
|
|
|
+ .WhereIF(!string.IsNullOrEmpty(dto.UserName), (p, u) => p.UserName == dto.UserName)
|
|
|
+ .WhereIF(dto.FieldName == "inTotal", (p, u) => p.CallDirection == ECallDirection.In) //呼入总量
|
|
|
+ .WhereIF(dto.FieldName == "inAnswered", (p, u) => p.CallDirection == ECallDirection.In && p.AnsweredTime != null) //接通总量
|
|
|
+ .WhereIF(dto.FieldName == "inHangupImmediate", (p, u) => p.CallDirection == ECallDirection.In && p.AnsweredTime == null && p.RingTimes < noConnectByeTimes) //呼入秒挂
|
|
|
+ .WhereIF(dto.FieldName == "inHanguped", (p, u) => p.CallDirection == ECallDirection.In && p.AnsweredTime == null && p.RingTimes > ringTims) //呼入超时未接
|
|
|
+ .WhereIF(dto.FieldName == "inAvailableAnswer", (p, u) => p.CallDirection == ECallDirection.In && p.AnsweredTime != null && p.Duration >= effectiveTimes) //有效接通量
|
|
|
+ .WhereIF(dto.FieldName == "inHangupImmediateWhenAnswered", (p, u) => p.CallDirection == ECallDirection.In && p.AnsweredTime != null && p.Duration < connectByeTimes) //接通秒挂
|
|
|
+ .WhereIF(dto.FieldName == "outTotal", (p, u) => p.CallDirection == ECallDirection.Out) //呼出总量
|
|
|
+ .WhereIF(dto.FieldName == "outAnswered", (p, u) => p.CallDirection == ECallDirection.Out && p.AnsweredTime != null) //呼出接通量
|
|
|
+ .OrderByDescending((p, u) => p.BeginIvrTime)
|
|
|
+ .Select(p => new CallRecordOutDto()
|
|
|
{
|
|
|
- FromNo = m.CPN,
|
|
|
- ToNo = m.CDPN,
|
|
|
- Direction = m.CallDirection,
|
|
|
- EndTime = m.OverTime,
|
|
|
- OrderId = m.Order.Id,
|
|
|
- OrderTitle = m.Order.Title,
|
|
|
- OrderNo = m.Order.No
|
|
|
+ FromNo = p.CPN,
|
|
|
+ ToNo = p.CDPN,
|
|
|
+ Direction = p.CallDirection,
|
|
|
+ EndTime = p.OverTime,
|
|
|
+ OrderId = p.Order.Id,
|
|
|
+ OrderTitle = p.Order.Title,
|
|
|
+ OrderNo = p.Order.No
|
|
|
}, true);
|
|
|
|
|
|
if (isAll)
|