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

namespace WCS.Entity
{
    /// <summary>
    ///  码垛信息记录主表
    /// </summary>
    [SugarTable(nameof(WCS_Palletizing), "码垛信息主表")]
    public class WCS_Palletizing
    {
        /// <summary>
        ///  Id
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "ID")]
        public int Id { get; set; }

        /// <summary>
        ///  任务Id
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "任务Id")]
        public int TaskId { get; set; }

        /// <summary>
        ///  任务
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(TaskId))]
        public WCS_TaskInfo? TaskInfo { get; set; }

        /// <summary>
        ///  触发任务的下一个地址
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "触发任务的下一个地址")]
        public string TaskAddNext { get; set; }

        /// <summary>
        ///  托盘条码
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "任务Id")]
        public string PalleCode { get; set; }

        /// <summary>
        ///  垛型编码
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "垛型编码")]
        public string Code { get; set; }

        /// <summary>
        ///  短垛型编码
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "短垛型编码")]
        public short ShortCode { get; set; }

        /// <summary>
        ///  帘线物料编码
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "帘线物料编码")]
        public string ProMaterCode { get; set; }

        /// <summary>
        ///  绑定的码垛工位
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "码垛工位")]
        public string? PalletizingStation { get; set; }

        /// <summary>
        ///  产品总数
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "产品总数")]
        public int CountQty { get; set; }

        /// <summary>
        ///  托盘类型
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "托盘类型")]
        public string TpTypeCode { get; set; }

        /// <summary>
        ///  层数
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "层数")]
        public int LayerCountQty { get; set; }

        /// <summary>
        ///  层信息
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(WCS_PalletizingLayer.PalletizingId))]
        public List<WCS_PalletizingLayer> Layers { get; set; }

        /// <summary>
        ///  位信息
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(WCS_PalletizingLoc.PalletizingId))]
        public List<WCS_PalletizingLoc> Locs { get; set; }

        /// <summary>
        ///  垛型大类
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "垛型大类")]
        public int StampType { get; set; }

        /// <summary>
        ///  是否结束
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "是否结束")]
        public bool Finish { get; set; }

        /// <summary>
        ///  是否二次绑盘
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "是否二次绑盘")]
        public bool isItHalf { get; set; }

        /// <summary>
        ///  当前所有的物料号
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "当前所有的物料号")]
        public string MatCodeList { get; set; }

        /// <summary>
        ///  仓库编号
        /// </summary>
        [SugarColumn(ColumnDescription = "仓库编号", IsNullable = true)]
        public string WarehouseCode { get; set; }

        /// <summary>
        ///  执行设备编号，桁架/机械手/、、、
        /// </summary>
        [SugarColumn(ColumnDescription = "执行设备编号", IsNullable = true)]
        public string DeviceCode { get; set; }

        /// <summary>
        ///  创建时间
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "创建时间")]
        public DateTime AddTime { get; set; }

        /// <summary>
        ///  编辑时间
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "编辑时间")]
        public DateTime EditTime { get; set; }
    }
}
