AdoPurchaseReceiptWriteback.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using SqlSugar;
  2. namespace Admin.NET.Plugin.AiDOP.MaterialWarehouse.InventoryPosting.Entity;
  3. /// <summary>
  4. /// DOP-L3 采购收货回写(C6 shadow)。承载 `pr_WMS_UpdatePurOrdRctTransactionProcessing2` 的收货数量/状态回写语义,
  5. /// 但**不写旧 ERP `PurOrd*` 表**(DOP 实体直指旧同名表,属读模型;路线 B 态②禁开旧表写路径)。
  6. /// 记录本次过账对采购单/行的意图回写,供 Phase 8 对账;真实回写旧表待正式方案(Phase 5B/后续)。
  7. /// </summary>
  8. [SugarTable("ado_purchase_receipt_writeback", "DOP-L3采购收货回写(C6 shadow,非旧PurOrd*)")]
  9. [SugarIndex("uk_ado_pr_writeback", nameof(TenantId), OrderByType.Asc, nameof(DomainCode), OrderByType.Asc,
  10. nameof(PostingId), OrderByType.Asc, nameof(PurOrd), OrderByType.Asc, nameof(PurLine), OrderByType.Asc, IsUnique = true)]
  11. public class AdoPurchaseReceiptWriteback : AdoInvEntityBase
  12. {
  13. [SugarColumn(ColumnName = "posting_id", ColumnDescription = "过账头Id")]
  14. public long PostingId { get; set; }
  15. [SugarColumn(ColumnName = "rct_nbr", ColumnDescription = "收货号", Length = 50, IsNullable = true)]
  16. public string RctNbr { get; set; }
  17. [SugarColumn(ColumnName = "pur_ord", ColumnDescription = "采购单号", Length = 60, IsNullable = false, DefaultValue = "")]
  18. public string PurOrd { get; set; }
  19. [SugarColumn(ColumnName = "pur_line", ColumnDescription = "采购单行号", DefaultValue = "0")]
  20. public int PurLine { get; set; }
  21. [SugarColumn(ColumnName = "potype", ColumnDescription = "采购类型(PurOrdDetail 键之一)", Length = 30, IsNullable = true)]
  22. public string Potype { get; set; }
  23. [SugarColumn(ColumnName = "accepted_qty", ColumnDescription = "接受收货数(本次 delta)", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  24. public decimal AcceptedQty { get; set; }
  25. [SugarColumn(ColumnName = "sample_qty", ColumnDescription = "留样数", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  26. public decimal SampleQty { get; set; }
  27. // ── L4 对账字段(前值→delta→后值 + 未收余量 + 完成,据 C6 LIVE 计算)──
  28. [SugarColumn(ColumnName = "qty_ordered", ColumnDescription = "采购订购数", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  29. public decimal QtyOrdered { get; set; }
  30. [SugarColumn(ColumnName = "returned_qty", ColumnDescription = "已退货数", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  31. public decimal ReturnedQty { get; set; }
  32. [SugarColumn(ColumnName = "before_received_qty", ColumnDescription = "变动前已收数", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  33. public decimal BeforeReceivedQty { get; set; }
  34. [SugarColumn(ColumnName = "after_received_qty", ColumnDescription = "变动后已收数", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  35. public decimal AfterReceivedQty { get; set; }
  36. [SugarColumn(ColumnName = "before_outstanding_qty", ColumnDescription = "变动前未收余量", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  37. public decimal BeforeOutstandingQty { get; set; }
  38. [SugarColumn(ColumnName = "after_outstanding_qty", ColumnDescription = "变动后未收余量", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
  39. public decimal AfterOutstandingQty { get; set; }
  40. [SugarColumn(ColumnName = "detail_completed", ColumnDescription = "明细是否收完((收-退)>=订)", DefaultValue = "0")]
  41. public bool DetailCompleted { get; set; }
  42. [SugarColumn(ColumnName = "qc_nbr", ColumnDescription = "检验单号", Length = 100, IsNullable = true)]
  43. public string QcNbr { get; set; }
  44. [SugarColumn(ColumnName = "receiver", ColumnDescription = "收货单号", Length = 50, IsNullable = true)]
  45. public string Receiver { get; set; }
  46. [SugarColumn(ColumnName = "fbillno", ColumnDescription = "来料检验单号", Length = 50, IsNullable = true)]
  47. public string FbillNo { get; set; }
  48. [SugarColumn(ColumnName = "qc_status", ColumnDescription = "QC状态(YES/NO)", Length = 10, IsNullable = true)]
  49. public string QcStatus { get; set; }
  50. }