using System;
using System.Collections.Generic;
using System.Text;

namespace AutoTurnOver.Models
{
    public class dc_base_order_data_source
    {
        public long id { get; set; }

        public string order_no { get; set; }
        public string order_type { get; set; }
        public string bailun_sku_warehouse_code { get; set; }
        public string bailun_sku { get; set; }
        public string warehouse_code { get; set; }
        public decimal sign_days { get; set; }
        public decimal bale_days { get; set; }
        public decimal put_days { get; set; }
        public string logistics_code { get; set; }
        public string logistics_name { get; set; }
        public string transport_type { get; set; }
        public DateTime? pay_time { get; set; }
        public string pay_type { get; set; }
        public DateTime? confirm_time { get; set; }
        public DateTime? sign_time { get; set; }
        public DateTime? sail_time { get; set; }
        public DateTime? put_time { get; set; }
        public DateTime? shipping_time { get; set; }
        public DateTime? create_date { get; set; }

        /// <summary>
        /// 付款天数
        /// </summary>
        public int? pay_days { get; set; }
        public decimal? sail_days { get; set; }

       /// <summary>
       /// 打包时间
       /// </summary>
        public DateTime? bale_time { get; set; }

        /// <summary>
        /// 调拨下单天数
        /// </summary>
        public int? transfer_order_days { get; set; }

    }

    public class dc_base_order_data_source_dto: dc_base_order_data_source
    {
        public string date_line_str
        {
            get
            {
                if (order_type.Contains("采购单"))
                {
                    if (pay_type == "先货后款")
                    {
                        return $" 创建时间【{create_date}】 ~  采购员确认【{confirm_time}】~ 签收【{sign_time}】 ~ 入库 【{put_time}】  ";
                    }
                    else
                    {
                        return $" 创建时间【{create_date}】 ~  付款【{pay_time}】~ 签收【{sign_time}】 ~ 入库 【{put_time}】  ";
                    }

                }
                else
                {
                    return $" 创建时间【{create_date}】~ 打包【{bale_time}】 ~  交运【{shipping_time}】~ 启航【{sail_time}】 ~ 签收【{sign_time}】 ~ 入库 【{put_time}】  ";
                }
            }
        }
    }

    public class dc_base_order_data_source_search_dto
    {
        public  int order_type { get; set; }
        public  string order_type_str { get {
                if (order_type == 11 || order_type==14)
                {
                    return "采购单-签收天数计算";
                }
                else if (order_type == 12)
                {
                    return "采购单-质检入库天数计算";
                }
                else if (order_type == 13)
                {
                    return "采购单-下单天数计算";
                }
                else if (order_type == 21 || order_type == 22 || order_type == 23 || order_type == 24|| order_type == 25 )
                {
                    return "调拨单-平均天数计算";
                }
                else
                {
                    return "";
                }
            } }
        public  string bailun_sku { get; set; }
        public  string warehouse_code { get; set; }
    }
}
