跳到内容

报表中心

受众:开发者 / 运维 摘要:Core Reporting 报表定义、即时快照和异步导出聚合底座。

Reporting 提供统一报表入口。业务模块通过 contributor 贡献报表定义、快照和导出任务,Reporting 只做聚合与调度,不直接依赖 Form、Meeting、Advertising、Payment Platform 等业务模块。

能力范围

能力说明
报表定义按 key 暴露报表名称、描述、参数和可导出能力
即时快照聚合 contributor 返回当前统计快照
异步导出统一创建导出任务,并返回 Async Task / File 产物信息
后台中心Admin 统一查看报表定义、快照和导出入口

API 路径

API说明
GET /api/v1/admin/reports查询报表定义列表
GET /api/v1/admin/reports/{key}/snapshot查询报表即时快照
POST /api/v1/admin/reports/{key}/export创建报表异步导出

权限前缀为 reporting:report:*。Admin 页面入口为 /#/reports

数据模型

Reporting 当前只拥有 seed 迁移,不自建报表业务表。内置报表来自 contributor,导出任务和文件产物分别由 Async Task 与 File 承接。

文件说明
spring-open-core/spring-open-core-reporting/src/main/resources/db/changelog/migrations/0000_00_00_030100_core_reporting_seed_data.xml报表权限、菜单和角色绑定

扩展点

扩展点用途
ReportContributor贡献报表定义、即时快照和导出任务
ReportService聚合 contributor 并提供统一查询
AsyncTaskReportContributor汇总异步任务运行状态和导出
FileArtifactReportContributor汇总文件导出产物状态

新增业务报表时,应在业务 owning module 实现 contributor。Reporting 不复制业务查询逻辑,也不保存业务模块专属统计表。

验证命令

bash
./mvnw -pl spring-open-core/spring-open-core-reporting -am test -DskipITs -DskipFrontend -Dsurefire.failIfNoSpecifiedTests=false
./.ai/scripts/check modules
./.ai/scripts/check migrations
git diff --check

Released under the Apache License 2.0.