mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-09 18:10:30 +08:00
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:
+13
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user