
//-----------------------------------------------------------------------
//<copyright>
// * Copyright (C) 2021 KEHAIDASOFT All Rights Reserved
// * version : 4.0.30319.42000
// * author  : khd by t4-2
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Khd.Core.Domain.Models
{
    [Table("mes_product_plan_detail")]
    public class MesProductPlanDetail
    {
        [Key]
        [Column("plan_detail_id")]
        public long PlanDetailId { get; set; }

        /// <summary>
        /// 明细编号
        /// </summary>
        [Column("plan_detail_code")]
        [Required]
        [StringLength(64)]
        public string PlanDetailCode { get; set; }

        /// <summary>
        /// 生产计划ID
        /// </summary>
        [Column("plan_id")]
        [Required]
        public long PlanId { get; set; }

        /// <summary>
        /// 计划编号, 关联mes_product_plan_info的plan_code
        /// </summary>
        [Column("plan_code")]
        [Required]
        [StringLength(64)]
        public string PlanCode { get; set; }

        /// <summary>
        /// 操作人员ID，关联sys_user的user_id
        /// </summary>
        [Column("user_id")]
        public long? UserId { get; set; }

        /// <summary>
        /// 操作人员名称，关联sys_user的user_name
        /// </summary>
        [Column("user_name")]
        [StringLength(64)]
        public string UserName { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        [Column("real_begin_time")]
        public DateTime? RealBeginTime { get; set; }

        /// <summary>
        /// 完成时间
        /// </summary>
        [Column("real_end_time")]
        public DateTime? RealEndTime { get; set; }

        /// <summary>
        /// 文件ID，关联附件信息主键
        /// </summary>
        [Column("attach_id")]
        public int? AttachId { get; set; }

        /// <summary>
        /// 明细状态：1-未开始；2-已开始；3-已完成；9-异常完成（校验物料信息不完整）
        /// </summary>
        [Column("plan_detail_status")]
        [Required]
        [StringLength(1)]
        public string PlanDetailStatus { get; set; } = "1";

        /// <summary>
        /// 是否标识：1-是；0-否
        /// </summary>
        [Column("is_flag")]
        [Required]
        [StringLength(1)]
        public string IsFlag { get; set; } = "1";

        /// <summary>
        /// 备注
        /// </summary>
        [Column("remark")]
        [StringLength(500)]
        public string Remark { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [Column("create_by")]
        [StringLength(64)]
        public string CreateBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("create_time")]
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 更新人
        /// </summary>
        [Column("update_by")]
        [StringLength(64)]
        public string UpdateBy { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Column("update_time")]
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 物料条码
        /// </summary>
        [Column("material_barcode")]
        [StringLength(64)]
        public string MaterialBarcode { get; set; }
    }


}

