using Dapper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using XYY.Common.Standard;
using XYY.Common.Standard.Attributes;
using XYY.Core.Standard;

namespace XYY.Model.Standard.Order
{

    public class OrderInputResult
    {
        public List<string> Existence { get; set; }
    }

    /// <summary>
    /// 客户订单表
    /// </summary>
    [Table("Order_Order")]
    [TrackTable(typeof(StatusLogs))]
    public class Order_Order : BaseEntity
    {
        [NoDb]
        public string BoxNumber
        {
            get; set;
        }

        public bool WaitSysncServiceTrackingNumber
        {
            get; set;
        }
        public bool IsOnline
        {
            get; set;
        }

        public string ioss
        {
            get; set;
        }
        /// <summary>
        /// 自提Id
        /// </summary>
        public string PudoId
        {
            get; set;
        }
        public int SystemId
        {
            get; set;
        }
        public DateTime? PredictionTime { get; set; }

        public DateTime? ReissueTime
        {
            get; set;
        }

        [Track("退件状态")]
        public ReissueStatus ReissueStatus
        {
            get; set;
        }

        public bool Printintercept
        {
            get; set;
        }

        public string PickingMergeServerLabelUrl
        {
            get; set;
        }

        public string PickingLabelUrl
        {
            get; set;
        }

        public int CreateOrderChannelId
        {
            get; set;
        }

        /// <summary>
        /// 客户编号
        /// </summary>
        public int CustomerId { get; set; }
        /// <summary>
        /// 客户订单号
        /// </summary>
        public string CustomerOrderNo { get; set; }
        /// <summary>
        /// 客户订单包裹重量（克）
        /// </summary>
        public int CustomerWeight { get; set; }
        /// <summary>
        /// 根据客户重量计算出来的总运费
        /// </summary>
        public decimal CustomerTotalFee { get; set; }
        /// <summary>
        /// 最终计费重量
        /// </summary>
        public int OPWeight { get; set; }
        /// <summary>
        /// 实际(称重)重量
        /// </summary>
        [DisplayName("称重重量")]
        public int? ActualWeight { get; set; }
        /// <summary>
        /// 我方计费
        /// </summary>
        public decimal OPTotalFee { get; set; }
        /// <summary>
        /// 是否包含其他敏感货物
        /// </summary>
        public bool HasSpecialGoods { get; set; }
        /// <summary>
        /// 客户重量
        /// </summary>
        public int SWeight
        {
            get; set;
        }
        /// <summary>
        /// 是否包含带电货物
        /// </summary>
        public bool IsContainsElectricGoosd { get; set; }

        /// <summary>
        /// 税号
        /// </summary>
        public string TaxNo
        {
            get; set;
        }

        /// <summary>
        /// 重派
        /// </summary>
        public bool IsResend
        {
            get; set;
        }



        /// <summary>
        /// 是否为COD订单
        /// </summary>
        public bool IsCod { get; set; }
        /// <summary>
        /// 货到付款应收款金额
        /// </summary>
        public decimal CodFee { get; set; }
        /// <summary>
        /// cod币种
        /// </summary>
        public string CodCurrency { get; set; }
        /// <summary>
        /// 长（cm）
        /// </summary>
        public decimal Length { get; set; }
        /// <summary>
        /// 宽（cm）
        /// </summary>
        public decimal Width { get; set; }
        /// <summary>
        /// 高（cm）
        /// </summary>
        public decimal Height { get; set; }

