AdoS0ManufacturingDtos.cs 30 KB

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