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

namespace OASystem.Domain.ViewModels.QiYeWeChat
{
    /// <summary>
    /// 打卡日报数据 View
    /// </summary>
    public class CheckInDayDataView : ResponseBase
    {

        public List<Root> datas { get; set; }

    }

    public class Root
    {
        /// <summary>
        /// 
        /// </summary>
        public Base_info? base_info { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public Summary_info? summary_info { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<Holiday_infos>? holiday_infos { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<Exception_infos>? exception_infos { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public Ot_info? ot_info { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<Sp_items>? sp_items { get; set; }
    }

    public class Exception_infos
    {
        /// <summary>
        /// 校准状态类型：1-迟到；2-早退；3-缺卡；4-旷工；5-地点异常；6-设备异常
        /// </summary>
        public int exception { get; set; }

        /// <summary>
        /// 当日此异常的次数
        /// </summary>
        public int count { get; set; }

        /// <summary>
        /// 当日此异常的时长（迟到/早退/旷工才有值）
        /// </summary>
        public int duration { get; set; }
    }

    public class Holiday_infos
    {
        public string? sp_number { get; set; }

        public Sp_title? sp_title { get; set; }

        public Sp_description? sp_description { get; set; }
    }


    public class Sp_title
    {
        public List<TitleItem>? data { get; set; }

    }


    public class Sp_description
    {

        public List<TitleItem>? data { get; set; }
    }


    public class CheckintimeItem
    {
        /// <summary>
        /// 
        /// </summary>
        public int work_sec { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int off_work_sec { get; set; }
    }

    public class Rule_info
    {
        /// <summary>
        /// 
        /// </summary>
        public int groupid { get; set; }
        /// <summary>
        /// 普通白班
        /// </summary>
        public string groupname { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int scheduleid { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string schedulename { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<CheckintimeItem> checkintime { get; set; }
    }

    public class Base_info
    {
        /// <summary>
        /// 日报日期
        /// </summary>
        public long date { get; set; }

        /// <summary>
        /// 日报日期 dt
        /// </summary>
        public DateTime dateDt {
            get
            {
                return new DateTime(date * 10000000 + 621355968000000000L).ToLocalTime();
            }
        }

        /// <summary>
        /// 记录类型：1-固定上下班；2-外出（此报表中不会出现外出打卡数据）；3-按班次上下班；4-自由签到；5-加班；7-无规则
        /// </summary>
        public int record_type { get; set; }
        /// <summary>
        /// 打卡人员姓名
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 打卡人员别名
        /// </summary>
        public string name_ex { get; set; }
        /// <summary>
        /// 打卡人员所在部门，会显示所有所在部门
        /// </summary>
        public string departs_name { get; set; }
        /// <summary>
        /// 打卡人员账号，即userid
        /// </summary>
        public string acctid { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public Rule_info rule_info { get; set; }
        /// <summary>
        /// 日报类型：0-工作日日报；1-休息日日报
        /// </summary>
        public int day_type { get; set; }
    }

    public class Summary_info
    {
        /// <summary>
        /// 
        /// </summary>
        public int checkin_count { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int regular_work_sec { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int standard_work_sec { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int earliest_time { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int lastest_time { get; set; }
    }

    public class Ot_info
    {
        /// <summary>
        /// 
        /// </summary>
        public int ot_status { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int ot_duration { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<long>? exception_duration { get; set; }
    }

    public class Sp_items
    {
        /// <summary>
        /// 
        /// </summary>
        public int type { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int vacation_id { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int count { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int duration { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int time_type { get; set; }
        /// <summary>
        /// 年假
        /// </summary>
        public string name { get; set; }
    }

}
