opt:优化报警前十

This commit is contained in:
2024-11-04 14:37:32 +08:00
parent 12feb75580
commit 40e67b0b7d
2 changed files with 11 additions and 9 deletions

View File

@@ -228,10 +228,12 @@ public class CockpitServiceImpl implements CockpitService {
return null;
});
//设备报警前十
CompletableFuture<List<Map<String, Object>>> task12 = CompletableFuture.supplyAsync(() -> cockpitMapper.ghStatistics(), pool);
task12.thenAccept((result) -> {
CompletableFuture<JSONArray> task12 = CompletableFuture.supplyAsync(() -> {
List<Map<String, Object>> result=cockpitMapper.ghStatistics();
getHomeInfo.put("gh_statistics", result);
}).exceptionally((e) -> {
return null;
}, pool);
task11.exceptionally((e) -> {
log.error("设备报警前十: {}", e.getMessage(), e);
getHomeInfo.put("gh_statistics", null);
return null;