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 9516c52c
authored
Jan 07, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
解决首页统计问题
1 parent
72bc76a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
src/main/java/cn/com/glsx/admin/modules/mapper/VehicleMapper.java
src/main/java/cn/com/glsx/admin/modules/service/HomeService.java
src/test/java/cn/com/glsx/test/UtilsTest.java
src/main/java/cn/com/glsx/admin/modules/mapper/VehicleMapper.java
View file @
9516c52
...
...
@@ -11,7 +11,6 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -231,7 +230,7 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
* @return
*/
@DataPerm
(
showSql
=
true
)
Integer
getOffLineAlarmCount
(
@Param
(
"lostBegin"
)
Date
lostBegin
);
Integer
getOffLineAlarmCount
(
@Param
(
"lostBegin"
)
String
lostBegin
);
Vehicle
selectByOrderId
(
@Param
(
"workOrderId"
)
Long
workOrderId
);
...
...
src/main/java/cn/com/glsx/admin/modules/service/HomeService.java
View file @
9516c52
...
...
@@ -135,7 +135,8 @@ public class HomeService {
returnMap
.
put
(
"powerOffAlarmCount"
,
powerOffAlarmCount
);
// 统计设备离线报警
Date
lostBegin
=
DateUtils
.
addHours
(
new
Date
(),
-
72
);
String
lostBegin
=
DateUtil
.
formatDateYmd
(
DateUtils
.
addHours
(
new
Date
(),
-
72
));
log
.
info
(
"lostBegin==="
+
lostBegin
);
Integer
offLineAlarmCount
=
vehicleMapper
.
getOffLineAlarmCount
(
lostBegin
);
returnMap
.
put
(
"offLineAlarmCount"
,
offLineAlarmCount
);
...
...
src/test/java/cn/com/glsx/test/UtilsTest.java
View file @
9516c52
package
cn
.
com
.
glsx
.
test
;
import
cn.com.glsx.admin.modules.utils.DateUtil
;
import
com.glsx.plat.common.utils.DateUtils
;
import
java.util.Date
;
public
class
UtilsTest
{
...
...
@@ -7,5 +10,8 @@ public class UtilsTest {
public
static
void
main
(
String
[]
args
)
{
Date
date
=
new
Date
();
System
.
out
.
println
(
"date = "
+
date
.
getHours
());
String
lostBegin
=
DateUtil
.
formatDateYmd
(
DateUtils
.
addHours
(
new
Date
(),
-
72
));
System
.
out
.
println
(
"lostBegin = "
+
lostBegin
);
}
}
}
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