        /// <summary>
        /// 运输服务商编号
        /// </summary>
        public int ChannelId { get; set; }
        /// <summary>
        /// 跟踪单号
        /// </summary>
        public string TrackingNumber { get; set; }
        /// <summary>
        /// 转单号
        /// </summary>
        public string TransferNumber { get; set; }
        /// <summary>
        /// 服务商订单号
        /// </summary>
        public string ServicesOrderNo { get; set; }
        /// <summary>
        /// 收件人名称
        /// </summary>
        public string ReceiverName { get; set; }
        /// <summary>
        /// 收件人公司
        /// </summary>
        public string ReceiverCompany { get; set; }
        /// <summary>
        /// 收件人国家二字代码
        /// </summary>
        public string ReceiverCountryCode { get; set; }
        /// <summary>
        /// 收件人国家中文名称
        /// </summary>
        public string ReceiverCountryName { get; set; }
        /// <summary>
        /// 收件人电子邮箱
        /// </summary>
        public string ReceiverEmail { get; set; }
        /// <summary>
        /// 收件人邮编
        /// </summary>
        public string ReceiverZipCode { get; set; }
        /// <summary>
        /// 收件人（州/省）
        /// </summary>
        public string ReceiverState { get; set; }
        /// <summary>
        /// 收件人城市
        /// </summary>
        public string ReceiverCity { get; set; }
        /// <summary>
        /// 收件人详细地址(街道)
        /// </summary>
        public string ReceiverStreet { get; set; }
        /// <summary>
        /// 收件人联系电话
        /// </summary>
        public string ReceiverPhone { get; set; }
        /// <summary>
        /// 订单来源 网站下单1,导入2,API下单3,ERP API下单 4
        /// </summary>
        public int SourceType { get; set; }
        /// <summary>
        /// 发件人名称
        /// </summary>
        public string SenderName { get; set; }
        /// <summary>
        /// 发件人公司
        /// </summary>
        public string SenderCompany { get; set; }
        /// <summary>
        /// 发件人国家二字代码
        /// </summary>
        public string SenderCountryCode { get; set; }
        /// <summary>
        /// 发件人国家中文名称
        /// </summary>
        public string SenderCountryName { get; set; }
        /// <summary>
        /// 发件人电子邮箱
        /// </summary>
        public string SenderEmail { get; set; }
        /// <summary>
        /// 发件人邮编
        /// </summary>
        public string SenderZipCode { get; set; }
        /// <summary>
        /// 发件人（州/省）
        /// </summary>
        public string SenderState { get; set; }
        /// <summary>
        /// 发件人城市
        /// </summary>
        public string SenderCity { get; set; }
        /// <summary>
        /// 发件人详细地址(街道)
        /// </summary>
        public string SenderStreet { get; set; }
        /// <summary>
        /// 发件人联系电话
        /// </summary>
        public string SenderPhone { get; set; }
        /// <summary>
        /// 订单状态
        /// -1.彻底删除,0.已撤销 1.已申请运单 2.已收件 3.已派件 4.已退件
        /// 5.待出库 6已出库
        /// </summary>
        /// 
        [Track("订单状态")]
        public int OrderStatus { get; set; }
        /// <summary>
        /// 物流状态
        /// 1.无物流信息 2.在国内揽收出库完成 3.头程供应商已收件 4.已离岸 5.已到岸 6.尾程派送中 7.已签收 8.被尾程退回
        /// </summary>
        public int LogisticsStatus { get; set; }
        /// <summary>
        /// 是否为异常件
        /// </summary>
        public bool IsUnusual { get; set; }
        /// <summary>
        /// 异常原因
        /// </summary>
        public UnusualReasonType UnusualReason { get; set; }
        /// <summary>
        /// 客户下单时间
        /// </summary>
        public DateTime OrderTime { get; set; }
        /// <summary>
        /// 我方收件时间
        /// </summary>
        public DateTime? ReceiveTime { get; set; }
        /// <summary>
        /// 我方发出时间
        /// </summary>
        public DateTime? SendOutTime { get; set; }
        /// <summary>
        /// 客户收到时间
        /// </summary>
        public DateTime? DeliveriedTime { get; set; }

        /// <summary>
        /// 服务商标签已上传Url
        /// </summary>
        public string ServiceLabelUrl
        {
            get; set;
        }

        /// <summary>
        /// 客户标签已上传Url
        /// </summary>
        public string CustomerLabelUrl
        {
            get; set;
        }

        /// <summary>
        /// 原始的面单保存路径。在异步下单模式下，ServiceLabelUrl可能会被在客户下载面单前修改成渠道面单地址，
        /// 为了防止客户异步下单时，xyy面单路径已被修改成渠道面单，所以需要该字段保存最原始的面单路径
        /// </summary>
        public string OriginServiceLabelUrl
        {
            get; set;
        }

        /// <summary>
        /// 是否电话通知
        /// </summary>
        public bool IsTelephone
        {
            get; set;
        }

        /// <summary>
        /// 是否短信通知
        /// </summary>
        public bool IsSMS
        {
            get; set;
        }
        /// <summary>
        /// 失联次数
        /// </summary>
        public int? OutOfContactNumber
        {
            get;
            set;
        }

        /// <summary>
        /// 最后一次联系次数
        /// </summary>
        public DateTime? LastTelephoneTime
        {
            get; set;
        }

        /// <summary>
        /// 短信通知服务地址
        /// </summary>
        public string SMSServiceClass
        {
            get; set;
        }

        /// <summary>
        /// 电话确认状态
        /// 0 还未联系客人 1 未联系到客人	2 客人同意派送	3 客人默认拒绝派送（未联系到客人3次以上） 4 客人拒绝派送
        /// </summary>
        public int TelephoneConfirmationStatus
        {
            get;
            set;
        }

        public string ServiceLabelPath
        {
            get; set;
        }

        public int RoomId
        {
            get; set;
        }

        public string ServiceOrderNumber2
        {
            get; set;
        }

        public string ServiceOrderNumber3
        {
            get; set;
        }

        public string ServiceOrderNumber4
        {
            get; set;
        }

        public string Origin
        {
            get; set;
        }

        public bool IsPrint
        {
            get; set;
        }

        public DateTime? PrintTime
        {
            get; set;
        }

        public string DestinationPortCode
        {
            get; set;
        }


        public string Region
        {
            get; set;
        }

        public string Area
        {
            get; set;
        }

        public bool IsPartShipment
        {
            get; set;
        }
        public int CreateBy
        {
            get; set;
        }

        public string FirstLegCode
        {
            get; set;
        }

        public bool IsContainsSpecialGoods
        {
            get;
            set;
        }

        /// <summary>
        /// 原下单系统
        /// </summary>
        public int SourceSystemId
        {
            get;
            set;
        }

        /// <summary>
        /// 转发系统
        /// </summary>
        public int ForwardingSystemId
        {
            get;
            set;
        }

        /// <summary>
        /// 是否转单
        /// </summary>
        public bool IsTransfer
        {
            get; set;
        }

        public int ERPApiId { get; set; }

        public string InvoiceUrl
        {
            get; set;
        }

        public string SystemNo
        {
            get; set;
        }

        public RemoteState RemoteState
        {
            get; set;
        }

        /// <summary>
        /// 门牌号
        /// </summary>
        public string House
        {
            get; set;
        }

        public int SealUserId
        {
            get; set;
        }

        public int SealCompanyId
        {
            get; set;
        }

        public int MpsOrderId { get; set; }
    }
}
