| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- namespace Admin.NET.Plugin.AiDOP.MaterialWarehouse.InventoryPosting.Inventory;
- /// <summary>库存事务类型(复刻 pr_SFM_InventoryTransactionProcessing2 的 TransType 常量)。</summary>
- public static class InventoryTransType
- {
- /// <summary>冻结(可用→冻结)。</summary>
- public const string InvFrz = "inv-frz";
- /// <summary>解冻。</summary>
- public const string InvUnFrz = "inv-unfrz";
- /// <summary>采购收货入库(→质检库存 Assay;ChangeQty>0)。IQC 合格入库主路径。</summary>
- public const string RctPoIns = "rct-po-ins";
- /// <summary>质检转序/发出(从质检库存出;ChangeQty<0 走 Assay 掩码)。</summary>
- public const string IssTrIns = "iss-tr-ins";
- /// <summary>销售出库(影响 QtyOnOrd)。</summary>
- public const string IssSo = "iss-so";
- /// <summary>IQC 合格收货(@IQCNbr≠'',Phase 6A 实核)。**C5 一般分支**:QtyOnHand+/Avail+/Assay=0。</summary>
- public const string RctPo = "rct-po";
- /// <summary>IQC 留样(Reason='iqc',ChangeQty 恒负)。**C5 一般分支**:QtyOnHand-/Avail-。</summary>
- public const string IssUnp = "iss-unp";
- }
- /// <summary>
- /// 标准化库存事务命令(C5 输入)。上游已完成 C1 判定 / 编排 / 取号,C5 只认此 DTO。
- /// 约定:ChangeQty>0=入库,<0=出库;LotSerial/Refs 空批落空串 ''(非 NULL)。
- /// </summary>
- public sealed class InventoryTransactionCommand
- {
- public long TenantId { get; set; }
- public string DomainCode { get; set; } = string.Empty;
- public long PostingId { get; set; }
- public long TransactionGroupId { get; set; }
- public int Seq { get; set; }
- public string ItemNum { get; set; } = string.Empty;
- public string Location { get; set; } = string.Empty;
- public string LotSerial { get; set; } = string.Empty;
- public string Refs { get; set; } = string.Empty;
- public string TransType { get; set; } = string.Empty;
- public decimal ChangeQty { get; set; }
- public decimal UmConversion { get; set; } = 1m;
- public decimal QtyPicked { get; set; }
- public string WorkOrd { get; set; }
- public string ShipperNum { get; set; }
- public string ShipType { get; set; }
- public string OrdNbr { get; set; }
- public string Curr { get; set; }
- public decimal Price { get; set; }
- public string Remark { get; set; }
- public string Reason { get; set; }
- public string Op { get; set; }
- public string Site { get; set; }
- public string User { get; set; }
- // 收货追溯(→ 流水 ado_inventory_transaction)
- public string Fbillno { get; set; }
- public string Receiver { get; set; }
- public string RctQcNbr { get; set; }
- }
- /// <summary>库存量快照(前值/后值通用)。</summary>
- public sealed class InventoryBalance
- {
- public decimal QtyOnHand { get; set; }
- public decimal AvailStatusQty { get; set; }
- public decimal Assay { get; set; }
- public decimal FreezeQty { get; set; }
- public decimal QtyOnOrd { get; set; }
- }
- /// <summary>单条命令的库存量增量(带符号;无 DB 副作用计算结果)。</summary>
- public sealed class InventoryDeltas
- {
- /// <summary>ChangeQty × 归一化 UMConversion。</summary>
- public decimal Conv { get; set; }
- public decimal DeltaQtyOnHand { get; set; }
- public decimal DeltaAvailStatusQty { get; set; }
- public decimal DeltaAssay { get; set; }
- public decimal DeltaFreezeQty { get; set; }
- public decimal DeltaQtyOnOrd { get; set; }
- }
- /// <summary>库存流水(InvTransHist 等价)字段值。</summary>
- public sealed class InventoryTransHistValues
- {
- /// <summary>变动前库位明细在手(由调用方传入 LocationDetail 变动前 QtyOnHand)。</summary>
- public decimal BeginBalance { get; set; }
- /// <summary>流水 QtyChange = conv(frz/unfrz 记 0)。</summary>
- public decimal QtyChange { get; set; }
- public decimal FreezeQty { get; set; }
- public decimal Assay { get; set; }
- /// <summary>金额 = conv × Price。</summary>
- public decimal Amt { get; set; }
- /// <summary>流水事务类型 = (Remark=='QcCheck' ? Reason : TransType)。</summary>
- public string TransType { get; set; }
- }
|