namespace Hotline.Share.Dtos.CallCenter { public class QueryCallsDetailDto { /// /// 日期 /// public string Date { get; set; } /// /// 时间 /// public string Hour { get; set; } /// /// 呼入总量 /// public int InTotal { get; set; } /// /// 呼入接通量 /// public int InConnectionQuantity { get; set; } /// /// 未接秒挂 /// public int NotAcceptedHang { get; set; } /// /// 呼入接通率 /// public string InConnectionRate => CalcSatisfiedRate(InTotal - NotAcceptedHang, InConnectionQuantity); /// /// 呼入总时长 /// public double TotalDurationIncomingCalls { get; set; } /// /// 平均时长 /// public double AverageDuration => CalcAvg(TotalDurationIncomingCalls, InConnectionQuantity); /// /// 有效接通量 /// public int InAvailableAnswer { get; set; } /// /// 呼入接通秒挂 /// public int InHangupImmediateWhenAnswered { get; set; } /// /// 有效接通率 /// public string EffectiveConnectionRate => CalcSatisfiedRate(InConnectionQuantity, InAvailableAnswer - InHangupImmediateWhenAnswered); /// /// 超时接通 /// public int TimeoutConnection { get; set; } /// /// 超时挂断 /// public int TimeoutSuspension { get; set; } /// /// 按时接通率 /// public string OnTimeConnectionRate => CalcSatisfiedRate(InConnectionQuantity, InConnectionQuantity - TimeoutConnection - TimeoutSuspension); /// /// 队列挂断 /// public int QueueByeCount { get; set; } /// /// IVR挂断 /// public int IvrByeCount { get; set; } /// /// 呼出总量 /// public int OutTotal { get; set; } /// /// 呼出接通量 /// public int OutConnectionQuantity { get; set; } /// /// 呼出接通率 /// public string OutConnectionRate => CalcSatisfiedRate(OutTotal, OutConnectionQuantity); /// /// 计算平均 /// /// 总数 /// /// public double CalcAvg(double Count, int Quantity) { if (Count <= 0 || Quantity <= 0) return 0; return Math.Round((Count / (double)Quantity), 3); } /// /// 计算满意度 /// /// 总数 /// /// public string CalcSatisfiedRate(int Count, int Quantity) { if (Count <= 0 || Quantity <= 0) return 0 + "%"; return Math.Round((Quantity / (double)Count) * 100, 3) + "%"; } } public class QueryCallsDetailStatistics { /// /// 日期 /// public string Date { get; set; } /// /// 呼入总量 (呼入接通 + 挂机量 + 呼入队列挂断) /// public int InTotal { get; set; } /// /// 呼入队列挂断 /// public int NotAcceptedHang { get; set; } /// /// 呼入接通量 /// public int InConnectionQuantity { get; set; } /// /// 挂机量(呼入 + telno 非空 + 通话时间是0) /// public int InNotAnswered { get; set; } /// /// 呼入接通率 /// public string InConnectionRate => CalcSatisfiedRate(InTotal, InConnectionQuantity + InNotAnswered); /// /// 呼入IVR挂断 /// public int IvrByeCount { get; set; } /// /// 呼出接通量 /// public int OutConnectionQuantity { get; set; } /// /// 呼出未接通 /// public int OutNotAnswered { get; set; } /// /// 计算满意度 /// /// 总数 /// /// public string CalcSatisfiedRate(int Count, int Quantity) { if (Count <= 0 || Quantity <= 0) return 0 + "%"; return Math.Round((Quantity / (double)Count) * 100, 3) + "%"; } } }