using SqlSugar; namespace Admin.NET.Plugin.AiDOP.MaterialWarehouse.InventoryPosting.Entity; /// /// DOP-L3 条码卡(影子)。**非旧 MissedPrint**。 /// 实核结论:旧 MissedPrint 无业务自然唯一键——BarCode 文本会重复(同日同物料同库位同货架可重复,pr_WMS_CreateBarCodeCard L64/L11-16), /// 全链按自增 RecID 定位。故 L3 用代理主键 id;**barcode 不设唯一**。 /// 回灌旧数据时的幂等键 = (tenant_id, source_domain, source_rec_id);DOP 自生成的卡 source_rec_id 为 NULL(多 NULL 不冲突,不受约束)。 /// [SugarTable("ado_barcode_card", "DOP-L3条码卡(影子,非旧MissedPrint)")] [SugarIndex("uk_ado_barcode_card_source", nameof(TenantId), OrderByType.Asc, nameof(SourceDomain), OrderByType.Asc, nameof(SourceRecId), OrderByType.Asc, IsUnique = true)] [SugarIndex("idx_ado_barcode_card_item_loc", nameof(TenantId), OrderByType.Asc, nameof(DomainCode), OrderByType.Asc, nameof(ItemNum), OrderByType.Asc, nameof(Location), OrderByType.Asc)] public class AdoBarcodeCard : 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 = "shelf", ColumnDescription = "货架", Length = 50, IsNullable = true)] public string Shelf { get; set; } [SugarColumn(ColumnName = "level_char", ColumnDescription = "等级", Length = 20, IsNullable = true)] public string LevelChar { get; set; } [SugarColumn(ColumnName = "supply", ColumnDescription = "供应商", Length = 50, IsNullable = true)] public string Supply { get; set; } [SugarColumn(ColumnName = "status", ColumnDescription = "状态", Length = 10, IsNullable = true)] public string Status { get; set; } [SugarColumn(ColumnName = "qty", ColumnDescription = "数量", Length = 18, DecimalDigits = 5, DefaultValue = "0")] public decimal Qty { get; set; } [SugarColumn(ColumnName = "is_tag", ColumnDescription = "是否箱标签", DefaultValue = "0")] public bool IsTag { get; set; } [SugarColumn(ColumnName = "barcode", ColumnDescription = "条码文本(非唯一)", Length = 100, IsNullable = true)] public string Barcode { get; set; } [SugarColumn(ColumnName = "type", ColumnDescription = "类型(Card/Batch等)", Length = 20, IsNullable = true)] public string Type { get; set; } [SugarColumn(ColumnName = "trans_type", ColumnDescription = "事务类型", Length = 50, IsNullable = true)] public string TransType { get; set; } [SugarColumn(ColumnName = "posting_id", ColumnDescription = "关联过账头 ado_iqc_inventory_posting.id", IsNullable = true)] public long? PostingId { get; set; } // ── 回灌幂等(DOP 自生成卡为 NULL)── [SugarColumn(ColumnName = "source_domain", ColumnDescription = "回灌来源Domain", Length = 20, IsNullable = true)] public string SourceDomain { get; set; } [SugarColumn(ColumnName = "source_rec_id", ColumnDescription = "回灌来源RecID(旧MissedPrint.RecID)", IsNullable = true)] public long? SourceRecId { get; set; } }