using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hotline.Share.Dtos.Bi
{
    public class DepartmentalProcessingStatisticsDto111
    {
        /// <summary>
        /// 部门Code
        /// </summary>
        public string OrgCode { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        public string OrgName { get; set; }

        /// <summary>
        /// 信件总量
        /// </summary>
        public int OrderCountNum { get; set; }

        /// <summary>
        /// 已办总量
        /// </summary>
        public int YBOrderCountNum { get; set; }

        /// <summary>
        /// 在办总量
        /// </summary>
        public int ZBOrderCountNum { get; set; }

        /// <summary>
        /// 办结率
        /// </summary>
        public double OrderCompletionRate => CalcSatisfiedRate(OrderCountNum, YBOrderCountNum);












        /// <summary>
        /// 计算满意度
        /// </summary>
        /// <param name="Count"></param>
        /// <param name="Quantity"></param>
        /// <returns></returns>
        public double CalcSatisfiedRate(int Count, int Quantity)
        {
            if (Count == 0 || Quantity == 0)
            {
                return 0;
            }
            return Math.Round((Quantity / (double)Count) * 100, 2);
        }
    }
}
