ToolingLedgerDto.cs 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. namespace Admin.NET.Plugin.AiDOP.Manufacturing.Dto;
  2. /// <summary>
  3. /// S6 模工具台账管理 列表查询入参(只读)。
  4. ///
  5. /// 数据源:aidopdev.MoldToolList(模工具台账,证据 sql.txt: select * from MoldToolList)。
  6. /// 类型(lx) 含 模具 / 工装 / 检具,同表同页同源;类型下拉可筛选。
  7. /// 租户作用域只取当前登录上下文,不接受客户端传入租户覆盖。
  8. /// </summary>
  9. public class ToolingLedgerListInput
  10. {
  11. /// <summary>页码(从 1 开始)</summary>
  12. public int Page { get; set; } = 1;
  13. /// <summary>每页条数</summary>
  14. public int PageSize { get; set; } = 10;
  15. /// <summary>名称(MoldToolList.MoldName,模糊匹配)</summary>
  16. public string? Name { get; set; }
  17. /// <summary>工作组(MoldToolList.gnyymc,模糊匹配)</summary>
  18. public string? WorkGroup { get; set; }
  19. /// <summary>使用部门(MoldToolList.MoldUsingDepartment,模糊匹配)</summary>
  20. public string? UsageDept { get; set; }
  21. /// <summary>类型(MoldToolList.lx:模具 / 工装 / 检具,精确匹配,下拉选择)</summary>
  22. public string? Type { get; set; }
  23. /// <summary>模具类型编码(MoldToolList.MoldTypeCode,模糊匹配)</summary>
  24. public string? MoldTypeCode { get; set; }
  25. }
  26. /// <summary>
  27. /// S6 模工具台账管理 列表行(只读)。字段对齐前端列 prop(camelCase),源列见注释(MoldToolList / 字段配置图)。
  28. /// </summary>
  29. public class ToolingLedgerListRow
  30. {
  31. /// <summary>主键 id(MoldToolList.id,子表 id)</summary>
  32. public int Id { get; set; }
  33. /// <summary>类型(MoldToolList.lx:模具 / 工装 / 检具)</summary>
  34. public string? Type { get; set; }
  35. /// <summary>名称(MoldToolList.MoldName)</summary>
  36. public string? Name { get; set; }
  37. /// <summary>供应商名(MoldToolList.gysmc)</summary>
  38. public string? SupplierName { get; set; }
  39. /// <summary>数量(MoldToolList.MoldCount)</summary>
  40. public int? Qty { get; set; }
  41. /// <summary>功能应用名称(MoldToolList.gnyymc)</summary>
  42. public string? FunctionAppName { get; set; }
  43. /// <summary>模具类型编码(MoldToolList.MoldTypeCode)</summary>
  44. public string? MoldTypeCode { get; set; }
  45. /// <summary>对应产品物料编码(MoldToolList.product_material_code)</summary>
  46. public string? ProductMaterialCode { get; set; }
  47. /// <summary>对应产品图纸号(MoldToolList.product_drawing_number)</summary>
  48. public string? ProductDrawingNo { get; set; }
  49. /// <summary>对应产品名称(MoldToolList.product_name)</summary>
  50. public string? ProductName { get; set; }
  51. /// <summary>对应工序(MoldToolList.process)</summary>
  52. public string? Process { get; set; }
  53. }
  54. /// <summary>
  55. /// S6 模工具台账 CRUD V1 常量(FUNC-S6-004)。
  56. /// </summary>
  57. public static class ToolingLedgerConst
  58. {
  59. /// <summary>
  60. /// 类型(lx)固定业务枚举。
  61. /// 依据:MoldToolList 全表 290 行 lx 仅 模具 / 工装 / 检具 三值(HEX 逐值核对无异体、无 NULL、无空串),
  62. /// 且系统内无对应字典。改为固定枚举是为了让**空租户也能创建首条数据**——
  63. /// 原 type-options 走 SELECT DISTINCT lx,空租户返回 [] 会使新增无选项可选。
  64. /// type-options 端点保持不变,仅供既有查询区继续使用。
  65. /// </summary>
  66. public static readonly string[] Types = ["模具", "工装", "检具"];
  67. }
  68. /// <summary>
  69. /// S6 模工具台账 详情(只含 CRUD V1 白名单字段 + 主键)。
  70. /// 不含 tenant_id,也不含任何本批 DEFERRED 字段。
  71. /// </summary>
  72. public class ToolingLedgerDetailDto
  73. {
  74. /// <summary>主键(MoldToolList.id)</summary>
  75. public int Id { get; set; }
  76. /// <summary>类型(lx)</summary>
  77. public string? Type { get; set; }
  78. /// <summary>名称(MoldName)</summary>
  79. public string? Name { get; set; }
  80. /// <summary>数量(MoldCount)</summary>
  81. public int Qty { get; set; }
  82. /// <summary>模具类型编码(MoldTypeCode,创建后不可修改)</summary>
  83. public string? MoldTypeCode { get; set; }
  84. /// <summary>工作组 / 功能应用名称(gnyymc)</summary>
  85. public string? WorkGroup { get; set; }
  86. /// <summary>对应产品物料编码(product_material_code)</summary>
  87. public string? ProductMaterialCode { get; set; }
  88. /// <summary>对应产品图纸号(product_drawing_number)</summary>
  89. public string? ProductDrawingNo { get; set; }
  90. /// <summary>对应产品名称(product_name)</summary>
  91. public string? ProductName { get; set; }
  92. /// <summary>对应工序(process)</summary>
  93. public string? Process { get; set; }
  94. }
  95. /// <summary>
  96. /// S6 模工具台账 新增入参。
  97. /// 白名单 9 字段;**禁止**出现 TenantId / Id / 任何 DEFERRED 字段
  98. /// (gys / gysmc / MoldUsingDepartment / zrr / zt / sm / bypl / fj /
  99. /// xh / bh / gnyyid / MoldMaintenanceReleaseTime / ActiveMaintenanceMoldCount)。
  100. /// MaxLength 一律对齐 DB 实际列长(全部 varchar(255)),不额外发明长度上限。
  101. /// </summary>
  102. public class ToolingLedgerCreateInput
  103. {
  104. /// <summary>类型(lx,必填,限 模具 / 工装 / 检具)</summary>
  105. [Required(ErrorMessage = "类型不能为空")]
  106. [MaxLength(255)]
  107. public string Type { get; set; } = string.Empty;
  108. /// <summary>名称(MoldName,必填,DB NOT NULL)</summary>
  109. [Required(ErrorMessage = "名称不能为空")]
  110. [MaxLength(255)]
  111. public string Name { get; set; } = string.Empty;
  112. /// <summary>数量(MoldCount,必填,DB NOT NULL,不允许负数)</summary>
  113. [Required(ErrorMessage = "数量不能为空")]
  114. [Range(0, int.MaxValue, ErrorMessage = "数量不能为负数")]
  115. public int? Qty { get; set; }
  116. /// <summary>模具类型编码(MoldTypeCode,必填,DB NOT NULL,租户内唯一)</summary>
  117. [Required(ErrorMessage = "模具类型编码不能为空")]
  118. [MaxLength(255)]
  119. public string MoldTypeCode { get; set; } = string.Empty;
  120. /// <summary>工作组 / 功能应用名称(gnyymc,可选,自由文本)</summary>
  121. [MaxLength(255)]
  122. public string? WorkGroup { get; set; }
  123. /// <summary>对应产品物料编码(product_material_code,可选)</summary>
  124. [MaxLength(255)]
  125. public string? ProductMaterialCode { get; set; }
  126. /// <summary>对应产品图纸号(product_drawing_number,可选)</summary>
  127. [MaxLength(255)]
  128. public string? ProductDrawingNo { get; set; }
  129. /// <summary>对应产品名称(product_name,可选)</summary>
  130. [MaxLength(255)]
  131. public string? ProductName { get; set; }
  132. /// <summary>对应工序(process,可选)</summary>
  133. [MaxLength(255)]
  134. public string? Process { get; set; }
  135. }
  136. /// <summary>
  137. /// S6 模工具台账 编辑入参。
  138. /// **刻意不含 MoldTypeCode** —— 从类型层面消除「编辑期改业务编码」的路径,
  139. /// 而不是只靠前端 disabled。理由:ProdLineDetail 已有 896 条按编码引用且系统无级联更新,
  140. /// 改编码等于静默断链。
  141. /// 同样禁止出现 TenantId / Id / 任何 DEFERRED 字段。
  142. /// </summary>
  143. public class ToolingLedgerUpdateInput
  144. {
  145. /// <summary>类型(lx,必填,限 模具 / 工装 / 检具)</summary>
  146. [Required(ErrorMessage = "类型不能为空")]
  147. [MaxLength(255)]
  148. public string Type { get; set; } = string.Empty;
  149. /// <summary>名称(MoldName,必填)</summary>
  150. [Required(ErrorMessage = "名称不能为空")]
  151. [MaxLength(255)]
  152. public string Name { get; set; } = string.Empty;
  153. /// <summary>数量(MoldCount,必填,不允许负数)</summary>
  154. [Required(ErrorMessage = "数量不能为空")]
  155. [Range(0, int.MaxValue, ErrorMessage = "数量不能为负数")]
  156. public int? Qty { get; set; }
  157. /// <summary>工作组 / 功能应用名称(gnyymc,可选)</summary>
  158. [MaxLength(255)]
  159. public string? WorkGroup { get; set; }
  160. /// <summary>对应产品物料编码(product_material_code,可选)</summary>
  161. [MaxLength(255)]
  162. public string? ProductMaterialCode { get; set; }
  163. /// <summary>对应产品图纸号(product_drawing_number,可选)</summary>
  164. [MaxLength(255)]
  165. public string? ProductDrawingNo { get; set; }
  166. /// <summary>对应产品名称(product_name,可选)</summary>
  167. [MaxLength(255)]
  168. public string? ProductName { get; set; }
  169. /// <summary>对应工序(process,可选)</summary>
  170. [MaxLength(255)]
  171. public string? Process { get; set; }
  172. }
  173. /// <summary>类型下拉选项(MoldToolList.lx distinct:模具 / 工装 / 检具)。</summary>
  174. public class ToolingLedgerTypeOption
  175. {
  176. /// <summary>类型值(MoldToolList.lx)</summary>
  177. public string? Val { get; set; }
  178. }