AdoS0ManufacturingDtos.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  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)模糊过滤。</summary>
  24. public string? StdOp { get; set; }
  25. public string? MilestoneOp { get; set; }
  26. }
  27. /// <summary>生产线主数据列表(LineMaster 语义)。</summary>
  28. public class AdoS0LineMasterQueryDto : AdoS0MfgPagedQueryBase
  29. {
  30. /// <summary>按生产线编码(line)模糊过滤。</summary>
  31. public string? Line { get; set; }
  32. public string? Workshop { get; set; }
  33. }
  34. public class AdoS0MfgPreprocessElementQueryDto : AdoS0MfgPagedQueryBase
  35. {
  36. public string? MaterialCode { get; set; }
  37. public string? MaterialName { get; set; }
  38. public string? ElementCode { get; set; }
  39. }
  40. public class AdoS0MfgMaterialProcessElementQueryDto : AdoS0MfgPagedQueryBase
  41. {
  42. public string? MaterialCode { get; set; }
  43. public string? MaterialName { get; set; }
  44. public string? ElementType { get; set; }
  45. public string? ElementCode { get; set; }
  46. }
  47. /// <summary>
  48. /// SOP 维护(源平台 QualitySegmentImage):列表查询
  49. /// </summary>
  50. public class AdoS0MfgSopDocumentQueryDto
  51. {
  52. [Required(ErrorMessage = "工厂域不能为空")]
  53. [MaxLength(50)]
  54. public string Domain { get; set; } = string.Empty;
  55. public string? Keyword { get; set; }
  56. public int Page { get; set; } = 1;
  57. public int PageSize { get; set; } = 20;
  58. }
  59. /// <summary>列表须支持 elementCategory 过滤(§7 / 附录 F)。</summary>
  60. public class AdoS0MfgElementParamQueryDto : AdoS0MfgPagedQueryBase
  61. {
  62. public string? ElementCategory { get; set; }
  63. }
  64. #endregion
  65. #region 仅 PagedQuery 等价的列表 Query
  66. /// <summary>标准 BOM 行级列表(ProductStructureMaster 路线 A)。</summary>
  67. public class AdoS0ProductStructureQueryDto : AdoS0MfgPagedQueryBase;
  68. public class AdoS0MfgRoutingOpDetailQueryDto : AdoS0MfgPagedQueryBase;
  69. public class AdoS0MfgLinePostQueryDto : AdoS0MfgPagedQueryBase;
  70. public class AdoS0MfgPersonSkillQueryDto : AdoS0MfgPagedQueryBase;
  71. public class AdoS0MfgPersonSkillAssignmentQueryDto : AdoS0MfgPagedQueryBase;
  72. public class AdoS0MfgWorkOrderControlQueryDto : AdoS0MfgPagedQueryBase;
  73. public class AdoS0MfgWorkCenterQueryDto : AdoS0MfgPagedQueryBase;
  74. public class AdoS0MfgLineMaterialQueryDto : AdoS0MfgPagedQueryBase;
  75. /// <summary>
  76. /// SOP 文件类型(源平台 ImageType):列表查询
  77. /// </summary>
  78. public class AdoS0MfgSopFileTypeQueryDto
  79. {
  80. [Required(ErrorMessage = "工厂域不能为空")]
  81. [MaxLength(50)]
  82. public string Domain { get; set; } = string.Empty;
  83. public string? Keyword { get; set; }
  84. public int Page { get; set; } = 1;
  85. public int PageSize { get; set; } = 20;
  86. }
  87. public class AdoS0MfgPreprocessElementParamQueryDto : AdoS0MfgPagedQueryBase
  88. {
  89. public long? PreprocessElementId { get; set; }
  90. }
  91. #endregion
  92. #region 标准资源 Upsert(12 个非聚合)
  93. public class AdoS0StdOpMasterUpsertDto
  94. {
  95. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  96. public long CompanyRefId { get; set; }
  97. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  98. public long FactoryRefId { get; set; }
  99. [Required(ErrorMessage = "工厂域编码不能为空")]
  100. [MaxLength(50)]
  101. public string Domain { get; set; } = string.Empty;
  102. [Required(ErrorMessage = "标准工序名称不能为空")]
  103. [MaxLength(100)]
  104. public string StdOp { get; set; } = string.Empty;
  105. [MaxLength(20)]
  106. public string? MilestoneOp { get; set; }
  107. [MaxLength(64)]
  108. public string? CreateUser { get; set; }
  109. [MaxLength(64)]
  110. public string? UpdateUser { get; set; }
  111. }
  112. public class AdoS0LineMasterUpsertDto
  113. {
  114. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  115. public long CompanyRefId { get; set; }
  116. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  117. public long FactoryRefId { get; set; }
  118. [Required(ErrorMessage = "工厂域编码不能为空")]
  119. [MaxLength(50)]
  120. public string Domain { get; set; } = string.Empty;
  121. [Required(ErrorMessage = "生产线编码不能为空")]
  122. [MaxLength(100)]
  123. public string Line { get; set; } = string.Empty;
  124. [MaxLength(255)]
  125. public string? Describe { get; set; }
  126. [MaxLength(50)]
  127. public string? LineType { get; set; }
  128. [MaxLength(50)]
  129. public string? LineCategory { get; set; }
  130. [MaxLength(50)]
  131. public string? Location { get; set; }
  132. [MaxLength(50)]
  133. public string? Workshop { get; set; }
  134. [MaxLength(50)]
  135. public string? VLocation { get; set; }
  136. [MaxLength(50)]
  137. public string? Location2 { get; set; }
  138. [MaxLength(50)]
  139. public string? Location3 { get; set; }
  140. [MaxLength(50)]
  141. public string? PickingLocation { get; set; }
  142. [MaxLength(50)]
  143. public string? MidLocation { get; set; }
  144. public bool IsActive { get; set; } = true;
  145. [MaxLength(64)]
  146. public string? CreateUser { get; set; }
  147. [MaxLength(64)]
  148. public string? UpdateUser { get; set; }
  149. }
  150. public class AdoS0MfgSopFileTypeUpsertDto
  151. {
  152. [Required(ErrorMessage = "工厂域不能为空")]
  153. [MaxLength(50)]
  154. public string Domain { get; set; } = string.Empty;
  155. [Required(ErrorMessage = "文件类型编码不能为空")]
  156. [MaxLength(100)]
  157. public string ImageTypeID { get; set; } = string.Empty;
  158. [MaxLength(255)]
  159. public string? Descr { get; set; }
  160. }
  161. public class AdoS0MfgElementParamUpsertDto
  162. {
  163. public long CompanyRefId { get; set; }
  164. public long FactoryRefId { get; set; }
  165. public string? ElementCode { get; set; }
  166. public string? ElementName { get; set; }
  167. public string? ElementCategory { get; set; }
  168. public string Code { get; set; } = string.Empty;
  169. public string Name { get; set; } = string.Empty;
  170. public string? ParamType { get; set; }
  171. public string? Unit { get; set; }
  172. public string? StdValue { get; set; }
  173. public decimal? UpperLimit { get; set; }
  174. public decimal? LowerLimit { get; set; }
  175. public string? EnumOptions { get; set; }
  176. public string? Remark { get; set; }
  177. public bool IsEnabled { get; set; } = true;
  178. }
  179. /// <summary>
  180. /// 生产要素参数(DevMonitor;固定 CodeType='Prod'):列表查询
  181. /// </summary>
  182. public class AdoS0DevMonitorQueryDto
  183. {
  184. [Required(ErrorMessage = "工厂域不能为空")]
  185. [MaxLength(50)]
  186. public string Domain { get; set; } = string.Empty;
  187. public string? Keyword { get; set; }
  188. public int Page { get; set; } = 1;
  189. public int PageSize { get; set; } = 20;
  190. }
  191. public class AdoS0DevMonitorUpsertDto
  192. {
  193. [Required(ErrorMessage = "工厂域不能为空")]
  194. [MaxLength(50)]
  195. public string Domain { get; set; } = string.Empty;
  196. [Required(ErrorMessage = "要素编码不能为空")]
  197. [MaxLength(100)]
  198. public string DeviceNumber { get; set; } = string.Empty;
  199. public string? DeviceDescr { get; set; }
  200. [Required(ErrorMessage = "参数编码不能为空")]
  201. [MaxLength(100)]
  202. public string MessageCode { get; set; } = string.Empty;
  203. public string? CodeDescr { get; set; }
  204. public string? ValueType { get; set; }
  205. public string? UM { get; set; }
  206. public string? StdValue { get; set; }
  207. public decimal? TopLimit { get; set; }
  208. public decimal? LowLimit { get; set; }
  209. public string? Ufld1 { get; set; }
  210. /// <summary>固定为 Prod</summary>
  211. public string CodeType { get; set; } = "Prod";
  212. public string? CreateUser { get; set; }
  213. public DateTime? CreateTime { get; set; }
  214. public string? UpdateUser { get; set; }
  215. public DateTime? UpdateTime { get; set; }
  216. }
  217. /// <summary>
  218. /// 物料工序生产要素(ItemOpCondition;固定 CodeType='Prod'):列表查询
  219. /// </summary>
  220. public class AdoS0ItemOpConditionQueryDto
  221. {
  222. [Required(ErrorMessage = "工厂域不能为空")]
  223. [MaxLength(50)]
  224. public string Domain { get; set; } = string.Empty;
  225. public string? Keyword { get; set; }
  226. public string? ItemNum { get; set; }
  227. public string? Op { get; set; }
  228. public string? Line { get; set; }
  229. public string? Typed { get; set; }
  230. public string? ItemCode { get; set; }
  231. public int Page { get; set; } = 1;
  232. public int PageSize { get; set; } = 20;
  233. }
  234. public class AdoS0ItemOpConditionUpsertDto
  235. {
  236. [Required(ErrorMessage = "工厂域不能为空")]
  237. [MaxLength(50)]
  238. public string Domain { get; set; } = string.Empty;
  239. [Required(ErrorMessage = "物料编码不能为空")]
  240. [MaxLength(100)]
  241. public string ItemNum { get; set; } = string.Empty;
  242. public string? Op { get; set; }
  243. public string? Line { get; set; }
  244. public string? Typed { get; set; }
  245. public string? ItemCode { get; set; }
  246. public string? Descr { get; set; }
  247. public bool IsMain { 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 AdoS0MfgPersonSkillUpsertDto
  256. {
  257. public long CompanyRefId { get; set; }
  258. public long FactoryRefId { get; set; }
  259. public string Code { get; set; } = string.Empty;
  260. public string Name { get; set; } = string.Empty;
  261. public string? SkillLevel { get; set; }
  262. public string? Remark { get; set; }
  263. public bool IsEnabled { get; set; } = true;
  264. }
  265. public class AdoS0MfgPersonSkillAssignmentUpsertDto
  266. {
  267. public long CompanyRefId { get; set; }
  268. public long FactoryRefId { get; set; }
  269. public string PersonCode { get; set; } = string.Empty;
  270. public string? WorkGroup { get; set; }
  271. public long SkillId { get; set; }
  272. public int SkillLevel { get; set; }
  273. public decimal ProductionEfficiency { get; set; } = 1m;
  274. public string? Remark { get; set; }
  275. public bool IsEnabled { get; set; } = true;
  276. }
  277. /// <summary>
  278. /// 人员技能维护(EmpSkills):列表查询。
  279. /// </summary>
  280. public class AdoS0EmpSkillsQueryDto : AdoS0MfgPagedQueryBase
  281. {
  282. /// <summary>工厂域(Domain)</summary>
  283. public string? Domain { get; set; }
  284. /// <summary>人员编号(Employee)</summary>
  285. public string? Employee { get; set; }
  286. /// <summary>工作组(Site)</summary>
  287. public string? Site { get; set; }
  288. /// <summary>技能编码(SkillNo)</summary>
  289. public string? SkillNo { get; set; }
  290. }
  291. public class AdoS0EmpSkillsUpsertDto
  292. {
  293. [Required(ErrorMessage = "人员编号不能为空")]
  294. [MaxLength(100)]
  295. public string Employee { get; set; } = string.Empty;
  296. [MaxLength(100)]
  297. public string? EmployeeId { get; set; }
  298. [MaxLength(100)]
  299. public string? EmployeeName { get; set; }
  300. [MaxLength(100)]
  301. public string? Site { get; set; }
  302. [Required(ErrorMessage = "技能编码不能为空")]
  303. [MaxLength(100)]
  304. public string SkillNo { get; set; } = string.Empty;
  305. [MaxLength(255)]
  306. public string? SkillDescription { get; set; }
  307. [MaxLength(50)]
  308. public string? SkillLevel { get; set; }
  309. public decimal? EfficiencyCoefficient { get; set; }
  310. public DateTime? DateSkill { get; set; }
  311. [Required(ErrorMessage = "工厂域不能为空")]
  312. [MaxLength(50)]
  313. public string Domain { get; set; } = string.Empty;
  314. [MaxLength(64)]
  315. public string? CreateUser { get; set; }
  316. public DateTime? CreateTime { get; set; }
  317. [MaxLength(64)]
  318. public string? UpdateUser { get; set; }
  319. public DateTime? UpdateTime { get; set; }
  320. }
  321. public class AdoS0MfgWorkCenterUpsertDto
  322. {
  323. public long CompanyRefId { get; set; }
  324. public long FactoryRefId { get; set; }
  325. public string Code { get; set; } = string.Empty;
  326. public string Name { get; set; } = string.Empty;
  327. public string? CenterType { get; set; }
  328. public decimal? Capacity { get; set; }
  329. public long? DepartmentId { get; set; }
  330. public string? Remark { get; set; }
  331. public bool IsEnabled { get; set; } = true;
  332. }
  333. public class AdoS0MfgLineMaterialUpsertDto
  334. {
  335. public long CompanyRefId { get; set; }
  336. public long FactoryRefId { get; set; }
  337. public long? ProductionLineId { get; set; }
  338. public long MaterialId { get; set; }
  339. public long? OperationId { get; set; }
  340. public long? WorkCenterId { get; set; }
  341. public string? EquipmentCode { get; set; }
  342. public decimal? StdCapacityPerUnit { get; set; }
  343. public decimal? ChangeoverTime { get; set; }
  344. public string? EquipmentTypeCode { get; set; }
  345. public string? MoldTypeCode { get; set; }
  346. public string? RequiredSkillCode { get; set; }
  347. public string? MaterialRole { get; set; }
  348. public string? Remark { get; set; }
  349. public bool IsEnabled { get; set; } = true;
  350. }
  351. /// <summary>
  352. /// 工作中心(WorkCtrMaster):列表查询
  353. /// </summary>
  354. public class AdoS0WorkCtrMasterQueryDto
  355. {
  356. [Required(ErrorMessage = "工厂域不能为空")]
  357. [MaxLength(50)]
  358. public string Domain { get; set; } = string.Empty;
  359. public string? Keyword { get; set; }
  360. public int Page { get; set; } = 1;
  361. public int PageSize { get; set; } = 20;
  362. }
  363. public class AdoS0WorkCtrMasterUpsertDto
  364. {
  365. [Required(ErrorMessage = "工作中心编码不能为空")]
  366. [MaxLength(100)]
  367. public string WorkCtr { get; set; } = string.Empty;
  368. [MaxLength(255)]
  369. public string? Descr { get; set; }
  370. [MaxLength(100)]
  371. public string? Department { get; set; }
  372. public bool IsActive { get; set; } = true;
  373. [Required(ErrorMessage = "工厂域不能为空")]
  374. [MaxLength(50)]
  375. public string Domain { get; set; } = string.Empty;
  376. [MaxLength(64)]
  377. public string? CreateUser { get; set; }
  378. public DateTime? CreateTime { get; set; }
  379. [MaxLength(64)]
  380. public string? UpdateUser { get; set; }
  381. public DateTime? UpdateTime { get; set; }
  382. }
  383. /// <summary>
  384. /// 生产线物料(ProdLineDetail):列表查询
  385. /// </summary>
  386. public class AdoS0ProdLineDetailQueryDto : AdoS0MfgPagedQueryBase
  387. {
  388. public string? Domain { get; set; }
  389. public string? Part { get; set; }
  390. public string? Op { get; set; }
  391. public string? Site { get; set; }
  392. public string? Line { get; set; }
  393. }
  394. public class AdoS0ProdLineDetailUpsertDto
  395. {
  396. [Required(ErrorMessage = "物料编码不能为空")]
  397. [MaxLength(100)]
  398. public string Part { get; set; } = string.Empty;
  399. [MaxLength(100)]
  400. public string? Op { get; set; }
  401. [MaxLength(100)]
  402. public string? Site { get; set; }
  403. [MaxLength(100)]
  404. public string? Line { get; set; }
  405. public decimal? Rate { get; set; }
  406. public decimal? SetupTime { get; set; }
  407. public string? SkillNo { get; set; }
  408. public string? InternalEquipmentTypeCode { get; set; }
  409. public string? MoldTypeCode { get; set; }
  410. public int? StandardStaffCount { get; set; }
  411. public int? Start { get; set; }
  412. public bool IsActive { get; set; } = true;
  413. public bool IsConfirm { get; set; }
  414. [Required(ErrorMessage = "工厂域不能为空")]
  415. [MaxLength(50)]
  416. public string Domain { get; set; } = string.Empty;
  417. [MaxLength(64)]
  418. public string? CreateUser { get; set; }
  419. public DateTime? CreateTime { get; set; }
  420. [MaxLength(64)]
  421. public string? UpdateUser { get; set; }
  422. public DateTime? UpdateTime { get; set; }
  423. }
  424. public class AdoS0MfgWorkOrderControlUpsertDto
  425. {
  426. public long CompanyRefId { get; set; }
  427. public long FactoryRefId { get; set; }
  428. public string Code { get; set; } = string.Empty;
  429. public string Name { get; set; } = string.Empty;
  430. public string? ControlType { get; set; }
  431. public string? ParamValue { get; set; }
  432. public string? Remark { get; set; }
  433. public bool IsEnabled { get; set; } = true;
  434. }
  435. /// <summary>
  436. /// 工单控制参数设置(WorkOrdControl):按 Domain 查询单记录。
  437. /// </summary>
  438. public class AdoS0WorkOrdControlGetDto
  439. {
  440. [Required(ErrorMessage = "工厂域不能为空")]
  441. [MaxLength(50)]
  442. public string Domain { get; set; } = string.Empty;
  443. }
  444. public class AdoS0WorkOrdControlUpsertDto
  445. {
  446. /// <summary>RecID → Id;存在则按 Id 更新。</summary>
  447. public long? Id { get; set; }
  448. [Required(ErrorMessage = "工厂域不能为空")]
  449. [MaxLength(50)]
  450. public string Domain { get; set; } = string.Empty;
  451. public decimal? EnteringPer { get; set; }
  452. public decimal? PaintingPer { get; set; }
  453. public decimal? IssuedInterval { get; set; }
  454. public bool PostVarsatSFC { get; set; }
  455. public bool IsIssued { get; set; }
  456. public bool IsPrintRejectBarcode { get; set; }
  457. public bool IsPrintScrapBarcode { get; set; }
  458. public bool IsQualityConfirm { get; set; }
  459. public bool IsActive { get; set; } = true;
  460. public bool IsConfirm { get; set; }
  461. [MaxLength(64)]
  462. public string? CreateUser { get; set; }
  463. public DateTime? CreateTime { get; set; }
  464. [MaxLength(64)]
  465. public string? UpdateUser { get; set; }
  466. public DateTime? UpdateTime { get; set; }
  467. }
  468. public class AdoS0MfgMaterialProcessElementUpsertDto
  469. {
  470. public long CompanyRefId { get; set; }
  471. public long FactoryRefId { get; set; }
  472. public long MaterialId { get; set; }
  473. public long OperationId { get; set; }
  474. public long? ProductionLineId { get; set; }
  475. public string? ElementType { get; set; }
  476. public string? ElementCode { get; set; }
  477. public string? ElementName { get; set; }
  478. public long ElementParamId { get; set; }
  479. public string? ParamValue { get; set; }
  480. public bool IsKeyElement { get; set; }
  481. public string? Remark { get; set; }
  482. public bool IsEnabled { get; set; } = true;
  483. }
  484. public class AdoS0MfgSopDocumentUpsertDto
  485. {
  486. [Required(ErrorMessage = "工厂域不能为空")]
  487. [MaxLength(50)]
  488. public string Domain { get; set; } = string.Empty;
  489. [MaxLength(100)]
  490. public string? Line { get; set; }
  491. [MaxLength(100)]
  492. public string? ItemNum { get; set; }
  493. [MaxLength(100)]
  494. public string? Op { get; set; }
  495. [MaxLength(100)]
  496. public string? ImageTypeID { get; set; }
  497. [MaxLength(1000)]
  498. public string? Path { get; set; }
  499. [MaxLength(255)]
  500. public string? Descr { get; set; }
  501. [MaxLength(50)]
  502. public string? Rev { get; set; }
  503. public int? SortID { get; set; }
  504. }
  505. public class AdoS0MfgPreprocessElementParamUpsertDto
  506. {
  507. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  508. public long CompanyRefId { get; set; }
  509. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  510. public long FactoryRefId { get; set; }
  511. [Range(1, long.MaxValue, ErrorMessage = "前处理要素不能为空")]
  512. public long PreprocessElementId { get; set; }
  513. [Range(1, long.MaxValue, ErrorMessage = "生产要素参数不能为空")]
  514. public long ElementParamId { get; set; }
  515. public string? ParamValue { get; set; }
  516. public int SortNo { get; set; }
  517. public string? Remark { get; set; }
  518. public bool IsEnabled { get; set; } = true;
  519. }
  520. #endregion
  521. #region 聚合 Upsert(步骤 9)
  522. /// <summary>标准 BOM 行维护 Upsert(含多工序号,对应 ProductStructureOp)。</summary>
  523. public class AdoS0ProductStructureUpsertDto
  524. {
  525. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  526. public long CompanyRefId { get; set; }
  527. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  528. public long FactoryRefId { get; set; }
  529. [Range(1, long.MaxValue, ErrorMessage = "父项物料不能为空")]
  530. public long ParentMaterialId { get; set; }
  531. [Range(1, long.MaxValue, ErrorMessage = "子项物料不能为空")]
  532. public long ComponentMaterialId { get; set; }
  533. public decimal Qty { get; set; } = 1m;
  534. public string? UM { get; set; }
  535. public decimal Scrap { get; set; }
  536. public decimal QtyConsumed { get; set; }
  537. public int? LineOp { get; set; }
  538. public string? Refs { get; set; }
  539. public string? Remark { get; set; }
  540. public DateTime? StartEff { get; set; }
  541. public DateTime? EndEff { get; set; }
  542. public string? StructureType { get; set; }
  543. public bool IsEnabled { get; set; } = true;
  544. /// <summary>多工序号(去重排序后落 ProductStructureOp)。</summary>
  545. public List<int> OpNos { get; set; } = new();
  546. }
  547. /// <summary>标准工艺路线明细行(RoutingOpDetail 复刻)Upsert。</summary>
  548. public class AdoS0MfgRoutingOpDetailUpsertDto
  549. {
  550. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  551. public long CompanyRefId { get; set; }
  552. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  553. public long FactoryRefId { get; set; }
  554. [Required(ErrorMessage = "工艺路线编码不能为空")]
  555. public string RouteCode { get; set; } = string.Empty;
  556. [Required(ErrorMessage = "工艺路线名称不能为空")]
  557. public string RouteName { get; set; } = string.Empty;
  558. [Required(ErrorMessage = "物料编码不能为空")]
  559. public string MaterialCode { get; set; } = string.Empty;
  560. [Required(ErrorMessage = "工序编码不能为空")]
  561. public string OperationCode { get; set; } = string.Empty;
  562. public string? OperationDescription { get; set; }
  563. public string? WorkCenterCode { get; set; }
  564. public string? MilestoneOperation { get; set; }
  565. public string? Ufld1 { get; set; }
  566. public string? Ufld2 { get; set; }
  567. public decimal? UDeci1 { get; set; }
  568. public string? Ufld3 { get; set; }
  569. public string? Ufld4 { get; set; }
  570. public string? Ufld5 { get; set; }
  571. public decimal? UDeci2 { get; set; }
  572. public string? Ufld6 { get; set; }
  573. public string? Ufld7 { get; set; }
  574. public string? Ufld8 { get; set; }
  575. public decimal? UDeci3 { get; set; }
  576. public string? Ufld9 { get; set; }
  577. public decimal? UDeci4 { get; set; }
  578. public decimal? UDeci5 { get; set; }
  579. public string? SupplierCode { get; set; }
  580. public int OutsourcedLeadTime { get; set; }
  581. public int SortNo { get; set; }
  582. public bool IsEnabled { get; set; } = true;
  583. public bool IsConfirm { get; set; }
  584. public int? CommentIndex { get; set; }
  585. public string? CreateUser { get; set; }
  586. public string? UpdateUser { get; set; }
  587. }
  588. public class AdoS0MfgLinePostSkillUpsertDto
  589. {
  590. public long? Id { get; set; }
  591. [Range(1, long.MaxValue, ErrorMessage = "人员技能不能为空")]
  592. public long PersonSkillId { get; set; }
  593. public string? RequiredLevel { get; set; }
  594. public string? Remark { get; set; }
  595. public DateTime? EffectiveDate { get; set; }
  596. public bool IsEnabled { get; set; } = true;
  597. }
  598. public class AdoS0MfgLinePostUpsertDto
  599. {
  600. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  601. public long CompanyRefId { get; set; }
  602. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  603. public long FactoryRefId { get; set; }
  604. [Required(ErrorMessage = "线体岗位编码不能为空")]
  605. public string Code { get; set; } = string.Empty;
  606. [Required(ErrorMessage = "线体岗位名称不能为空")]
  607. public string Name { get; set; } = string.Empty;
  608. public long? ProductionLineId { get; set; }
  609. public string? Remark { get; set; }
  610. public bool IsEnabled { get; set; } = true;
  611. public List<AdoS0MfgLinePostSkillUpsertDto> Skills { get; set; } = new();
  612. }
  613. /// <summary>
  614. /// 产线岗位维护(LineSkillMaster):列表查询
  615. /// </summary>
  616. public class AdoS0LineSkillMasterQueryDto
  617. {
  618. [Required(ErrorMessage = "工厂域不能为空")]
  619. [MaxLength(50)]
  620. public string Domain { get; set; } = string.Empty;
  621. /// <summary>匹配生产线/岗位编码/岗位描述</summary>
  622. public string? Keyword { get; set; }
  623. public int Page { get; set; } = 1;
  624. public int PageSize { get; set; } = 20;
  625. }
  626. public class AdoS0LineSkillDetailUpsertDto
  627. {
  628. [Range(1, long.MaxValue, ErrorMessage = "人员技能不能为空")]
  629. public long PersonSkillId { get; set; }
  630. public string? RequiredLevel { get; set; }
  631. public string? Remark { get; set; }
  632. public DateTime? EffectiveDate { get; set; }
  633. public bool IsEnabled { get; set; } = true;
  634. }
  635. public class AdoS0LineSkillMasterUpsertDto
  636. {
  637. [Required(ErrorMessage = "工厂域不能为空")]
  638. [MaxLength(50)]
  639. public string Domain { get; set; } = string.Empty;
  640. [Required(ErrorMessage = "生产线不能为空")]
  641. [MaxLength(100)]
  642. public string ProdLine { get; set; } = string.Empty;
  643. [Required(ErrorMessage = "岗位编码不能为空")]
  644. [MaxLength(100)]
  645. public string JOBNo { get; set; } = string.Empty;
  646. [MaxLength(255)]
  647. public string? JOBDescr { get; set; }
  648. [MaxLength(64)]
  649. public string? CreateUser { get; set; }
  650. public DateTime? CreateTime { get; set; }
  651. [MaxLength(64)]
  652. public string? UpdateUser { get; set; }
  653. public DateTime? UpdateTime { get; set; }
  654. public List<AdoS0LineSkillDetailUpsertDto> Skills { get; set; } = new();
  655. }
  656. public class AdoS0MfgPreprocessElementParamLineUpsertDto
  657. {
  658. public long? Id { get; set; }
  659. [Range(1, long.MaxValue, ErrorMessage = "生产要素参数不能为空")]
  660. public long ElementParamId { get; set; }
  661. public string? ParamValue { get; set; }
  662. public int SortNo { get; set; }
  663. public string? Remark { get; set; }
  664. public bool IsEnabled { get; set; } = true;
  665. }
  666. public class AdoS0MfgPreprocessElementUpsertDto
  667. {
  668. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  669. public long CompanyRefId { get; set; }
  670. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  671. public long FactoryRefId { get; set; }
  672. [Required(ErrorMessage = "前处理要素编码不能为空")]
  673. public string Code { get; set; } = string.Empty;
  674. [Required(ErrorMessage = "前处理要素名称不能为空")]
  675. public string Name { get; set; } = string.Empty;
  676. public long? MaterialId { get; set; }
  677. public long? OperationId { get; set; }
  678. public bool IsKeyElement { get; set; }
  679. public string? Remark { get; set; }
  680. public bool IsEnabled { get; set; } = true;
  681. public List<AdoS0MfgPreprocessElementParamLineUpsertDto> Params { get; set; } = new();
  682. }
  683. #endregion