S8FieldSemanticsSeedData.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. namespace Admin.NET.Plugin.AiDOP;
  2. /// <summary>
  3. /// S8 字段语义字典类型种子(TASK-003-023-S8-FIELD-SEMANTICS-TOOLTIP-1)。
  4. /// 复用 SysDictType + SysDictData 承载字段语义;不新建 ado_s8_*_field_dict。
  5. /// 与配套 <see cref="S8FieldSemanticsDictDataSeedData"/> 一起灌入 19 条字段语义。
  6. /// </summary>
  7. [IncreSeed]
  8. public class S8FieldSemanticsSeedData : ISqlSugarEntitySeedData<SysDictType>
  9. {
  10. public const long DictTypeId = 1329900008001L;
  11. public IEnumerable<SysDictType> HasData()
  12. {
  13. var ct = DateTime.Parse("2026-05-14 00:00:00");
  14. return new[]
  15. {
  16. new SysDictType
  17. {
  18. Id = DictTypeId,
  19. Name = "S8字段语义字典",
  20. Code = "s8_field_semantics",
  21. SysFlag = YesNoEnum.N,
  22. IsTenant = YesNoEnum.N,
  23. OrderNo = 600,
  24. Remark = "S8 配置中心、异常处理、主动提报、监控看板字段语义说明",
  25. Status = StatusEnum.Enable,
  26. CreateTime = ct,
  27. },
  28. };
  29. }
  30. }
  31. /// <summary>
  32. /// S8 字段语义字典数据种子(19 条 A 类业务术语)。
  33. /// 字段约定:
  34. /// Code = 字段编码(snake_case,前端按此精确匹配)
  35. /// Label = UI 中文短名(tooltip 标题)
  36. /// Value = 前端字段 key(camelCase,前端按此回退匹配)
  37. /// Name = 英文全称或业务全称
  38. /// Remark = 中文业务说明(tooltip 主体)
  39. /// ExtData = JSON:pages / category / example / source / relatedDict / uiTargets
  40. /// </summary>
  41. [IncreSeed]
  42. public class S8FieldSemanticsDictDataSeedData : ISqlSugarEntitySeedData<SysDictData>
  43. {
  44. public IEnumerable<SysDictData> HasData()
  45. {
  46. var ct = DateTime.Parse("2026-05-14 00:00:00");
  47. var typeId = S8FieldSemanticsSeedData.DictTypeId;
  48. long seq = 1329900008101L;
  49. return new[]
  50. {
  51. F(seq++, typeId, "sla_deadline", "SLA 截止时间", "slaDeadline",
  52. "Service Level Agreement Deadline",
  53. "异常处理的最晚截止时间。超过该时间未关闭将触发超时升级。",
  54. "时效", "2026-05-20 18:00",
  55. "ado_s8_exception.sla_deadline", null,
  56. new[] { "S8TaskDetailPage", "S8ExceptionListPage" }, 100, ct),
  57. F(seq++, typeId, "sla_minutes", "SLA 时长(分钟)", "slaMinutes",
  58. "Service Level Agreement Minutes",
  59. "异常类型的默认 SLA 时长(分钟),新建异常时按此推算截止时间。",
  60. "时效", "60",
  61. "ado_s8_exception_type.sla_minutes", null,
  62. new[] { "S8ExceptionTypeConfigPage", "WatchRuleWizardDialog" }, 101, ct),
  63. F(seq++, typeId, "owner_role_code", "责任角色", "ownerRoleCode",
  64. "Owner Role Code",
  65. "异常发生后默认接收处理的角色(不是部门)。指向 ado_s8_role_permission_config 中已配置的角色编码。",
  66. "角色", "quality_engineer",
  67. "ado_s8_exception_type.owner_role_code", "ado_s8_role_permission_config",
  68. new[] { "S8TaskDetailPage", "S8ExceptionTypeConfigPage" }, 102, ct),
  69. F(seq++, typeId, "escalate_role_code", "升级角色", "escalateRoleCode",
  70. "Escalate Role Code",
  71. "SLA 超时后异常自动升级到的角色,用于二级响应。",
  72. "角色", "quality_manager",
  73. "ado_s8_exception_type.escalate_role_code", "ado_s8_role_permission_config",
  74. new[] { "S8ExceptionTypeConfigPage", "S8TaskDetailPage" }, 103, ct),
  75. F(seq++, typeId, "type_code", "异常类型编码", "typeCode",
  76. "Exception Type Code",
  77. "异常类型的唯一业务编码,是异常类型主数据的主键。",
  78. "标识", "ORDER_CHANGE",
  79. "ado_s8_exception_type.type_code", "ado_s8_exception_type",
  80. new[] { "S8ExceptionTypeConfigPage", "WatchRuleWizardDialog" }, 104, ct),
  81. F(seq++, typeId, "rule_mechanism", "报警机制", "ruleMechanism",
  82. "Rule Mechanism",
  83. "规则的检测方式:DATE 日期型 / RATIO 比例型 / VALUE_RANGE 数值超差型 / MANUAL_REPORT 人工主动提报。",
  84. "机制", "DATE",
  85. "ado_s8_watch_rule.rule_mechanism", null,
  86. new[] { "S8WatchRuleConfigPage", "WatchRuleWizardDialog", "S8TaskDetailPage" }, 105, ct),
  87. F(seq++, typeId, "stage_code", "阶段维度", "stageCode",
  88. "Stage Code (S1-S7)",
  89. "S8 监控的 7 个阶段维度:S1 产销协同 / S2 生产准备 / S3 供应协同 / S4 质量检验 / S5 仓储供应 / S6 本体生产 / S7 总装发货。",
  90. "维度", "S1",
  91. "ado_s8_watch_rule.stage_code", "ado_s8_dimension_node(S_STAGE)",
  92. new[] { "S8WatchRuleConfigPage", "WatchRuleWizardDialog", "S8ExceptionListPage" }, 106, ct),
  93. F(seq++, typeId, "order_flow_code", "订单流程节点", "orderFlowCode",
  94. "Order Flow Code",
  95. "订单全流程 5 节点:评审排产测算 / 产品设计 / 材料采购 / 本体生产 / 总装发货。",
  96. "维度", "BODY_PRODUCTION",
  97. "ado_s8_watch_rule.order_flow_code", "ado_s8_dimension_node(ORDER_FLOW)",
  98. new[] { "S8WatchRuleConfigPage", "WatchRuleWizardDialog", "S8TaskDetailPage" }, 107, ct),
  99. F(seq++, typeId, "monitor_object", "监控对象", "monitorObject",
  100. "Monitor Object",
  101. "规则监控的业务实体(如销售订单 / 工单 / 采购单),决定数据源表。",
  102. "机制", "SALES_ORDER_FLOW_STAGE",
  103. "ado_s8_monitor_object.object_code", "ado_s8_monitor_object",
  104. new[] { "WatchRuleWizardDialog", "S8WatchRuleConfigPage" }, 108, ct),
  105. F(seq++, typeId, "monitor_metric", "监控指标", "monitorMetric",
  106. "Monitor Metric",
  107. "监控对象上被检测的具体指标(如到期时间 / 完工率 / 实测值),与监控对象联动。",
  108. "机制", "ORDER_FLOW_STAGE_DUE",
  109. "ado_s8_monitor_metric.metric_code", "ado_s8_monitor_metric",
  110. new[] { "WatchRuleWizardDialog", "S8WatchRuleConfigPage" }, 109, ct),
  111. F(seq++, typeId, "condition_standard", "判定标准", "conditionStandard",
  112. "Condition / Threshold Standard",
  113. "触发异常的业务条件摘要,如阈值范围、宽限时间、比例下限。",
  114. "机制", "公差 0.95–1.05",
  115. "ado_s8_watch_rule.params_json 摘要", null,
  116. new[] { "WatchRuleWizardDialog", "S8WatchRuleConfigPage" }, 110, ct),
  117. F(seq++, typeId, "poll_interval_seconds", "检测频率", "pollIntervalSeconds",
  118. "Poll Interval (seconds)",
  119. "规则的轮询周期(秒)。数值越小检测越频繁,对数据库压力越大。",
  120. "机制", "300",
  121. "ado_s8_watch_rule.poll_interval_seconds", null,
  122. new[] { "S8WatchRuleConfigPage", "WatchRuleWizardDialog" }, 111, ct),
  123. F(seq++, typeId, "rule_code", "规则编码", "ruleCode",
  124. "Rule Code",
  125. "规则的内部唯一编码,用于检索与故障定位。",
  126. "标识", "RULE_S7_DELIVERY_DELAY_DATE",
  127. "ado_s8_watch_rule.rule_code", null,
  128. new[] { "S8WatchRuleConfigPage", "S8TaskDetailPage" }, 112, ct),
  129. F(seq++, typeId, "exception_status", "异常状态", "exceptionStatus",
  130. "Exception Status",
  131. "异常生命周期状态:新建 / 已指派 / 处理中 / 已处理 / 待检验 / 已关闭 / 已驳回 / 已升级。",
  132. "状态", "IN_PROGRESS",
  133. "ado_s8_exception.status", "S8DictionaryService.S8_EXCEPTION_STATUS",
  134. new[] { "S8ExceptionListPage", "S8TaskDetailPage" }, 113, ct),
  135. F(seq++, typeId, "severity", "严重程度", "severity",
  136. "Severity",
  137. "异常严重度:FOLLOW 关注 / SERIOUS 严重。",
  138. "状态", "SERIOUS",
  139. "ado_s8_exception.severity", "S8DictionaryService.S8_EXCEPTION_SEVERITY",
  140. new[] { "S8TaskDetailPage", "S8ExceptionListPage", "S8ManualReportPage" }, 114, ct),
  141. F(seq++, typeId, "priority_level", "优先级", "priorityLevel",
  142. "Priority Level",
  143. "P1 最高 / P2 高 / P3 中 / P4 低,由严重度与 SLA 共同推算。",
  144. "优先级", "P2",
  145. "ado_s8_exception.priority_level", "S8DictionaryService.S8_PRIORITY_LEVEL",
  146. new[] { "S8ExceptionListPage", "S8TaskDetailPage" }, 115, ct),
  147. F(seq++, typeId, "related_object_code", "关联对象编码", "relatedObjectCode",
  148. "Related Object Code",
  149. "异常关联的业务对象编码(订单号 / 工单号 / 采购单号),用于跨系统定位。",
  150. "关联", "SO-2026-001",
  151. "ado_s8_exception.related_object_code", null,
  152. new[] { "S8ManualReportPage", "S8TaskDetailPage", "S8ExceptionListPage" }, 116, ct),
  153. F(seq++, typeId, "source_type", "异常来源", "sourceType",
  154. "Source Type",
  155. "异常的产生方式:MANUAL 人工提报 / RULE 规则触发 / SYSTEM 系统自动。",
  156. "状态", "RULE",
  157. "ado_s8_exception.source_type", "S8DictionaryService.S8_SOURCE_TYPE",
  158. new[] { "S8TaskDetailPage" }, 117, ct),
  159. F(seq++, typeId, "rule_type", "规则类型", "ruleType",
  160. "Rule Type",
  161. "规则评估器类型:OUT_OF_RANGE 阈值越界 / TIMEOUT 超时 / SHORTAGE 短缺。",
  162. "机制", "TIMEOUT",
  163. "ado_s8_watch_rule.rule_type", null,
  164. new[] { "S8ExceptionListPage", "S8TaskDetailPage" }, 118, ct),
  165. };
  166. }
  167. private static SysDictData F(
  168. long id, long typeId, string code, string label, string value,
  169. string fullName, string remark,
  170. string category, string? example,
  171. string? source, string? relatedDict,
  172. string[] pages, int order, DateTime ct)
  173. {
  174. var extObj = new
  175. {
  176. pages,
  177. category,
  178. example,
  179. source,
  180. relatedDict,
  181. uiTargets = System.Array.Empty<string>(),
  182. fullName,
  183. };
  184. var extJson = System.Text.Json.JsonSerializer.Serialize(extObj);
  185. return new SysDictData
  186. {
  187. Id = id,
  188. DictTypeId = typeId,
  189. Code = code,
  190. Label = label,
  191. Value = value,
  192. Name = fullName,
  193. Remark = remark,
  194. ExtData = extJson,
  195. OrderNo = order,
  196. Status = StatusEnum.Enable,
  197. CreateTime = ct,
  198. };
  199. }
  200. }