Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
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 fff55e6e
authored
Mar 06, 2023
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加警情查询耗时日志
1 parent
d8b8867f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletions
src/main/java/cn/com/glsx/admin/modules/service/HomeService.java
src/main/java/cn/com/glsx/admin/modules/service/HomeService.java
View file @
fff55e6
...
@@ -16,6 +16,7 @@ import cn.com.glsx.admin.modules.remote.RemoteStuJudgeAlarmService;
...
@@ -16,6 +16,7 @@ import cn.com.glsx.admin.modules.remote.RemoteStuJudgeAlarmService;
import
cn.com.glsx.admin.modules.utils.DateUtil
;
import
cn.com.glsx.admin.modules.utils.DateUtil
;
import
cn.com.glsx.auth.utils.ShieldContextHolder
;
import
cn.com.glsx.auth.utils.ShieldContextHolder
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.StopWatch
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.glsx.plat.common.utils.DateUtils
;
import
com.glsx.plat.common.utils.DateUtils
;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.glsx.plat.common.utils.StringUtils
;
...
@@ -169,17 +170,27 @@ public class HomeService extends AbstractCommonService {
...
@@ -169,17 +170,27 @@ public class HomeService extends AbstractCommonService {
String
endTime
=
nowYmd
+
" 23:59:59"
;
String
endTime
=
nowYmd
+
" 23:59:59"
;
//统计防拆报警
//统计防拆报警
StopWatch
sw
=
new
StopWatch
();
sw
.
start
(
"getTearDownAlarmCount"
);
Integer
tearDownAlarmCount
=
remoteAlarmService
.
getTearDownAlarmCount
(
sns
,
startTime
,
endTime
);
Integer
tearDownAlarmCount
=
remoteAlarmService
.
getTearDownAlarmCount
(
sns
,
startTime
,
endTime
);
sw
.
stop
();
log
.
info
(
sw
.
getLastTaskName
()
+
"耗时:"
+
sw
.
getLastTaskTimeMillis
()
/
1000
+
"s"
);
returnMap
.
put
(
"tearDownAlarmCount"
,
tearDownAlarmCount
);
returnMap
.
put
(
"tearDownAlarmCount"
,
tearDownAlarmCount
);
// 统计断电预警数据
// 统计断电预警数据
sw
.
start
(
"getPowerOffAlertCount"
);
Integer
powerOffAlarmCount
=
remoteAlarmService
.
getPowerOffAlertCount
(
sns
,
startTime
,
endTime
);
Integer
powerOffAlarmCount
=
remoteAlarmService
.
getPowerOffAlertCount
(
sns
,
startTime
,
endTime
);
sw
.
stop
();
log
.
info
(
sw
.
getLastTaskName
()
+
"耗时:"
+
sw
.
getLastTaskTimeMillis
()
/
1000
+
"s"
);
returnMap
.
put
(
"powerOffAlarmCount"
,
powerOffAlarmCount
);
returnMap
.
put
(
"powerOffAlarmCount"
,
powerOffAlarmCount
);
// 统计设备离线报警
// 统计设备离线报警
sw
.
start
(
"getOffLineAlarmCount"
);
Date
date
=
new
Date
();
Date
date
=
new
Date
();
String
lostBegin
=
DateUtil
.
formatDate
(
DateUtils
.
addHours
(
date
,
-
72
));
String
lostBegin
=
DateUtil
.
formatDate
(
DateUtils
.
addHours
(
date
,
-
72
));
List
<
StatCountModel
>
offLineAlarmCountList
=
vehicleMapper
.
getOffLineAlarmCount
(
lostBegin
);
List
<
StatCountModel
>
offLineAlarmCountList
=
vehicleMapper
.
getOffLineAlarmCount
(
lostBegin
);
sw
.
stop
();
log
.
info
(
sw
.
getLastTaskName
()
+
"耗时:"
+
sw
.
getLastTaskTimeMillis
()
/
1000
+
"s"
);
returnMap
.
put
(
"offLineAlarmStartTime"
,
lostBegin
);
returnMap
.
put
(
"offLineAlarmStartTime"
,
lostBegin
);
returnMap
.
put
(
"offLineAlarmEndTime"
,
DateUtil
.
formatDate
(
date
));
returnMap
.
put
(
"offLineAlarmEndTime"
,
DateUtil
.
formatDate
(
date
));
//设备离线数
//设备离线数
...
@@ -187,9 +198,12 @@ public class HomeService extends AbstractCommonService {
...
@@ -187,9 +198,12 @@ public class HomeService extends AbstractCommonService {
returnMap
.
put
(
"offLineAlarmCount"
,
offLineAlarmCount
);
returnMap
.
put
(
"offLineAlarmCount"
,
offLineAlarmCount
);
// 查询大数据研判警情 大数据研判报警总数包括 聚集 黑区 二押
// 查询大数据研判警情 大数据研判报警总数包括 聚集 黑区 二押
sw
.
start
(
"getStuJudgeAlarmCount"
);
Integer
stuJudgeAlarmCount
=
remoteStuJudgeAlarmService
.
getStuJudgeAlarmCount
(
sns
);
Integer
stuJudgeAlarmCount
=
remoteStuJudgeAlarmService
.
getStuJudgeAlarmCount
(
sns
);
sw
.
stop
();
log
.
info
(
sw
.
getLastTaskName
()
+
"耗时:"
+
sw
.
getLastTaskTimeMillis
()
/
1000
+
"s"
);
returnMap
.
put
(
"stuJudgeAlarmCount"
,
stuJudgeAlarmCount
);
returnMap
.
put
(
"stuJudgeAlarmCount"
,
stuJudgeAlarmCount
);
log
.
info
(
"getAlarmNumber总耗时:"
+
sw
.
getTotalTimeSeconds
()
+
"s"
);
return
returnMap
;
return
returnMap
;
}
}
...
...
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