AdoS0ManufacturingDtos.cs 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017
  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. [Required(ErrorMessage = "工厂域不能为空")]
  440. [MaxLength(50)]
  441. public string Domain { get; set; } = string.Empty;
  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):按 Domain 查询单记录。
  520. /// </summary>
  521. public class AdoS0WorkOrdControlGetDto
  522. {
  523. [Required(ErrorMessage = "工厂域不能为空")]
  524. [MaxLength(50)]
  525. public string Domain { get; set; } = string.Empty;
  526. }
  527. public class AdoS0WorkOrdControlUpsertDto
  528. {
  529. /// <summary>RecID → Id;存在则按 Id 更新。</summary>
  530. public long? Id { get; set; }
  531. [Required(ErrorMessage = "工厂域不能为空")]
  532. [MaxLength(50)]
  533. public string Domain { get; set; } = string.Empty;
  534. public decimal? EnteringPer { get; set; }
  535. public decimal? PaintingPer { get; set; }
  536. public decimal? IssuedInterval { get; set; }
  537. public bool PostVarsatSFC { get; set; }
  538. public bool IsIssued { get; set; }
  539. public bool IsPrintRejectBarcode { get; set; }
  540. public bool IsPrintScrapBarcode { get; set; }
  541. public bool IsQualityConfirm { get; set; }
  542. public bool IsActive { get; set; } = true;
  543. public bool IsConfirm { get; set; }
  544. [MaxLength(64)]
  545. public string? CreateUser { get; set; }
  546. public DateTime? CreateTime { get; set; }
  547. [MaxLength(64)]
  548. public string? UpdateUser { get; set; }
  549. public DateTime? UpdateTime { get; set; }
  550. }
  551. public class AdoS0MfgMaterialProcessElementUpsertDto
  552. {
  553. public long CompanyRefId { get; set; }
  554. public long FactoryRefId { get; set; }
  555. public long MaterialId { get; set; }
  556. public long OperationId { get; set; }
  557. public long? ProductionLineId { get; set; }
  558. public string? ElementType { get; set; }
  559. public string? ElementCode { get; set; }
  560. public string? ElementName { get; set; }
  561. public long ElementParamId { get; set; }
  562. public string? ParamValue { get; set; }
  563. public bool IsKeyElement { get; set; }
  564. public string? Remark { get; set; }
  565. public bool IsEnabled { get; set; } = true;
  566. }
  567. public class AdoS0MfgSopDocumentUpsertDto
  568. {
  569. [Required(ErrorMessage = "工厂域不能为空")]
  570. [MaxLength(50)]
  571. public string Domain { get; set; } = string.Empty;
  572. [MaxLength(100)]
  573. public string? Line { get; set; }
  574. [MaxLength(100)]
  575. public string? ItemNum { get; set; }
  576. [MaxLength(100)]
  577. public string? Op { get; set; }
  578. [MaxLength(100)]
  579. public string? ImageTypeID { get; set; }
  580. [MaxLength(1000)]
  581. public string? Path { get; set; }
  582. [MaxLength(255)]
  583. public string? Descr { get; set; }
  584. [MaxLength(50)]
  585. public string? Rev { get; set; }
  586. public int? SortID { get; set; }
  587. }
  588. #endregion
  589. #region 聚合 Upsert(步骤 9)
  590. /// <summary>标准 BOM 行维护 Upsert(含多工序号,对应 ProductStructureOp)。</summary>
  591. public class AdoS0ProductStructureUpsertDto
  592. {
  593. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  594. public long CompanyRefId { get; set; }
  595. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  596. public long FactoryRefId { get; set; }
  597. [Range(1, long.MaxValue, ErrorMessage = "父项物料不能为空")]
  598. public long ParentMaterialId { get; set; }
  599. [Range(1, long.MaxValue, ErrorMessage = "子项物料不能为空")]
  600. public long ComponentMaterialId { get; set; }
  601. public decimal Qty { get; set; } = 1m;
  602. public string? UM { get; set; }
  603. public decimal Scrap { get; set; }
  604. public decimal QtyConsumed { get; set; }
  605. public int? LineOp { get; set; }
  606. public string? Refs { get; set; }
  607. public string? Remark { get; set; }
  608. public DateTime? StartEff { get; set; }
  609. public DateTime? EndEff { get; set; }
  610. public string? StructureType { get; set; }
  611. public bool IsEnabled { get; set; } = true;
  612. /// <summary>多工序号(去重排序后落 ProductStructureOp)。</summary>
  613. public List<int> OpNos { get; set; } = new();
  614. }
  615. /// <summary>标准工艺路线明细行(RoutingOpDetail 复刻)Upsert。</summary>
  616. public class AdoS0MfgRoutingOpDetailUpsertDto
  617. {
  618. // 行级工艺路线(legacy RoutingOpDetail 复刻)不建模组织作用域:全表 company/factory 多为 0,
  619. // 前端已不展示公司/工厂,故此处放行 0,按原值透传,不强制非零。
  620. public long CompanyRefId { get; set; }
  621. public long FactoryRefId { get; set; }
  622. [Required(ErrorMessage = "工艺路线编码不能为空")]
  623. public string RouteCode { get; set; } = string.Empty;
  624. [Required(ErrorMessage = "工艺路线名称不能为空")]
  625. public string RouteName { get; set; } = string.Empty;
  626. [Required(ErrorMessage = "物料编码不能为空")]
  627. public string MaterialCode { get; set; } = string.Empty;
  628. [Required(ErrorMessage = "工序编码不能为空")]
  629. public string OperationCode { get; set; } = string.Empty;
  630. public string? OperationDescription { get; set; }
  631. public string? WorkCenterCode { get; set; }
  632. public string? MilestoneOperation { get; set; }
  633. public string? Ufld1 { get; set; }
  634. public string? Ufld2 { get; set; }
  635. public decimal? UDeci1 { get; set; }
  636. public string? Ufld3 { get; set; }
  637. public string? Ufld4 { get; set; }
  638. public string? Ufld5 { get; set; }
  639. public decimal? UDeci2 { get; set; }
  640. public string? Ufld6 { get; set; }
  641. public string? Ufld7 { get; set; }
  642. public string? Ufld8 { get; set; }
  643. public decimal? UDeci3 { get; set; }
  644. public string? Ufld9 { get; set; }
  645. public decimal? UDeci4 { get; set; }
  646. public decimal? UDeci5 { get; set; }
  647. public string? SupplierCode { get; set; }
  648. public int OutsourcedLeadTime { get; set; }
  649. public int SortNo { get; set; }
  650. public bool IsEnabled { get; set; } = true;
  651. public bool IsConfirm { get; set; }
  652. public int? CommentIndex { get; set; }
  653. public string? CreateUser { get; set; }
  654. public string? UpdateUser { get; set; }
  655. }
  656. /// <summary>
  657. /// 产线岗位维护(LineSkillMaster):列表查询。
  658. /// Domain 为旧系统遗留字段,仅在请求显式传入时按相等过滤;新系统数据隔离以 ITenantIdFilter 为准。
  659. /// </summary>
  660. public class AdoS0LineSkillMasterQueryDto
  661. {
  662. /// <summary>旧系统遗留字段;不传或空字符串时不参与过滤。</summary>
  663. [MaxLength(50)]
  664. public string? Domain { get; set; }
  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(12)]
  693. public string? Site { get; set; }
  694. public int? Orderby { get; set; }
  695. [MaxLength(20)]
  696. public string? WType { get; set; }
  697. public decimal? RunCrew { get; set; }
  698. [MaxLength(64)]
  699. public string? CreateUser { get; set; }
  700. public DateTime? CreateTime { get; set; }
  701. [MaxLength(64)]
  702. public string? UpdateUser { get; set; }
  703. public DateTime? UpdateTime { get; set; }
  704. public List<AdoS0LineSkillDetailUpsertDto> Skills { get; set; } = new();
  705. }
  706. public class AdoS0ProcessFlowCardQueryDto : AdoS0MfgPagedQueryBase
  707. {
  708. public string? DomainCode { get; set; }
  709. public string? WorkOrderNo { get; set; }
  710. public string? FlowCardNo { get; set; }
  711. public string? ItemNum { get; set; }
  712. public bool? IsActive { get; set; }
  713. }
  714. public class AdoS0ProcessFlowCardUpsertDto
  715. {
  716. /// <summary>
  717. /// 公司。**服务端忽略**:新增由 AdoS0ProcessFlowCardsController.ResolveDefaultOrgAsync(tenantId)
  718. /// 在当前租户内解析后强制 stamp,编辑由 IgnoreColumns pin 既有原值。
  719. /// 保留字段仅为 payload 向后兼容(前端 useS0MfgOrgScope 仍会带值),不做校验——
  720. /// 原 [Range(1, long.MaxValue)] 是失效前置门:值不参与落库,却会在模型绑定阶段
  721. /// 把"租户未配置机构"误报成"公司不能为空",故移除。
  722. /// </summary>
  723. public long CompanyRefId { get; set; }
  724. /// <summary>工厂。**服务端忽略**,同 <see cref="CompanyRefId"/>。</summary>
  725. public long FactoryRefId { get; set; }
  726. [MaxLength(50)]
  727. public string? DomainCode { get; set; }
  728. [Required(ErrorMessage = "工单不能为空")]
  729. [MaxLength(100)]
  730. public string WorkOrderNo { get; set; } = string.Empty;
  731. [MaxLength(100)]
  732. public string? WorkOrderBatchNo { get; set; }
  733. [Required(ErrorMessage = "流转卡号不能为空")]
  734. [MaxLength(100)]
  735. public string FlowCardNo { get; set; } = string.Empty;
  736. [MaxLength(100)]
  737. public string? Nature { get; set; }
  738. [Required(ErrorMessage = "物料编码不能为空")]
  739. [MaxLength(100)]
  740. public string ItemNum { get; set; } = string.Empty;
  741. [MaxLength(200)]
  742. public string? ItemName { get; set; }
  743. [MaxLength(100)]
  744. public string? DrawingNo { get; set; }
  745. [MaxLength(50)]
  746. public string? BomVersion { get; set; }
  747. [MaxLength(100)]
  748. public string? RoutingCode { get; set; }
  749. [MaxLength(500)]
  750. public string? Remarks { get; set; }
  751. public bool IsActive { get; set; } = true;
  752. public string? CreateUser { get; set; }
  753. public string? UpdateUser { get; set; }
  754. }
  755. public class AdoS0ProcessFlowCardToggleActiveDto
  756. {
  757. public bool IsEnabled { get; set; }
  758. }
  759. public class AdoS0OrderScheduleCycleQueryDto : AdoS0MfgPagedQueryBase
  760. {
  761. public string? DomainCode { get; set; }
  762. public string? OrderType { get; set; }
  763. public bool? IsActive { get; set; }
  764. }
  765. public class AdoS0OrderScheduleCycleUpsertDto
  766. {
  767. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  768. public long CompanyRefId { get; set; }
  769. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  770. public long FactoryRefId { get; set; }
  771. [MaxLength(50)]
  772. public string? DomainCode { get; set; }
  773. /// <summary>订单类型;留空表示默认/不限。</summary>
  774. [MaxLength(100)]
  775. public string? OrderType { get; set; }
  776. [Range(0, int.MaxValue, ErrorMessage = "标准时长不能为负")]
  777. public int StdHours { get; set; }
  778. [MaxLength(500)]
  779. public string? Remarks { get; set; }
  780. public bool IsActive { get; set; } = true;
  781. public string? CreateUser { get; set; }
  782. public string? UpdateUser { get; set; }
  783. }
  784. public class AdoS0OrderScheduleCycleToggleActiveDto
  785. {
  786. public bool IsEnabled { get; set; }
  787. }
  788. #endregion