using System;
using SqlSugar;
using System.Collections.Generic;

namespace ZR.Model.Models.Balance
{
    /// <summary>
    /// 库存管理/库存明细表，数据实体对象
    ///
    /// @author admin
    /// @date 2023-04-27
    /// </summary>
    [SugarTable("stk_balance_dtl")]
    public class StkBalanceDtl : BusinessBase
    {
        /// <summary>
        /// 库存明细表ID 
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int BalanceId { get; set; }

        /// <summary>
        /// 库区ID 
        /// </summary>
        public int RegionId { get; set; }

        /// <summary>
        /// 库位ID 
        /// </summary>
        public int BinId { get; set; }

        /// <summary>
        /// 交验单号 
        /// </summary>
        public string DeliverNo { get; set; }

        /// <summary>
        /// 生产令号 
        /// </summary>
        public string BomNo { get; set; }

        /// <summary>
        /// 物料编码 
        /// </summary>
        public string MaterialCode { get; set; }

        /// <summary>
        /// 物料名称 
        /// </summary>
        public string MaterialName { get; set; }

        /// <summary>
        /// 规格型号/图号 
        /// </summary>
        public string MaterialSpec { get; set; }

        /// <summary>
        /// 物料类型（外协件，外购件） 
        /// </summary>
        public string Category { get; set; }

        /// <summary>
        /// 关键件标识（0非关键件，1关键件） 
        /// </summary>
        public bool KeyFlag { get; set; }

        /// <summary>
        /// BN/SN码 
        /// </summary>
        public string BnSnCode { get; set; }

        /// <summary>
        /// 库存数量 
        /// </summary>
        public int BalanceQty { get; set; }

        /// <summary>
        /// 库存状态（0初始创建，33盘点入库占用，55在库，77盘点出库占用，99出库完成） 
        /// </summary>
        public int Status { get; set; }

        #region 表外字段
        [SugarColumn(IsIgnore = true)]
        public string RegionName { get; set; }
        [SugarColumn(IsIgnore = true)]
        public string RegionCode { get; set; }
        [SugarColumn(IsIgnore = true)]
        public string BinCode { get; set; }
        /// <summary>
        /// Sum库存数量
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int SumQty { get; set; }
        #endregion
    }
}