namespace Admin.NET.Plugin.AiDOP.Manufacturing.Dto; /// /// S6 模工具台账管理 列表查询入参(只读)。 /// /// 数据源:aidopdev.MoldToolList(模工具台账,证据 sql.txt: select * from MoldToolList)。 /// 类型(lx) 含 模具 / 工装 / 检具,同表同页同源;类型下拉可筛选。 /// 租户作用域只取当前登录上下文,不接受客户端传入租户覆盖。 /// public class ToolingLedgerListInput { /// 页码(从 1 开始) public int Page { get; set; } = 1; /// 每页条数 public int PageSize { get; set; } = 10; /// 名称(MoldToolList.MoldName,模糊匹配) public string? Name { get; set; } /// 工作组(MoldToolList.gnyymc,模糊匹配) public string? WorkGroup { get; set; } /// 使用部门(MoldToolList.MoldUsingDepartment,模糊匹配) public string? UsageDept { get; set; } /// 类型(MoldToolList.lx:模具 / 工装 / 检具,精确匹配,下拉选择) public string? Type { get; set; } /// 模具类型编码(MoldToolList.MoldTypeCode,模糊匹配) public string? MoldTypeCode { get; set; } } /// /// S6 模工具台账管理 列表行(只读)。字段对齐前端列 prop(camelCase),源列见注释(MoldToolList / 字段配置图)。 /// public class ToolingLedgerListRow { /// 主键 id(MoldToolList.id,子表 id) public int Id { get; set; } /// 类型(MoldToolList.lx:模具 / 工装 / 检具) public string? Type { get; set; } /// 名称(MoldToolList.MoldName) public string? Name { get; set; } /// 供应商名(MoldToolList.gysmc) public string? SupplierName { get; set; } /// 数量(MoldToolList.MoldCount) public int? Qty { get; set; } /// 功能应用名称(MoldToolList.gnyymc) public string? FunctionAppName { get; set; } /// 模具类型编码(MoldToolList.MoldTypeCode) public string? MoldTypeCode { get; set; } /// 对应产品物料编码(MoldToolList.product_material_code) public string? ProductMaterialCode { get; set; } /// 对应产品图纸号(MoldToolList.product_drawing_number) public string? ProductDrawingNo { get; set; } /// 对应产品名称(MoldToolList.product_name) public string? ProductName { get; set; } /// 对应工序(MoldToolList.process) public string? Process { get; set; } } /// /// S6 模工具台账 CRUD V1 常量(FUNC-S6-004)。 /// public static class ToolingLedgerConst { /// /// 类型(lx)固定业务枚举。 /// 依据:MoldToolList 全表 290 行 lx 仅 模具 / 工装 / 检具 三值(HEX 逐值核对无异体、无 NULL、无空串), /// 且系统内无对应字典。改为固定枚举是为了让**空租户也能创建首条数据**—— /// 原 type-options 走 SELECT DISTINCT lx,空租户返回 [] 会使新增无选项可选。 /// type-options 端点保持不变,仅供既有查询区继续使用。 /// public static readonly string[] Types = ["模具", "工装", "检具"]; } /// /// S6 模工具台账 详情(只含 CRUD V1 白名单字段 + 主键)。 /// 不含 tenant_id,也不含任何本批 DEFERRED 字段。 /// public class ToolingLedgerDetailDto { /// 主键(MoldToolList.id) public int Id { get; set; } /// 类型(lx) public string? Type { get; set; } /// 名称(MoldName) public string? Name { get; set; } /// 数量(MoldCount) public int Qty { get; set; } /// 模具类型编码(MoldTypeCode,创建后不可修改) public string? MoldTypeCode { get; set; } /// 工作组 / 功能应用名称(gnyymc) public string? WorkGroup { get; set; } /// 对应产品物料编码(product_material_code) public string? ProductMaterialCode { get; set; } /// 对应产品图纸号(product_drawing_number) public string? ProductDrawingNo { get; set; } /// 对应产品名称(product_name) public string? ProductName { get; set; } /// 对应工序(process) public string? Process { get; set; } } /// /// S6 模工具台账 新增入参。 /// 白名单 9 字段;**禁止**出现 TenantId / Id / 任何 DEFERRED 字段 /// (gys / gysmc / MoldUsingDepartment / zrr / zt / sm / bypl / fj / /// xh / bh / gnyyid / MoldMaintenanceReleaseTime / ActiveMaintenanceMoldCount)。 /// MaxLength 一律对齐 DB 实际列长(全部 varchar(255)),不额外发明长度上限。 /// public class ToolingLedgerCreateInput { /// 类型(lx,必填,限 模具 / 工装 / 检具) [Required(ErrorMessage = "类型不能为空")] [MaxLength(255)] public string Type { get; set; } = string.Empty; /// 名称(MoldName,必填,DB NOT NULL) [Required(ErrorMessage = "名称不能为空")] [MaxLength(255)] public string Name { get; set; } = string.Empty; /// 数量(MoldCount,必填,DB NOT NULL,不允许负数) [Required(ErrorMessage = "数量不能为空")] [Range(0, int.MaxValue, ErrorMessage = "数量不能为负数")] public int? Qty { get; set; } /// 模具类型编码(MoldTypeCode,必填,DB NOT NULL,租户内唯一) [Required(ErrorMessage = "模具类型编码不能为空")] [MaxLength(255)] public string MoldTypeCode { get; set; } = string.Empty; /// 工作组 / 功能应用名称(gnyymc,可选,自由文本) [MaxLength(255)] public string? WorkGroup { get; set; } /// 对应产品物料编码(product_material_code,可选) [MaxLength(255)] public string? ProductMaterialCode { get; set; } /// 对应产品图纸号(product_drawing_number,可选) [MaxLength(255)] public string? ProductDrawingNo { get; set; } /// 对应产品名称(product_name,可选) [MaxLength(255)] public string? ProductName { get; set; } /// 对应工序(process,可选) [MaxLength(255)] public string? Process { get; set; } } /// /// S6 模工具台账 编辑入参。 /// **刻意不含 MoldTypeCode** —— 从类型层面消除「编辑期改业务编码」的路径, /// 而不是只靠前端 disabled。理由:ProdLineDetail 已有 896 条按编码引用且系统无级联更新, /// 改编码等于静默断链。 /// 同样禁止出现 TenantId / Id / 任何 DEFERRED 字段。 /// public class ToolingLedgerUpdateInput { /// 类型(lx,必填,限 模具 / 工装 / 检具) [Required(ErrorMessage = "类型不能为空")] [MaxLength(255)] public string Type { get; set; } = string.Empty; /// 名称(MoldName,必填) [Required(ErrorMessage = "名称不能为空")] [MaxLength(255)] public string Name { get; set; } = string.Empty; /// 数量(MoldCount,必填,不允许负数) [Required(ErrorMessage = "数量不能为空")] [Range(0, int.MaxValue, ErrorMessage = "数量不能为负数")] public int? Qty { get; set; } /// 工作组 / 功能应用名称(gnyymc,可选) [MaxLength(255)] public string? WorkGroup { get; set; } /// 对应产品物料编码(product_material_code,可选) [MaxLength(255)] public string? ProductMaterialCode { get; set; } /// 对应产品图纸号(product_drawing_number,可选) [MaxLength(255)] public string? ProductDrawingNo { get; set; } /// 对应产品名称(product_name,可选) [MaxLength(255)] public string? ProductName { get; set; } /// 对应工序(process,可选) [MaxLength(255)] public string? Process { get; set; } } /// 类型下拉选项(MoldToolList.lx distinct:模具 / 工装 / 检具)。 public class ToolingLedgerTypeOption { /// 类型值(MoldToolList.lx) public string? Val { get; set; } }