fix(ai): Copilot 审计修复 — C-1/H-1/H-2/H-3/H-4/H-5/L-2

- L-2: value_to_f64 对 Null 返回 NaN(防止误触发规则)
- C-1: load_patient_data 空数据时跳过写入快照
- H-1: 每日刷新定时器添加初始延迟
- H-2: copilot_consumer 传内层 content
- H-3: 前端 hooks/Alert 修复分页响应解析
- H-4: risk_handler 动态选择 AI provider
- H-5: 新增 DELETE /copilot/rules/{id} 软删除路由
This commit is contained in:
iven
2026-05-13 00:21:27 +08:00
parent 6d97328ff6
commit d6676abecf
9 changed files with 73 additions and 9 deletions

View File

@@ -81,6 +81,11 @@ async fn process_event(db: &sea_orm::DatabaseConnection, event: &erp_core::event
.as_str()
.unwrap_or("异常告警")
.to_string();
// 只传内层 content避免重复存储顶层元数据
let content = insight_data
.get("content")
.cloned()
.unwrap_or(insight_data.clone());
let _ = crate::service::insight_service::InsightService::create_insight(
db,
tenant_id,
@@ -89,7 +94,7 @@ async fn process_event(db: &sea_orm::DatabaseConnection, event: &erp_core::event
"rule".into(),
Some(severity),
title,
insight_data,
content,
None,
168, // 7 天过期
None,