using SqlSugar;


namespace WCS.BLL.DbModels
{
    /// <summary>
    /// 出库单据明细表
    /// </summary>
    [SugarTable("wcs_out_order_detail")]
    public class OutOrderDetail
    {
        /// <summary>
        /// 主键 自增Id
        /// </summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 出库单据的主键ID
        /// </summary>
        [SugarColumn(ColumnName = "order_id", IsNullable = false)]
        public int OrderId { get; set; }

        /// <summary>
        /// 出库单据号
        /// </summary>           
        [SugarColumn(ColumnName = "order_number", Length = 50, IsNullable = false, ColumnDescription = "出库单据号")]
        public string OrderNumber { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        [SugarColumn(ColumnName = "mat_code", Length = 100, IsNullable = true, ColumnDescription = "物料编号")]
        public string MatCode { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>           
        [SugarColumn(ColumnName = "mat_name", Length = 150, IsNullable = true, ColumnDescription = "物料名称")]
        public string MatName { get; set; }
        /// <summary>
        /// 物料批次
        /// </summary>           
        [SugarColumn(ColumnName = "mat_batch", Length = 150, IsNullable = true, ColumnDescription = "物料批次")]
        public string MatBatch { get; set; }

        /// <summary>
        /// 物料需求数量 
        /// </summary>
        [SugarColumn(ColumnName = "req_qty", IsNullable = false, ColumnDescription = "物料需求数量")]
        public int ReqQty { get; set; }

        /// <summary>
        /// 物料已出库数量 
        /// </summary>
        [SugarColumn(ColumnName = "out_qty", IsNullable = false, DefaultValue = "0", ColumnDescription = "物料已出库数量")]
        public int OutQty { get; set; } = 0;

        /// <summary>
        /// 创建时间
        /// </summary>           
        [SugarColumn(ColumnName = "create_time", IsNullable = false, ColumnDescription = "入库时间")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 创建人
        /// </summary>           
        [SugarColumn(ColumnName = "create_user", Length = 100, IsNullable = true, ColumnDescription = "操作员")]
        public string CreateUser { get; set; }

        /// <summary>
        /// 用于绑定中显示序号
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int RowNumber { get; set; }
    }
}
