using Hotline.Share.Dtos.CallCenter; using Hotline.Share.Dtos.Settings; using Hotline.Share.Dtos.Users; using Hotline.Share.Enums.Order; using Hotline.Share.Requests; using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using XF.Utility.EnumExtensions; namespace Hotline.Share.Dtos.Order { public record CanLinkCallRecordOrderVisitDto : PagedKeywordRequest { } public record QueryOrderVisitDto : PagedKeywordRequest { public EVisitStateQuery VisitStateQuery { get; set; } /// /// 归档方式 /// public FiledType? FiledType { get; set; } /// /// 是否会签 /// public bool? IsCountersign { get; set; } /// /// 回访方式 /// public EVisitType? VisitType { get; set; } /// /// 工单编号 /// public string? No { get; set; } /// /// 是否只查询自己的待回访工单 /// public bool? QuerySelf { get; set; } /// /// 回访人 /// public string? EmployeeName { get; set; } /// /// 是否省工单 /// public bool? IsProvince { get; set; } /// /// 是否有效智能回访 /// public bool? IsEffectiveAiVisit { get; set; } /// /// 来电号码 /// public string? FromPhone { get; set; } /// /// 联系电话 /// public string? Contact { get; set; } /// /// 语音评价(话务评价) /// public List VoiceEvaluate { get; set; } = new(); /// /// 话务员评价(话务评价) /// public List SeatEvaluate { get; set; } = new(); /// /// 部门办件结果 /// public List OrgProcessingResults { get; set; } = new(); /// /// 部门办件态度 /// public List OrgHandledAttitude { get; set; } = new(); /// /// 来源渠道 /// public string Channel { get; set; } /// /// 是否超期 /// public bool? IsOverTime { get; set; } /// /// 发布时间 /// public DateTime? StartPublishTime { get; set; } /// /// 发布时间 /// public DateTime? EndPublishTime { get; set; } /// /// 接办部门 /// public string? ActualHandleOrgName { get; set; } /// /// 一级部门 /// public string? OrgLevelOneName { get; set; } /// /// 来电主体 /// public EIdentityType? IdentityType { get; set; } /// /// 受理时间(工单创建时间) /// public DateTime? CreationTimeStart { get; set; } public DateTime? CreationTimeEnd { get; set; } /// /// 智能回访结果 /// public EAiVisitResult? AiVisitResult { get; set; } /// /// 是否创建立智能回访任务 /// public bool? IsAiVisit { get; set; } /// /// 工单标签Code /// public string? OrderTagCode { get; set; } /// /// 是否回访结果修改 /// public bool? IsUpdate { get; set; } } public record QueryOrderPublishStatisticsAllDto : PagedRequest { /// /// 开始时间 /// [Required] public DateTime StartTime { get; set; } /// /// 结束时间 /// [Required] public DateTime EndTime { get; set; } } public record QueryOrderPublishStatisticsDto : PagedRequest { /// /// 开始时间 /// [Required] public DateTime StartTime { get; set; } /// /// 结束时间 /// [Required] public DateTime EndTime { get; set; } /// /// 归档方式; 10 = 中心归档, 20 = 部门归档; /// 不传查询全部 /// public EProcessType? ProcessType { get; set; } } public class QueryOrderVisitQuantity : StartEndTimeDto { /// /// 访问员 /// public string? EmployeeName { get; set; } } public record QueryOrderVisitSourceChannelDto { /// /// 开始时间 /// [Required] public DateTime StartTime { get; set; } /// /// 结束时间 /// [Required] public DateTime EndTime { get; set; } } public record VisitJudgeQueryReq : PagedKeywordRequest { /// /// 转接号码 /// public string? TransferPhone { get; set; } /// /// 归档类型 /// public FiledType? FiledType { get; set; } /// /// 工单编号 /// public string? No { get; set; } /// /// 工单标题 /// public string? Title { get; set; } /// /// 回访人 /// public string? VisitUserName { get; set; } /// /// 来电号码 /// public string? FromPhone { get; set; } /// /// 受理类型 /// public string AcceptType { get; set; } /// /// 热点分类 /// public string Hotspot { get; set; } /// /// 接办部门 /// public string OrgId { get; set; } /// /// 受理坐席名字或工号 /// public string? NameOrNo { get; set; } /// /// 受理时间(工单创建时间) /// public DateTime? CreationTimeStart { get; set; } public DateTime? CreationTimeEnd { get; set; } /// /// 办结时间 /// public DateTime? ActualHandleTimeStart { get; set; } public DateTime? ActualHandleTimeEnd { get; set; } /// /// 回访时间 /// public DateTime? VisitTimeStart { get; set; } public DateTime? VisitTimeEnd { get; set; } /// /// 评判状态 /// public EJudgeState? JudgeState { get; set; } /// /// 部门扭转 /// public bool? OrgJudge { get; set; } /// /// 坐席扭转 /// public bool? SeatJudge { get; set; } /// /// 是否待扭转 /// public bool IsIng { get; set; } } public class JudgeVisitReq { public List Ids { get; set; } /// /// 是否同意 /// public bool IsAgree { get; set; } /// /// 是否 /// public string? JudgeContent { get; set; } } public class JudgeVisitRsp { public int ErrorCount { get; set; } public int SuccessCount { get; set; } } public record VisitDetailListDto : PagedKeywordRequest { public EVisitStateQuery VisitState { get; set; } } public record DistributionVisitDto { public List Ids { get; set; } public string UserId { get; set; } } public record VisitPutThroughDto { public string id { get; set; } } public class VisitSmsInDto { [Required] public List Ids { get; set; } } /// /// 批量保存回访入参 /// public class VisitBatchInDto { /// /// 批量保存回访入参 /// public class VisitIdsBatchInDto { /// /// 工单Id /// [Required(ErrorMessage = "工单Id不能为空")] public string OrderId { get; set; } /// /// 回访Id /// [Required(ErrorMessage = "回访Id不能为空")] public string VisitId { get; set; } /// /// 工单标题 /// [Required(ErrorMessage = "工单标题不能为空")] public string No { get; set; } } /// /// 回访Id集合 /// [Required] public List Visit { get; set; } /// /// 话务员评价(话务评价) /// public ESeatEvaluate? SeatEvaluate { get; set; } /// /// 部门办件结果 /// [Required(ErrorMessage = "部门办结结果不能为空")] public Kv OrgProcessingResults { get; set; } /// /// 部门办件态度 /// [Required(ErrorMessage = "部门办件态度不能为空")] public Kv OrgHandledAttitude { get; set; } /// /// 不满意原因 /// public List? OrgNoSatisfiedReason { get; set; } /// /// 话务员回访内容 /// [Required(ErrorMessage = "话务员回访内容不能为空")] public string SeatVisitContent { get; set; } /// /// 部门回访内容 /// [Required(ErrorMessage = "部门回访内容不能为空")] public string OrgVisitContent { get; set; } } public class VisitBatchOutDto { /// /// 总个数 /// public int TotalCount { get; set; } /// /// 成功个数 /// public int CompleteCount { get; set; } /// /// 异常个数 /// public int ErrorCount { get; set; } /// /// 异常信息 /// public string ErrorMessage { get; set; } } public record VisitDto { /// /// 回访主表主键 /// public string Id { get; set; } /// /// 是否接通 /// public bool IsPutThrough { get; set; } /// /// 通话记录ID /// public string? CallId { get; set; } /// /// 是否重办 /// public bool IsAgain { get; set; } /// /// 部门扭转 /// public bool? OrgJudge { get; set; } /// /// 坐席扭转 /// public bool? SeatJudge { get; set; } /// /// 是否回访结果修改 /// public bool? IsUpdate { get; set; } public List VisitDetails { get; set; } } public record VisitDetailDto { /// /// Id /// public string Id { get; set; } /// /// 回访主表ID /// public string VisitId { get; set; } /// /// 语音评价(话务评价) /// public EVoiceEvaluate? VoiceEvaluate { get; set; } /// /// 话务员评价(话务评价) /// public ESeatEvaluate? SeatEvaluate { get; set; } /// /// 部门办件结果 /// public Kv? OrgProcessingResults { get; set; } /// /// 不满意原因 /// public List? OrgNoSatisfiedReason { get; set; } /// /// 部门办件态度 /// public Kv? OrgHandledAttitude { get; set; } /// /// 是否联系 /// public bool? IsContact { get; set; } /// /// 处理结果 /// public bool? Volved { get; set; } /// /// 未解决备注 /// public string? VolveConent { get; set; } /// /// 回访内容 /// public string? VisitContent { get; set; } /// /// 回访部门名称 /// public string? VisitOrgName { get; set; } /// /// 回访部门Code /// public string? VisitOrgCode { get; set; } /// /// 回访对象类型 10:话务员 20:部门 /// public EVisitTarget? VisitTarget { get; set; } } public record OrderVisitAgainListDto : PagedKeywordRequest { } public class AiVisitQueryData { public string Uid { get; set; } public int Status { get; set; } } public class AddVisitApplyDto { public string OrderNo { get; set; } public string OrderId { get; set; } public string VisitReason { get; set; } public string OrderVisitId { get; set; } public List FileIds { get; set; } } public class ExaminOrderVisitDto { public string Id { get; set; } public string? ExaminOpinion { get; set; } public bool IsPass { get; set; } } public class OrderCanVisitAgainDto { public OrderVisitDto OrderVisit { get; set; } /// /// 部门办件结果 /// public Kv? OrgProcessingResults { get; set; } /// /// 不满意原因 /// public List? OrgNoSatisfiedReason { get; set; } /// /// 部门办件态度 /// public Kv? OrgHandledAttitude { get; set; } /// /// 回访部门名称 /// public string VisitOrgName { get; set; } } public class VisitApplyDto { public string? ExaminOpinion { get; set; } public DateTime CreationTime { get; set; } public string OrderNo { get; set; } public string OrderId { get; set; } public OrderDto Order { get; set; } public string EmployeeId { get; set; } public UserDto Employee { get; set; } public string VisitReason { get; set; } /// /// 源单号 /// public string OrderVisitId { get; set; } public OrderVisitDto OrderVisit { get; set; } /// /// 流程ID /// public string? WorkflowId { get; set; } public EVisitApplyState VisitApplyState { get; set; } public string VisitApplyStateText => VisitApplyState.GetDescription(); public string Id { get; set; } public string? CreatorId { get; set; } public string? CreatorName { get; set; } public string? CreatorOrgId { get; set; } public string? CreatorOrgName { get; set; } public int CreatorOrgLevel { get; set; } /// /// 一级部门Id /// public string? AreaId { get; set; } } public record VisitApplyListDto : PagedKeywordRequest { public EVisitApplyState? VisitApplyState { get; set; } } public enum EVisitStateQuery { /// /// 全部 /// [Description("全部")] All = 0, /// /// 已回访 /// [Description("已回访")] Visited = 1, /// /// 未回访 /// [Description("未回访")] NoVisit = 2, /// /// 短信回访中 /// 逻辑需求(Task_317) : 操作了短信回访的工单,在没有短信结果回复前,回访状态需从“待回访”更新为“短信回访中” /// [Description("短信回访中")] SMSVisiting = 21, /// /// 短信不满意待回访 /// 逻辑需求(Task_317) : 若短信回访结果为不满意,回访状态需从“短信回访中”更新为“短信不满意待回访” /// [Description("短信不满意待回访")] SMSUnsatisfied = 41, [Description("未接通")] NoPutThrough = 51, /// /// 智能回访中 /// [Description("智能回访中")] ChipVoiceVisiting = 61, } public class OrderVisitQuantityOutDto { /// /// 回访员 /// public string EmployeeName { get; set; } /// /// 回访员 /// public string EmployeeId { get; set; } /// /// 电话回访量 /// public int CallVisitCount { get; set; } /// /// 默认回访量 /// public int DefaultVisitCount { get; set; } /// /// 短信回访量 /// public int SmsVisitCount { get; set; } /// /// 总回访量 /// public int TotalVisitCount => SmsVisitCount + DefaultVisitCount + CallVisitCount; } public class OrderVisitSourceChannelDto { public int Count { get; set; } public string SourceChannel { get; set; } } public class OrderVisitDto { public string Id { get; set; } public OrderDto Order { get; set; } /// /// 回访状态 /// public EVisitState VisitState { get; set; } public string VisitStateText => VisitState.GetDescription(); /// /// 回访方式 /// public EVisitType? VisitType { get; set; } public string VisitTypeText => VisitType?.GetDescription() ?? string.Empty; /// /// 发布时间 /// public DateTime PublishTime { get; set; } /// /// 回访人 /// public string? EmployeeId { get; set; } public string? EmployeeName { get; set; } public DateTime CreationTime { get; set; } /// /// 是否接通 /// public bool? IsPutThrough { get; set; } /// /// 重办状态 /// public EAgainState? AgainState { get; set; } public string AgainStateText => AgainState?.GetDescription() ?? string.Empty; /// /// 回访时间 /// public DateTime? VisitTime { get; set; } /// /// 回访明细 /// public List OrderVisitDetails { get; set; } /// /// 可直接访问的通话录音地址 /// public string? RecordingFileUrl { get; set; } public string? RecordingBaseAddress { get; set; } public string? RecordingAbsolutePath { get; set; } /// /// 渠道为电话时,此字段存在 /// public string? CallId { get; set; } public Kv? NowEvaluate { get; set; } /// /// 智能回访录音地址 /// public string? RecordUrl { get; set; } /// /// 部门扭转 /// public bool? OrgJudge { get; set; } /// /// 坐席扭转 /// public bool? SeatJudge { get; set; } /// /// 评判状态 /// public EJudgeState? JudgeState { get; set; } public string? JudgeStateText => JudgeState?.GetDescription() ?? string.Empty; /// /// 评判意见 /// public string? JudgeContent { get; set; } /// /// 是否有效智能回访 /// public bool? IsEffectiveAiVisit { get; set; } /// /// 是否有效智能回访 /// public string IsEffectiveAiVisitText => IsEffectiveAiVisit == true ? "是" : IsEffectiveAiVisit == false ? "否" : ""; /// /// 工单标签(自贡) /// public string? OrderTag => OrderTags != null && OrderTags.Any() ? string.Join(",", OrderTags.Select(x => x.DicDataName)) : string.Empty; public string? OrderTagCode { get; set; } public List? OrderTags { get; set; } /// /// 是否回访结果修改 /// public bool? IsUpdate { get; set; } /// /// 不满意原因 /// public List? OrgNoSatisfiedReason { get; set; } /// /// 回访对象类型 10:话务员 20:部门 /// public EVisitTarget VisitTarget { get; set; } } public class OrderVisitDetailDto { /// /// 回访主表明细ID /// public string Id { get; set; } /// /// 回访主表ID /// public string VisitId { get; set; } public OrderVisitDto OrderVisit { get; set; } public OrderSecondaryHandlingDto SecondaryHandling { get; set; } /// /// 甄别记录 /// public List OrderScreens { get; set; } public OrderDto Order => OrderVisit != null ? OrderVisit.Order : null; /// /// 语音评价(话务评价) /// public EVoiceEvaluate? VoiceEvaluate { get; set; } public string? VoiceEvaluateText => VoiceEvaluate?.GetDescription(); /// /// 话务员评价(话务评价) /// public ESeatEvaluate? SeatEvaluate { get; set; } public string? SeatEvaluateText => SeatEvaluate?.GetDescription(); /// /// 是否联系 /// public bool? IsContact { get; set; } /// /// 处理结果 /// public bool? Volved { get; set; } /// /// 部门办件结果 /// public Kv? OrgProcessingResults { get; set; } public string OrgProcessingResultsText => !(OrgProcessingResults is null) ? OrgProcessingResults.Value : ""; /// /// 不满意原因 /// public List? OrgNoSatisfiedReason { get; set; } /// /// 不满意原因字符串 /// public string OrgNoSatisfiedReasonText => OrgNoSatisfiedReason != null ? string.Join(',', OrgNoSatisfiedReason.Select(d => d.Value)) : ""; /// /// 部门办件态度 /// public Kv? OrgHandledAttitude { get; set; } /// /// 回访内容 /// public string? VisitContent { get; set; } /// /// 回访部门Code /// public string VisitOrgCode { get; set; } /// /// 回访部门名称 /// public string VisitOrgName { get; set; } /// /// 回访对象类型 10:话务员 20:部门 /// public EVisitTarget VisitTarget { get; set; } /// /// 未解决备注 /// public string? VolveConent { get; set; } /// /// 是否退回 /// public string ScreenSendBackText => GetScreenSendBack() ? "是" : "否"; public bool GetScreenSendBack() { if (OrderScreens != null && OrderScreens.Any()) { if (OrderScreens.First().Status == EScreenStatus.SendBack && OrderScreens.First().SendBackApply) { return true; } } return false; } public bool ScreenSendBack => GetScreenSendBack(); /// /// 截至甄别时间 /// public DateTime? ScreenByEndTime { get; set; } public bool? IsShowOperate { get; set; } } /// /// 回访详情的历史记录 /// public class OrderVisitDetailHistoryDto { public EVoiceEvaluate? VoiceEvaluate { get; set; } public string? VoiceEvaluateTxt => this.VoiceEvaluate?.GetDescription(); public ESeatEvaluate? SeatEvaluate { get; set; } public string? SeatEvaluateTxt => this.SeatEvaluate?.GetDescription(); public string VisitOrgName { get; set; } public Kv? OrgProcessingResults { get; set; } public string? orgProcessingResultsValue => this.OrgProcessingResults?.Value; public Kv? OrgHandledAttitude { get; set; } public string? OrgHandledAttitudeValue => this.OrgHandledAttitude?.Value; public string? VisitContent { get; set; } public DateTime? VisitTime { get; set; } /// /// 通话Id /// public string? CallId { get; set; } } public class DistributionVisitRspDto { public int SuccessCount { get; set; } public int ErrorCount { get; set; } } public class PublishVisitAllDto { public OrderDto? Order { get; set; } public string Id { get; set; } /// /// 回访状态 /// public EVisitState VisitState { get; set; } /// /// 回访方式 /// public EVisitType? VisitType { get; set; } public string? VisitName { get; set; } /// /// 回访时间 /// public DateTime? VisitTime { get; set; } /// /// 回访明细 /// public List OrderVisitDetails { get; set; } /// /// 发布时间 /// public DateTime PublishTime { get; set; } } public class PublishVisitDto { /// /// 工单对象 /// public OrderDto Order { get; set; } /// /// 服务工单编号 /// public string No { get; set; } /// /// 回访评价方式 /// public EVisitType? VisitType { get; set; } /// /// 回访人 /// public string VisitName { get; set; } /// /// 回访时间 /// public DateTime? VisitTime { get; set; } /// /// 回访评价情况 /// public string VisitRemark { get; set; } /// /// 回访结果满意度 /// public string SubjectResultSatifyCode { get; set; } /// /// 行政区划代码 /// public string AreaCode { get; set; } /// /// 工单回访首次结果满意度 /// public string FirstSatisfactionCode { get; set; } /// /// 附件 /// public string ClientGuid { get; set; } } public class OrderVisitDetailWebDto { /// /// 回访明细ID /// public string Id { get; set; } /// /// 回访对象类型 10:话务员 20:部门 /// public EVisitTarget VisitTarget { get; set; } /// /// 语音评价(话务评价) /// public EVoiceEvaluate? VoiceEvaluate { get; set; } /// /// 话务员评价(话务评价) /// public ESeatEvaluate? SeatEvaluate { get; set; } /// /// 部门办件结果 /// public Kv? OrgProcessingResults { get; set; } /// /// 不满意原因 /// public List? OrgNoSatisfiedReason { get; set; } /// /// 部门办件态度 /// public Kv? OrgHandledAttitude { get; set; } /// /// 回访内容 /// public string? VisitContent { get; set; } /// /// 部门是否联系 /// public bool? IsContact { get; set; } /// /// 是否解决问题 /// public bool? Volved { get; set; } } public class OrderVisitProvinceDto { public string ProvinceNo { get; set; } public EVisitType VisitType { get; set; } public DateTime VisitTime { get; set; } public string VisitRemark { get; set; } public Kv VisitResult { get; set; } } /// /// 回访更新事件载荷 /// public class OrderVisitNotifyDto { /// /// Id /// public string Id { get; set; } /// /// 工单ID /// public string OrderId { get; set; } /// /// 回访详情 /// public List OrderVisitDetails { get; set; } /// /// 回访状态 /// public EVisitState VisitState { get; set; } /// /// 回访方式 /// public EVisitType? VisitType { get; set; } /// /// 回访人 /// public string? EmployeeId { get; set; } /// /// 回访时间 /// public DateTime? VisitTime { get; set; } public string CreatorName { get; set; } /// /// 发布时间 /// public DateTime PublishTime { get; set; } } /// /// 修改记录 /// public class OrderVisitDetailCopyDto { /// /// 回访信息 /// public List OrderVisitDetailDtos { get; set; } /// /// 修改记录 /// public List OrderVisitDetailCopyDtos { get; set; } /// /// 创建时间 /// public DateTime CreationTime { get; set; } /// /// 创建人 /// public string? CreatorName { get; set; } } }