using Hotline.Share.Enums.CallCenter; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using XF.Domain.Repository; namespace Hotline.CallCenter.Calls { public class TelActionRecord : CreationEntity { /// /// 用户ID /// public string UserId { get; set; } /// /// 用户名称 /// public string UserName { get; set; } /// /// 分机号 /// public string TelNo { get; set; } /// /// 分机组 /// public string QueueId { get; set; } /// /// 开始时间 /// public DateTime StartTime { get; set; } /// /// 结束时间 /// public DateTime? EndTime { get; set; } /// /// 动作类型 /// public EActionType ActionType { get; set; } /// /// 用时 /// public double Duration { get; private set; } public TelActionRecord() { } public TelActionRecord(string userId, string userName, string telNo, string queueId, EActionType actionType) { UserId = userId; UserName = userName; TelNo = telNo; QueueId = queueId; ActionType = actionType; StartTime = DateTime.Now; } public void EndAction() { EndTime = DateTime.Now; Duration = Math.Round(((double)(EndTime.Value - StartTime).TotalSeconds), 2); } } }