AdoInventoryLocationDetail.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using SqlSugar;
  2. namespace Admin.NET.Plugin.AiDOP.MaterialWarehouse.InventoryPosting.Entity;
  3. /// <summary>
  4. /// DOP-L3 库位/批次库存明细(影子)。**非旧 LocationDetail**。
  5. /// 自然键据 pr_SFM_InventoryTransactionProcessing2 实核(L33-35 JOIN / L370-371 UPDATE):
  6. /// Domain + ItemNum + Location + LotSerial + Refs 五维。
  7. /// ⚠️ 非批控物料 LotSerial/Refs 旧系统落**空串 ''(非 NULL)**并以空串占位唯一(L332-333 显式写 '',JOIN 用 IsNull(x,''))。
  8. /// 故 lot_serial / refs 必须 NOT NULL DEFAULT '',否则 MySQL「多 NULL 不冲突」会让同库位非批控物料重复建行。
  9. /// </summary>
  10. [SugarTable("ado_inventory_location_detail", "DOP-L3库位批次库存明细(影子,非旧LocationDetail)")]
  11. [SugarIndex("uk_ado_inv_loc_detail",
  12. nameof(TenantId), OrderByType.Asc,
  13. nameof(DomainCode), OrderByType.Asc,
  14. nameof(ItemNum), OrderByType.Asc,
  15. nameof(Location), OrderByType.Asc,
  16. nameof(LotSerial), OrderByType.Asc,
  17. nameof(Refs), OrderByType.Asc,
  18. IsUnique = true)]
  19. public class AdoInventoryLocationDetail : AdoInvEntityBase
  20. {
  21. [SugarColumn(ColumnName = "item_num", ColumnDescription = "物料号", Length = 50, IsNullable = false, DefaultValue = "")]
  22. public string ItemNum { get; set; }
  23. [SugarColumn(ColumnName = "location", ColumnDescription = "库位", Length = 30, IsNullable = false, DefaultValue = "")]
  24. public string Location { get; set; }
  25. /// <summary>批次/序列号。非批控物料落空串 ''(NOT NULL DEFAULT ''),空串占位唯一。</summary>
  26. [SugarColumn(ColumnName = "lot_serial", ColumnDescription = "批次/序列号(空批落空串非NULL)", Length = 50, IsNullable = false, DefaultValue = "")]
  27. public string LotSerial { get; set; }
  28. /// <summary>旧 Refs 维度(唯一键第 6 维;空落空串 '')。</summary>
  29. [SugarColumn(ColumnName = "refs", ColumnDescription = "Refs维度(空落空串非NULL)", Length = 50, IsNullable = false, DefaultValue = "")]
  30. public string Refs { get; set; }
  31. [SugarColumn(ColumnName = "qty_on_hand", ColumnDescription = "在手库存", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  32. public decimal QtyOnHand { get; set; }
  33. [SugarColumn(ColumnName = "avail_status_qty", ColumnDescription = "非限制/可用库存", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  34. public decimal AvailStatusQty { get; set; }
  35. [SugarColumn(ColumnName = "assay_qty", ColumnDescription = "质检库存", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  36. public decimal AssayQty { get; set; }
  37. [SugarColumn(ColumnName = "freeze_qty", ColumnDescription = "冻结库存", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  38. public decimal FreezeQty { get; set; }
  39. }