| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- using Admin.NET.Core;
- namespace Admin.NET.Plugin.AiDOP.Entity;
- /// <summary>
- /// S6 模工具台账(复刻 legacy 表 MoldToolList,FUNC-S6-004)。
- ///
- /// 只映射 CRUD V1 白名单字段 + 主键 + 租户列。其余 legacy 列(gys / gysmc / MoldUsingDepartment /
- /// zrr / zt / sm / bypl / fj / xh / bh / gnyyid / MoldMaintenanceReleaseTime /
- /// ActiveMaintenanceMoldCount)语义未确认,本批一律不映射、不写入。
- /// 写路径全部使用「显式 SetColumns + 显式 WHERE」或 Insertable,不做 delete+reinsert,
- /// 故未映射列在更新时天然保留(SAFE-BY-PARTIAL-UPDATE)。
- ///
- /// [IgnoreTable]:MoldToolList 是外部导入的 legacy 表,表结构由 UpdateScripts 管理。
- /// 该特性使实体被 SqlSugarSetup.GetEntityTypesForInit 排除,禁止 CodeFirst 对其
- /// ALTER 列 / 改可空性 / 建索引。同理本实体**不得**登记进 Startup.cs 的显式
- /// db.CodeFirst.InitTables(...) 列表——那条路径不受 [IgnoreTable] 保护。
- ///
- /// 租户:tenant_id 为唯一租户边界;实现 ITenantIdFilter 以获得全局查询过滤(defense-in-depth),
- /// 但业务代码仍必须在每条读写语句显式带 tenant 条件(全局过滤器对超管不生效)。
- /// 唯一键 uk_MoldToolList_tenant_type_code(tenant_id, MoldTypeCode) 由 UpdateScripts 维护。
- /// </summary>
- [IgnoreTable]
- [SugarTable("MoldToolList", "模工具台账(复刻 MoldToolList)")]
- public class AdoS6MoldToolList : ITenantIdFilter
- {
- /// <summary>主键(legacy 自增 int)</summary>
- [SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true, IsIdentity = true)]
- public int Id { get; set; }
- /// <summary>类型(模具 / 工装 / 检具)</summary>
- [SugarColumn(ColumnName = "lx", ColumnDescription = "类型", Length = 255, IsNullable = true)]
- public string? Lx { get; set; }
- /// <summary>名称(DB NOT NULL)</summary>
- [SugarColumn(ColumnName = "MoldName", ColumnDescription = "名称", Length = 255)]
- public string MoldName { get; set; } = string.Empty;
- /// <summary>数量(DB NOT NULL)</summary>
- [SugarColumn(ColumnName = "MoldCount", ColumnDescription = "数量")]
- public int MoldCount { get; set; }
- /// <summary>模具类型编码(DB NOT NULL;租户内唯一业务编码,创建后不可修改)</summary>
- [SugarColumn(ColumnName = "MoldTypeCode", ColumnDescription = "模具类型编码", Length = 255)]
- public string MoldTypeCode { get; set; } = string.Empty;
- /// <summary>工作组 / 功能应用名称(自由文本,源系统同列两名,忠实复刻)</summary>
- [SugarColumn(ColumnName = "gnyymc", ColumnDescription = "工作组/功能应用名称", Length = 255, IsNullable = true)]
- public string? Gnyymc { get; set; }
- /// <summary>对应产品物料编码(自由文本,存量含 "/" 占位值)</summary>
- [SugarColumn(ColumnName = "product_material_code", ColumnDescription = "对应产品物料编码", Length = 255, IsNullable = true)]
- public string? ProductMaterialCode { get; set; }
- /// <summary>对应产品图纸号</summary>
- [SugarColumn(ColumnName = "product_drawing_number", ColumnDescription = "对应产品图纸号", Length = 255, IsNullable = true)]
- public string? ProductDrawingNumber { get; set; }
- /// <summary>对应产品名称</summary>
- [SugarColumn(ColumnName = "product_name", ColumnDescription = "对应产品名称", Length = 255, IsNullable = true)]
- public string? ProductName { get; set; }
- /// <summary>对应工序</summary>
- [SugarColumn(ColumnName = "process", ColumnDescription = "对应工序", Length = 255, IsNullable = true)]
- public string? Process { get; set; }
- /// <summary>租户(唯一租户边界;仅服务端从 JWT 盖章,不接受客户端传入)</summary>
- [SugarColumn(ColumnName = "tenant_id", ColumnDescription = "租户", IsNullable = true)]
- public long? TenantId { get; set; }
- }
|