namespace AgriculturalPlatform.Api.Models; /// 收购单(过磅称重单) public class PurchaseOrder { public int Id { get; set; } /// 收购单号(如 CG20260812-0001) public string OrderNo { get; set; } = string.Empty; /// 农户 public int FarmerId { get; set; } public Farmer? Farmer { get; set; } /// 收购品种 public int ProductId { get; set; } public Product? Product { get; set; } /// 收购方组织(公司/站/个体) public int PurchaserOrgId { get; set; } public Organization? PurchaserOrg { get; set; } /// 等级(主等级,多等级时为首磅等级;完整多等级见 Weighs) public string Grade { get; set; } = string.Empty; public string Unit { get; set; } = "公斤"; /// 单价(元/单位,多磅时为首磅单价) public decimal UnitPrice { get; set; } /// 毛重(kg,合计) public decimal GrossWeight { get; set; } /// 皮重(kg,合计) public decimal TareWeight { get; set; } /// 净重(kg,合计)= 毛重 - 皮重 public decimal NetWeight { get; set; } /// 金额(元,合计)= Σ 净重 × 单价 public decimal Amount { get; set; } /// 容器/框数合计 public int BoxCount { get; set; } /// 磅次(多磅单每磅记录) public ICollection Weighs { get; set; } = new List(); /// 过户记录 public ICollection Transfers { get; set; } = new List(); /// 过磅次数:1=已称毛重,2=已回皮完成 public int WeighCount { get; set; } public PurchaseStatus Status { get; set; } = PurchaseStatus.Weighing; /// 经办人 public int? OperatorId { get; set; } public User? Operator { get; set; } /// 第一次过磅时间(进场称毛重) public DateTime WeighInAt { get; set; } = DateTime.Now; /// 回皮时间 public DateTime? WeighOutAt { get; set; } public string Notes { get; set; } = string.Empty; public DateTime CreatedAt { get; set; } = DateTime.Now; public DateTime? UpdatedAt { get; set; } }