S6ProcessInspectionReviewDto.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. namespace Admin.NET.Plugin.AiDOP.Manufacturing.Dto;
  2. /// <summary>Phase 1D 审核流状态(只读,供前端按钮控制)。所有判定/状态由后端拥有,前端不得回传状态。</summary>
  3. public class S6ReviewStateOutput
  4. {
  5. public long BillId { get; set; }
  6. public long? InstanceId { get; set; }
  7. /// <summary>Phase 1C 质量结果(PASS/FAIL/PENDING/INVALID)—— 只读回显,审批不改写。</summary>
  8. public string? OverallResult { get; set; }
  9. /// <summary>Phase 1C 结果状态(NOT_STARTED/IN_PROGRESS/COMPLETED)。</summary>
  10. public string? ResultStatus { get; set; }
  11. /// <summary>流程状态:NotStarted / Running / Approved / Rejected / Cancelled / Terminated。</summary>
  12. public string? FlowStatus { get; set; }
  13. public string? CurrentNodeCode { get; set; }
  14. public string? CurrentNodeName { get; set; }
  15. public string? CurrentAssigneeRole { get; set; }
  16. public bool IsCompleted { get; set; }
  17. public bool HasDisposition { get; set; }
  18. /// <summary>网关判据(FAIL→1)。</summary>
  19. public int DispositionRequired { get; set; }
  20. // 按钮门控(后端计算)
  21. /// <summary>
  22. /// S6-IPQC-EDIT-1:当前用户此刻是否可修改检验录入(项目结果 / 样本实测)。
  23. /// 与 <see cref="CanSubmitReview"/> 共用同一份 N1 待办归属判定,但**不叠加"检验已完成"**条件 ——
  24. /// 二者语义不等价:N1 己有待办且 ResultStatus=IN_PROGRESS 时 CanEdit=true / CanSubmitReview=false,
  25. /// 而这正是需要编辑的状态。故前端不得用 canSubmitReview 顶替 canEdit。
  26. /// 取值口径:未起流程 → true(首次录入);主管退回回到 N1 且待办归属本人 → true;
  27. /// N2 / N3 / 无本人待办 / 流程已结束 → false。
  28. /// </summary>
  29. public bool CanEdit { get; set; }
  30. public bool CanSubmitReview { get; set; }
  31. public bool CanSupervisorApprove { get; set; }
  32. public bool CanSupervisorReturn { get; set; }
  33. public bool CanSubmitDisposition { get; set; }
  34. public string? Message { get; set; }
  35. // ── Phase 1E 展示收口(后端拥有业务中文,前端不猜语义)──
  36. /// <summary>检验结果业务文案:合格 / 不合格 / 检验中 / —。</summary>
  37. public string? QualityText { get; set; }
  38. /// <summary>统一展示状态(业务中文):检验中 / 待提交审核 / 主管审核中 / QE质量处置中 / 已关闭 / …。</summary>
  39. public string? DisplayStatus { get; set; }
  40. /// <summary>QE 质量处置(存在则展示;不改写质量结果)。</summary>
  41. public S6DispositionView? Disposition { get; set; }
  42. /// <summary>审核历史(正式 ApprovalFlow 时间线,按时间升序)。</summary>
  43. public List<S6ReviewHistoryItem> History { get; set; } = new();
  44. }
  45. /// <summary>QE 质量处置展示(只读)。</summary>
  46. public class S6DispositionView
  47. {
  48. public string? DispositionType { get; set; }
  49. public string? DispositionTypeText { get; set; }
  50. public decimal? DispositionQty { get; set; }
  51. public string? DispositionOpinion { get; set; }
  52. public string? ResponsibilityDept { get; set; }
  53. public string? ResponsibleUser { get; set; }
  54. public string? OperatorName { get; set; }
  55. public DateTime? SubmittedAt { get; set; }
  56. }
  57. /// <summary>审核历史条目(源自 ApprovalFlowLog;action/node 已转业务中文)。</summary>
  58. public class S6ReviewHistoryItem
  59. {
  60. public DateTime? Time { get; set; }
  61. public string? OperatorName { get; set; }
  62. public string? NodeName { get; set; }
  63. public string? ActionText { get; set; }
  64. public string? Comment { get; set; }
  65. }
  66. /// <summary>提交审核入参:仅单据 id;租户/发起人后端自解析。</summary>
  67. public class S6SubmitReviewInput
  68. {
  69. public long BillId { get; set; }
  70. public string? Comment { get; set; }
  71. }
  72. /// <summary>主管审核通过入参(路由自动按 overall_result 决定去向)。</summary>
  73. public class S6ReviewApproveInput
  74. {
  75. public long BillId { get; set; }
  76. public string? Comment { get; set; }
  77. }
  78. /// <summary>主管退回入参(意见必填)。</summary>
  79. public class S6ReviewReturnInput
  80. {
  81. public long BillId { get; set; }
  82. public string? Comment { get; set; }
  83. }
  84. /// <summary>QE 质量处置入参(不改写 Phase 1C 质量结果)。</summary>
  85. public class S6QeDispositionInput
  86. {
  87. public long BillId { get; set; }
  88. /// <summary>REWORK / CONCESSION / SCRAP / OTHER。</summary>
  89. public string DispositionType { get; set; } = string.Empty;
  90. public decimal? DispositionQty { get; set; }
  91. public decimal? ReworkQty { get; set; }
  92. public decimal? ConcessionQty { get; set; }
  93. public decimal? ScrapQty { get; set; }
  94. public string? DispositionOpinion { get; set; }
  95. public string? ResponsibilityDept { get; set; }
  96. public string? ResponsibleUser { get; set; }
  97. public string? Comment { get; set; }
  98. }