feat: add dashboard with ECharts and SN/callback statistics

Added sn-stats and callback-stats endpoints. HomeView now shows stat cards, pending todos, recent activity, and ECharts pie charts for SN status distribution and callback status. Installed echarts dependency.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-05-27 08:37:09 +08:00
parent 5d50d2819b
commit 8c788ea388
4 changed files with 238 additions and 78 deletions
@@ -198,4 +198,17 @@ public class ReportService {
PlatformCustomer c = customerMapper.selectById(customerId);
return c != null ? c.getName() : null;
}
public Map<String, Long> getSnStats() {
Map<String, Long> stats = new java.util.LinkedHashMap<>();
for (String status : List.of("REGISTERED", "ISSUED", "ACTIVATED", "SUSPENDED", "REVOKED")) {
long count = licenseSnMapper.selectCount(
Wrappers.lambdaQuery(PlatformLicenseSn.class)
.eq(PlatformLicenseSn::getStatus, status));
if (count > 0) stats.put(status, count);
}
long total = stats.values().stream().mapToLong(Long::longValue).sum();
stats.put("TOTAL", total);
return stats;
}
}