diff --git a/backend/app/api/bot_kpis.py b/backend/app/api/bot_kpis.py index f95446fa..8a982bd8 100644 --- a/backend/app/api/bot_kpis.py +++ b/backend/app/api/bot_kpis.py @@ -97,6 +97,9 @@ def list_bot_kpis( "score": score, "status": status, "period": latest_val.period if latest_val else None, + # P0-① 三区标注: Bot KPI值最近回填时间/批次(UI BotSourceTag 消费) + "value_updated_at": latest_val.calculated_at.strftime("%Y-%m-%d %H:%M") if latest_val and latest_val.calculated_at else None, + "value_source_batch": latest_val.source_batch if latest_val else None, "frequency": k.frequency or "monthly", }) diff --git a/backend/app/api/kpis.py b/backend/app/api/kpis.py index e978426f..8885656b 100644 --- a/backend/app/api/kpis.py +++ b/backend/app/api/kpis.py @@ -548,6 +548,8 @@ def list_kpi_values( "source_batch": v.source_batch or "", "data_status": v.data_status, "remark": v.remark or "", + # P0-① 三区标注: C区Bot回填时间 + "updated_at": v.calculated_at.strftime("%Y-%m-%d %H:%M") if v.calculated_at else None, } for v in vals] } @@ -608,6 +610,8 @@ def get_kpi(kpi_id: int, db: Session = Depends(get_db), entity_id: int = Depends "source_type": v.source_type, "data_status": v.data_status, "source_batch": v.source_batch, + # P0-① 三区标注: C区Bot回填时间(UI BotSourceTag 消费) + "updated_at": v.calculated_at.strftime("%Y-%m-%d %H:%M") if v.calculated_at else None, }) return result