Commit 9569c7a0 by 向延琳

测试存储过程

1 parent 34e18a78
...@@ -220,10 +220,12 @@ public class DashboardService extends AbstractCommonService { ...@@ -220,10 +220,12 @@ public class DashboardService extends AbstractCommonService {
log.info("{} 耗时:{} ms", "看板统计信息 - sn查询", stopWatch.getLastTaskTimeMillis()); log.info("{} 耗时:{} ms", "看板统计信息 - sn查询", stopWatch.getLastTaskTimeMillis());
//断电报警 //断电报警
CompletableFuture<Integer> powerOffFutureFuture = CompletableFuture.supplyAsync(() -> getPowerOffCount(sns)); int powerOffCount = getPowerOffCount(sns);
// CompletableFuture<Integer> powerOffFutureFuture = CompletableFuture.supplyAsync(() -> getPowerOffCount(sns));
//光感报警 //光感报警
CompletableFuture<Integer> lightFutureFuture = CompletableFuture.supplyAsync(() -> getLightCount(sns)); int lightCount = getLightCount(sns);
// CompletableFuture<Integer> lightFutureFuture = CompletableFuture.supplyAsync(() -> getLightCount(sns));
//围栏报警 //围栏报警
stopWatch.start(); stopWatch.start();
...@@ -234,14 +236,14 @@ public class DashboardService extends AbstractCommonService { ...@@ -234,14 +236,14 @@ public class DashboardService extends AbstractCommonService {
//在线率 //在线率
String onlineRate = getOnLineRate(totalActiveDevice); String onlineRate = getOnLineRate(totalActiveDevice);
int powerOffCount; // int powerOffCount;
int lightCount; // int lightCount;
try { // try {
powerOffCount = powerOffFutureFuture.get(); // powerOffCount = powerOffFutureFuture.get();
lightCount = lightFutureFuture.get(); // lightCount = lightFutureFuture.get();
} catch (InterruptedException | ExecutionException e) { // } catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e); // throw new RuntimeException(e);
} // }
long t2 = System.currentTimeMillis(); long t2 = System.currentTimeMillis();
log.info("{} 总耗时:{} ms", "看板统计信息", t2 - t1); log.info("{} 总耗时:{} ms", "看板统计信息", t2 - t1);
return new StatisticalInfoVO(totalActiveDevice, totalVehicle, todayActiveDevice, powerOffCount, fenceCount, lightCount, onlineRate); return new StatisticalInfoVO(totalActiveDevice, totalVehicle, todayActiveDevice, powerOffCount, fenceCount, lightCount, onlineRate);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!