AdoS0ManufacturingDtos.cs 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021
  1. namespace Admin.NET.Plugin.AiDOP.Dto.S0.Manufacturing;
  2. /// <summary>
  3. /// 制造列表查询公共段:公司/工厂、keyword、isEnabled、分页。
  4. /// S0 使用 pageNo 时可通过 <see cref="PageNo"/> 绑定,控制器内取 EffectivePage。
  5. /// </summary>
  6. public class AdoS0MfgPagedQueryBase
  7. {
  8. public long? CompanyRefId { get; set; }
  9. public long? FactoryRefId { get; set; }
  10. public string? Keyword { get; set; }
  11. public bool? IsEnabled { get; set; }
  12. /// <summary>与 Gitee Demo 一致的页码(默认 1)。</summary>
  13. public int Page { get; set; } = 1;
  14. /// <summary>S0 PagedQuery.pageNo;若传入则优先于 <see cref="Page"/>。</summary>
  15. public int? PageNo { get; set; }
  16. public int PageSize { get; set; } = 20;
  17. public int EffectivePage => PageNo is > 0 ? PageNo.Value : (Page < 1 ? 1 : Page);
  18. }
  19. #region 附录 F 扩展 Query
  20. /// <summary>标准工序主数据列表(StdOpMaster 语义)。</summary>
  21. public class AdoS0StdOpMasterQueryDto : AdoS0MfgPagedQueryBase
  22. {
  23. /// <summary>按标准工序编码(std_op_code)模糊过滤。</summary>
  24. public string? StdOpCode { get; set; }
  25. /// <summary>按标准工序名称(std_op)模糊过滤。</summary>
  26. public string? StdOp { get; set; }
  27. public string? MilestoneOp { get; set; }
  28. }
  29. /// <summary>生产线主数据列表(LineMaster 语义)。</summary>
  30. public class AdoS0LineMasterQueryDto : AdoS0MfgPagedQueryBase
  31. {
  32. /// <summary>按生产线编码(line)模糊过滤。</summary>
  33. public string? Line { get; set; }
  34. public string? Workshop { get; set; }
  35. }
  36. public class AdoS0MfgPreprocessElementQueryDto : AdoS0MfgPagedQueryBase
  37. {
  38. public string? Domain { get; set; }
  39. public string? MaterialCode { get; set; }
  40. public string? MaterialName { get; set; }
  41. public string? Op { get; set; }
  42. public string? ElementCode { get; set; }
  43. }
  44. public class AdoS0MfgPreprocessElementUpsertDto
  45. {
  46. [Required(ErrorMessage = "工厂域不能为空")]
  47. [MaxLength(50)]
  48. public string Domain { get; set; } = string.Empty;
  49. [Required(ErrorMessage = "物料编码不能为空")]
  50. [MaxLength(100)]
  51. public string ItemNum { get; set; } = string.Empty;
  52. [MaxLength(100)]
  53. public string? Op { get; set; }
  54. [MaxLength(100)]
  55. public string? Line { get; set; }
  56. [MaxLength(100)]
  57. public string? Typed { get; set; }
  58. [MaxLength(100)]
  59. public string? ItemCode { get; set; }
  60. [MaxLength(255)]
  61. public string? Descr { get; set; }
  62. public bool IsMain { get; set; }
  63. [MaxLength(64)]
  64. public string? CreateUser { get; set; }
  65. public DateTime? CreateTime { get; set; }
  66. [MaxLength(64)]
  67. public string? UpdateUser { get; set; }
  68. public DateTime? UpdateTime { get; set; }
  69. }
  70. public class AdoS0MfgMaterialProcessElementQueryDto : AdoS0MfgPagedQueryBase
  71. {
  72. public string? MaterialCode { get; set; }
  73. public string? MaterialName { get; set; }
  74. public string? ElementType { get; set; }
  75. public string? ElementCode { get; set; }
  76. }
  77. /// <summary>
  78. /// SOP 维护(源平台 QualitySegmentImage):列表查询
  79. /// </summary>
  80. public class AdoS0MfgSopDocumentQueryDto
  81. {
  82. // 去 domain 化(S0-SOP-DOMAIN-DECOUPLING-FIX):查询不再要求 Domain,放宽 [Required] 为可空;
  83. // 租户隔离由 tenant_id 保证,Domain 仅保留为兼容字段,不参与列表可见性判定。
  84. [MaxLength(50)]
  85. public string? Domain { get; set; }
  86. public string? Keyword { get; set; }
  87. public int Page { get; set; } = 1;
  88. public int PageSize { get; set; } = 20;
  89. }
  90. /// <summary>列表须支持 elementCategory 过滤(§7 / 附录 F)。</summary>
  91. public class AdoS0MfgElementParamQueryDto : AdoS0MfgPagedQueryBase
  92. {
  93. public string? ElementCategory { get; set; }
  94. }
  95. #endregion
  96. #region 仅 PagedQuery 等价的列表 Query
  97. /// <summary>标准 BOM 行级列表(ProductStructureMaster 路线 A)。</summary>
  98. public class AdoS0ProductStructureQueryDto : AdoS0MfgPagedQueryBase;
  99. public class AdoS0MfgRoutingOpDetailQueryDto : AdoS0MfgPagedQueryBase;
  100. public class AdoS0MfgLinePostQueryDto : AdoS0MfgPagedQueryBase;
  101. public class AdoS0MfgPersonSkillQueryDto : AdoS0MfgPagedQueryBase;
  102. public class AdoS0MfgPersonSkillAssignmentQueryDto : AdoS0MfgPagedQueryBase;
  103. public class AdoS0MfgWorkOrderControlQueryDto : AdoS0MfgPagedQueryBase;
  104. public class AdoS0MfgWorkCenterQueryDto : AdoS0MfgPagedQueryBase;
  105. public class AdoS0MfgLineMaterialQueryDto : AdoS0MfgPagedQueryBase;
  106. /// <summary>
  107. /// SOP 文件类型(源平台 ImageType):列表查询
  108. /// </summary>
  109. public class AdoS0MfgSopFileTypeQueryDto
  110. {
  111. // 去 domain 化(S0-DOMAIN-FILTER-REMOVAL-READONLY-1):查询不再要求 Domain,放宽 [Required] 为可空;租户隔离由实体保证。
  112. [MaxLength(50)]
  113. public string? Domain { get; set; }
  114. public string? Keyword { get; set; }
  115. public int Page { get; set; } = 1;
  116. public int PageSize { get; set; } = 20;
  117. }
  118. #endregion
  119. #region 标准资源 Upsert(12 个非聚合)
  120. public class AdoS0StdOpMasterUpsertDto
  121. {
  122. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  123. public long CompanyRefId { get; set; }
  124. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  125. public long FactoryRefId { get; set; }
  126. [Required(ErrorMessage = "工厂域编码不能为空")]
  127. [MaxLength(50)]
  128. public string Domain { get; set; } = string.Empty;
  129. [Required(ErrorMessage = "标准工序名称不能为空")]
  130. [MaxLength(100)]
  131. public string StdOp { get; set; } = string.Empty;
  132. [Required(ErrorMessage = "标准工序编码不能为空")]
  133. [MaxLength(100)]
  134. public string StdOpCode { get; set; } = string.Empty;
  135. [MaxLength(20)]
  136. public string? MilestoneOp { get; set; }
  137. [MaxLength(64)]
  138. public string? CreateUser { get; set; }
  139. [MaxLength(64)]
  140. public string? UpdateUser { get; set; }
  141. }
  142. public class AdoS0LineMasterUpsertDto
  143. {
  144. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  145. public long CompanyRefId { get; set; }
  146. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  147. public long FactoryRefId { get; set; }
  148. [Required(ErrorMessage = "工厂域编码不能为空")]
  149. [MaxLength(50)]
  150. public string Domain { get; set; } = string.Empty;
  151. [Required(ErrorMessage = "生产线编码不能为空")]
  152. [MaxLength(100)]
  153. public string Line { get; set; } = string.Empty;
  154. [MaxLength(255)]
  155. public string? Describe { get; set; }
  156. [MaxLength(50)]
  157. public string? LineType { get; set; }
  158. [MaxLength(50)]
  159. public string? LineCategory { get; set; }
  160. [MaxLength(50)]
  161. public string? Location { get; set; }
  162. [MaxLength(50)]
  163. public string? Workshop { get; set; }
  164. [MaxLength(50)]
  165. public string? VLocation { get; set; }
  166. [MaxLength(50)]
  167. public string? Location2 { get; set; }
  168. [MaxLength(50)]
  169. public string? Location3 { get; set; }
  170. [MaxLength(50)]
  171. public string? PickingLocation { get; set; }
  172. [MaxLength(50)]
  173. public string? MidLocation { get; set; }
  174. public bool IsActive { get; set; } = true;
  175. [MaxLength(64)]
  176. public string? CreateUser { get; set; }
  177. [MaxLength(64)]
  178. public string? UpdateUser { get; set; }
  179. }
  180. public class AdoS0MfgSopFileTypeUpsertDto
  181. {
  182. [Required(ErrorMessage = "工厂域不能为空")]
  183. [MaxLength(50)]
  184. public string Domain { get; set; } = string.Empty;
  185. [Required(ErrorMessage = "文件类型编码不能为空")]
  186. [MaxLength(100)]
  187. public string ImageTypeID { get; set; } = string.Empty;
  188. [MaxLength(255)]
  189. public string? Descr { get; set; }
  190. }
  191. public class AdoS0MfgElementParamUpsertDto
  192. {
  193. public long CompanyRefId { get; set; }
  194. public long FactoryRefId { get; set; }
  195. public string? ElementCode { get; set; }
  196. public string? ElementName { get; set; }
  197. public string? ElementCategory { get; set; }
  198. public string Code { get; set; } = string.Empty;
  199. public string Name { get; set; } = string.Empty;
  200. public string? ParamType { get; set; }
  201. public string? Unit { get; set; }
  202. public string? StdValue { get; set; }
  203. public decimal? UpperLimit { get; set; }
  204. public decimal? LowerLimit { get; set; }
  205. public string? EnumOptions { get; set; }
  206. public string? Remark { get; set; }
  207. public bool IsEnabled { get; set; } = true;
  208. }
  209. /// <summary>
  210. /// 生产要素参数(DevMonitor;固定 CodeType='Prod'):列表查询
  211. /// </summary>
  212. public class AdoS0DevMonitorQueryDto
  213. {
  214. // 去 domain 化(S0-DOMAIN-FILTER-REMOVAL-READONLY-1):查询不再要求 Domain,放宽 [Required] 为可空;租户隔离由实体保证。
  215. [MaxLength(50)]
  216. public string? Domain { get; set; }
  217. public string? Keyword { get; set; }
  218. public int Page { get; set; } = 1;
  219. public int PageSize { get; set; } = 20;
  220. }
  221. public class AdoS0MfgPreprocessElementParamQueryDto
  222. {
  223. // 去 domain 化(S0-DOMAIN-FILTER-REMOVAL-READONLY-1):查询不再要求 Domain,放宽 [Required] 为可空;租户隔离由实体保证。
  224. [MaxLength(50)]
  225. public string? Domain { get; set; }
  226. public string? Keyword { get; set; }
  227. public int Page { get; set; } = 1;
  228. public int PageSize { get; set; } = 20;
  229. }
  230. public class AdoS0DevMonitorUpsertDto
  231. {
  232. [Required(ErrorMessage = "工厂域不能为空")]
  233. [MaxLength(50)]
  234. public string Domain { get; set; } = string.Empty;
  235. [Required(ErrorMessage = "要素编码不能为空")]
  236. [MaxLength(100)]
  237. public string DeviceNumber { get; set; } = string.Empty;
  238. public string? DeviceDescr { get; set; }
  239. [Required(ErrorMessage = "参数编码不能为空")]
  240. [MaxLength(100)]
  241. public string MessageCode { get; set; } = string.Empty;
  242. public string? CodeDescr { get; set; }
  243. public string? ValueType { get; set; }
  244. public string? UM { get; set; }
  245. public string? StdValue { get; set; }
  246. public decimal? TopLimit { get; set; }
  247. public decimal? LowLimit { get; set; }
  248. public string? Ufld1 { get; set; }
  249. /// <summary>固定为 Prod</summary>
  250. public string CodeType { get; set; } = "Prod";
  251. public string? CreateUser { get; set; }
  252. public DateTime? CreateTime { get; set; }
  253. public string? UpdateUser { get; set; }
  254. public DateTime? UpdateTime { get; set; }
  255. }
  256. public class AdoS0MfgPreprocessElementParamUpsertDto
  257. {
  258. [Required(ErrorMessage = "工厂域不能为空")]
  259. [MaxLength(50)]
  260. public string Domain { get; set; } = string.Empty;
  261. [Required(ErrorMessage = "要素编码不能为空")]
  262. [MaxLength(100)]
  263. public string DeviceNumber { get; set; } = string.Empty;
  264. public string? DeviceDescr { get; set; }
  265. [Required(ErrorMessage = "参数编码不能为空")]
  266. [MaxLength(100)]
  267. public string MessageCode { get; set; } = string.Empty;
  268. public string? CodeDescr { get; set; }
  269. public string? ValueType { get; set; }
  270. public string? UM { get; set; }
  271. public string? StdValue { get; set; }
  272. public decimal? TopLimit { get; set; }
  273. public decimal? LowLimit { get; set; }
  274. public string? Ufld1 { get; set; }
  275. [MaxLength(64)]
  276. public string? CreateUser { get; set; }
  277. public DateTime? CreateTime { get; set; }
  278. [MaxLength(64)]
  279. public string? UpdateUser { get; set; }
  280. public DateTime? UpdateTime { get; set; }
  281. }
  282. /// <summary>
  283. /// 物料工序生产要素(ItemOpCondition;固定 CodeType='Prod'):列表查询
  284. /// </summary>
  285. public class AdoS0ItemOpConditionQueryDto
  286. {
  287. // 去 domain 化(S0-DOMAIN-FILTER-REMOVAL-READONLY-1):查询不再要求 Domain,放宽 [Required] 为可空;租户隔离由实体保证。
  288. [MaxLength(50)]
  289. public string? Domain { get; set; }
  290. public string? Keyword { get; set; }
  291. public string? ItemNum { get; set; }
  292. public string? Op { get; set; }
  293. public string? Line { get; set; }
  294. public string? Typed { get; set; }
  295. public string? ItemCode { get; set; }
  296. public int Page { get; set; } = 1;
  297. public int PageSize { get; set; } = 20;
  298. }
  299. public class AdoS0ItemOpConditionUpsertDto
  300. {
  301. [Required(ErrorMessage = "工厂域不能为空")]
  302. [MaxLength(50)]
  303. public string Domain { get; set; } = string.Empty;
  304. [Required(ErrorMessage = "物料编码不能为空")]
  305. [MaxLength(100)]
  306. public string ItemNum { get; set; } = string.Empty;
  307. public string? Op { get; set; }
  308. public string? Line { get; set; }
  309. public string? Typed { get; set; }
  310. public string? ItemCode { get; set; }
  311. public string? Descr { get; set; }
  312. public bool IsMain { get; set; }
  313. /// <summary>固定为 Prod</summary>
  314. public string CodeType { get; set; } = "Prod";
  315. public string? CreateUser { get; set; }
  316. public DateTime? CreateTime { get; set; }
  317. public string? UpdateUser { get; set; }
  318. public DateTime? UpdateTime { get; set; }
  319. }
  320. public class AdoS0MfgPersonSkillUpsertDto
  321. {
  322. public long CompanyRefId { get; set; }
  323. public long FactoryRefId { get; set; }
  324. [MaxLength(100)]
  325. public string Code { get; set; } = string.Empty;
  326. [MaxLength(200)]
  327. public string Name { get; set; } = string.Empty;
  328. [MaxLength(50)]
  329. public string? SkillLevel { get; set; }
  330. [MaxLength(500)]
  331. public string? Remark { get; set; }
  332. public bool IsEnabled { get; set; } = true;
  333. }
  334. /// <summary>
  335. /// 人员技能字典下拉项。供「人员技能分配」页 SkillNo 字段联动使用,按 PersonSkill.Code 作为业务值。
  336. /// </summary>
  337. public class S0PersonSkillOptionRow
  338. {
  339. public string Value { get; set; } = string.Empty;
  340. public string Label { get; set; } = string.Empty;
  341. public string Code { get; set; } = string.Empty;
  342. public string Name { get; set; } = string.Empty;
  343. public string? SkillLevel { get; set; }
  344. public long CompanyRefId { get; set; }
  345. public long FactoryRefId { get; set; }
  346. public bool IsEnabled { get; set; }
  347. }
  348. public class AdoS0MfgPersonSkillAssignmentUpsertDto
  349. {
  350. public long CompanyRefId { get; set; }
  351. public long FactoryRefId { get; set; }
  352. public string PersonCode { get; set; } = string.Empty;
  353. public string? WorkGroup { get; set; }
  354. public long SkillId { get; set; }
  355. public int SkillLevel { get; set; }
  356. public decimal ProductionEfficiency { get; set; } = 1m;
  357. public string? Remark { get; set; }
  358. public bool IsEnabled { get; set; } = true;
  359. }
  360. /// <summary>
  361. /// 人员技能维护(EmpSkills):列表查询。
  362. /// </summary>
  363. public class AdoS0EmpSkillsQueryDto : AdoS0MfgPagedQueryBase
  364. {
  365. /// <summary>工厂域(Domain)</summary>
  366. public string? Domain { get; set; }
  367. /// <summary>人员编号(Employee)</summary>
  368. public string? Employee { get; set; }
  369. /// <summary>工作组(Site)</summary>
  370. public string? Site { get; set; }
  371. /// <summary>技能编码(SkillNo)</summary>
  372. public string? SkillNo { get; set; }
  373. }
  374. public class AdoS0EmpSkillsUpsertDto
  375. {
  376. [Required(ErrorMessage = "人员编号不能为空")]
  377. [MaxLength(100)]
  378. public string Employee { get; set; } = string.Empty;
  379. [MaxLength(100)]
  380. public string? EmployeeId { get; set; }
  381. [MaxLength(100)]
  382. public string? EmployeeName { get; set; }
  383. [MaxLength(100)]
  384. public string? Site { get; set; }
  385. [Required(ErrorMessage = "技能编码不能为空")]
  386. [MaxLength(100)]
  387. public string SkillNo { get; set; } = string.Empty;
  388. [MaxLength(255)]
  389. public string? SkillDescription { get; set; }
  390. [MaxLength(50)]
  391. public string? SkillLevel { get; set; }
  392. public decimal? EfficiencyCoefficient { get; set; }
  393. public DateTime? DateSkill { get; set; }
  394. [Required(ErrorMessage = "工厂域不能为空")]
  395. [MaxLength(50)]
  396. public string Domain { get; set; } = string.Empty;
  397. [MaxLength(64)]
  398. public string? CreateUser { get; set; }
  399. public DateTime? CreateTime { get; set; }
  400. [MaxLength(64)]
  401. public string? UpdateUser { get; set; }
  402. public DateTime? UpdateTime { get; set; }
  403. }
  404. public class AdoS0MfgWorkCenterUpsertDto
  405. {
  406. public long CompanyRefId { get; set; }
  407. public long FactoryRefId { get; set; }
  408. public string Code { get; set; } = string.Empty;
  409. public string Name { get; set; } = string.Empty;
  410. public string? CenterType { get; set; }
  411. public decimal? Capacity { get; set; }
  412. public long? DepartmentId { get; set; }
  413. public string? Remark { get; set; }
  414. public bool IsEnabled { get; set; } = true;
  415. }
  416. public class AdoS0MfgLineMaterialUpsertDto
  417. {
  418. public long CompanyRefId { get; set; }
  419. public long FactoryRefId { get; set; }
  420. public long? ProductionLineId { get; set; }
  421. public long MaterialId { get; set; }
  422. public long? OperationId { get; set; }
  423. public long? WorkCenterId { get; set; }
  424. public string? EquipmentCode { get; set; }
  425. public decimal? StdCapacityPerUnit { get; set; }
  426. public decimal? ChangeoverTime { get; set; }
  427. public string? EquipmentTypeCode { get; set; }
  428. public string? MoldTypeCode { get; set; }
  429. public string? RequiredSkillCode { get; set; }
  430. public string? MaterialRole { get; set; }
  431. public string? Remark { get; set; }
  432. public bool IsEnabled { get; set; } = true;
  433. }
  434. /// <summary>
  435. /// 工作中心(WorkCtrMaster):列表查询
  436. /// </summary>
  437. public class AdoS0WorkCtrMasterQueryDto
  438. {
  439. [Required(ErrorMessage = "工厂域不能为空")]
  440. [MaxLength(50)]
  441. public string Domain { get; set; } = string.Empty;
  442. public string? Keyword { get; set; }
  443. public int Page { get; set; } = 1;
  444. public int PageSize { get; set; } = 20;
  445. }
  446. public class AdoS0WorkCtrMasterUpsertDto
  447. {
  448. [Required(ErrorMessage = "工作中心编码不能为空")]
  449. [MaxLength(100)]
  450. public string WorkCtr { get; set; } = string.Empty;
  451. [MaxLength(255)]
  452. public string? Descr { get; set; }
  453. [MaxLength(100)]
  454. public string? Department { get; set; }
  455. public bool IsActive { get; set; } = true;
  456. [Required(ErrorMessage = "工厂域不能为空")]
  457. [MaxLength(50)]
  458. public string Domain { get; set; } = string.Empty;
  459. [MaxLength(64)]
  460. public string? CreateUser { get; set; }
  461. public DateTime? CreateTime { get; set; }
  462. [MaxLength(64)]
  463. public string? UpdateUser { get; set; }
  464. public DateTime? UpdateTime { get; set; }
  465. }
  466. /// <summary>
  467. /// 生产线物料(ProdLineDetail):列表查询
  468. /// </summary>
  469. public class AdoS0ProdLineDetailQueryDto : AdoS0MfgPagedQueryBase
  470. {
  471. public string? Domain { get; set; }
  472. public string? Part { get; set; }
  473. public int? Op { get; set; }
  474. public string? Site { get; set; }
  475. public string? Line { get; set; }
  476. }
  477. public class AdoS0ProdLineDetailUpsertDto
  478. {
  479. [Required(ErrorMessage = "物料编码不能为空")]
  480. [MaxLength(100)]
  481. public string Part { get; set; } = string.Empty;
  482. public int Op { get; set; }
  483. [MaxLength(100)]
  484. public string? Site { get; set; }
  485. [MaxLength(100)]
  486. public string? Line { get; set; }
  487. public decimal? Rate { get; set; }
  488. public decimal? SetupTime { get; set; }
  489. public string? SkillNo { get; set; }
  490. public string? InternalEquipmentTypeCode { get; set; }
  491. public string? MoldTypeCode { get; set; }
  492. /// <summary>标准人数。可空:前端 el-input-number 清空时传 null,反序列化不报错;控制器写入时 null 视为 0(与字段省略行为一致)。</summary>
  493. public decimal? StandardStaffCount { get; set; }
  494. public int? Start { get; set; }
  495. public bool IsActive { get; set; } = true;
  496. public bool IsConfirm { get; set; }
  497. [Required(ErrorMessage = "工厂域不能为空")]
  498. [MaxLength(50)]
  499. public string Domain { get; set; } = string.Empty;
  500. [MaxLength(64)]
  501. public string? CreateUser { get; set; }
  502. public DateTime? CreateTime { get; set; }
  503. [MaxLength(64)]
  504. public string? UpdateUser { get; set; }
  505. public DateTime? UpdateTime { get; set; }
  506. }
  507. public class AdoS0MfgWorkOrderControlUpsertDto
  508. {
  509. public long CompanyRefId { get; set; }
  510. public long FactoryRefId { get; set; }
  511. public string Code { get; set; } = string.Empty;
  512. public string Name { get; set; } = string.Empty;
  513. public string? ControlType { get; set; }
  514. public string? ParamValue { get; set; }
  515. public string? Remark { get; set; }
  516. public bool IsEnabled { get; set; } = true;
  517. }
  518. /// <summary>
  519. /// 工单控制参数设置(WorkOrdControl):每个租户一套配置。
  520. ///
  521. /// 业务模型(S0-WORKORD-CONTROL-TENANT-UX-FIX):
  522. /// 隔离边界只有 tenant_id;Domain 降级为历史兼容业务字段,可空,
  523. /// 不参与可见性判定,页面初始加载也不依赖它。
  524. /// </summary>
  525. public class AdoS0WorkOrdControlGetDto
  526. {
  527. /// <summary>工厂域(可选业务筛选,留空表示取当前租户的配置)。</summary>
  528. [MaxLength(50)]
  529. public string? Domain { get; set; }
  530. }
  531. public class AdoS0WorkOrdControlUpsertDto
  532. {
  533. /// <summary>RecID → Id;存在则按 Id 更新(Id 必须属于当前租户,否则 404)。</summary>
  534. public long? Id { get; set; }
  535. /// <summary>工厂域(可选历史兼容字段,留空则沿用既有值)。</summary>
  536. [MaxLength(50)]
  537. public string? Domain { get; set; }
  538. public decimal? EnteringPer { get; set; }
  539. public decimal? PaintingPer { get; set; }
  540. public decimal? IssuedInterval { get; set; }
  541. public bool PostVarsatSFC { get; set; }
  542. public bool IsIssued { get; set; }
  543. public bool IsPrintRejectBarcode { get; set; }
  544. public bool IsPrintScrapBarcode { get; set; }
  545. public bool IsQualityConfirm { get; set; }
  546. public bool IsActive { get; set; } = true;
  547. public bool IsConfirm { get; set; }
  548. [MaxLength(64)]
  549. public string? CreateUser { get; set; }
  550. public DateTime? CreateTime { get; set; }
  551. [MaxLength(64)]
  552. public string? UpdateUser { get; set; }
  553. public DateTime? UpdateTime { get; set; }
  554. }
  555. public class AdoS0MfgMaterialProcessElementUpsertDto
  556. {
  557. public long CompanyRefId { get; set; }
  558. public long FactoryRefId { get; set; }
  559. public long MaterialId { get; set; }
  560. public long OperationId { get; set; }
  561. public long? ProductionLineId { get; set; }
  562. public string? ElementType { get; set; }
  563. public string? ElementCode { get; set; }
  564. public string? ElementName { get; set; }
  565. public long ElementParamId { get; set; }
  566. public string? ParamValue { get; set; }
  567. public bool IsKeyElement { get; set; }
  568. public string? Remark { get; set; }
  569. public bool IsEnabled { get; set; } = true;
  570. }
  571. public class AdoS0MfgSopDocumentUpsertDto
  572. {
  573. [Required(ErrorMessage = "工厂域不能为空")]
  574. [MaxLength(50)]
  575. public string Domain { get; set; } = string.Empty;
  576. [MaxLength(100)]
  577. public string? Line { get; set; }
  578. [MaxLength(100)]
  579. public string? ItemNum { get; set; }
  580. [MaxLength(100)]
  581. public string? Op { get; set; }
  582. [MaxLength(100)]
  583. public string? ImageTypeID { get; set; }
  584. [MaxLength(1000)]
  585. public string? Path { get; set; }
  586. [MaxLength(255)]
  587. public string? Descr { get; set; }
  588. [MaxLength(50)]
  589. public string? Rev { get; set; }
  590. public int? SortID { get; set; }
  591. }
  592. #endregion
  593. #region 聚合 Upsert(步骤 9)
  594. /// <summary>标准 BOM 行维护 Upsert(含多工序号,对应 ProductStructureOp)。</summary>
  595. public class AdoS0ProductStructureUpsertDto
  596. {
  597. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  598. public long CompanyRefId { get; set; }
  599. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  600. public long FactoryRefId { get; set; }
  601. [Range(1, long.MaxValue, ErrorMessage = "父项物料不能为空")]
  602. public long ParentMaterialId { get; set; }
  603. [Range(1, long.MaxValue, ErrorMessage = "子项物料不能为空")]
  604. public long ComponentMaterialId { get; set; }
  605. public decimal Qty { get; set; } = 1m;
  606. public string? UM { get; set; }
  607. public decimal Scrap { get; set; }
  608. public decimal QtyConsumed { get; set; }
  609. public int? LineOp { get; set; }
  610. public string? Refs { get; set; }
  611. public string? Remark { get; set; }
  612. public DateTime? StartEff { get; set; }
  613. public DateTime? EndEff { get; set; }
  614. public string? StructureType { get; set; }
  615. public bool IsEnabled { get; set; } = true;
  616. /// <summary>多工序号(去重排序后落 ProductStructureOp)。</summary>
  617. public List<int> OpNos { get; set; } = new();
  618. }
  619. /// <summary>标准工艺路线明细行(RoutingOpDetail 复刻)Upsert。</summary>
  620. public class AdoS0MfgRoutingOpDetailUpsertDto
  621. {
  622. // 行级工艺路线(legacy RoutingOpDetail 复刻)不建模组织作用域:全表 company/factory 多为 0,
  623. // 前端已不展示公司/工厂,故此处放行 0,按原值透传,不强制非零。
  624. public long CompanyRefId { get; set; }
  625. public long FactoryRefId { get; set; }
  626. [Required(ErrorMessage = "工艺路线编码不能为空")]
  627. public string RouteCode { get; set; } = string.Empty;
  628. [Required(ErrorMessage = "工艺路线名称不能为空")]
  629. public string RouteName { get; set; } = string.Empty;
  630. [Required(ErrorMessage = "物料编码不能为空")]
  631. public string MaterialCode { get; set; } = string.Empty;
  632. [Required(ErrorMessage = "工序编码不能为空")]
  633. public string OperationCode { get; set; } = string.Empty;
  634. public string? OperationDescription { get; set; }
  635. public string? WorkCenterCode { get; set; }
  636. public string? MilestoneOperation { get; set; }
  637. public string? Ufld1 { get; set; }
  638. public string? Ufld2 { get; set; }
  639. public decimal? UDeci1 { get; set; }
  640. public string? Ufld3 { get; set; }
  641. public string? Ufld4 { get; set; }
  642. public string? Ufld5 { get; set; }
  643. public decimal? UDeci2 { get; set; }
  644. public string? Ufld6 { get; set; }
  645. public string? Ufld7 { get; set; }
  646. public string? Ufld8 { get; set; }
  647. public decimal? UDeci3 { get; set; }
  648. public string? Ufld9 { get; set; }
  649. public decimal? UDeci4 { get; set; }
  650. public decimal? UDeci5 { get; set; }
  651. public string? SupplierCode { get; set; }
  652. public int OutsourcedLeadTime { get; set; }
  653. public int SortNo { get; set; }
  654. public bool IsEnabled { get; set; } = true;
  655. public bool IsConfirm { get; set; }
  656. public int? CommentIndex { get; set; }
  657. public string? CreateUser { get; set; }
  658. public string? UpdateUser { get; set; }
  659. }
  660. /// <summary>
  661. /// 产线岗位维护(LineSkillMaster):列表查询。
  662. /// Domain 为旧系统遗留字段,仅在请求显式传入时按相等过滤;新系统数据隔离以 ITenantIdFilter 为准。
  663. /// </summary>
  664. public class AdoS0LineSkillMasterQueryDto
  665. {
  666. /// <summary>旧系统遗留字段;不传或空字符串时不参与过滤。</summary>
  667. [MaxLength(50)]
  668. public string? Domain { get; set; }
  669. /// <summary>匹配生产线/岗位编码/岗位描述</summary>
  670. public string? Keyword { get; set; }
  671. public int Page { get; set; } = 1;
  672. public int PageSize { get; set; } = 20;
  673. }
  674. public class AdoS0LineSkillDetailUpsertDto
  675. {
  676. [Range(1, long.MaxValue, ErrorMessage = "人员技能不能为空")]
  677. public long PersonSkillId { get; set; }
  678. public string? RequiredLevel { get; set; }
  679. public string? Remark { get; set; }
  680. public DateTime? EffectiveDate { get; set; }
  681. public bool IsEnabled { get; set; } = true;
  682. }
  683. public class AdoS0LineSkillMasterUpsertDto
  684. {
  685. [Required(ErrorMessage = "工厂域不能为空")]
  686. [MaxLength(50)]
  687. public string Domain { get; set; } = string.Empty;
  688. [Required(ErrorMessage = "生产线不能为空")]
  689. [MaxLength(100)]
  690. public string ProdLine { get; set; } = string.Empty;
  691. [Required(ErrorMessage = "岗位编码不能为空")]
  692. [MaxLength(100)]
  693. public string JOBNo { get; set; } = string.Empty;
  694. [MaxLength(255)]
  695. public string? JOBDescr { get; set; }
  696. [MaxLength(12)]
  697. public string? Site { get; set; }
  698. public int? Orderby { get; set; }
  699. [MaxLength(20)]
  700. public string? WType { get; set; }
  701. public decimal? RunCrew { get; set; }
  702. [MaxLength(64)]
  703. public string? CreateUser { get; set; }
  704. public DateTime? CreateTime { get; set; }
  705. [MaxLength(64)]
  706. public string? UpdateUser { get; set; }
  707. public DateTime? UpdateTime { get; set; }
  708. public List<AdoS0LineSkillDetailUpsertDto> Skills { get; set; } = new();
  709. }
  710. public class AdoS0ProcessFlowCardQueryDto : AdoS0MfgPagedQueryBase
  711. {
  712. public string? DomainCode { get; set; }
  713. public string? WorkOrderNo { get; set; }
  714. public string? FlowCardNo { get; set; }
  715. public string? ItemNum { get; set; }
  716. public bool? IsActive { get; set; }
  717. }
  718. public class AdoS0ProcessFlowCardUpsertDto
  719. {
  720. /// <summary>
  721. /// 公司。**服务端忽略**:新增由 AdoS0ProcessFlowCardsController.ResolveDefaultOrgAsync(tenantId)
  722. /// 在当前租户内解析后强制 stamp,编辑由 IgnoreColumns pin 既有原值。
  723. /// 保留字段仅为 payload 向后兼容(前端 useS0MfgOrgScope 仍会带值),不做校验——
  724. /// 原 [Range(1, long.MaxValue)] 是失效前置门:值不参与落库,却会在模型绑定阶段
  725. /// 把"租户未配置机构"误报成"公司不能为空",故移除。
  726. /// </summary>
  727. public long CompanyRefId { get; set; }
  728. /// <summary>工厂。**服务端忽略**,同 <see cref="CompanyRefId"/>。</summary>
  729. public long FactoryRefId { get; set; }
  730. [MaxLength(50)]
  731. public string? DomainCode { get; set; }
  732. [Required(ErrorMessage = "工单不能为空")]
  733. [MaxLength(100)]
  734. public string WorkOrderNo { get; set; } = string.Empty;
  735. [MaxLength(100)]
  736. public string? WorkOrderBatchNo { get; set; }
  737. [Required(ErrorMessage = "流转卡号不能为空")]
  738. [MaxLength(100)]
  739. public string FlowCardNo { get; set; } = string.Empty;
  740. [MaxLength(100)]
  741. public string? Nature { get; set; }
  742. [Required(ErrorMessage = "物料编码不能为空")]
  743. [MaxLength(100)]
  744. public string ItemNum { get; set; } = string.Empty;
  745. [MaxLength(200)]
  746. public string? ItemName { get; set; }
  747. [MaxLength(100)]
  748. public string? DrawingNo { get; set; }
  749. [MaxLength(50)]
  750. public string? BomVersion { get; set; }
  751. [MaxLength(100)]
  752. public string? RoutingCode { get; set; }
  753. [MaxLength(500)]
  754. public string? Remarks { get; set; }
  755. public bool IsActive { get; set; } = true;
  756. public string? CreateUser { get; set; }
  757. public string? UpdateUser { get; set; }
  758. }
  759. public class AdoS0ProcessFlowCardToggleActiveDto
  760. {
  761. public bool IsEnabled { get; set; }
  762. }
  763. public class AdoS0OrderScheduleCycleQueryDto : AdoS0MfgPagedQueryBase
  764. {
  765. public string? DomainCode { get; set; }
  766. public string? OrderType { get; set; }
  767. public bool? IsActive { get; set; }
  768. }
  769. public class AdoS0OrderScheduleCycleUpsertDto
  770. {
  771. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  772. public long CompanyRefId { get; set; }
  773. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  774. public long FactoryRefId { get; set; }
  775. [MaxLength(50)]
  776. public string? DomainCode { get; set; }
  777. /// <summary>订单类型;留空表示默认/不限。</summary>
  778. [MaxLength(100)]
  779. public string? OrderType { get; set; }
  780. [Range(0, int.MaxValue, ErrorMessage = "标准时长不能为负")]
  781. public int StdHours { get; set; }
  782. [MaxLength(500)]
  783. public string? Remarks { get; set; }
  784. public bool IsActive { get; set; } = true;
  785. public string? CreateUser { get; set; }
  786. public string? UpdateUser { get; set; }
  787. }
  788. public class AdoS0OrderScheduleCycleToggleActiveDto
  789. {
  790. public bool IsEnabled { get; set; }
  791. }
  792. #endregion