Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-miniappserver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9569c7a0
authored
Aug 17, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
测试存储过程
1 parent
34e18a78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
src/main/java/cn/com/glsx/app/modules/service/DashboardService.java
src/main/java/cn/com/glsx/app/modules/service/DashboardService.java
View file @
9569c7a
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment