AdoS8Exception.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S8;
  2. /// <summary>
  3. /// 异常主表(业务实体;列表为查询该表及关联展示字段,非独立「列表视图表」)。
  4. /// </summary>
  5. [SugarTable("ado_s8_exception", "S8 异常主表")]
  6. [SugarIndex("uk_ado_s8_exception_tenant_factory_code", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(ExceptionCode), OrderByType.Asc, IsUnique = true)]
  7. [SugarIndex("idx_ado_s8_exception_type_time", nameof(TenantId), OrderByType.Asc, nameof(FactoryId), OrderByType.Asc, nameof(ExceptionTypeCode), OrderByType.Asc, nameof(CreatedAt), OrderByType.Desc)]
  8. public class AdoS8Exception
  9. {
  10. [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
  11. public long Id { get; set; }
  12. [SugarColumn(ColumnName = "tenant_id", ColumnDataType = "bigint")]
  13. public long TenantId { get; set; }
  14. [SugarColumn(ColumnName = "factory_id", ColumnDataType = "bigint")]
  15. public long FactoryId { get; set; }
  16. [SugarColumn(ColumnName = "exception_code", Length = 64)]
  17. public string ExceptionCode { get; set; } = string.Empty;
  18. [SugarColumn(ColumnName = "title", Length = 256)]
  19. public string Title { get; set; } = string.Empty;
  20. [SugarColumn(ColumnName = "description", Length = 4000, IsNullable = true)]
  21. public string? Description { get; set; }
  22. [SugarColumn(ColumnName = "scene_code", Length = 64)]
  23. public string SceneCode { get; set; } = string.Empty;
  24. [SugarColumn(ColumnName = "source_type", Length = 32)]
  25. public string SourceType { get; set; } = "MANUAL";
  26. [SugarColumn(ColumnName = "status", Length = 32)]
  27. public string Status { get; set; } = "NEW";
  28. [SugarColumn(ColumnName = "severity", Length = 32)]
  29. public string Severity { get; set; } = "MEDIUM";
  30. [SugarColumn(ColumnName = "priority_score", ColumnDataType = "decimal(10,2)")]
  31. public decimal PriorityScore { get; set; }
  32. [SugarColumn(ColumnName = "priority_level", Length = 16)]
  33. public string PriorityLevel { get; set; } = "P3";
  34. [SugarColumn(ColumnName = "occurrence_dept_id", ColumnDataType = "bigint")]
  35. public long OccurrenceDeptId { get; set; }
  36. [SugarColumn(ColumnName = "responsible_dept_id", ColumnDataType = "bigint")]
  37. public long ResponsibleDeptId { get; set; }
  38. [SugarColumn(ColumnName = "responsible_group_id", ColumnDataType = "bigint", IsNullable = true)]
  39. public long? ResponsibleGroupId { get; set; }
  40. [SugarColumn(ColumnName = "assignee_id", ColumnDataType = "bigint", IsNullable = true)]
  41. public long? AssigneeId { get; set; }
  42. [SugarColumn(ColumnName = "reporter_id", ColumnDataType = "bigint", IsNullable = true)]
  43. public long? ReporterId { get; set; }
  44. [SugarColumn(ColumnName = "sla_deadline", IsNullable = true)]
  45. public DateTime? SlaDeadline { get; set; }
  46. [SugarColumn(ColumnName = "timeout_flag", ColumnDataType = "boolean")]
  47. public bool TimeoutFlag { get; set; }
  48. [SugarColumn(ColumnName = "created_at")]
  49. public DateTime CreatedAt { get; set; } = DateTime.Now;
  50. [SugarColumn(ColumnName = "updated_at", IsNullable = true)]
  51. public DateTime? UpdatedAt { get; set; }
  52. [SugarColumn(ColumnName = "assigned_at", IsNullable = true)]
  53. public DateTime? AssignedAt { get; set; }
  54. [SugarColumn(ColumnName = "closed_at", IsNullable = true)]
  55. public DateTime? ClosedAt { get; set; }
  56. /// <summary>所属模块码(S1-S7),标识异常产生于哪个业务环节</summary>
  57. [SugarColumn(ColumnName = "module_code", Length = 16, IsNullable = true)]
  58. public string? ModuleCode { get; set; }
  59. [SugarColumn(ColumnName = "process_node_code", Length = 64, IsNullable = true)]
  60. public string? ProcessNodeCode { get; set; }
  61. [SugarColumn(ColumnName = "related_object_code", Length = 64, IsNullable = true)]
  62. public string? RelatedObjectCode { get; set; }
  63. /// <summary>当前进行中的审批实例ID(用于并发控制)</summary>
  64. [SugarColumn(ColumnName = "active_flow_instance_id", IsNullable = true)]
  65. public long? ActiveFlowInstanceId { get; set; }
  66. /// <summary>当前进行中的审批业务类型(EXCEPTION_ESCALATION / EXCEPTION_CLOSURE)</summary>
  67. [SugarColumn(ColumnName = "active_flow_biz_type", Length = 32, IsNullable = true)]
  68. public string? ActiveFlowBizType { get; set; }
  69. [SugarColumn(ColumnName = "is_deleted", ColumnDataType = "boolean")]
  70. public bool IsDeleted { get; set; }
  71. [SugarColumn(ColumnName = "created_by", Length = 64, IsNullable = true)]
  72. public string? CreatedBy { get; set; }
  73. [SugarColumn(ColumnName = "updated_by", Length = 64, IsNullable = true)]
  74. public string? UpdatedBy { get; set; }
  75. /// <summary>异常类型编码(关联 ado_s8_exception_type.type_code)。配置化改造后新增。</summary>
  76. [SugarColumn(ColumnName = "exception_type_code", Length = 64, IsNullable = true)]
  77. public string? ExceptionTypeCode { get; set; }
  78. /// <summary>来源数据源 ID(自动建单时填充;人工提报为空)。关联 ado_s8_data_source.id</summary>
  79. [SugarColumn(ColumnName = "source_data_source_id", ColumnDataType = "bigint", IsNullable = true)]
  80. public long? SourceDataSourceId { get; set; }
  81. /// <summary>来源监视规则 ID(自动建单时填充)。关联 ado_s8_watch_rule.id</summary>
  82. [SugarColumn(ColumnName = "source_rule_id", ColumnDataType = "bigint", IsNullable = true)]
  83. public long? SourceRuleId { get; set; }
  84. /// <summary>命中规则时的原始数据快照(JSON 文本,便于追溯)</summary>
  85. [SugarColumn(ColumnName = "source_payload", Length = 4000, IsNullable = true)]
  86. public string? SourcePayload { get; set; }
  87. /// <summary>检验人ID(提交复检时手选)</summary>
  88. [SugarColumn(ColumnName = "verifier_id", ColumnDataType = "bigint", IsNullable = true)]
  89. public long? VerifierId { get; set; }
  90. /// <summary>提交复检时间</summary>
  91. [SugarColumn(ColumnName = "verification_assigned_at", IsNullable = true)]
  92. public DateTime? VerificationAssignedAt { get; set; }
  93. /// <summary>检验完成时间</summary>
  94. [SugarColumn(ColumnName = "verified_at", IsNullable = true)]
  95. public DateTime? VerifiedAt { get; set; }
  96. /// <summary>检验结果(APPROVED / REJECTED)</summary>
  97. [SugarColumn(ColumnName = "verification_result", Length = 32, IsNullable = true)]
  98. public string? VerificationResult { get; set; }
  99. /// <summary>检验意见</summary>
  100. [SugarColumn(ColumnName = "verification_remark", Length = 2000, IsNullable = true)]
  101. public string? VerificationRemark { get; set; }
  102. }