AdoS6IpqcInspectionFlowState.cs 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using Admin.NET.Core;
  2. namespace Admin.NET.Plugin.AiDOP.Entity;
  3. /// <summary>
  4. /// S6 过程检验单(IPQC)流程状态轻量扩展表。
  5. ///
  6. /// 源表 qms_gcjyd 无审核人/审核时间/并发/租户列,故本表承载流程态与审核信息,
  7. /// 不给归口表 qms_gcjyd 加列、不回写 qms_gcjyd.status。
  8. /// 一检验单一行(inspection_id 唯一);流程权威状态仍由 ApprovalFlowInstance/Task 承载,
  9. /// 本表为业务侧展示与审核信息落点(business_status / 审核人 / 审核时间 / 退回原因 / row_version 乐观锁)。
  10. /// </summary>
  11. [SugarTable("ado_s6_ipqc_inspection_flow_state", "S6过程检验单流程状态")]
  12. [SugarIndex("uk_s6_ipqc_flow_state_insp", nameof(InspectionId), OrderByType.Asc, true)]
  13. [SugarIndex("idx_s6_ipqc_flow_state_flow", nameof(FlowInstanceId), OrderByType.Asc)]
  14. public class AdoS6IpqcInspectionFlowState : EntityBaseDel, ITenantIdFilter
  15. {
  16. /// <summary>租户</summary>
  17. [SugarColumn(ColumnName = "tenant_id", ColumnDescription = "租户", IsNullable = true)]
  18. public long? TenantId { get; set; }
  19. /// <summary>工厂/组织</summary>
  20. [SugarColumn(ColumnName = "org_id", ColumnDescription = "工厂/组织", IsNullable = true)]
  21. public long? OrgId { get; set; }
  22. /// <summary>检验单 id(qms_gcjyd.id,BizId)</summary>
  23. [SugarColumn(ColumnName = "inspection_id", ColumnDescription = "检验单id")]
  24. public long InspectionId { get; set; }
  25. /// <summary>检验单号(qms_gcjyd.djbh)</summary>
  26. [SugarColumn(ColumnName = "inspection_no", ColumnDescription = "检验单号", Length = 255, IsNullable = true)]
  27. public string? InspectionNo { get; set; }
  28. /// <summary>业务类型(IPQC_INSPECTION)</summary>
  29. [SugarColumn(ColumnName = "biz_type", ColumnDescription = "业务类型", Length = 80, IsNullable = true)]
  30. public string? BizType { get; set; } = "IPQC_INSPECTION";
  31. /// <summary>流程实例 id</summary>
  32. [SugarColumn(ColumnName = "flow_instance_id", ColumnDescription = "流程实例id", IsNullable = true)]
  33. public long? FlowInstanceId { get; set; }
  34. /// <summary>业务状态(INSPECTING / PENDING_REVIEW / APPROVED / RETURNED)</summary>
  35. [SugarColumn(ColumnName = "business_status", ColumnDescription = "业务状态", Length = 32, IsNullable = true)]
  36. public string? BusinessStatus { get; set; }
  37. /// <summary>当前节点码(N1_INSPECT / N2_SUP_REVIEW,完成为空)</summary>
  38. [SugarColumn(ColumnName = "current_node", ColumnDescription = "当前节点", Length = 32, IsNullable = true)]
  39. public string? CurrentNode { get; set; }
  40. /// <summary>检验员用户 id</summary>
  41. [SugarColumn(ColumnName = "inspector_user_id", ColumnDescription = "检验员用户id", IsNullable = true)]
  42. public long? InspectorUserId { get; set; }
  43. /// <summary>检验员姓名</summary>
  44. [SugarColumn(ColumnName = "inspector_name", ColumnDescription = "检验员姓名", Length = 100, IsNullable = true)]
  45. public string? InspectorName { get; set; }
  46. /// <summary>检验主管用户 id</summary>
  47. [SugarColumn(ColumnName = "supervisor_user_id", ColumnDescription = "检验主管用户id", IsNullable = true)]
  48. public long? SupervisorUserId { get; set; }
  49. /// <summary>检验主管姓名</summary>
  50. [SugarColumn(ColumnName = "supervisor_name", ColumnDescription = "检验主管姓名", Length = 100, IsNullable = true)]
  51. public string? SupervisorName { get; set; }
  52. /// <summary>提交时间(检验员)</summary>
  53. [SugarColumn(ColumnName = "submitted_at", ColumnDescription = "提交时间", IsNullable = true)]
  54. public DateTime? SubmittedAt { get; set; }
  55. /// <summary>审核时间(主管)</summary>
  56. [SugarColumn(ColumnName = "reviewed_at", ColumnDescription = "审核时间", IsNullable = true)]
  57. public DateTime? ReviewedAt { get; set; }
  58. /// <summary>审核结果(APPROVED / RETURNED)</summary>
  59. [SugarColumn(ColumnName = "review_result", ColumnDescription = "审核结果", Length = 32, IsNullable = true)]
  60. public string? ReviewResult { get; set; }
  61. /// <summary>退回原因</summary>
  62. [SugarColumn(ColumnName = "return_reason", ColumnDescription = "退回原因", Length = 500, IsNullable = true)]
  63. public string? ReturnReason { get; set; }
  64. /// <summary>是否需要质量处置(DOP 流程控制字段,主管 N2 整批判定驱动:1=不合格转N3 / 0=合格结束;与 qms_gcjyd.jgpd 整批判定一致)。网关 GW_RESULT 判据。</summary>
  65. [SugarColumn(ColumnName = "disposition_required", ColumnDescription = "是否需质量处置(1需/0否)", IsNullable = true)]
  66. public int? DispositionRequired { get; set; }
  67. /// <summary>乐观锁版本</summary>
  68. [SugarColumn(ColumnName = "row_version", ColumnDescription = "乐观锁版本", IsNullable = true)]
  69. public long? RowVersion { get; set; }
  70. }