namespace Admin.NET.Plugin.AiDOP;
///
/// S8 字段语义字典类型种子(TASK-003-023-S8-FIELD-SEMANTICS-TOOLTIP-1)。
/// 复用 SysDictType + SysDictData 承载字段语义;不新建 ado_s8_*_field_dict。
/// 与配套 一起灌入 19 条字段语义。
///
[IncreSeed]
public class S8FieldSemanticsSeedData : ISqlSugarEntitySeedData
{
public const long DictTypeId = 1329900008001L;
public IEnumerable HasData()
{
var ct = DateTime.Parse("2026-05-14 00:00:00");
return new[]
{
new SysDictType
{
Id = DictTypeId,
Name = "S8字段语义字典",
Code = "s8_field_semantics",
SysFlag = YesNoEnum.N,
IsTenant = YesNoEnum.N,
OrderNo = 600,
Remark = "S8 配置中心、异常处理、主动提报、监控看板字段语义说明",
Status = StatusEnum.Enable,
CreateTime = ct,
},
};
}
}
///
/// S8 字段语义字典数据种子(19 条 A 类业务术语)。
/// 字段约定:
/// Code = 字段编码(snake_case,前端按此精确匹配)
/// Label = UI 中文短名(tooltip 标题)
/// Value = 前端字段 key(camelCase,前端按此回退匹配)
/// Name = 英文全称或业务全称
/// Remark = 中文业务说明(tooltip 主体)
/// ExtData = JSON:pages / category / example / source / relatedDict / uiTargets
///
[IncreSeed]
public class S8FieldSemanticsDictDataSeedData : ISqlSugarEntitySeedData
{
public IEnumerable HasData()
{
var ct = DateTime.Parse("2026-05-14 00:00:00");
var typeId = S8FieldSemanticsSeedData.DictTypeId;
long seq = 1329900008101L;
return new[]
{
F(seq++, typeId, "sla_deadline", "SLA 截止时间", "slaDeadline",
"Service Level Agreement Deadline",
"异常处理的最晚截止时间。超过该时间未关闭将触发超时升级。",
"时效", "2026-05-20 18:00",
"ado_s8_exception.sla_deadline", null,
new[] { "S8TaskDetailPage", "S8ExceptionListPage" }, 100, ct),
F(seq++, typeId, "sla_minutes", "SLA 时长(分钟)", "slaMinutes",
"Service Level Agreement Minutes",
"异常类型的默认 SLA 时长(分钟),新建异常时按此推算截止时间。",
"时效", "60",
"ado_s8_exception_type.sla_minutes", null,
new[] { "S8ExceptionTypeConfigPage", "WatchRuleWizardDialog" }, 101, ct),
F(seq++, typeId, "owner_role_code", "责任角色", "ownerRoleCode",
"Owner Role Code",
"异常发生后默认接收处理的角色(不是部门)。指向 ado_s8_role_permission_config 中已配置的角色编码。",
"角色", "quality_engineer",
"ado_s8_exception_type.owner_role_code", "ado_s8_role_permission_config",
new[] { "S8TaskDetailPage", "S8ExceptionTypeConfigPage" }, 102, ct),
F(seq++, typeId, "escalate_role_code", "升级角色", "escalateRoleCode",
"Escalate Role Code",
"SLA 超时后异常自动升级到的角色,用于二级响应。",
"角色", "quality_manager",
"ado_s8_exception_type.escalate_role_code", "ado_s8_role_permission_config",
new[] { "S8ExceptionTypeConfigPage", "S8TaskDetailPage" }, 103, ct),
F(seq++, typeId, "type_code", "异常类型编码", "typeCode",
"Exception Type Code",
"异常类型的唯一业务编码,是异常类型主数据的主键。",
"标识", "ORDER_CHANGE",
"ado_s8_exception_type.type_code", "ado_s8_exception_type",
new[] { "S8ExceptionTypeConfigPage", "WatchRuleWizardDialog" }, 104, ct),
F(seq++, typeId, "rule_mechanism", "报警机制", "ruleMechanism",
"Rule Mechanism",
"规则的检测方式:DATE 日期型 / RATIO 比例型 / VALUE_RANGE 数值超差型 / MANUAL_REPORT 人工主动提报。",
"机制", "DATE",
"ado_s8_watch_rule.rule_mechanism", null,
new[] { "S8WatchRuleConfigPage", "WatchRuleWizardDialog", "S8TaskDetailPage" }, 105, ct),
F(seq++, typeId, "stage_code", "阶段维度", "stageCode",
"Stage Code (S1-S7)",
"S8 监控的 7 个阶段维度:S1 产销协同 / S2 生产准备 / S3 供应协同 / S4 质量检验 / S5 仓储供应 / S6 本体生产 / S7 总装发货。",
"维度", "S1",
"ado_s8_watch_rule.stage_code", "ado_s8_dimension_node(S_STAGE)",
new[] { "S8WatchRuleConfigPage", "WatchRuleWizardDialog", "S8ExceptionListPage" }, 106, ct),
F(seq++, typeId, "order_flow_code", "订单流程节点", "orderFlowCode",
"Order Flow Code",
"订单全流程 5 节点:评审排产测算 / 产品设计 / 材料采购 / 本体生产 / 总装发货。",
"维度", "BODY_PRODUCTION",
"ado_s8_watch_rule.order_flow_code", "ado_s8_dimension_node(ORDER_FLOW)",
new[] { "S8WatchRuleConfigPage", "WatchRuleWizardDialog", "S8TaskDetailPage" }, 107, ct),
F(seq++, typeId, "monitor_object", "监控对象", "monitorObject",
"Monitor Object",
"规则监控的业务实体(如销售订单 / 工单 / 采购单),决定数据源表。",
"机制", "SALES_ORDER_FLOW_STAGE",
"ado_s8_monitor_object.object_code", "ado_s8_monitor_object",
new[] { "WatchRuleWizardDialog", "S8WatchRuleConfigPage" }, 108, ct),
F(seq++, typeId, "monitor_metric", "监控指标", "monitorMetric",
"Monitor Metric",
"监控对象上被检测的具体指标(如到期时间 / 完工率 / 实测值),与监控对象联动。",
"机制", "ORDER_FLOW_STAGE_DUE",
"ado_s8_monitor_metric.metric_code", "ado_s8_monitor_metric",
new[] { "WatchRuleWizardDialog", "S8WatchRuleConfigPage" }, 109, ct),
F(seq++, typeId, "condition_standard", "判定标准", "conditionStandard",
"Condition / Threshold Standard",
"触发异常的业务条件摘要,如阈值范围、宽限时间、比例下限。",
"机制", "公差 0.95–1.05",
"ado_s8_watch_rule.params_json 摘要", null,
new[] { "WatchRuleWizardDialog", "S8WatchRuleConfigPage" }, 110, ct),
F(seq++, typeId, "poll_interval_seconds", "检测频率", "pollIntervalSeconds",
"Poll Interval (seconds)",
"规则的轮询周期(秒)。数值越小检测越频繁,对数据库压力越大。",
"机制", "300",
"ado_s8_watch_rule.poll_interval_seconds", null,
new[] { "S8WatchRuleConfigPage", "WatchRuleWizardDialog" }, 111, ct),
F(seq++, typeId, "rule_code", "规则编码", "ruleCode",
"Rule Code",
"规则的内部唯一编码,用于检索与故障定位。",
"标识", "RULE_S7_DELIVERY_DELAY_DATE",
"ado_s8_watch_rule.rule_code", null,
new[] { "S8WatchRuleConfigPage", "S8TaskDetailPage" }, 112, ct),
F(seq++, typeId, "exception_status", "异常状态", "exceptionStatus",
"Exception Status",
"异常生命周期状态:新建 / 已指派 / 处理中 / 已处理 / 待检验 / 已关闭 / 已驳回 / 已升级。",
"状态", "IN_PROGRESS",
"ado_s8_exception.status", "S8DictionaryService.S8_EXCEPTION_STATUS",
new[] { "S8ExceptionListPage", "S8TaskDetailPage" }, 113, ct),
F(seq++, typeId, "severity", "严重程度", "severity",
"Severity",
"异常严重度:FOLLOW 关注 / SERIOUS 严重。",
"状态", "SERIOUS",
"ado_s8_exception.severity", "S8DictionaryService.S8_EXCEPTION_SEVERITY",
new[] { "S8TaskDetailPage", "S8ExceptionListPage", "S8ManualReportPage" }, 114, ct),
F(seq++, typeId, "priority_level", "优先级", "priorityLevel",
"Priority Level",
"P1 最高 / P2 高 / P3 中 / P4 低,由严重度与 SLA 共同推算。",
"优先级", "P2",
"ado_s8_exception.priority_level", "S8DictionaryService.S8_PRIORITY_LEVEL",
new[] { "S8ExceptionListPage", "S8TaskDetailPage" }, 115, ct),
F(seq++, typeId, "related_object_code", "关联对象编码", "relatedObjectCode",
"Related Object Code",
"异常关联的业务对象编码(订单号 / 工单号 / 采购单号),用于跨系统定位。",
"关联", "SO-2026-001",
"ado_s8_exception.related_object_code", null,
new[] { "S8ManualReportPage", "S8TaskDetailPage", "S8ExceptionListPage" }, 116, ct),
F(seq++, typeId, "source_type", "异常来源", "sourceType",
"Source Type",
"异常的产生方式:MANUAL 人工提报 / RULE 规则触发 / SYSTEM 系统自动。",
"状态", "RULE",
"ado_s8_exception.source_type", "S8DictionaryService.S8_SOURCE_TYPE",
new[] { "S8TaskDetailPage" }, 117, ct),
F(seq++, typeId, "rule_type", "规则类型", "ruleType",
"Rule Type",
"规则评估器类型:OUT_OF_RANGE 阈值越界 / TIMEOUT 超时 / SHORTAGE 短缺。",
"机制", "TIMEOUT",
"ado_s8_watch_rule.rule_type", null,
new[] { "S8ExceptionListPage", "S8TaskDetailPage" }, 118, ct),
};
}
private static SysDictData F(
long id, long typeId, string code, string label, string value,
string fullName, string remark,
string category, string? example,
string? source, string? relatedDict,
string[] pages, int order, DateTime ct)
{
var extObj = new
{
pages,
category,
example,
source,
relatedDict,
uiTargets = System.Array.Empty(),
fullName,
};
var extJson = System.Text.Json.JsonSerializer.Serialize(extObj);
return new SysDictData
{
Id = id,
DictTypeId = typeId,
Code = code,
Label = label,
Value = value,
Name = fullName,
Remark = remark,
ExtData = extJson,
OrderNo = order,
Status = StatusEnum.Enable,
CreateTime = ct,
};
}
}