AdoS0ManufacturingDtos.cs 31 KB

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