IIqcReceiptStateLoader.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. namespace Admin.NET.Plugin.AiDOP.MaterialWarehouse.InventoryPosting.L1;
  2. /// <summary>
  3. /// consume 时重新加载的收货可变状态(Runtime Gate 新鲜度 + 收货上下文)。
  4. /// 由 L0 loader 从标准层/源提供——**不取自事件 payload**。
  5. /// </summary>
  6. public sealed class IqcReceiptState
  7. {
  8. /// <summary>检验单/收货上下文是否存在(不存在=数据未就绪,可重试)。</summary>
  9. public bool Found { get; set; }
  10. // Runtime Gate 新鲜数据
  11. public bool HasPendingReceipt { get; set; } // @IsRctTemp>0
  12. public bool HasReceivableDetails { get; set; } // @RctDetails<>''
  13. // 收货上下文(构造 C5 命令 / C6 对账 / C7 任务)
  14. public string ItemNum { get; set; }
  15. public string Location { get; set; }
  16. public string LotSerial { get; set; }
  17. public string Refs { get; set; }
  18. public string RctNbr { get; set; } // 新收货号
  19. public string PurOrd { get; set; }
  20. public int PurLine { get; set; }
  21. public string Potype { get; set; }
  22. public decimal OrderedQty { get; set; }
  23. public decimal BeforeReceivedQty { get; set; }
  24. public decimal ReturnedQty { get; set; }
  25. public decimal SampleQty { get; set; }
  26. /// <summary>
  27. /// L0 freshness 水位(Phase B8):标准层该记录的最近同步时点(源自 `mdp_std_*.sync_time`)。
  28. /// null=未知。消费端据此与事件发生时刻比对:标准层落后于事件 → 不过账、事件保持 retryable,避免用陈旧态过账。
  29. /// </summary>
  30. public DateTime? SourceSyncedAt { get; set; }
  31. }
  32. /// <summary>
  33. /// L1→L0 边界 port:给定 (tenant, domain, FBILLNO) 加载**最新**收货状态。
  34. /// L0 下阶段实现:从 `mdp_std_*`(IQC 检验单 std + 采购收货 std)读取;本阶段仅定义 port,不建 mdp entity/transform。
  35. ///
  36. /// L0 下阶段须提供的最小数据 = <see cref="IqcReceiptState"/> 全字段:
  37. /// Found / HasPendingReceipt(IsRctTemp) / HasReceivableDetails(Status='N' 明细) /
  38. /// ItemNum / Location / LotSerial / Refs / RctNbr / PurOrd / PurLine / Potype /
  39. /// OrderedQty(QtyOrded) / BeforeReceivedQty(PurOrdDetail.RctQty) / ReturnedQty(QtyReturned) / SampleQty(InsSampleQty)。
  40. /// </summary>
  41. public interface IIqcReceiptStateLoader
  42. {
  43. Task<IqcReceiptState> LoadAsync(long tenantId, string domainCode, string fbillno);
  44. }