using RB_MES_API.Context;
using System.ComponentModel.DataAnnotations;
namespace RB_MES_API.Models.Cloud
{
    /// <summary>
    /// 受托加工材料退料单 R006-CUST
    /// </summary>
    public class STK_OEMInStockRETURN
    {
        /// <summary>
        /// 实体主键（无需填写，保存时自动添加）
        /// </summary>
        public int FID { get; set; }
        /// <summary>
        /// 单据编号
        /// </summary>
        public string FBillNo { get; set; }
        /// <summary>
        /// 单据类型 (必填项)
        /// </summary>
        public Dictionary<string, string> FBillTypeID { get; set; } = new Dictionary<string, string>() {
            { "FNumber","WWLLD01_SYS"}
        };
        /// <summary>
        /// 库存组织 (必填项)
        /// </summary>
        public Dictionary<string, string> FStockOrgId { get; set; } = new Dictionary<string, string>() {
            { "FNumber",LocalStaticRequest.DefaultOrg}
        };
        /// <summary>
        /// 日期 (必填项)
        /// </summary>
        [DataType(DataType.Date)]
        public string FDate { get; set; } = DateTime.Now.ToShortDateString();
        /// <summary>
        /// 客户  (必填项)
        /// </summary>
        public Dictionary<string, string> FCustId { get; set; } = new Dictionary<string, string>() {
            { "FNumber",""}
        };
        /// <summary>
        /// 验收
        /// </summary>
        public string FCheckerId { get; set; }
        /// <summary>
        /// 仓管员
        /// </summary>
        public Dictionary<string, string> FStockerId { get; set; } = new Dictionary<string, string>() {
            { "FNumber",""}
        };
        /// <summary>
        ///  库存组
        /// </summary>
        public Dictionary<string, string> FStockerGroupId { get; set; } = new Dictionary<string, string>() {
            { "FNumber",""}
        };
        /// <summary>
        /// 备注
        /// </summary>
        public string FNote { get; set; }
        /// <summary>
        /// 货主类型  (必填项)
        /// </summary>
        public string FOwnerTypeIdHead { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public Dictionary<string, string> FCreatorId { get; set; } = new Dictionary<string, string>() {
            { "FUserID",""}
        };
        /// <summary>
        /// 创建日期
        /// </summary>
        public string FCreateDate { get; set; }
        /// <summary>
        /// 最后修改人
        /// </summary>
        public Dictionary<string, string> FModifierId { get; set; } = new Dictionary<string, string>() {
            { "FUserID",""}
        };
        /// <summary>
        /// 最后修改日期
        /// </summary>
        public string FModifyDate { get; set; }
        /// <summary>
        /// 序列号上传
        /// </summary>
        public string FScanBox { get; set; }
        /// <summary>
        /// 退料方式
        /// </summary>
        public string FReturnStyle { get; set; }
        /// <summary>
        /// 退料类型 (必填项)
        /// </summary>
        public string FReturnType { get; set; }
        /// <summary>
        /// 部门
        /// </summary>
        public Dictionary<string, string> FDeptID { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
        /// <summary>
        /// MES唯一标识
        /// </summary>
        [StringLength(36)]
        public string F_SBMI_QUEUE_ID { get; set; }



        public List<BillEntry> FBillEntry { get; set; } = new List<BillEntry>();
        /// <summary>
        /// 明细  
        /// </summary>
        public class BillEntry
        {
            /// <summary>
            /// 实体主键（无需填写，保存时自动添加）
            /// </summary>
            public int FEntryID { get; set; }
            /// <summary>
            /// 客户物料编码   
            /// </summary>
            public Dictionary<string, string> FCustMatId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            /// <summary>
            ///  物料编码   (必填项)
            /// </summary>
            public Dictionary<string, string> FMaterialId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            /// <summary>
            ///  辅助属性
            /// </summary>
            public AuxpropId FAuxPropId { get; set; }
            public class AuxpropId
            {
                public Dictionary<string, string> FAUXPROPID__FF100001 { get; set; } = new Dictionary<string, string>() {
                { "FNumber",""} };
            }
            /// <summary>
            ///  BOM版本   
            /// </summary>
            public Dictionary<string, string> FBomId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            /// <summary>
            /// 生产日期
            /// </summary>
            [DataType(DataType.Date)]
            public string FProduceDate { get; set; }
            /// <summary>
            /// 有效期至
            /// </summary>
            [DataType(DataType.Date)]
            public string FExpiryDate { get; set; }
            // <summary>
            /// 计划跟踪号
            /// </summary>
            public string FMtoNo { get; set; }
            // <summary>
            /// 项目编号
            /// </summary>
            public string FProjectNo { get; set; }
            /// <summary>
            ///  单位  (必填项)   
            /// </summary>
            public Dictionary<string, string> FUnitID { get; set; } = new Dictionary<string, string>() {
            { "FNumber",""}
        };
            /// <summary>
            /// 基本单位    (必填项)     
            /// </summary>
            public Dictionary<string, string> FBaseUnitId { get; set; } = new Dictionary<string, string>() {
            { "FNumber",""}
        };
            // <summary>
            /// 实退数量
            /// </summary>
            public decimal FQty { get; set; }
            // <summary>
            /// 补料数量
            /// </summary>
            public decimal FFeedQty { get; set; }
            /// <summary>
            ///  退货仓库
            /// </summary>
            public Dictionary<string, string> FStockId { get; set; } = new Dictionary<string, string>() {
            { "FNumber",""}
        };


            public FStockLocId StockLocId { get; set; }
            /// <summary>
            /// 仓位  
            /// </summary>
            public class FStockLocId
            {
                public Dictionary<string, string> FSTOCKLOCID__FF100001 { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}

        };
                public Dictionary<string, string> FSTOCKLOCID__FF100002 { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}

        };
            }
            // <summary>
            /// 实退数量(库存辅单位)
            /// </summary>
            public decimal FSecQty { get; set; }
            /// <summary>
            ///  批号
            /// </summary>
            public Dictionary<string, string> FLot { get; set; } = new Dictionary<string, string>() {
            { "FNumber",""}
        };
            /// <summary>
            ///  库存状态
            /// </summary>
            public Dictionary<string, string> FStockStatusId { get; set; } = new Dictionary<string, string>() {
            { "FNumber","KCZT01_SYS"}
        };
            // <summary>
            /// 备注
            /// </summary>
            [StringLength(36)]
            public string FNoteEntry { get; set; }
            // <summary>
            /// 货主类型 (必填项)
            /// </summary>
             [StringLength(36)]
            public string FOwnerTypeId { get; set; }
            /// <summary>
            ///  货主 (必填项)
            /// </summary>
            public Dictionary<string, string> FOwnerId { get; set; } = new Dictionary<string, string>() {
            { "FNumber",""}
        };
            // <summary>
            /// 保管者类型 (必填项)
            /// </summary>
            [StringLength(36)]
            public string FKeeperTypeId { get; set; } = "BD_KeeperOrg";
            /// <summary>
            ///  辅单位
            /// </summary>
            public Dictionary<string, string> FExtAuxUnitId { get; set; } = new Dictionary<string, string>() {
            { "FNumber",""}
        };
            /// <summary>
            ///  保管者   (必填项)
            /// </summary>
            public Dictionary<string, string> FKeeperId { get; set; } = new Dictionary<string, string>() {
            { "FNumber",LocalStaticRequest.DefaultOrg}
        };
            // <summary>
            /// 实退数量（辅单位）
            /// </summary>
            [StringLength(36)]
            public decimal FExtAuxUnitQty { get; set; }
            // <summary>
            /// 补料数量（辅单位）
            /// </summary>
            [StringLength(36)]
            public decimal FFeedExAuxQty { get; set; }
            // <summary>
            /// 服务上下文
            /// </summary>
            [StringLength(36)]
            public decimal FServiceContext { get; set; }
            // <summary>
            /// 补料数量（基本单位）
            /// </summary>
            [StringLength(36)]
            public decimal FFeedBaseQty { get; set; }
            // <summary>
            /// 补料数量（库存辅单位）
            /// </summary>
            [StringLength(36)]
            public decimal FFeedSecQty { get; set; }
            /// <summary>
            /// 源单分录行号 FSrcBillEntrySeq 
            /// </summary>
            public string FSeq { get; set; }
            /// <summary>
            /// 更新库存标志
            /// </summary>
            //public string FStockFlag { get; set; } = "1";
        }

        /// <summary>
        /// 序列号子单据体      
        /// </summary>
        public class FSerialSubEntity
        {
            /// <summary>
            /// 实体主键（无需填写，保存时自动添加）
            /// </summary>
            public int FDetailID { get; set; }
            /// <summary>
            /// 序列号
            /// </summary>
            [StringLength(36)]
            public string FSerialNo { get; set; }       
            /// <summary>
            /// 备注
            /// </summary>
            [StringLength(36)]
            public string FSerialNote { get; set; }
        }
    }
}
