AdoS0SalesDtos.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. namespace Admin.NET.Plugin.AiDOP.Dto.S0.Sales;
  2. public class AdoS0ToggleEnabledDto
  3. {
  4. public bool IsEnabled { get; set; }
  5. }
  6. public class AdoS0ItemSubstituteDetailQueryDto
  7. {
  8. public string? Domain { get; set; }
  9. public string? Keyword { get; set; }
  10. public string? SubstituteType { get; set; }
  11. public int Page { get; set; } = 1;
  12. public int PageSize { get; set; } = 20;
  13. }
  14. /// <summary>
  15. /// 选择替代方案(ic_substitute)只读查询
  16. /// </summary>
  17. public class AdoS0SubstituteSchemeQueryDto
  18. {
  19. /// <summary>源平台 company_id;为空则不按公司过滤。</summary>
  20. public long? CompanyId { get; set; }
  21. /// <summary>源平台 factory_id;为空则不按工厂过滤。</summary>
  22. public long? FactoryId { get; set; }
  23. /// <summary>替代方案编码(模糊匹配)</summary>
  24. public string? SubstituteCode { get; set; }
  25. public int Page { get; set; } = 1;
  26. public int PageSize { get; set; } = 20;
  27. }
  28. public class AdoS0ItemSubstituteDetailUpsertDto
  29. {
  30. [Required(ErrorMessage = "父级物料不能为空")]
  31. public string ParentItem { get; set; } = string.Empty;
  32. [Required(ErrorMessage = "物料编码不能为空")]
  33. public string ItemNum { get; set; } = string.Empty;
  34. [Required(ErrorMessage = "替代物料不能为空")]
  35. public string SubstituteItem { get; set; } = string.Empty;
  36. public decimal? SubstituteQty { get; set; }
  37. public string? SubstituteType { get; set; }
  38. public string? Remark { get; set; }
  39. [Required(ErrorMessage = "工厂域不能为空")]
  40. public string Domain { get; set; } = string.Empty;
  41. public string? CreateUser { get; set; }
  42. public DateTime? CreateTime { get; set; }
  43. public string? UpdateUser { get; set; }
  44. public DateTime? UpdateTime { get; set; }
  45. }
  46. /// <summary>客户主数据启停(CustMaster / IsActive)</summary>
  47. public class AdoS0CustMasterToggleActiveDto
  48. {
  49. public bool IsActive { get; set; }
  50. }
  51. public class AdoS0CustMasterQueryDto
  52. {
  53. public long? CompanyRefId { get; set; }
  54. public long? FactoryRefId { get; set; }
  55. public string? DomainCode { get; set; }
  56. /// <summary>同时匹配客户编码、客户简称</summary>
  57. public string? Keyword { get; set; }
  58. public string? Cust { get; set; }
  59. public string? SortName { get; set; }
  60. public string? Curr { get; set; }
  61. public string? Slspsn1 { get; set; }
  62. public string? ShipTo { get; set; }
  63. public bool? IsActive { get; set; }
  64. public bool? IsConfirm { get; set; }
  65. public int Page { get; set; } = 1;
  66. public int PageSize { get; set; } = 20;
  67. }
  68. public class AdoS0CustMasterUpsertDto
  69. {
  70. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  71. public long CompanyRefId { get; set; }
  72. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  73. public long FactoryRefId { get; set; }
  74. public string? DomainCode { get; set; }
  75. [Required(ErrorMessage = "客户编码不能为空")]
  76. public string Cust { get; set; } = string.Empty;
  77. [Required(ErrorMessage = "客户简称不能为空")]
  78. public string SortName { get; set; } = string.Empty;
  79. public string? CustFullName { get; set; }
  80. public string? Curr { get; set; }
  81. public string? Slspsn1 { get; set; }
  82. public string? Slspsn2 { get; set; }
  83. public string? ShipTo { get; set; }
  84. public string? TaxClass { get; set; }
  85. public bool TaxIn { get; set; } = true;
  86. public string? CustClass { get; set; }
  87. public string? Address { get; set; }
  88. public string? ShippingAddress { get; set; }
  89. public string? Contact { get; set; }
  90. public string? Position { get; set; }
  91. public string? ContactInfo { get; set; }
  92. public string? CreditRating { get; set; }
  93. public string? Remarks { get; set; }
  94. public bool IsActive { get; set; } = true;
  95. public bool IsConfirm { get; set; }
  96. public string? CreateUser { get; set; }
  97. public string? UpdateUser { get; set; }
  98. }
  99. /// <summary>物料主数据启停(ItemMaster / IsActive)</summary>
  100. public class AdoS0ItemMasterToggleActiveDto
  101. {
  102. public bool IsActive { get; set; }
  103. }
  104. public class AdoS0ItemMasterQueryDto
  105. {
  106. public long? CompanyRefId { get; set; }
  107. public long? FactoryRefId { get; set; }
  108. public string? DomainCode { get; set; }
  109. /// <summary>匹配物料编码、物料名称</summary>
  110. public string? Keyword { get; set; }
  111. public string? ItemNum { get; set; }
  112. public string? Descr { get; set; }
  113. public string? Descr1 { get; set; }
  114. public string? ItemType { get; set; }
  115. public string? PurMfg { get; set; }
  116. public string? Location { get; set; }
  117. public string? Status { get; set; }
  118. public bool? IsActive { get; set; }
  119. public bool? IsConfirm { get; set; }
  120. public int Page { get; set; } = 1;
  121. public int PageSize { get; set; } = 20;
  122. }
  123. public class AdoS0ItemMasterUpsertDto
  124. {
  125. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  126. public long CompanyRefId { get; set; }
  127. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  128. public long FactoryRefId { get; set; }
  129. [MaxLength(50)]
  130. public string? DomainCode { get; set; }
  131. [Required(ErrorMessage = "物料编码不能为空")]
  132. [MaxLength(100)]
  133. public string ItemNum { get; set; } = string.Empty;
  134. [Required(ErrorMessage = "物料名称不能为空")]
  135. [MaxLength(200)]
  136. public string Descr { get; set; } = string.Empty;
  137. [MaxLength(200)]
  138. public string? Descr1 { get; set; }
  139. [MaxLength(50)]
  140. public string? PkgCode { get; set; }
  141. [MaxLength(50)]
  142. public string? UM { get; set; }
  143. [MaxLength(100)]
  144. public string? PurMfg { get; set; }
  145. [MaxLength(100)]
  146. public string? Drawing { get; set; }
  147. [MaxLength(100)]
  148. public string? ItemType { get; set; }
  149. [MaxLength(100)]
  150. public string? Location { get; set; }
  151. [MaxLength(100)]
  152. public string? DefaultShelf { get; set; }
  153. public bool KeyItem { get; set; }
  154. // C2 技术护栏 + C1 负数拒绝:上界对齐 Entity 列类型 decimal(18,5)(max 9,999,999,999,999.99999);
  155. // 下界 0 与前端 el-input-number :min="0" 对齐(C0 §7 C1-Q1 选 a:后端拒绝负数)。
  156. // 业务实际上限待 C0 业务签字(参见 lwb/C0-business-rule-scope-review-20260425.md C2-Q1/Q2)。
  157. [Range(typeof(decimal), "0", "9999999999999.99999",
  158. ErrorMessage = "净重不能为负,且不能超过技术允许范围(decimal(18,5))")]
  159. public decimal? NetWeight { get; set; }
  160. [MaxLength(50)]
  161. public string? NetWeightUM { get; set; }
  162. public bool Inspect { get; set; }
  163. public int? PurLT { get; set; }
  164. public int? InsLT { get; set; }
  165. public int? MfgLT { get; set; }
  166. public decimal? Length { get; set; }
  167. public decimal? Size { get; set; }
  168. [MaxLength(50)]
  169. public string? SizeUM { get; set; }
  170. public bool IssuePolicy { get; set; }
  171. public int? MfgMttr { get; set; }
  172. [MaxLength(50)]
  173. public string? LocationType { get; set; }
  174. [MaxLength(100)]
  175. public string? CommodityCode { get; set; }
  176. [MaxLength(50)]
  177. public string? Rev { get; set; }
  178. public decimal? MaxOrd { get; set; }
  179. public decimal? MinOrd { get; set; }
  180. public decimal? OrdMult { get; set; }
  181. public decimal? MinOrdSales { get; set; }
  182. public bool AutoLotNums { get; set; }
  183. public bool Install { get; set; }
  184. public decimal? SafetyStk { get; set; }
  185. public int? DaysBetweenPM { get; set; }
  186. public int? ExpireAlarmDay { get; set; }
  187. public decimal? StockTurnOver { get; set; }
  188. public bool LotSerialControl { get; set; }
  189. public bool AllocateSingleLot { get; set; }
  190. [MaxLength(50)]
  191. public string? Status { get; set; }
  192. [MaxLength(100)]
  193. public string? Planner { get; set; }
  194. public bool TraceDetail { get; set; }
  195. public bool IsMainMas { get; set; }
  196. [MaxLength(1000)]
  197. public string? Remark { get; set; }
  198. [MaxLength(50)]
  199. public string? EMTType { get; set; }
  200. [MaxLength(100)]
  201. public string? OwnerApplication { get; set; }
  202. [MaxLength(50)]
  203. public string? BomVersion { get; set; }
  204. public bool EnableBomVersion { get; set; }
  205. public int? BOMDesign { get; set; }
  206. public int? RoutingDes { get; set; }
  207. public bool CustSupplied { get; set; }
  208. public int? DrawingDesign { get; set; }
  209. [MaxLength(100)]
  210. public string? DesignOwner { get; set; }
  211. public bool IsActive { get; set; } = true;
  212. public bool IsConfirm { get; set; }
  213. [MaxLength(100)]
  214. public string? CreateUser { get; set; }
  215. [MaxLength(100)]
  216. public string? UpdateUser { get; set; }
  217. }
  218. /// <summary>订单优先级(PriorityCode / IsActive)</summary>
  219. public class AdoS0PriorityCodeToggleActiveDto
  220. {
  221. public bool IsActive { get; set; }
  222. }
  223. public class AdoS0PriorityCodeQueryDto
  224. {
  225. public string? DomainCode { get; set; }
  226. /// <summary>匹配名称、来源表、工单字段 value</summary>
  227. public string? Keyword { get; set; }
  228. public string? Descr { get; set; }
  229. public int? Priority { get; set; }
  230. public bool? OrderBy { get; set; }
  231. public string? SourceTable { get; set; }
  232. public string? SourceColumn { get; set; }
  233. public string? Value { get; set; }
  234. public bool? IsActive { get; set; }
  235. public int Page { get; set; } = 1;
  236. public int PageSize { get; set; } = 20;
  237. }
  238. public class AdoS0PriorityCodeUpsertDto
  239. {
  240. public string? DomainCode { get; set; }
  241. public string? Descr { get; set; }
  242. public string? Value { get; set; }
  243. public int Priority { get; set; }
  244. public bool? OrderBy { get; set; }
  245. public string? SourceTable { get; set; }
  246. public string? SourceColumn { get; set; }
  247. public string? SourceType { get; set; }
  248. public string? SourceId { get; set; }
  249. public string? ValueType { get; set; }
  250. public string? ValueId { get; set; }
  251. /// <summary>客户类型编码(字典 s0_order_priority_customer_type 的 Value),可空</summary>
  252. public string? CustomerTypeCode { get; set; }
  253. /// <summary>订单类型编码(字典 s0_order_type 的 Value),可空</summary>
  254. public string? OrderTypeCode { get; set; }
  255. public bool IsActive { get; set; } = true;
  256. public string? CreateUser { get; set; }
  257. public string? LegacyCreateUser { get; set; }
  258. public string? UpdateUser { get; set; }
  259. }
  260. // ── B1: 合同评审周期标准 ──────────────────────────────────────────────
  261. public class AdoS0ContractReviewCycleQueryDto
  262. {
  263. public long? CompanyRefId { get; set; }
  264. public long? FactoryRefId { get; set; }
  265. public string? DomainCode { get; set; }
  266. public bool? IsActive { get; set; }
  267. public int Page { get; set; } = 1;
  268. public int PageSize { get; set; } = 20;
  269. }
  270. public class AdoS0ContractReviewCycleUpsertDto
  271. {
  272. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  273. public long CompanyRefId { get; set; }
  274. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  275. public long FactoryRefId { get; set; }
  276. public string? DomainCode { get; set; }
  277. [Required(ErrorMessage = "阶段编码不能为空")]
  278. public string StageCode { get; set; } = string.Empty;
  279. [Required(ErrorMessage = "阶段名称不能为空")]
  280. public string StageName { get; set; } = string.Empty;
  281. [Range(0, int.MaxValue, ErrorMessage = "标准时长不能为负")]
  282. public int StdHours { get; set; }
  283. public int OrderNo { get; set; }
  284. public bool IsActive { get; set; } = true;
  285. public string? CreateUser { get; set; }
  286. public string? UpdateUser { get; set; }
  287. }
  288. public class AdoS0ContractReviewCycleToggleActiveDto
  289. {
  290. public bool IsActive { get; set; }
  291. }
  292. // ── B2: 产品设计周期标准 ──────────────────────────────────────────────
  293. public class AdoS0ProductDesignCycleQueryDto
  294. {
  295. public long? CompanyRefId { get; set; }
  296. public long? FactoryRefId { get; set; }
  297. public string? DomainCode { get; set; }
  298. public string? ItemType { get; set; }
  299. public string? OwnerApplication { get; set; }
  300. public bool? IsActive { get; set; }
  301. public int Page { get; set; } = 1;
  302. public int PageSize { get; set; } = 20;
  303. }
  304. public class AdoS0ProductDesignCycleUpsertDto
  305. {
  306. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  307. public long CompanyRefId { get; set; }
  308. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  309. public long FactoryRefId { get; set; }
  310. public string? DomainCode { get; set; }
  311. [Required(ErrorMessage = "物料类型不能为空")]
  312. public string ItemType { get; set; } = string.Empty;
  313. [Required(ErrorMessage = "物料属性不能为空")]
  314. public string OwnerApplication { get; set; } = string.Empty;
  315. [Range(0, int.MaxValue, ErrorMessage = "标准时长不能为负")]
  316. public int StdHours { get; set; }
  317. public bool IsActive { get; set; } = true;
  318. public string? CreateUser { get; set; }
  319. public string? UpdateUser { get; set; }
  320. }
  321. public class AdoS0ProductDesignCycleToggleActiveDto
  322. {
  323. public bool IsActive { get; set; }
  324. }
  325. /// <summary>
  326. /// 产品设计周期列表行响应(Entity 字段 + ItemMaster 命中校验字段)。
  327. /// 不影响 Upsert / Query / ToggleActive DTO,仅 GetPagedAsync 列表返回使用。
  328. /// </summary>
  329. public class AdoS0ProductDesignCycleRowDto
  330. {
  331. public long Id { get; set; }
  332. public long CompanyRefId { get; set; }
  333. public long FactoryRefId { get; set; }
  334. public string? DomainCode { get; set; }
  335. public string ItemType { get; set; } = string.Empty;
  336. public string OwnerApplication { get; set; } = string.Empty;
  337. public int StdHours { get; set; }
  338. public bool IsActive { get; set; }
  339. public string? CreateUser { get; set; }
  340. public DateTime CreateTime { get; set; }
  341. public string? UpdateUser { get; set; }
  342. public DateTime? UpdateTime { get; set; }
  343. /// <summary>该 (ItemType[, Domain]) 组合在 ItemMaster 命中的物料行数。</summary>
  344. public int ItemMasterMatchedCount { get; set; }
  345. /// <summary>前 3 个示例物料,格式 "ItemNum / Descr";无 Descr 时仅 ItemNum;无命中时空列表。</summary>
  346. public List<string> ItemMasterSampleItems { get; set; } = new();
  347. }
  348. // ── B3: 订单评审周期标准 ──────────────────────────────────────────────
  349. public class AdoS0OrderReviewCycleQueryDto
  350. {
  351. public long? CompanyRefId { get; set; }
  352. public long? FactoryRefId { get; set; }
  353. public string? DomainCode { get; set; }
  354. public string? OrderType { get; set; }
  355. public bool? IsActive { get; set; }
  356. public int Page { get; set; } = 1;
  357. public int PageSize { get; set; } = 20;
  358. }
  359. public class AdoS0OrderReviewCycleUpsertDto
  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. public string? DomainCode { get; set; }
  366. /// <summary>订单类型;留空表示默认/不限。</summary>
  367. public string? OrderType { get; set; }
  368. [Range(0, int.MaxValue, ErrorMessage = "标准时长不能为负")]
  369. public int StdHours { get; set; }
  370. public string? Remarks { get; set; }
  371. public bool IsActive { get; set; } = true;
  372. public string? CreateUser { get; set; }
  373. public string? UpdateUser { get; set; }
  374. }
  375. public class AdoS0OrderReviewCycleToggleActiveDto
  376. {
  377. public bool IsActive { get; set; }
  378. }
  379. // ── B1.1: 合同评审周期下钻配置 ────────────────────────────────────────
  380. public class AdoS0ContractReviewCycleBreakdownQueryDto
  381. {
  382. public long? CompanyRefId { get; set; }
  383. public long? FactoryRefId { get; set; }
  384. public string? DomainCode { get; set; }
  385. /// <summary>父阶段编码(如 'feedback' 意见反馈)</summary>
  386. public string? ParentStageCode { get; set; }
  387. public bool? IsActive { get; set; }
  388. public int Page { get; set; } = 1;
  389. public int PageSize { get; set; } = 20;
  390. }
  391. public class AdoS0ContractReviewCycleBreakdownUpsertDto
  392. {
  393. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  394. public long CompanyRefId { get; set; }
  395. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  396. public long FactoryRefId { get; set; }
  397. public string? DomainCode { get; set; }
  398. [Required(ErrorMessage = "父阶段编码不能为空")]
  399. public string ParentStageCode { get; set; } = string.Empty;
  400. [Required(ErrorMessage = "组编码不能为空")]
  401. public string GroupCode { get; set; } = string.Empty;
  402. [Required(ErrorMessage = "组名称不能为空")]
  403. public string GroupName { get; set; } = string.Empty;
  404. [Range(typeof(decimal), "0", "9999.99", ErrorMessage = "标准时长必须在 0 ~ 9999.99 之间")]
  405. public decimal StdHours { get; set; }
  406. public int OrderNo { get; set; } = 1;
  407. public bool IsActive { get; set; } = true;
  408. public string? CreateUser { get; set; }
  409. public string? UpdateUser { get; set; }
  410. }
  411. public class AdoS0ContractReviewCycleBreakdownToggleActiveDto
  412. {
  413. public bool IsActive { get; set; }
  414. }
  415. // ── B1.2: 合同评审周期同步开关 ────────────────────────────────────────
  416. /// <summary>同步开关读取响应;行不存在时 IsSyncEnabled 默认 false。</summary>
  417. public class AdoS0ContractReviewCycleSyncFlagDto
  418. {
  419. public long? Id { get; set; }
  420. public long? CompanyRefId { get; set; }
  421. public long FactoryRefId { get; set; }
  422. public string? DomainCode { get; set; }
  423. public bool IsSyncEnabled { get; set; }
  424. }
  425. public class AdoS0ContractReviewCycleSyncFlagUpsertDto
  426. {
  427. [Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
  428. public long CompanyRefId { get; set; }
  429. [Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
  430. public long FactoryRefId { get; set; }
  431. public string? DomainCode { get; set; }
  432. public bool IsSyncEnabled { get; set; }
  433. public string? CreateUser { get; set; }
  434. public string? UpdateUser { get; set; }
  435. }
  436. // ── B1.3: PI 只读配置(S8 后续可消费) ─────────────────────────────────
  437. public class AdoS0ContractReviewCyclePiConfigStageDto
  438. {
  439. public string StageCode { get; set; } = string.Empty;
  440. public string StageName { get; set; } = string.Empty;
  441. public int StdHours { get; set; }
  442. public int OrderNo { get; set; }
  443. }
  444. public class AdoS0ContractReviewCyclePiConfigBreakdownDto
  445. {
  446. public string GroupCode { get; set; } = string.Empty;
  447. public string GroupName { get; set; } = string.Empty;
  448. public decimal StdHours { get; set; }
  449. public int OrderNo { get; set; }
  450. }
  451. public class AdoS0ContractReviewCyclePiConfigDto
  452. {
  453. public long FactoryRefId { get; set; }
  454. public bool SyncEnabled { get; set; }
  455. public List<AdoS0ContractReviewCyclePiConfigStageDto> MainStages { get; set; } = new();
  456. public List<AdoS0ContractReviewCyclePiConfigBreakdownDto> OpinionFeedbackBreakdown { get; set; } = new();
  457. }