ReportModel.cs 904 Bytes
namespace HHECS.WorkHourStatistics.Dtos
{
    public class ReportModel
    {
        /// <summary>
        /// 工号
        /// </summary>
        public string WorkNo { get; set; } = null!;

        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; } = null!;

        /// <summary>
        /// 部门
        /// </summary>
        public string SysOrgCode { get; set; } = null!;

        /// <summary>
        /// 总天数/需要动态添加的列数
        /// </summary>
        public int Days => Values.Count;

        /// <summary>
        /// 数据:key 时间,value 数值
        /// </summary>
        public Dictionary<string, double> Values { get; set; } = new Dictionary<string, double>();

        /// <summary>
        /// 合计
        /// </summary>
        public double Total => Math.Round(Values.Sum(x => x.Value), 2);
    }
}