AdoS0ManufacturingDtos.cs 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  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. public class AdoS0MfgPersonSkillAssignmentUpsertDto
  330. {
  331. public long CompanyRefId { get; set; }
  332. public long FactoryRefId { get; set; }
  333. public string PersonCode { get; set; } = string.Empty;
  334. public string? WorkGroup { get; set; }
  335. public long SkillId { get; set; }
  336. public int SkillLevel { get; set; }
  337. public decimal ProductionEfficiency { get; set; } = 1m;
  338. public string? Remark { get; set; }
  339. public bool IsEnabled { get; set; } = true;
  340. }
  341. /// <summary>
  342. /// 人员技能维护(EmpSkills):列表查询。
  343. /// </summary>
  344. public class AdoS0EmpSkillsQueryDto : AdoS0MfgPagedQueryBase
  345. {
  346. /// <summary>工厂域(Domain)</summary>
  347. public string? Domain { get; set; }
  348. /// <summary>人员编号(Employee)</summary>
  349. public string? Employee { get; set; }
  350. /// <summary>工作组(Site)</summary>
  351. public string? Site { get; set; }
  352. /// <summary>技能编码(SkillNo)</summary>
  353. public string? SkillNo { get; set; }
  354. }
  355. public class AdoS0EmpSkillsUpsertDto
  356. {
  357. [Required(ErrorMessage = "人员编号不能为空")]
  358. [MaxLength(100)]
  359. public string Employee { get; set; } = string.Empty;
  360. [MaxLength(100)]
  361. public string? EmployeeId { get; set; }
  362. [MaxLength(100)]
  363. public string? EmployeeName { get; set; }
  364. [MaxLength(100)]
  365. public string? Site { get; set; }
  366. [Required(ErrorMessage = "技能编码不能为空")]
  367. [MaxLength(100)]
  368. public string SkillNo { get; set; } = string.Empty;
  369. [MaxLength(255)]
  370. public string? SkillDescription { get; set; }
  371. [MaxLength(50)]
  372. public string? SkillLevel { get; set; }
  373. public decimal? EfficiencyCoefficient { get; set; }
  374. public DateTime? DateSkill { get; set; }
  375. [Required(ErrorMessage = "工厂域不能为空")]
  376. [MaxLength(50)]
  377. public string Domain { get; set; } = string.Empty;
  378. [MaxLength(64)]
  379. public string? CreateUser { get; set; }
  380. public DateTime? CreateTime { get; set; }
  381. [MaxLength(64)]
  382. public string? UpdateUser { get; set; }
  383. public DateTime? UpdateTime { get; set; }
  384. }
  385. public class AdoS0MfgWorkCenterUpsertDto
  386. {
  387. public long CompanyRefId { get; set; }
  388. public long FactoryRefId { get; set; }
  389. public string Code { get; set; } = string.Empty;
  390. public string Name { get; set; } = string.Empty;
  391. public string? CenterType { get; set; }
  392. public decimal? Capacity { get; set; }
  393. public long? DepartmentId { get; set; }
  394. public string? Remark { get; set; }
  395. public bool IsEnabled { get; set; } = true;
  396. }
  397. public class AdoS0MfgLineMaterialUpsertDto
  398. {
  399. public long CompanyRefId { get; set; }
  400. public long FactoryRefId { get; set; }
  401. public long? ProductionLineId { get; set; }
  402. public long MaterialId { get; set; }
  403. public long? OperationId { get; set; }
  404. public long? WorkCenterId { get; set; }
  405. public string? EquipmentCode { get; set; }
  406. public decimal? StdCapacityPerUnit { get; set; }
  407. public decimal? ChangeoverTime { get; set; }
  408. public string? EquipmentTypeCode { get; set; }
  409. public string? MoldTypeCode { get; set; }
  410. public string? RequiredSkillCode { get; set; }
  411. public string? MaterialRole { get; set; }
  412. public string? Remark { get; set; }
  413. public bool IsEnabled { get; set; } = true;
  414. }
  415. /// <summary>
  416. /// 工作中心(WorkCtrMaster):列表查询
  417. /// </summary>
  418. public class AdoS0WorkCtrMasterQueryDto
  419. {
  420. [Required(ErrorMessage = "工厂域不能为空")]
  421. [MaxLength(50)]
  422. public string Domain { get; set; } = string.Empty;
  423. public string? Keyword { get; set; }
  424. public int Page { get; set; } = 1;
  425. public int PageSize { get; set; } = 20;
  426. }
  427. public class AdoS0WorkCtrMasterUpsertDto
  428. {
  429. [Required(ErrorMessage = "工作中心编码不能为空")]
  430. [MaxLength(100)]
  431. public string WorkCtr { get; set; } = string.Empty;
  432. [MaxLength(255)]
  433. public string? Descr { get; set; }
  434. [MaxLength(100)]
  435. public string? Department { get; set; }
  436. public bool IsActive { get; set; } = true;
  437. [Required(ErrorMessage = "工厂域不能为空")]
  438. [MaxLength(50)]
  439. public string Domain { get; set; } = string.Empty;
  440. [MaxLength(64)]
  441. public string? CreateUser { get; set; }
  442. public DateTime? CreateTime { get; set; }
  443. [MaxLength(64)]
  444. public string? UpdateUser { get; set; }
  445. public DateTime? UpdateTime { get; set; }
  446. }
  447. /// <summary>
  448. /// 生产线物料(ProdLineDetail):列表查询
  449. /// </summary>
  450. public class AdoS0ProdLineDetailQueryDto : AdoS0MfgPagedQueryBase
  451. {
  452. public string? Domain { get; set; }
  453. public string? Part { get; set; }
  454. public int? Op { get; set; }
  455. public string? Site { get; set; }
  456. public string? Line { get; set; }
  457. }
  458. public class AdoS0ProdLineDetailUpsertDto
  459. {
  460. [Required(ErrorMessage = "物料编码不能为空")]
  461. [MaxLength(100)]
  462. public string Part { get; set; } = string.Empty;
  463. public int Op { get; set; }
  464. [MaxLength(100)]
  465. public string? Site { get; set; }
  466. [MaxLength(100)]
  467. public string? Line { get; set; }
  468. public decimal? Rate { get; set; }
  469. public decimal? SetupTime { get; set; }
  470. public string? SkillNo { get; set; }
  471. public string? InternalEquipmentTypeCode { get; set; }
  472. public string? MoldTypeCode { get; set; }
  473. public decimal StandardStaffCount { get; set; }
  474. public int? Start { get; set; }
  475. public bool IsActive { get; set; } = true;
  476. public bool IsConfirm { get; set; }
  477. [Required(ErrorMessage = "工厂域不能为空")]
  478. [MaxLength(50)]
  479. public string Domain { get; set; } = string.Empty;
  480. [MaxLength(64)]
  481. public string? CreateUser { get; set; }
  482. public DateTime? CreateTime { get; set; }
  483. [MaxLength(64)]
  484. public string? UpdateUser { get; set; }
  485. public DateTime? UpdateTime { get; set; }
  486. }
  487. public class AdoS0MfgWorkOrderControlUpsertDto
  488. {
  489. public long CompanyRefId { get; set; }
  490. public long FactoryRefId { get; set; }
  491. public string Code { get; set; } = string.Empty;
  492. public string Name { get; set; } = string.Empty;
  493. public string? ControlType { get; set; }
  494. public string? ParamValue { get; set; }
  495. public string? Remark { get; set; }
  496. public bool IsEnabled { get; set; } = true;
  497. }
  498. /// <summary>
  499. /// 工单控制参数设置(WorkOrdControl):按 Domain 查询单记录。
  500. /// </summary>
  501. public class AdoS0WorkOrdControlGetDto
  502. {
  503. [Required(ErrorMessage = "工厂域不能为空")]
  504. [MaxLength(50)]
  505. public string Domain { get; set; } = string.Empty;
  506. }
  507. public class AdoS0WorkOrdControlUpsertDto
  508. {
  509. /// <summary>RecID → Id;存在则按 Id 更新。</summary>
  510. public long? Id { get; set; }
  511. [Required(ErrorMessage = "工厂域不能为空")]
  512. [MaxLength(50)]
  513. public string Domain { get; set; } = string.Empty;
  514. public decimal? EnteringPer { get; set; }
  515. public decimal? PaintingPer { get; set; }
  516. public decimal? IssuedInterval { get; set; }
  517. public bool PostVarsatSFC { get; set; }
  518. public bool IsIssued { get; set; }
  519. public bool IsPrintRejectBarcode { get; set; }
  520. public bool IsPrintScrapBarcode { get; set; }
  521. public bool IsQualityConfirm { get; set; }
  522. public bool IsActive { get; set; } = true;
  523. public bool IsConfirm { get; set; }
  524. [MaxLength(64)]
  525. public string? CreateUser { get; set; }
  526. public DateTime? CreateTime { get; set; }
  527. [MaxLength(64)]
  528. public string? UpdateUser { get; set; }
  529. public DateTime? UpdateTime { get; set; }
  530. }
  531. public class AdoS0MfgMaterialProcessElementUpsertDto
  532. {
  533. public long CompanyRefId { get; set; }
  534. public long FactoryRefId { get; set; }
  535. public long MaterialId { get; set; }
  536. public long OperationId { get; set; }
  537. public long? ProductionLineId { get; set; }
  538. public string? ElementType { get; set; }
  539. public string? ElementCode { get; set; }
  540. public string? ElementName { get; set; }
  541. public long ElementParamId { get; set; }
  542. public string? ParamValue { get; set; }
  543. public bool IsKeyElement { get; set; }
  544. public string? Remark { get; set; }
  545. public bool IsEnabled { get; set; } = true;
  546. }
  547. public class AdoS0MfgSopDocumentUpsertDto
  548. {
  549. [Required(ErrorMessage = "工厂域不能为空")]
  550. [MaxLength(50)]
  551. public string Domain { get; set; } = string.Empty;
  552. [MaxLength(100)]
  553. public string? Line { get; set; }
  554. [MaxLength(100)]
  555. public string? ItemNum { get; set; }
  556. [MaxLength(100)]
  557. public string? Op { get; set; }
  558. [MaxLength(100)]
  559. public string? ImageTypeID { get; set; }
  560. [MaxLength(1000)]
  561. public string? Path { get; set; }
  562. [MaxLength(255)]
  563. public string? Descr { get; set; }
  564. [MaxLength(50)]
  565. public string? Rev { get; set; }
  566. public int? SortID { get; set; }
  567. }
  568. #endregion
  569. #region 聚合 Upsert(步骤 9)
  570. /// <summary>标准 BOM 行维护 Upsert(含多工序号,对应 ProductStructureOp)。</summary>
  571. public class AdoS0ProductStructureUpsertDto
  572. {
  573. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  574. public long CompanyRefId { get; set; }
  575. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  576. public long FactoryRefId { get; set; }
  577. [Range(1, long.MaxValue, ErrorMessage = "父项物料不能为空")]
  578. public long ParentMaterialId { get; set; }
  579. [Range(1, long.MaxValue, ErrorMessage = "子项物料不能为空")]
  580. public long ComponentMaterialId { get; set; }
  581. public decimal Qty { get; set; } = 1m;
  582. public string? UM { get; set; }
  583. public decimal Scrap { get; set; }
  584. public decimal QtyConsumed { get; set; }
  585. public int? LineOp { get; set; }
  586. public string? Refs { get; set; }
  587. public string? Remark { get; set; }
  588. public DateTime? StartEff { get; set; }
  589. public DateTime? EndEff { get; set; }
  590. public string? StructureType { get; set; }
  591. public bool IsEnabled { get; set; } = true;
  592. /// <summary>多工序号(去重排序后落 ProductStructureOp)。</summary>
  593. public List<int> OpNos { get; set; } = new();
  594. }
  595. /// <summary>标准工艺路线明细行(RoutingOpDetail 复刻)Upsert。</summary>
  596. public class AdoS0MfgRoutingOpDetailUpsertDto
  597. {
  598. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  599. public long CompanyRefId { get; set; }
  600. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  601. public long FactoryRefId { get; set; }
  602. [Required(ErrorMessage = "工艺路线编码不能为空")]
  603. public string RouteCode { get; set; } = string.Empty;
  604. [Required(ErrorMessage = "工艺路线名称不能为空")]
  605. public string RouteName { get; set; } = string.Empty;
  606. [Required(ErrorMessage = "物料编码不能为空")]
  607. public string MaterialCode { get; set; } = string.Empty;
  608. [Required(ErrorMessage = "工序编码不能为空")]
  609. public string OperationCode { get; set; } = string.Empty;
  610. public string? OperationDescription { get; set; }
  611. public string? WorkCenterCode { get; set; }
  612. public string? MilestoneOperation { get; set; }
  613. public string? Ufld1 { get; set; }
  614. public string? Ufld2 { get; set; }
  615. public decimal? UDeci1 { get; set; }
  616. public string? Ufld3 { get; set; }
  617. public string? Ufld4 { get; set; }
  618. public string? Ufld5 { get; set; }
  619. public decimal? UDeci2 { get; set; }
  620. public string? Ufld6 { get; set; }
  621. public string? Ufld7 { get; set; }
  622. public string? Ufld8 { get; set; }
  623. public decimal? UDeci3 { get; set; }
  624. public string? Ufld9 { get; set; }
  625. public decimal? UDeci4 { get; set; }
  626. public decimal? UDeci5 { get; set; }
  627. public string? SupplierCode { get; set; }
  628. public int OutsourcedLeadTime { get; set; }
  629. public int SortNo { get; set; }
  630. public bool IsEnabled { get; set; } = true;
  631. public bool IsConfirm { get; set; }
  632. public int? CommentIndex { get; set; }
  633. public string? CreateUser { get; set; }
  634. public string? UpdateUser { get; set; }
  635. }
  636. public class AdoS0MfgLinePostSkillUpsertDto
  637. {
  638. public long? Id { get; set; }
  639. [Range(1, long.MaxValue, ErrorMessage = "人员技能不能为空")]
  640. public long PersonSkillId { get; set; }
  641. public string? RequiredLevel { get; set; }
  642. public string? Remark { get; set; }
  643. public DateTime? EffectiveDate { get; set; }
  644. public bool IsEnabled { get; set; } = true;
  645. }
  646. public class AdoS0MfgLinePostUpsertDto
  647. {
  648. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  649. public long CompanyRefId { get; set; }
  650. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  651. public long FactoryRefId { get; set; }
  652. [Required(ErrorMessage = "线体岗位编码不能为空")]
  653. public string Code { get; set; } = string.Empty;
  654. [Required(ErrorMessage = "线体岗位名称不能为空")]
  655. public string Name { get; set; } = string.Empty;
  656. public long? ProductionLineId { get; set; }
  657. public string? Remark { get; set; }
  658. public bool IsEnabled { get; set; } = true;
  659. public List<AdoS0MfgLinePostSkillUpsertDto> Skills { get; set; } = new();
  660. }
  661. /// <summary>
  662. /// 产线岗位维护(LineSkillMaster):列表查询
  663. /// </summary>
  664. public class AdoS0LineSkillMasterQueryDto
  665. {
  666. [Required(ErrorMessage = "工厂域不能为空")]
  667. [MaxLength(50)]
  668. public string Domain { get; set; } = string.Empty;
  669. /// <summary>匹配生产线/岗位编码/岗位描述</summary>
  670. public string? Keyword { get; set; }
  671. public int Page { get; set; } = 1;
  672. public int PageSize { get; set; } = 20;
  673. }
  674. public class AdoS0LineSkillDetailUpsertDto
  675. {
  676. [Range(1, long.MaxValue, ErrorMessage = "人员技能不能为空")]
  677. public long PersonSkillId { get; set; }
  678. public string? RequiredLevel { get; set; }
  679. public string? Remark { get; set; }
  680. public DateTime? EffectiveDate { get; set; }
  681. public bool IsEnabled { get; set; } = true;
  682. }
  683. public class AdoS0LineSkillMasterUpsertDto
  684. {
  685. [Required(ErrorMessage = "工厂域不能为空")]
  686. [MaxLength(50)]
  687. public string Domain { get; set; } = string.Empty;
  688. [Required(ErrorMessage = "生产线不能为空")]
  689. [MaxLength(100)]
  690. public string ProdLine { get; set; } = string.Empty;
  691. [Required(ErrorMessage = "岗位编码不能为空")]
  692. [MaxLength(100)]
  693. public string JOBNo { get; set; } = string.Empty;
  694. [MaxLength(255)]
  695. public string? JOBDescr { get; set; }
  696. [MaxLength(64)]
  697. public string? CreateUser { get; set; }
  698. public DateTime? CreateTime { get; set; }
  699. [MaxLength(64)]
  700. public string? UpdateUser { get; set; }
  701. public DateTime? UpdateTime { get; set; }
  702. public List<AdoS0LineSkillDetailUpsertDto> Skills { get; set; } = new();
  703. }
  704. public class AdoS0ProcessFlowCardQueryDto : AdoS0MfgPagedQueryBase
  705. {
  706. public string? DomainCode { get; set; }
  707. public string? WorkOrderNo { get; set; }
  708. public string? FlowCardNo { get; set; }
  709. public string? ItemNum { get; set; }
  710. public bool? IsActive { get; set; }
  711. }
  712. public class AdoS0ProcessFlowCardUpsertDto
  713. {
  714. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  715. public long CompanyRefId { get; set; }
  716. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  717. public long FactoryRefId { get; set; }
  718. [MaxLength(50)]
  719. public string? DomainCode { get; set; }
  720. [Required(ErrorMessage = "工单不能为空")]
  721. [MaxLength(100)]
  722. public string WorkOrderNo { get; set; } = string.Empty;
  723. [MaxLength(100)]
  724. public string? WorkOrderBatchNo { get; set; }
  725. [Required(ErrorMessage = "流转卡号不能为空")]
  726. [MaxLength(100)]
  727. public string FlowCardNo { get; set; } = string.Empty;
  728. [MaxLength(100)]
  729. public string? Nature { get; set; }
  730. [Required(ErrorMessage = "物料编码不能为空")]
  731. [MaxLength(100)]
  732. public string ItemNum { get; set; } = string.Empty;
  733. [MaxLength(200)]
  734. public string? ItemName { get; set; }
  735. [MaxLength(100)]
  736. public string? DrawingNo { get; set; }
  737. [MaxLength(50)]
  738. public string? BomVersion { get; set; }
  739. [MaxLength(100)]
  740. public string? RoutingCode { get; set; }
  741. [MaxLength(500)]
  742. public string? Remarks { get; set; }
  743. public bool IsActive { get; set; } = true;
  744. public string? CreateUser { get; set; }
  745. public string? UpdateUser { get; set; }
  746. }
  747. public class AdoS0ProcessFlowCardToggleActiveDto
  748. {
  749. public bool IsEnabled { get; set; }
  750. }
  751. public class AdoS0OrderScheduleCycleQueryDto : AdoS0MfgPagedQueryBase
  752. {
  753. public string? DomainCode { get; set; }
  754. public string? OrderType { get; set; }
  755. public bool? IsActive { get; set; }
  756. }
  757. public class AdoS0OrderScheduleCycleUpsertDto
  758. {
  759. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  760. public long CompanyRefId { get; set; }
  761. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  762. public long FactoryRefId { get; set; }
  763. [MaxLength(50)]
  764. public string? DomainCode { get; set; }
  765. /// <summary>订单类型;留空表示默认/不限。</summary>
  766. [MaxLength(100)]
  767. public string? OrderType { get; set; }
  768. [Range(0, int.MaxValue, ErrorMessage = "标准时长不能为负")]
  769. public int StdHours { get; set; }
  770. [MaxLength(500)]
  771. public string? Remarks { get; set; }
  772. public bool IsActive { get; set; } = true;
  773. public string? CreateUser { get; set; }
  774. public string? UpdateUser { get; set; }
  775. }
  776. public class AdoS0OrderScheduleCycleToggleActiveDto
  777. {
  778. public bool IsEnabled { get; set; }
  779. }
  780. #endregion