using Hotline.Share.Enums.CallCenter;
using Hotline.Share.Requests;
using Hotline.Share.Tools;
using System.ComponentModel.DataAnnotations;
using XF.Utility.EnumExtensions;
namespace Hotline.Share.Dtos.CallCenter;
public record BiQueryCallsDto : ReportRequiredPagedRequest
{
///
/// 线路
///
public string? Line { get; set; }
///
/// 查询类型 1:呼入总量明细;2:接通总量明细
///
public string? TypeCode { get; set; } = "1";
}
public record QueryCallListDto : PagedRequest
{
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public string Type { get; set; }
public string Source { get; set; }
public TimeSpan? StartHourTo { get; set; }
}
public class BiQueryHourCallDto : StartEndTimeDto
{
public string Source { get; set; }
}
public class BiQueryGateWayDto : StartEndTimeDto
{
public string Gateway { get; set; }
}
public class StartEndTimeDto
{
[Required]
public DateTime StartTime { get; set; }
[Required]
public DateTime EndTime { get; set; }
}
public record PagedStartEndTimeDto : PagedRequest
{
[Required]
public DateTime StartTime { get; set; }
[Required]
public DateTime EndTime { get; set; }
}
public class TotalList
{
public TotalList()
{
}
public TotalList(List list, T total)
{
List = list;
Total = total;
}
public T Total { get; set; }
public List List { get; set; }
}
public class TotalData
{
public TotalData()
{
}
public TotalData(List list, int total)
{
Data = list;
Total = total;
}
public int Total { get; set; }
public List Data { get; set; }
}
public record QueryCallsStatisticsDetailInDto : PagedStartEndTimeDto
{
///
/// 工单编号
///
public string? OrderNo { get; set; }
///
/// 主叫
///
public string? FromNo { get; set; }
///
/// 被叫
///
public string? ToNo { get; set; }
///
/// 分机号码
///
public string? TelNo { get; set; }
///
/// 挂断方
///
public EEndBy? EndBy { get; set; }
///
/// 上一个页面点击的字段名称
///
public string? FieldName { get; set; }
}
public class QueryCallsStatisticsDetailOutDto
{
public string Id { get; set; }
public string? OrderId { get; set; }
///
/// 工单号
///
public string? OrderNo { get; set; }
///
/// 工单标题
///
public string? OrderTitle { get; set; }
///
/// 主叫
///
public string FromNo { get; set; }
///
/// 被叫
///
public string ToNo { get; set; }
///
/// 响应分机号
///
public string TelNo { get; set; }
///
/// 挂断方
///
public EEndBy? EndBy { get; set; }
public string EndByTxt => EndBy.GetDescription();
///
/// 话务员姓名
///
public string UserName { get; set; }
///
/// 分机组id(技能组Id)
///
public string? GroupId { get; set; }
///
/// IVR开始时间
///
public DateTime? BeginIvrTime { get; set; }
///
/// 接听时间
///
public DateTime? AnsweredTime { get; set; }
///
/// 挂机时间
///
public DateTime EndTime { get; set; }
///
/// 通话时长(秒)
///
public int Duration { get; set; }
///
/// 语音文件路径
///
public string AudioFile { get; set; }
}
#region 宜宾新话务报表
public class QueryCallDateStatisticsDetailDto
{
public DateTime? StartTime { get; set; }
public DateTime? EndTime { get; set; }
}
public class QueryCallDateStatisticsDetailResp
{
///
/// 日期
///
public string Date { get; set; }
///
/// 呼入总量(计算所得)
///
public int CallInTotal => IvrCallInTotal + PersonCallInCount + EnterpriseCallInCount + AiCallInCount;
///
/// IVR呼入总量
///
public int IvrCallInTotal { get; set; }
///
/// 个人服务呼入总量
///
public int PersonCallInCount { get; set; }
///
/// 企业服务呼入总量
///
public int EnterpriseCallInCount { get; set; }
///
/// 智能应答呼入总量
///
public int AiCallInCount { get; set; }
///
/// 接通总量(计算所得)
///
public int PutthroughCount => PersonCallInPutthroughCount+ EnterpriseCallInPutthroughCount + AiCallInPutthroughCount;
///
/// 个人服务接通量
///
public int PersonCallInPutthroughCount { get; set; }
///
/// 企业服务接通量
///
public int EnterpriseCallInPutthroughCount { get; set; }
///
/// 智能应答呼入总量
///
public int AiCallInPutthroughCount { get; set; }
///
/// 挂断总量
///
public int RingOffCount => PersonRingOffCount + EnterpriseRingOffCount + IvrRingOffCount;
///
/// 个人服务挂断总量
///
public int PersonRingOffCount { get; set; }
///
/// 企业服务挂断总量
///
public int EnterpriseRingOffCount { get; set; }
///
/// IVR挂断总量
///
public int IvrRingOffCount { get; set; }
///
/// 总体接通率
///
public double TotalPutthroughRate => PutthroughCount == 0 ? 0 : Math.Round(((double)PutthroughCount / CallInTotal)*100,2);
///
/// 总体接通率(文本)
///
public string TotalPutthroughRateText => TotalPutthroughRate + "%";
///
/// 服务接通率
///
public double ServicePutthorughRate => (PersonCallInPutthroughCount + EnterpriseCallInPutthroughCount + AiCallInPutthroughCount) == 0 ? 0 : Math.Round(((double)PutthroughCount / (PersonCallInPutthroughCount + EnterpriseCallInPutthroughCount + AiCallInPutthroughCount)) * 100, 2);
///
/// 服务接通率(文本)
///
public string ServicePutthorughRateText => ServicePutthorughRate + "%";
///
/// 话务接通率
///
public double CallPutthorughRate => (PersonCallInPutthroughCount + EnterpriseCallInPutthroughCount) == 0 ? 0 : Math.Round(((double)(PersonCallInPutthroughCount + EnterpriseCallInPutthroughCount)) / (PersonCallInCount + EnterpriseCallInCount) * 100, 2);
///
/// 话务接通率(文本)
///
public string CallPutthorughRateText => CallPutthorughRate + "%";
}
public class QueryPersonCallDateStatisticsDetailResp
{
///
/// 日期
///
public string Date { get; set; }
///
/// 个人服务呼入总量
///
public int PersonCallInCount { get; set; }
///
/// 个人服务接通量
///
public int PersonCallInPutthroughCount { get; set; }
///
/// 个人服务挂断总量
///
public int PersonRingOffCount => PersonQueueOffCount + PersonWaitOffCount;
///
/// 个人服务队列挂断
///
public int PersonQueueOffCount { get; set; }
///
/// 个人服务等待挂断
///
public int PersonWaitOffCount { get; set; }
///
/// 个人服务接通率
///
public double PersonCallPutthorughRate => PersonCallInPutthroughCount == 0 ? 0 : Math.Round(((double)(PersonCallInPutthroughCount)) / (PersonCallInCount) * 100, 2);
///
/// 个人服务接通率
///
public string PersonCallPutthorughRateText => PersonCallPutthorughRate + "%";
}
public class QueryEnterpriseCallDateStatisticsDetailResp
{
///
/// 日期
///
public string Date { get; set; }
///
/// 企业服务呼入总量
///
public int EnterpriseCallInCount { get; set; }
///
/// 企业服务接通量
///
public int EnterpriseCallInPutthroughCount { get; set; }
///
/// 企业服务挂断总量
///
public int EnterpriseRingOffCount => EnterpriseQueueOffCount + EnterpriseWaitOffCount;
///
/// 企业服务队列挂断
///
public int EnterpriseQueueOffCount { get; set; }
///
/// 企业服务等待挂断
///
public int EnterpriseWaitOffCount { get; set; }
///
/// 企业服务接通率
///
public double EnterpriseCallPutthorughRate => EnterpriseCallInPutthroughCount == 0 ? 0 : Math.Round(((double)(EnterpriseCallInPutthroughCount)) / (EnterpriseCallInCount) * 100, 2);
///
/// 个人服务接通率
///
public string EnterpriseCallPutthorughRateText => EnterpriseCallPutthorughRate + "%";
}
public class QueryCallOutDateStatisticsDetailResp
{
///
/// 日期
///
public string Date { get; set; }
///
/// 呼出总量
///
public int CallOutTotal => PersonCallOutCount + EnterpriseCallOutCount + AiVisitCallOutCount + AiCallOutCount;
///
/// 个人服务呼出总量
///
public int PersonCallOutCount { get; set; }
///
/// 企业服务呼出总量
///
public int EnterpriseCallOutCount { get; set; }
///
/// 智能回访呼出总量
///
public int AiVisitCallOutCount { get; set; }
///
/// 智能外呼呼出总量
///
public int AiCallOutCount { get; set; }
///
/// 呼出接通数
///
public int CallOutPutthroughCount => PersonCallOutPutthroughCount + EnterpriseCallOutPutthroughCount + AiVisitCallOutPutthroughCount + AiCallOutPutthroughCount;
///
/// 个人服务呼出接通数
///
public int PersonCallOutPutthroughCount { get; set; }
///
/// 企业服务呼出接通数
///
public int EnterpriseCallOutPutthroughCount { get; set; }
///
/// 智能回访呼出接通数
///
public int AiVisitCallOutPutthroughCount { get; set; }
///
/// 智能外呼呼出接通数
///
public int AiCallOutPutthroughCount { get; set; }
///
/// 呼出接通率
///
public double CallOutPutthroughRate => CallOutTotal == 0 ? 0 : Math.Round(((double)CallOutPutthroughCount / CallOutTotal) * 100, 2);
public string CallOutPutthroughRateText => CallOutPutthroughRate + "%";
///
/// 个人服务呼出接通率
///
public double PersonCallOutPutthroughRate => PersonCallOutCount == 0 ? 0 : Math.Round(((double)PersonCallOutPutthroughCount / PersonCallOutCount) * 100, 2);
public string PersonCallOutPutthroughRateText => PersonCallOutPutthroughRate + "%";
///
/// 企业服务呼出接通率
///
public double EnterpriseCallOutPutthroughRate => EnterpriseCallOutCount == 0 ? 0 : Math.Round(((double)EnterpriseCallOutPutthroughCount / EnterpriseCallOutCount) * 100, 2);
public string EnterpriseCallOutPutthroughRateText => EnterpriseCallOutPutthroughRate + "%";
///
/// 智能回访呼出接通率
///
public double AiVisitCallOutPutthroughRate => AiVisitCallOutCount == 0 ? 0 : Math.Round(((double)AiVisitCallOutPutthroughCount / AiVisitCallOutCount) * 100, 2);
public string AiVisitCallOutPutthroughRatetext => AiVisitCallOutPutthroughRate + "%";
///
/// 智能外呼呼出接通率
///
public double AiCallOutPutthroughRate => AiCallOutCount == 0 ? 0 : Math.Round(((double)AiCallOutPutthroughCount / AiCallOutCount) * 100, 2);
public string AiCallOutPutthroughRateText => AiCallOutPutthroughRate + "%";
}
public class QuerySeatMonthCallResp
{
///
/// 坐席姓名
///
public string Name { get; set; }
///
/// 用户ID
///
public string UserId { get; set; }
///
/// 呼入总量
///
public int InTotal => InAnswered + InHanguped;
///
/// 呼入接通量
///
public int InAnswered { get; set; }
///
/// 有效接通量
///
public int InAvailableAnswer { get; set; }
///
/// 呼入接通秒挂
///
public int InHangupImmediateWhenAnswered { get; set; }
///
/// 超时接通量
///
public int OverTimeImmediate { get; set; }
///
/// 按时接通量
///
public int InTimeImmediate { get; set; }
///
/// 呼入未接通总量
///
public int InHanguped { get; set; }
///
/// 未接通秒挂量
///
public int InHangupImmediate { get; set; }
///
/// 超时未接通量
///
public int OverTimeInHanguped { get; set; }
///
/// 呼入接通率
///
public double InAnsweredRate => InTotal > 0 ? Math.Round(((double)InAnswered / (double)InTotal) * 100, digits: 2) : 0;
///
/// 呼入接通率(显示)
///
public string InAnsweredRateString => this.InAnsweredRate + "%";
}
public class QuerySeatMonthCallRequest
{
///
/// 振铃开始时间开始
///
public DateTime? StartTime { get; set; }
///
/// 振铃开始时间结束
///
public DateTime? EndTime { get; set; }
///
/// 员工ID
///
public string? EmpId { get; set; }
}
public record QuerySeatMonthCallDetailRequest:PagedRequest
{
///
/// 坐席ID
///
public string? EmpId { get; set; }
///
/// 主叫
///
public string? Cpn { get; set; }
///
/// 被叫
///
public string? Cdpn { get; set; }
///
/// 分机号
///
public string? TelNo { get; set; }
///
/// 接通时间开始
///
public DateTime? AnsweredStartTime { get; set; }
///
/// 接通时间结束
///
public DateTime? AnsweredEndTime { get; set; }
///
/// 振铃时间开始
///
public DateTime? RingStartTime { get; set; }
///
/// 振铃时间结束
///
public DateTime? RingEndTime { get;set; }
}
public class QuerySeatMonthCallDetailResp
{
///
/// 主叫
///
public string Cpn { get; set; }
///
/// 被叫
///
public string Cdpn { get; set; }
///
/// 振铃开始时间
///
public DateTime? RingTimeBegin { get; set; }
///
/// 接通时间
///
public DateTime? AnsweredTime { get; set; }
///
/// 响应分机
///
public string? TelNo { get; set; }
///
/// 坐席名称
///
public string? SeatName { get; set; }
}
#endregion