AdoSmartOpsKpiMaster.cs 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using Admin.NET.Core;
  2. namespace Admin.NET.Plugin.AiDOP.Entity;
  3. /// <summary>
  4. /// 运营指标主数据(KPI Master),完整的指标定义含公式、规则、父子关系。
  5. /// </summary>
  6. [SugarTable("ado_smart_ops_kpi_master", "运营指标主数据")]
  7. [SugarIndex("uk_kpi_master_code_tenant", nameof(MetricCode), OrderByType.Asc, nameof(TenantId), OrderByType.Asc, true)]
  8. public class AdoSmartOpsKpiMaster : ITenantIdFilter
  9. {
  10. [SugarColumn(ColumnDescription = "主键", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
  11. public long Id { get; set; }
  12. [SugarColumn(ColumnDescription = "指标编码(自动生成 S1_L1_001)", Length = 50)]
  13. public string MetricCode { get; set; } = string.Empty;
  14. [SugarColumn(ColumnDescription = "模块 S1~S9", Length = 20)]
  15. public string ModuleCode { get; set; } = string.Empty;
  16. [SugarColumn(ColumnDescription = "层级 1=L1 2=L2 3=L3")]
  17. public int MetricLevel { get; set; }
  18. [SugarColumn(ColumnDescription = "父指标 ID(L1 为 null)", ColumnDataType = "bigint", IsNullable = true)]
  19. public long? ParentId { get; set; }
  20. [SugarColumn(ColumnDescription = "指标名称", Length = 200)]
  21. public string MetricName { get; set; } = string.Empty;
  22. [SugarColumn(ColumnDescription = "KPI 描述", ColumnDataType = "text", IsNullable = true)]
  23. public string? Description { get; set; }
  24. [SugarColumn(ColumnDescription = "计算公式", ColumnDataType = "text", IsNullable = true)]
  25. public string? Formula { get; set; }
  26. [SugarColumn(ColumnDescription = "计算规则(含举例)", ColumnDataType = "text", IsNullable = true)]
  27. public string? CalcRule { get; set; }
  28. [SugarColumn(ColumnDescription = "数据来源模块", Length = 200, IsNullable = true)]
  29. public string? DataSource { get; set; }
  30. [SugarColumn(ColumnDescription = "统计频率", Length = 50, IsNullable = true)]
  31. public string? StatFrequency { get; set; }
  32. [SugarColumn(ColumnDescription = "责任部门", Length = 200, IsNullable = true)]
  33. public string? Department { get; set; }
  34. [SugarColumn(ColumnDescription = "DOP 系统字段映射", Length = 500, IsNullable = true)]
  35. public string? DopFields { get; set; }
  36. [SugarColumn(ColumnDescription = "单位", Length = 50, IsNullable = true)]
  37. public string? Unit { get; set; }
  38. [SugarColumn(ColumnDescription = "优劣方向 higher_is_better/lower_is_better", Length = 20)]
  39. public string Direction { get; set; } = "higher_is_better";
  40. [SugarColumn(ColumnDescription = "黄色阈值(达标比例%,higher: actual/target>=此值为黄,lower: actual/target<=此值为黄)", IsNullable = true)]
  41. public decimal? YellowThreshold { get; set; }
  42. [SugarColumn(ColumnDescription = "红色阈值(未达标比例%,higher: actual/target<此值为红,lower: actual/target>此值为红)", IsNullable = true)]
  43. public decimal? RedThreshold { get; set; }
  44. [SugarColumn(ColumnDescription = "是否可上九宫格首页")]
  45. public bool IsHomePage { get; set; }
  46. [SugarColumn(ColumnDescription = "同级排序号")]
  47. public int SortNo { get; set; }
  48. [SugarColumn(ColumnDescription = "备注", ColumnDataType = "text", IsNullable = true)]
  49. public string? Remark { get; set; }
  50. [SugarColumn(ColumnDescription = "启用")]
  51. public bool IsEnabled { get; set; } = true;
  52. [SugarColumn(ColumnDescription = "租户 ID", ColumnDataType = "bigint")]
  53. public long? TenantId { get; set; }
  54. [SugarColumn(ColumnDescription = "创建时间")]
  55. public DateTime CreatedAt { get; set; } = DateTime.Now;
  56. [SugarColumn(ColumnDescription = "更新时间", IsNullable = true)]
  57. public DateTime? UpdatedAt { get; set; }
  58. }