Files
F8WebAI/backend/AgriculturalPlatform.Api/Models/PurchaseOrder.cs
T

77 lines
2.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace AgriculturalPlatform.Api.Models;
/// <summary>收购单(过磅称重单)</summary>
public class PurchaseOrder
{
public int Id { get; set; }
/// <summary>收购单号(如 CG20260812-0001</summary>
public string OrderNo { get; set; } = string.Empty;
/// <summary>农户</summary>
public int FarmerId { get; set; }
public Farmer? Farmer { get; set; }
/// <summary>收购品种</summary>
public int ProductId { get; set; }
public Product? Product { get; set; }
/// <summary>收购方组织(公司/站/个体)</summary>
public int PurchaserOrgId { get; set; }
public Organization? PurchaserOrg { get; set; }
/// <summary>等级(主等级,多等级时为首磅等级;完整多等级见 Weighs</summary>
public string Grade { get; set; } = string.Empty;
public string Unit { get; set; } = "公斤";
/// <summary>单价(元/单位,多磅时为首磅单价)</summary>
public decimal UnitPrice { get; set; }
/// <summary>毛重(kg,合计)</summary>
public decimal GrossWeight { get; set; }
/// <summary>皮重(kg,合计)</summary>
public decimal TareWeight { get; set; }
/// <summary>净重(kg,合计)= 毛重 - 皮重</summary>
public decimal NetWeight { get; set; }
/// <summary>金额(元,合计)= Σ 净重 × 单价</summary>
public decimal Amount { get; set; }
/// <summary>容器/框数合计</summary>
public int BoxCount { get; set; }
/// <summary>磅次(多磅单每磅记录)</summary>
public ICollection<PurchaseWeigh> Weighs { get; set; } = new List<PurchaseWeigh>();
/// <summary>过户记录</summary>
public ICollection<PurchaseTransfer> Transfers { get; set; } = new List<PurchaseTransfer>();
/// <summary>过磅次数:1=已称毛重,2=已回皮完成</summary>
public int WeighCount { get; set; }
public PurchaseStatus Status { get; set; } = PurchaseStatus.Weighing;
/// <summary>经办人</summary>
public int? OperatorId { get; set; }
public User? Operator { get; set; }
/// <summary>第一次过磅时间(进场称毛重)</summary>
public DateTime WeighInAt { get; set; } = DateTime.Now;
/// <summary>回皮时间</summary>
public DateTime? WeighOutAt { get; set; }
public string Notes { get; set; } = string.Empty;
public DateTime CreatedAt { get; set; } = DateTime.Now;
public DateTime? UpdatedAt { get; set; }
}