fix(web+health): 修复咨询轮询 temp ID 400 + 健康数据统计 500
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- ConsultationDetail: 轮询取 lastId 时过滤 temp_ 前缀的乐观消息 ID,
  避免将非法 UUID 传给 after_id 参数导致后端 400
- stats_service: count_abnormal_lab_items 和 compute_daily_report_rate
  中 SQL 字面量 0 类型为 INT4,与 Rust i64 (INT8) 不匹配,
  改为 0::bigint 确保类型兼容
This commit is contained in:
iven
2026-04-30 12:27:56 +08:00
parent 1bebb57765
commit 84fafb0bc5
2 changed files with 4 additions and 3 deletions

View File

@@ -386,7 +386,7 @@ async fn count_abnormal_lab_items(
(SELECT jsonb_agg(elem) FROM jsonb_array_elements(items) elem WHERE elem->>'is_abnormal' = 'true'),
'[]'::jsonb
)
)), 0) AS total
)), 0::bigint) AS total
FROM lab_report
WHERE tenant_id = $1 AND deleted_at IS NULL AND items IS NOT NULL
AND created_at >= date_trunc('month', NOW())
@@ -446,7 +446,7 @@ async fn compute_daily_report_rate(
let sql = r#"
SELECT d::date::text AS date,
COUNT(DISTINCT vs.patient_id) AS reported,
0 AS total
0::bigint AS total
FROM generate_series(
CURRENT_DATE - INTERVAL '6 days',
CURRENT_DATE,