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 41a6733d
authored
Jul 29, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
2 parents
01d413c3
dc14d54b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 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 @
41a6733
...
...
@@ -219,18 +219,11 @@ public class DashboardService extends AbstractCommonService {
stopWatch
.
stop
();
log
.
info
(
"{} 耗时:{} ms"
,
"看板统计信息 - sn查询"
,
stopWatch
.
getLastTaskTimeMillis
());
AlarmTrackRecQueryDTO
query
=
new
AlarmTrackRecQueryDTO
();
query
.
setSns
(
sns
);
query
.
setStartTime
(
DateUtil
.
getTodayFirstDateTimeStr
());
query
.
setEndTime
(
DateUtil
.
getTodayLastDateTimeStr
());
query
.
setAlarmType
(
Constants
.
ALARM_TYPE_POWER_OFF
);
//断电报警
CompletableFuture
<
Integer
>
powerOffFutureFuture
=
CompletableFuture
.
supplyAsync
(()
->
getPowerOffCount
(
query
));
CompletableFuture
<
Integer
>
powerOffFutureFuture
=
CompletableFuture
.
supplyAsync
(()
->
getPowerOffCount
(
sns
));
//光感报警
query
.
setAlarmType
(
Constants
.
ALARM_TYPE_LIGHT
);
CompletableFuture
<
Integer
>
lightFutureFuture
=
CompletableFuture
.
supplyAsync
(()
->
getLightCount
(
query
));
CompletableFuture
<
Integer
>
lightFutureFuture
=
CompletableFuture
.
supplyAsync
(()
->
getLightCount
(
sns
));
//围栏报警
stopWatch
.
start
();
...
...
@@ -257,9 +250,14 @@ public class DashboardService extends AbstractCommonService {
/**
* 今日光感
*/
private
Integer
getLightCount
(
AlarmTrackRecQueryDTO
query
)
{
private
Integer
getLightCount
(
List
<
String
>
sns
)
{
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
AlarmTrackRecQueryDTO
query
=
new
AlarmTrackRecQueryDTO
();
query
.
setSns
(
sns
);
query
.
setStartTime
(
DateUtil
.
getTodayFirstDateTimeStr
());
query
.
setEndTime
(
DateUtil
.
getTodayLastDateTimeStr
());
query
.
setAlarmType
(
Constants
.
ALARM_TYPE_LIGHT
);
Integer
lightCount
=
remoteAlarmService
.
getAlarmCount
(
query
);
stopWatch
.
stop
();
log
.
info
(
"{} 耗时:{} ms"
,
"看板统计信息 - 今日光感报警查询"
,
stopWatch
.
getLastTaskTimeMillis
());
...
...
@@ -269,9 +267,14 @@ public class DashboardService extends AbstractCommonService {
/**
* 今日断电报警
*/
private
Integer
getPowerOffCount
(
AlarmTrackRecQueryDTO
query
)
{
private
Integer
getPowerOffCount
(
List
<
String
>
sns
)
{
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
AlarmTrackRecQueryDTO
query
=
new
AlarmTrackRecQueryDTO
();
query
.
setSns
(
sns
);
query
.
setStartTime
(
DateUtil
.
getTodayFirstDateTimeStr
());
query
.
setEndTime
(
DateUtil
.
getTodayLastDateTimeStr
());
query
.
setAlarmType
(
Constants
.
ALARM_TYPE_POWER_OFF
);
Integer
powerOffCount
=
remoteAlarmService
.
getAlarmCount
(
query
);
stopWatch
.
stop
();
log
.
info
(
"{} 耗时:{} ms"
,
"看板统计信息 - 今日断电报警"
,
stopWatch
.
getLastTaskTimeMillis
());
...
...
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