using Npgsql.Replication.PgOutput;
using OASystem.Domain.Entities.Financial;
using OASystem.Domain.ViewModels.System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OASystem.Domain.ViewModels.Financial
{
    /// <summary>
    /// 日付申请 View
    /// </summary>
    public class Fin_DailyFeePaymentView:Fin_DailyFeePayment
    {}


    public class Fin_DailyFeePaymentPageCount
    {
        /// <summary>
        /// 总条数
        /// </summary>
        public int Count { get; set; }
    }

    /// <summary>
    /// 日付申请 分页查询View
    /// </summary>
    public class Fin_DailyFeePaymentPageListView
    {
        /// <summary>
        /// 行号
        /// </summary>
        public int RowNumber { get; set; }

        /// <summary>
        /// Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 公司Id
        /// </summary>
        public int CompanyId { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>
        public string? CompanyName { get; set; }

        /// <summary>
        /// 费用描述
        /// </summary>
        public string? Instructions { get; set; }

        /// <summary>
        /// 费用总计
        /// </summary>
        public decimal? SumPrice { get; set; }

        /// <summary>
        /// 申请人Id
        /// </summary>
        public int CreateUserId { get; set; }

        /// <summary>
        /// 申请人姓名
        /// </summary>
        public string? CreateUser { get; set; }

        /// <summary>
        /// 申请时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 财务审核
        /// </summary>
        public int FAudit { get; set; }

        /// <summary>
        /// 财务 审核状态
        /// </summary>
        public string? FAuditDesc
        {
            get
            {
                string str = "未审核";
                if (FAudit == 0) str = "未审核";
                else if (FAudit == 1) 
                {
                    str = "已通过"; 
                    FAuditName = "朱成梅";
                }
                else if (FAudit == 2)
                {
                    str = "未通过";
                    FAuditName = "朱成梅";
                }
                return str;
            }
        }

        /// <summary>
        /// 财务审核人姓名
        /// </summary>
        public string? FAuditName { get; set; } = "无";

        /// <summary>
        /// 总经理审核
        /// </summary>
        public int MAudit { get; set; }

        /// <summary>
        /// 总经理 审核状态
        /// </summary>
        public string? MAuditDesc
        {
            get
            {
                string str = "未审核";
                if (MAudit == 0) str = "未审核";
                else if (MAudit == 1) { str = "已通过"; MAuditName = "张海麟"; }
                else if (MAudit == 2) { str = "未通过"; MAuditName = "张海麟"; }
                return str;
            }
        }

        /// <summary>
        /// 总经理审核姓名
        /// </summary>
        public string? MAuditName { get; set; } = "无";

        /// <summary>
        /// 费用类型
        /// </summary>
        public int PriceTypeId { get; set; }
    }

    /// <summary>
    /// 日服申请 分页
    /// </summary>
    public class Fin_DailyFeePaymentPage
    {
        /// <summary>
        /// 总条数
        /// </summary>
        public int? Rows { get; set; }

        public List<Fin_DailyFeePaymentPageListView> Data { get; set; }
    }

    /// <summary>
    /// 日付申请费用明细
    /// </summary>
    public class Fin_DailyFeePaymentContentInfolView
    {
        public int Id { get; set; }
        /// <summary>
        /// 费用名称
        /// </summary>
        public string PriceName { get; set; }

        /// <summary>
        /// 数量单价
        /// </summary>
        public int Quantity { get; set; }

        /// <summary>
        /// 费用单价
        /// </summary>
        public decimal Price { get; set; }

        /// <summary>
        /// 当前总计
        /// </summary>
        public decimal ItemTotal { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }

    public class Fin_DailyFeePaymentInfolView
    {
        public int Id { get; set; }
        public int CompanyId { get; set; }
        public int TransferTypeId { get; set; }
        public int PriceTypeId { get; set; }
        public string Instructions { get; set; }
        public decimal SumPrice { get; set; }

        public int CreateUserId { get; set; }

        /// <summary>
        /// 财务审核
        /// </summary>
        public int FAudit { get; set; }

        public string FAuditDesc
        {
            get
            {
                string str = "未审核";
                if (FAudit == 0) str = "未审核";
                else if (FAudit == 1) str = "已通过";
                else if (FAudit == 2) str = "未通过";
                return str;
            }
        }

        /// <summary>
        /// 总经理审核
        /// </summary>
        public int MAudit { get; set; }

        public string MAuditDesc
        {
            get
            {
                string str = "未审核";
                if (MAudit == 0) str = "未审核";
                else if (MAudit == 1) str = "已通过";
                else if (MAudit == 2) str = "未通过";
                return str;
            }
        }

        public DateTime CreateTime { get; set; }
        public List<Fin_DailyFeePaymentContentInfolView> FeeContents { get; set; }
    }

    /// <summary>
    /// android 详情
    /// </summary>
    public class Fin_DailyFeePaymentInfoAndroidlView
    {
        public int Id { get; set; }
        public int CompanyId { get; set; }
        public int TransferTypeId { get; set; }
        public int PriceTypeId { get; set; }
        public string Instructions { get; set; }
        public decimal SumPrice { get; set; }

        public int CreateUserId { get; set; }

        public List<Fin_DailyFeePaymentContentInfolView> FeeContents { get; set; }
    }

    /// <summary>
    /// 费用类型
    /// </summary>
    public class Fin_DailyFeePaymentPagePriceTypeView
    {
        /// <summary>
        /// 类型Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
    }

    /// <summary>
    /// 费用子类型
    /// </summary>
    public class Fin_DailyFeePaymentPagePriceSubTypeView
    {
        /// <summary>
        /// 费用类型Id
        /// </summary>
        public int STid { get; set; }

        /// <summary>
        /// 子类型Id
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 子类型名称
        /// </summary>
        public string Name { get; set; }
    }

    /// <summary>
    /// 费用类型数据源
    /// </summary>
    public class Fin_DailyFeePaymentPagePriceTypeDataView
    {
        /// <summary>
        /// 费用类型
        /// </summary>
        public List<Fin_DailyFeePaymentPagePriceTypeView>? FeeTypeData { get; set; }

        /// <summary>
        /// 费用子类型
        /// </summary>
        public List<Fin_DailyFeePaymentPagePriceSubTypeView>? FeeSubTypeData { get; set; }

        /// <summary>
        /// 用户名称
        /// </summary>
        public List<UserNameView>? UserNameData { get; set; }

        /// <summary>
        /// 费用标识类型
        /// </summary>
        public List<Fin_DailyFeePaymentPagePriceTypeView>? FeeMarkTypeData { get; set; }

        /// <summary>
        /// 费用子类型
        /// </summary>
        public List<Fin_DailyFeePaymentPagePriceSubTypeView>? FeeMarkSubTypeData { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>
        public List<CompanyNameView>? CompanyNameData { get; set; }
    }

    /// <summary>
    /// 类型数据源
    /// </summary>
    public class DailyFeePaymentDataSourceView : Fin_DailyFeePaymentPagePriceTypeView
    {
        public List<Fin_DailyFeePaymentPagePriceSubTypeView> SubDatas { get; set; }
    }
}
