namespace DataSharing.Share.Dtos.HotlineWeb
{
    public class TelCallInfoDto
    {
        /// <summary>
        /// 总量
        /// </summary>
        public int CountNum { get; set; }

        /// <summary>
        /// 已接通
        /// </summary>
        public int ConnectNum { get; set; }

        /// <summary>
        /// 接通率
        /// </summary>
        public double ConnectionRate => CalcConnectionRate();

        public double CalcConnectionRate()
        {
            if (CountNum != 0 && ConnectNum != 0)
            {
                return Math.Round((ConnectNum / (double)CountNum) * 100, 2);
            }
            return 0;
        }
    }
}
