AdoS0ManufacturingDtos.cs 27 KB

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