| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using SqlSugar;
- namespace Admin.NET.Plugin.AiDOP.MaterialWarehouse.InventoryPosting.Entity;
- /// <summary>
- /// DOP-L3 库存事务流水(影子, append-only)。**非旧 InvTransHist**。
- /// 旧 InvTransHist 为纯 append-only(pr_SFM_InventoryTransactionProcessing2 L373 仅 INSERT,零 UPDATE、无自然唯一键)。
- /// L3 用代理主键 id;结构层防重键 = (tenant_id, transaction_group_id, seq):同一次过账(group)内的流水行 seq 唯一,
- /// 防止同一 Posting 重复写同一流水。**此为结构层防重,不替代 Phase 4 的 Posting 幂等。**
- /// transaction_group_id 由 Phase 5 每次过账用雪花赋值;seq 为组内 1..N。
- /// </summary>
- [SugarTable("ado_inventory_transaction", "DOP-L3库存事务流水(影子,append-only,非旧InvTransHist)")]
- [SugarIndex("uk_ado_inv_trans_group_seq", nameof(TenantId), OrderByType.Asc, nameof(TransactionGroupId), OrderByType.Asc, nameof(Seq), OrderByType.Asc, IsUnique = true)]
- [SugarIndex("idx_ado_inv_trans_posting", nameof(TenantId), OrderByType.Asc, nameof(PostingId), OrderByType.Asc)]
- public class AdoInventoryTransaction : AdoInvEntityBase
- {
- [SugarColumn(ColumnName = "item_num", ColumnDescription = "物料号", Length = 50, IsNullable = false, DefaultValue = "")]
- public string ItemNum { get; set; }
- [SugarColumn(ColumnName = "location", ColumnDescription = "库位", Length = 30, IsNullable = false, DefaultValue = "")]
- public string Location { get; set; }
- [SugarColumn(ColumnName = "lot_serial", ColumnDescription = "批次/序列号(空落空串)", Length = 50, IsNullable = false, DefaultValue = "")]
- public string LotSerial { get; set; }
- [SugarColumn(ColumnName = "trans_type", ColumnDescription = "事务类型", Length = 50, IsNullable = false, DefaultValue = "")]
- public string TransType { get; set; }
- [SugarColumn(ColumnName = "qty_change", ColumnDescription = "变动数量(带方向)", Length = 18, DecimalDigits = 5, DefaultValue = "0")]
- public decimal QtyChange { get; set; }
- [SugarColumn(ColumnName = "begin_balance", ColumnDescription = "变动前余额", Length = 18, DecimalDigits = 5, IsNullable = true)]
- public decimal? BeginBalance { get; set; }
- [SugarColumn(ColumnName = "work_ord", ColumnDescription = "工单号", Length = 60, IsNullable = true)]
- public string WorkOrd { get; set; }
- [SugarColumn(ColumnName = "shipper_num", ColumnDescription = "送货/发运号", Length = 60, IsNullable = true)]
- public string ShipperNum { get; set; }
- [SugarColumn(ColumnName = "remark", ColumnDescription = "备注", Length = 500, IsNullable = true)]
- public string Remark { get; set; }
- // ── IQC 过账追溯 ──
- [SugarColumn(ColumnName = "fbillno", ColumnDescription = "来源来料检验单号FBILLNO", Length = 50, IsNullable = true)]
- public string FbillNo { get; set; }
- [SugarColumn(ColumnName = "receiver", ColumnDescription = "收货单号Receiver", Length = 50, IsNullable = true)]
- public string Receiver { get; set; }
- [SugarColumn(ColumnName = "rct_qc_nbr", ColumnDescription = "检验单号RctQCNbr", Length = 100, IsNullable = true)]
- public string RctQcNbr { get; set; }
- [SugarColumn(ColumnName = "posting_id", ColumnDescription = "关联过账头 ado_iqc_inventory_posting.id", IsNullable = true)]
- public long? PostingId { get; set; }
- [SugarColumn(ColumnName = "transaction_group_id", ColumnDescription = "过账事务组Id(每次过账雪花)", DefaultValue = "0")]
- public long TransactionGroupId { get; set; }
- [SugarColumn(ColumnName = "seq", ColumnDescription = "组内序号1..N", DefaultValue = "0")]
- public int Seq { get; set; }
- }
|