using RB_MES_API.Context;
using System.ComponentModel.DataAnnotations;
namespace RB_MES_API.Models.Cloud
{
    /// <summary>
    /// 盘亏单
    /// </summary>
    public class STK_StockCountLoss
    {
        /// <summary>
        /// 实体主键（无需填写，保存时自动添加）
        /// </summary>
        public int FID { get; set; } 
        /// <summary>
        /// 单据编号   
        /// </summary>
        [StringLength(36)]
        public string FBillNo { get; set; } 
        /// <summary>
        /// 单据类型   (必填项)
        /// </summary>
        public Dictionary<string, string> FBillTypeID { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER","PK01_SYS"}
        };
        /// <summary>
        /// 日期  (必填项)
        /// </summary>
        [DataType(DataType.DateTime)]
        public string FDate { get; set; } = DateTime.Now.ToShortDateString();
        /// <summary>
        /// 物料盘点作业编码   
        /// </summary>
        [StringLength(36)]
        public string FStockCountInputNo { get; set; } 
        /// <summary>
        /// 盘点来源内码
        /// </summary>
        public int FStkCountSchemeId { get; set; } 
        /// <summary>
        /// 库存组织   (必填项)
        /// </summary>
        public Dictionary<string, string> FStockOrgId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",LocalStaticRequest.DefaultOrg}
        };
        /// <summary>
        /// 货主类型    (必填项)  
        /// </summary>
        [StringLength(36)]
        public string FOwnerTypeIdHead { get; set; } = "BD_KeeperOrg";
        /// <summary>
        /// 货主
        /// </summary>
        public Dictionary<string, string> FOwnerIdHead { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",LocalStaticRequest.DefaultOrg}
        };
        /// <summary>
        /// 部门
        /// </summary>
        public Dictionary<string, string> FDeptId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
        /// <summary>
        /// 库存组
        /// </summary>
        public Dictionary<string, string> FStockerGroupId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
        /// <summary>
        /// 仓管员
        /// </summary>
        public Dictionary<string, string> FStockerId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(36)]
        public string FNoteHead { get; set; } 
        /// <summary>
        /// 盘点来源名称
        /// </summary>
        [StringLength(36)]
        public string FStkCountSchemeName { get; set; } 
        /// <summary>
        /// 序列号上传
        /// </summary>
        //[StringLength(36)]
        //public string FScanBox { get; set; } = "";
        /// <summary>
        /// 第三方系统
        /// </summary>
        [StringLength(36)]
        public string FThirdSystem { get; set; } 
        /// <summary>
        /// 第三方源单内码
        /// </summary>
        [StringLength(36)]
        public string FThirdSrcId { get; set; } 
        /// <summary>
        ///  第三方源单编码
        /// </summary>
        [StringLength(36)]
        public string FThirdSrcBillNo { get; set; }
        /// <summary>
        /// MES唯一标识
        /// </summary>
        [StringLength(36)]
        public string F_SBMI_QUEUE_ID { get; set; }
        ///// <summary>
        ///// 作废人
        ///// </summary>
        ////public Dictionary<string, string> FCANCELLERID { get; set; } = new Dictionary<string, string>() {
        ////    { "FUserID",""}
        ////};
        ///// <summary>
        ///// 作废日期
        ///// </summary>
        ////public DateTime FCANCELDATE { 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> 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>
            /// 单位   (必填项) 
            /// </summary>
            public Dictionary<string, string> FUnitID { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            /// <summary>
            /// 基本单位
            /// </summary>
            public Dictionary<string, string> FSubBaseUnitId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            /// <summary>
            /// 盘点数量
            /// </summary>
            public decimal FCountQty { get; set; }
            /// <summary>
            /// 仓库   (必填项) 
            /// </summary>
            public Dictionary<string, string> FStockId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            /// <summary>
            /// 仓位  
            /// </summary>
            public StockLocId FStockLocId { get; set; } = new StockLocId();
            public class StockLocId
            {
                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 Dictionary<string, string> FLOT { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            public Dictionary<string, string> FStockStatusId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER","KCZT01_SYS"}
        };
            /// <summary>
            /// 货主类型    (必填项)
            /// </summary>
            [StringLength(36)]
            public string FOwnerTypeId { get; set; } = "BD_KeeperOrg";
            /// <summary>
            /// 货主        (必填项)
            /// </summary>
            public Dictionary<string, string> FOwnerid { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",LocalStaticRequest.DefaultOrg}
        };
            /// <summary>
            /// 备注
            /// </summary>
            [StringLength(36)]
            public string Fnote { get; set; }
            /// <summary>
            /// 保管者类型   (必填项)
            /// </summary>
            [StringLength(36)]
            public string FKeeperTypeId { get; set; } = "BD_KeeperOrg";
            /// <summary>
            /// 保管者        (必填项)
            /// </summary>
            public Dictionary<string, string> FKeeperId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            /// <summary>
            /// 项目编号
            /// </summary>
            [StringLength(36)]
            public string FProjectNo { get; set; } = "";
            /// <summary>
            /// BOM版本
            /// </summary>
            public Dictionary<string, string> FBomId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            /// <summary>
            /// 服务上下文
            /// </summary>
            //[StringLength(36)]
            //public string FServiceContext { get; set; } = "";
            /// <summary>
            /// 生产日期
            /// </summary>
            [DataType(DataType.DateTime)]
            public string FProduceDate { get; set; }
            /// <summary>
            /// 到期日
            /// </summary>
            [DataType(DataType.DateTime)]
            public string FExpiryDate { get; set; }
            /// <summary>
            /// 辅单位
            /// </summary>
            public Dictionary<string, string> FExtAuxUnitId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            /// <summary>
            ///  盘点数量（辅单位）
            /// </summary>
            public decimal FExtAuxUnitQty { get; set; } 
            /// <summary>
            /// 账存数量（辅单位）
            /// </summary>
            public decimal FExtSecAcctQty { get; set; } 
            /// <summary>
            /// 盘亏数量（辅单位）
            /// </summary>
            public decimal FExtSecLOSSQty { get; set; }
            /// <summary>
            /// 盘点数量（基本）
            /// </summary>
            public decimal FBaseCountQty { get; set; } 
            /// <summary>
            /// 库存辅单位
            /// </summary>
            public Dictionary<string, string> FSecUnitId { get; set; } = new Dictionary<string, string>() {
            { "FNUMBER",""}
        };
            /// <summary>
            /// 计划跟踪号
            /// </summary>
            [StringLength(36)]
            public string FMtoNo { get; set; } 
            /// <summary>
            /// 第三方源单分录编码
            /// </summary>
            [StringLength(36)]
            public string FThirdSrcEntryId { get; set; }
            /// <summary>
            /// 源单分录行号
            /// </summary>
            public string FSeq { get; set; }
        }



        /// <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; } 
        }
    }
}
