AdoS0ManufacturingDtos.cs 33 KB

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