dingdanquanliucheng/backend/app/services/report_service.py
2026-05-14 13:51:06 +08:00

25 lines
799 B
Python

class ReportService:
# 报表服务先保留演示统计结果,后续可替换为真实聚合查询。
def performance_report(self) -> dict:
return {
"stat_type": "month",
"list": [
{
"stat_period": "2026-05",
"order_count": 10,
"order_amount": 10000,
"category_amounts": [{"category_id": 1, "category_name": "工业品", "amount": 6000}],
"commission_amount": 500,
}
],
}
def export_performance_report(self) -> dict:
return {
"file_url": "https://oss.example.com/export/performance.xlsx",
"file_name": "performance.xlsx",
}
report_service = ReportService()