AdoS0ManufacturingDtos.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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. public class AdoS0MfgStandardOperationQueryDto : AdoS0MfgPagedQueryBase
  21. {
  22. public string? Name { get; set; }
  23. }
  24. public class AdoS0MfgProductionLineQueryDto : AdoS0MfgPagedQueryBase
  25. {
  26. public string? Line { get; set; }
  27. public long? LocationId { get; set; }
  28. }
  29. public class AdoS0MfgPreprocessElementQueryDto : AdoS0MfgPagedQueryBase
  30. {
  31. public string? MaterialCode { get; set; }
  32. public string? MaterialName { get; set; }
  33. public string? ElementCode { get; set; }
  34. }
  35. public class AdoS0MfgMaterialProcessElementQueryDto : AdoS0MfgPagedQueryBase
  36. {
  37. public string? MaterialCode { get; set; }
  38. public string? MaterialName { get; set; }
  39. public string? ElementType { get; set; }
  40. public string? ElementCode { get; set; }
  41. }
  42. public class AdoS0MfgSopDocumentQueryDto : AdoS0MfgPagedQueryBase
  43. {
  44. public long? ProductionLineId { get; set; }
  45. public string? MaterialCode { get; set; }
  46. }
  47. /// <summary>列表须支持 elementCategory 过滤(§7 / 附录 F)。</summary>
  48. public class AdoS0MfgElementParamQueryDto : AdoS0MfgPagedQueryBase
  49. {
  50. public string? ElementCategory { get; set; }
  51. }
  52. #endregion
  53. #region 仅 PagedQuery 等价的列表 Query
  54. public class AdoS0MfgBomQueryDto : AdoS0MfgPagedQueryBase;
  55. public class AdoS0MfgRoutingQueryDto : AdoS0MfgPagedQueryBase;
  56. public class AdoS0MfgLinePostQueryDto : AdoS0MfgPagedQueryBase;
  57. public class AdoS0MfgPersonSkillQueryDto : AdoS0MfgPagedQueryBase;
  58. public class AdoS0MfgPersonSkillAssignmentQueryDto : AdoS0MfgPagedQueryBase;
  59. public class AdoS0MfgMaterialSubstitutionQueryDto : AdoS0MfgPagedQueryBase;
  60. public class AdoS0MfgWorkOrderControlQueryDto : AdoS0MfgPagedQueryBase;
  61. public class AdoS0MfgWorkCenterQueryDto : AdoS0MfgPagedQueryBase;
  62. public class AdoS0MfgLineMaterialQueryDto : AdoS0MfgPagedQueryBase;
  63. public class AdoS0MfgSopFileTypeQueryDto : AdoS0MfgPagedQueryBase;
  64. public class AdoS0MfgPreprocessElementParamQueryDto : AdoS0MfgPagedQueryBase
  65. {
  66. public long? PreprocessElementId { get; set; }
  67. }
  68. #endregion
  69. #region 标准资源 Upsert(12 个非聚合)
  70. public class AdoS0MfgStandardOperationUpsertDto
  71. {
  72. public long CompanyRefId { get; set; }
  73. public long FactoryRefId { get; set; }
  74. public string Code { get; set; } = string.Empty;
  75. public string Name { get; set; } = string.Empty;
  76. public bool IsKeyOperation { get; set; }
  77. public string? OperationType { get; set; }
  78. public decimal? StdTime { get; set; }
  79. public string? Remark { get; set; }
  80. public bool IsEnabled { get; set; } = true;
  81. }
  82. public class AdoS0MfgProductionLineUpsertDto
  83. {
  84. public long CompanyRefId { get; set; }
  85. public long FactoryRefId { get; set; }
  86. public string Code { get; set; } = string.Empty;
  87. public string Name { get; set; } = string.Empty;
  88. public string? LineType { get; set; }
  89. public string? LineCategory { get; set; }
  90. public long? LocationId { get; set; }
  91. public long? WorkshopId { get; set; }
  92. public decimal? Capacity { get; set; }
  93. public string? Remark { get; set; }
  94. public bool IsEnabled { get; set; } = true;
  95. }
  96. public class AdoS0MfgSopFileTypeUpsertDto
  97. {
  98. public long CompanyRefId { get; set; }
  99. public long FactoryRefId { get; set; }
  100. public string Code { get; set; } = string.Empty;
  101. public string Name { get; set; } = string.Empty;
  102. public string? Remark { get; set; }
  103. public bool IsEnabled { get; set; } = true;
  104. }
  105. public class AdoS0MfgElementParamUpsertDto
  106. {
  107. public long CompanyRefId { get; set; }
  108. public long FactoryRefId { get; set; }
  109. public string? ElementCode { get; set; }
  110. public string? ElementName { get; set; }
  111. public string? ElementCategory { get; set; }
  112. public string Code { get; set; } = string.Empty;
  113. public string Name { get; set; } = string.Empty;
  114. public string? ParamType { get; set; }
  115. public string? Unit { get; set; }
  116. public string? StdValue { get; set; }
  117. public decimal? UpperLimit { get; set; }
  118. public decimal? LowerLimit { get; set; }
  119. public string? EnumOptions { get; set; }
  120. public string? Remark { get; set; }
  121. public bool IsEnabled { get; set; } = true;
  122. }
  123. public class AdoS0MfgPersonSkillUpsertDto
  124. {
  125. public long CompanyRefId { get; set; }
  126. public long FactoryRefId { get; set; }
  127. public string Code { get; set; } = string.Empty;
  128. public string Name { get; set; } = string.Empty;
  129. public string? SkillLevel { get; set; }
  130. public string? Remark { get; set; }
  131. public bool IsEnabled { get; set; } = true;
  132. }
  133. public class AdoS0MfgPersonSkillAssignmentUpsertDto
  134. {
  135. public long CompanyRefId { get; set; }
  136. public long FactoryRefId { get; set; }
  137. public string PersonCode { get; set; } = string.Empty;
  138. public string? WorkGroup { get; set; }
  139. public long SkillId { get; set; }
  140. public int SkillLevel { get; set; }
  141. public decimal ProductionEfficiency { get; set; } = 1m;
  142. public string? Remark { get; set; }
  143. public bool IsEnabled { get; set; } = true;
  144. }
  145. public class AdoS0MfgWorkCenterUpsertDto
  146. {
  147. public long CompanyRefId { get; set; }
  148. public long FactoryRefId { get; set; }
  149. public string Code { get; set; } = string.Empty;
  150. public string Name { get; set; } = string.Empty;
  151. public string? CenterType { get; set; }
  152. public decimal? Capacity { get; set; }
  153. public long? DepartmentId { get; set; }
  154. public string? Remark { get; set; }
  155. public bool IsEnabled { get; set; } = true;
  156. }
  157. public class AdoS0MfgLineMaterialUpsertDto
  158. {
  159. public long CompanyRefId { get; set; }
  160. public long FactoryRefId { get; set; }
  161. public long? ProductionLineId { get; set; }
  162. public long MaterialId { get; set; }
  163. public long? OperationId { get; set; }
  164. public long? WorkCenterId { get; set; }
  165. public string? EquipmentCode { get; set; }
  166. public decimal? StdCapacityPerUnit { get; set; }
  167. public decimal? ChangeoverTime { get; set; }
  168. public string? EquipmentTypeCode { get; set; }
  169. public string? MoldTypeCode { get; set; }
  170. public string? RequiredSkillCode { get; set; }
  171. public string? MaterialRole { get; set; }
  172. public string? Remark { get; set; }
  173. public bool IsEnabled { get; set; } = true;
  174. }
  175. public class AdoS0MfgMaterialSubstitutionUpsertDto
  176. {
  177. public long CompanyRefId { get; set; }
  178. public long FactoryRefId { get; set; }
  179. public long MaterialId { get; set; }
  180. public long SubstituteMaterialId { get; set; }
  181. public decimal SubstituteRatio { get; set; } = 1m;
  182. public int Priority { get; set; }
  183. public long? ParentMaterialId { get; set; }
  184. public string? Remark { get; set; }
  185. public bool IsEnabled { get; set; } = true;
  186. }
  187. public class AdoS0MfgWorkOrderControlUpsertDto
  188. {
  189. public long CompanyRefId { get; set; }
  190. public long FactoryRefId { get; set; }
  191. public string Code { get; set; } = string.Empty;
  192. public string Name { get; set; } = string.Empty;
  193. public string? ControlType { get; set; }
  194. public string? ParamValue { get; set; }
  195. public string? Remark { get; set; }
  196. public bool IsEnabled { get; set; } = true;
  197. }
  198. public class AdoS0MfgMaterialProcessElementUpsertDto
  199. {
  200. public long CompanyRefId { get; set; }
  201. public long FactoryRefId { get; set; }
  202. public long MaterialId { get; set; }
  203. public long OperationId { get; set; }
  204. public long? ProductionLineId { get; set; }
  205. public string? ElementType { get; set; }
  206. public string? ElementCode { get; set; }
  207. public string? ElementName { get; set; }
  208. public long ElementParamId { get; set; }
  209. public string? ParamValue { get; set; }
  210. public bool IsKeyElement { get; set; }
  211. public string? Remark { get; set; }
  212. public bool IsEnabled { get; set; } = true;
  213. }
  214. public class AdoS0MfgSopDocumentUpsertDto
  215. {
  216. public long CompanyRefId { get; set; }
  217. public long FactoryRefId { get; set; }
  218. public string Code { get; set; } = string.Empty;
  219. public string Name { get; set; } = string.Empty;
  220. public long? ProductionLineId { get; set; }
  221. public long SopFileTypeId { get; set; }
  222. public long? MaterialId { get; set; }
  223. public long? OperationId { get; set; }
  224. public string? FileVersion { get; set; }
  225. public long? FileId { get; set; }
  226. public string DocStatus { get; set; } = "draft";
  227. public string? Remark { get; set; }
  228. public bool IsEnabled { get; set; } = true;
  229. }
  230. public class AdoS0MfgPreprocessElementParamUpsertDto
  231. {
  232. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  233. public long CompanyRefId { get; set; }
  234. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  235. public long FactoryRefId { get; set; }
  236. [Range(1, long.MaxValue, ErrorMessage = "前处理要素不能为空")]
  237. public long PreprocessElementId { get; set; }
  238. [Range(1, long.MaxValue, ErrorMessage = "生产要素参数不能为空")]
  239. public long ElementParamId { get; set; }
  240. public string? ParamValue { get; set; }
  241. public int SortNo { get; set; }
  242. public string? Remark { get; set; }
  243. public bool IsEnabled { get; set; } = true;
  244. }
  245. #endregion
  246. #region 聚合 Upsert(步骤 9)
  247. public class AdoS0MfgBomItemUpsertDto
  248. {
  249. public long? Id { get; set; }
  250. [Range(1, long.MaxValue, ErrorMessage = "子项物料不能为空")]
  251. public long MaterialId { get; set; }
  252. public decimal Qty { get; set; } = 1m;
  253. public decimal QtyNumerator { get; set; } = 1m;
  254. public decimal QtyDenominator { get; set; } = 1m;
  255. public decimal LossRate { get; set; }
  256. public decimal FixedLossQty { get; set; }
  257. public long? OperationId { get; set; }
  258. public bool IsPhantom { get; set; }
  259. public string? Unit { get; set; }
  260. public int SortNo { get; set; }
  261. public string? Remark { get; set; }
  262. public bool IsEnabled { get; set; } = true;
  263. }
  264. public class AdoS0MfgBomUpsertDto
  265. {
  266. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  267. public long CompanyRefId { get; set; }
  268. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  269. public long FactoryRefId { get; set; }
  270. [Required(ErrorMessage = "BOM 编码不能为空")]
  271. public string Code { get; set; } = string.Empty;
  272. [Required(ErrorMessage = "BOM 名称不能为空")]
  273. public string Name { get; set; } = string.Empty;
  274. public long? MaterialId { get; set; }
  275. public string BizVersion { get; set; } = "1.0";
  276. public string DocStatus { get; set; } = "draft";
  277. public string? Remark { get; set; }
  278. public bool IsEnabled { get; set; } = true;
  279. public List<AdoS0MfgBomItemUpsertDto> Items { get; set; } = new();
  280. }
  281. public class AdoS0MfgRoutingOperationUpsertDto
  282. {
  283. public long? Id { get; set; }
  284. [Range(1, long.MaxValue, ErrorMessage = "工序不能为空")]
  285. public long OperationId { get; set; }
  286. public int SortNo { get; set; }
  287. public long? WorkCenterId { get; set; }
  288. public long? ProductionLineId { get; set; }
  289. public decimal? StdTime { get; set; }
  290. public string? Remark { get; set; }
  291. public bool IsReportOperation { get; set; }
  292. public string? Activity1 { get; set; }
  293. public decimal? Activity1Qty { get; set; }
  294. public string? Activity1Unit { get; set; }
  295. public string? Activity2 { get; set; }
  296. public decimal? Activity2Qty { get; set; }
  297. public string? Activity2Unit { get; set; }
  298. public string? Activity3 { get; set; }
  299. public decimal? Activity3Qty { get; set; }
  300. public string? Activity3Unit { get; set; }
  301. public decimal BaseQty { get; set; } = 1m;
  302. public bool IsOutsourced { get; set; }
  303. public long? SupplierId { get; set; }
  304. public int OutsourcedLeadTime { get; set; }
  305. public bool IsEnabled { get; set; } = true;
  306. }
  307. public class AdoS0MfgRoutingUpsertDto
  308. {
  309. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  310. public long CompanyRefId { get; set; }
  311. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  312. public long FactoryRefId { get; set; }
  313. [Required(ErrorMessage = "工艺路线编码不能为空")]
  314. public string Code { get; set; } = string.Empty;
  315. [Required(ErrorMessage = "工艺路线名称不能为空")]
  316. public string Name { get; set; } = string.Empty;
  317. public long? MaterialId { get; set; }
  318. public string BizVersion { get; set; } = "1.0";
  319. public string DocStatus { get; set; } = "draft";
  320. public string? Remark { get; set; }
  321. public bool IsEnabled { get; set; } = true;
  322. public List<AdoS0MfgRoutingOperationUpsertDto> Operations { get; set; } = new();
  323. }
  324. public class AdoS0MfgLinePostSkillUpsertDto
  325. {
  326. public long? Id { get; set; }
  327. [Range(1, long.MaxValue, ErrorMessage = "人员技能不能为空")]
  328. public long PersonSkillId { get; set; }
  329. public string? RequiredLevel { get; set; }
  330. public string? Remark { get; set; }
  331. public DateTime? EffectiveDate { get; set; }
  332. public bool IsEnabled { get; set; } = true;
  333. }
  334. public class AdoS0MfgLinePostUpsertDto
  335. {
  336. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  337. public long CompanyRefId { get; set; }
  338. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  339. public long FactoryRefId { get; set; }
  340. [Required(ErrorMessage = "线体岗位编码不能为空")]
  341. public string Code { get; set; } = string.Empty;
  342. [Required(ErrorMessage = "线体岗位名称不能为空")]
  343. public string Name { get; set; } = string.Empty;
  344. public long? ProductionLineId { get; set; }
  345. public string? Remark { get; set; }
  346. public bool IsEnabled { get; set; } = true;
  347. public List<AdoS0MfgLinePostSkillUpsertDto> Skills { get; set; } = new();
  348. }
  349. public class AdoS0MfgPreprocessElementParamLineUpsertDto
  350. {
  351. public long? Id { get; set; }
  352. [Range(1, long.MaxValue, ErrorMessage = "生产要素参数不能为空")]
  353. public long ElementParamId { get; set; }
  354. public string? ParamValue { get; set; }
  355. public int SortNo { get; set; }
  356. public string? Remark { get; set; }
  357. public bool IsEnabled { get; set; } = true;
  358. }
  359. public class AdoS0MfgPreprocessElementUpsertDto
  360. {
  361. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  362. public long CompanyRefId { get; set; }
  363. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  364. public long FactoryRefId { get; set; }
  365. [Required(ErrorMessage = "前处理要素编码不能为空")]
  366. public string Code { get; set; } = string.Empty;
  367. [Required(ErrorMessage = "前处理要素名称不能为空")]
  368. public string Name { get; set; } = string.Empty;
  369. public long? MaterialId { get; set; }
  370. public long? OperationId { get; set; }
  371. public bool IsKeyElement { get; set; }
  372. public string? Remark { get; set; }
  373. public bool IsEnabled { get; set; } = true;
  374. public List<AdoS0MfgPreprocessElementParamLineUpsertDto> Params { get; set; } = new();
  375. }
  376. #endregion