|
@@ -37,7 +37,7 @@ public class CallNativeRepository : BaseRepository<CallNative>, ICallNativeRepos
|
|
}
|
|
}
|
|
|
|
|
|
var list = await Db.Reportable(dts).ToQueryable<DateTime>()
|
|
var list = await Db.Reportable(dts).ToQueryable<DateTime>()
|
|
- .LeftJoin<CallNative>((it, o) => o.BeginIvrTime >= it.ColumnName && o.BeginIvrTime < it.ColumnName.AddHours(1) && o.Direction == ECallDirection.In)
|
|
|
|
|
|
+ .LeftJoin<CallNative>((it, o) => o.BeginIvrTime >= it.ColumnName && o.BeginIvrTime < it.ColumnName.AddHours(1) && o.Direction == ECallDirection.In && o.CallState != ECallState.Invalid)
|
|
//.Where((it, o) => o.CallDirection == ECallDirection.In)
|
|
//.Where((it, o) => o.CallDirection == ECallDirection.In)
|
|
.WhereIF(!string.IsNullOrEmpty(source), (it, o) => o.ToNo == source)
|
|
.WhereIF(!string.IsNullOrEmpty(source), (it, o) => o.ToNo == source)
|
|
.GroupBy((it, o) => it.ColumnName)
|
|
.GroupBy((it, o) => it.ColumnName)
|
|
@@ -45,11 +45,11 @@ public class CallNativeRepository : BaseRepository<CallNative>, ICallNativeRepos
|
|
{
|
|
{
|
|
DateTimeTo = it.ColumnName,
|
|
DateTimeTo = it.ColumnName,
|
|
Hour = it.ColumnName.Hour, //小时段
|
|
Hour = it.ColumnName.Hour, //小时段
|
|
- EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.Duration >= effectiveTimes, 1, 0)),//有效接通
|
|
|
|
- ConnectByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.Duration > 0 && o.Duration <= connectByeTimes, 1, 0)), //接通秒挂
|
|
|
|
- NoConnectByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.Duration == 0 && o.RingDuration <= noConnectByeTimes && o.RingDuration > 0, 1, 0)), //未接通秒挂
|
|
|
|
- QueueByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.WaitDuration > 0 && o.RingDuration == 0 && o.AnsweredTime == null, 1, 0)), //队列挂断
|
|
|
|
- IvrByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.BeginIvrTime.HasValue && !o.BeginQueueTime.HasValue && !o.BeginRingTime.HasValue && o.AnsweredTime == null, 1, 0)), //IVR挂断
|
|
|
|
|
|
+ EffectiveCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.AnsweredTime != null, 1, 0)),//有效接通
|
|
|
|
+ ConnectByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.AnsweredTime != null && o.Duration < connectByeTimes, 1, 0)), //接通秒挂
|
|
|
|
+ NoConnectByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.RingDuration <= noConnectByeTimes && o.RingDuration > 0, 1, 0)), //未接通秒挂
|
|
|
|
+ QueueByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.CallState == ECallState.NotAcceptedHang, 1, 0)), //队列挂断
|
|
|
|
+ IvrByeCount = SqlFunc.AggregateSum(SqlFunc.IIF(o.CallState == ECallState.IVRNoAccept, 1, 0)), //IVR挂断
|
|
})
|
|
})
|
|
.MergeTable()
|
|
.MergeTable()
|
|
.OrderBy(x => x.Hour)
|
|
.OrderBy(x => x.Hour)
|