using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using ChangKeTec.Wms.Models.Enums; namespace ChangKeTec.Wms.Models.Wms { public partial class TS_BARCODE { [DatabaseGenerated(DatabaseGeneratedOption.Computed)] public long UID { get; set; } [Key] [StringLength(50)] [DisplayName("条码")] public string BarCode { get; set; } [Required(AllowEmptyStrings = true)] [StringLength(50)] [DisplayName( "物料号")] public string PartCode { get; set; } [NotMapped] [DisplayName( "物料描述")] public string PartDesc => WmsCache.GetPartDesc(PartCode); [NotMapped] [DisplayName( "描述一")] public string PartDesc1 => WmsCache.GetPartDesc1(PartCode); [NotMapped] [DisplayName( "描述二")] public string PartDesc2 => WmsCache.GetPartDesc2(PartCode); [NotMapped] [DisplayName( "ERP物料号")] public string ErpPartCode => WmsCache.GetErpPartCode(PartCode); [NotMapped] [DisplayName( "项目编号")] public string ProjectId => WmsCache.GetProjectId(PartCode); [NotMapped] [DisplayName( "单位")] public string Unit => WmsCache.GetUnit(PartCode); [StringLength(50)] [DisplayName( "供应商物料号")] public string VendPartCode { get; set; } [StringLength(50)] [DisplayName( "客户物料号")] public string CustPartCode { get; set; } [Required(AllowEmptyStrings = true)] [StringLength(50)] [DisplayName( "批次")] public string Batch { get; set; } [DisplayName( "管理类型")] public EnumManageType ManageType { get; set; } [DisplayName( "生产日期")] public DateTime ProduceDate { get; set; } = DateTime.Now.Date; [Required(AllowEmptyStrings = true)] [StringLength(50)] [DisplayName("流水号")] public string SerialNum { get; set; } = ""; [Column(TypeName = "money")] [DisplayName( "数量")] public decimal Qty { get; set; } [DisplayName( "条码类型")] public int BarCodeType { get; set; } [DisplayName( "物料类型")] public string PartType => WmsCache.GetPartType(PartCode); [Required(AllowEmptyStrings = true)] [StringLength(50)] [DisplayName( "物料类型")] public string PartKind => WmsCache.GetPartKind(PartCode); [NotMapped] [DisplayName( "物料组")] public string PartGroup => WmsCache.GetPartGroup(PartCode); [NotMapped] [DisplayName( "配置信息")] public string Configuration => WmsCache.GetConfigration(PartCode); [Required(AllowEmptyStrings = true)] [StringLength(500)] [DisplayName( "完整条码信息")] public string FullBarCode { get; set; } [Required(AllowEmptyStrings = true)] [StringLength(50)] [DisplayName("单据号")] public string BillNum { get; set; } = ""; [DisplayName("单据行")] public int BillLine { get; set; } = 1; [StringLength(50)] [DisplayName("供应商编号")] public string VendId { get; set; } = ""; [NotMapped] [DisplayName( "供应商名称")] public string VendName => WmsCache.GetVenderName(VendId); [NotMapped] [DisplayName( "生产线")] public string LineName => WmsCache.GetWorkLineName(VendId); [NotMapped] [DisplayName( "客户名称")] public string CustName => WmsCache.GetCustName(VendId); [NotMapped] [DisplayName( "我方编号")] public string SelfCode => WmsCache.GetSelfCode(VendId); [StringLength(50)] [DisplayName( "供应商批次")] public string VendBatch { get; set; } [StringLength(50)] [DisplayName( "班次编号")] public string ShiftId { get; set; } [NotMapped] [DisplayName( "班次")] public string ShiftName => WmsCache.GetShiftName(ShiftId); [StringLength(50)] [DisplayName( "班组编号")] public string TeamId { get; set; } [NotMapped] [DisplayName( "班组")] public string TeamName => WmsCache.GetTeamName(TeamId); [StringLength(50)] [DisplayName( "器具编号")] public string EqptCode { get; set; } [StringLength(50)] [DisplayName( "器具类型")] public string EqptType { get; set; } [DisplayName( "标箱数")] public decimal PackQty { get; set; } [DisplayName( "创建时间")] public DateTime CreateTime { get; set; } = DateTime.Now; [Required(AllowEmptyStrings = true)] [StringLength(50)] [DisplayName( "创建人")] public string CreateOper { get; set; } [DisplayName( "更新时间")] public DateTime UpdateTime { get; set; } = DateTime.Now; [Column(TypeName = "money")] [DisplayName( "更新数量")] public decimal UpdateQty { get; set; } [DisplayName( "打印次数")] public int PrintCount { get; set; } [StringLength(50)] public string QLevel { get; set; } [StringLength(50)] public string Process { get; set; } [StringLength(50)] public string CertificateOfQuality { get; set; } [StringLength(50)] public string DeliverDest { get; set; } [DisplayName( "状态")] public int State { get; set; } [StringLength(500)] [DisplayName( "备注")] public string Remark { get; set; } //[NotMapped] //[DisplayName("单位2")] //public string Unit2 => WmsCache.GetUnit2(PartCode); //[NotMapped] //[DisplayName("转换率")] //public decimal Conversion => WmsCache.GetConversion(PartCode); //[NotMapped] //[DisplayName("数量2")] //public decimal Qty2 =>(Conversion == 1? Qty : Math.Round(Qty / Conversion,1,MidpointRounding.AwayFromZero)); //[NotMapped] //[DisplayName("检验员")] //public string Inspecter => WmsCache.GetPartInspecter(PartCode); } }