You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

136 lines
3.6 KiB

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 TB_CHECK_DETAIL
{
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
public int UID { get; set; }
[NotMapped]
public string => CheckState.ToString();
[DisplayName("差异数量")]
[NotMapped]
public decimal DiffQty => GetDiffQty();
private decimal GetDiffQty()
{
if (CheckState == EnumCheckState.)
return 0;
else
return FinalCheckQty - BookQty;
}
[DisplayName("差异金额")]
[NotMapped]
public decimal DiffAmount => GetDiffAmount();
private decimal GetDiffAmount()
{
var price = WmsCache.GetPartPrice(PartCode);
return price * DiffQty;
}
[Key]
[Column(Order=0)]
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("单据编号")]
public string BillNum { get; set; }
[Key]
[Column(Order = 1)]
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("盘点库位")]
public string BillLocCode { get; set; }
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("账面库位")]
public string BookLocCode { get; set; }
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("实际库位")]
public string CheckLocCode { get; set; }
[Key]
[Column(Order = 2)]
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("箱码")]
public string BarCode { get; set; }
[Key]
[Column(Order = 3)]
[DisplayName("物料状态")]
public EnumStockState State { get; set; }
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("物料号")]
public string PartCode { get; set; }
[NotMapped]
public string => WmsCache.GetPartDesc(PartCode);
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("批次")]
public string Batch { get; set; }
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("器具号")]
public string EqptCode { get; set; } = "";
[Column(TypeName = "money")]
[DisplayName("账面数量")]
public decimal BookQty { get; set; }
[Column(TypeName = "money")]
[DisplayName("盘点数量")]
public decimal FinalCheckQty { get; set; }
[Column(TypeName = "money")]
[DisplayName("初盘数量")]
public decimal CheckQty { get; set; }
[Column(TypeName = "money")]
[DisplayName("重盘数量")]
public decimal ReCheckQty { get; set; }
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("盘点时间")]
public string CheckTime { get; set; }
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("盘点人")]
public string OperName { get; set; }
[StringLength(50)]
[DisplayName("供应商编号")]
public string VendId { get; set; }
[StringLength(50)]
[DisplayName("供应商批次")]
public string VendBatch { get; set; }
[DisplayName("生产日期")]
public DateTime? ProduceDate { get; set; }
public EnumCheckState CheckState { get; set; }
}
}