using Hotline.Share.Enums.CallCenter;
using Hotline.Share.Requests;
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 => PutthroughCount == 0 ? 0 : Math.Round(((double)PutthroughCount / CallInTotal) * 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 { get; set; }
///
/// 个人服务队列挂断
///
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 { get; set; }
///
/// 企业服务队列挂断
///
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 + "%";
}
#endregion