Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
9f27c927
Commit
9f27c927
authored
Jun 03, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对于收到的消息进行坐标校验,避免大量的无效坐标
parent
9d5b881b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
CarIotNewListener.java
...a/com/yeejoin/equipmanage/listener/CarIotNewListener.java
+1
-1
ThreadCar.java
...c/main/java/com/yeejoin/equipmanage/thread/ThreadCar.java
+6
-3
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/listener/CarIotNewListener.java
View file @
9f27c927
...
...
@@ -104,7 +104,7 @@ public class CarIotNewListener extends EmqxListener {
Date
startTime
=
new
Date
(
jsonObject
.
getLong
(
"time"
));
wlCarMileage
.
setStartTime
(
startTime
);
wlCarMileage
.
setStartName
(
getAddress
(
startLongitude
,
startLatitude
));
wlCarMileage
.
setStartSpeed
(
jsonObject
.
getIntValue
(
"FireCar_Speed"
));
wlCarMileage
.
setStartSpeed
(
Double
.
valueOf
(
jsonObject
.
getDoubleValue
(
"FireCar_Speed"
)).
intValue
(
));
try
{
iWlCarMileageService
.
save
(
wlCarMileage
);
}
catch
(
Exception
e
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/thread/ThreadCar.java
View file @
9f27c927
...
...
@@ -50,7 +50,7 @@ public class ThreadCar extends Thread {
JSONObject
lastObj
=
null
;
WlCarMileage
last
=
null
;
try
{
TimeUnit
.
MILLISECONDS
.
sleep
(
Long
.
valueOf
((
long
)
(
clippingTime
))
);
this
.
sleep
(
clippingTime
);
//业务处理
//如果十分钟没有坐标,则需要设置结束标记
// 获取结束坐标
...
...
@@ -94,7 +94,7 @@ public class ThreadCar extends Thread {
// 230215180624
// Date endTime =UTCToCST(lastObj.getString("time"));
Date
endTime
=
new
Date
();
Date
endTime
=
new
Date
(
jsonObject
.
getLong
(
"time"
)
);
long
takeTime
=
(
endTime
.
getTime
()
/
1000
*
1000
)
-
(
last
.
getStartTime
().
getTime
()
/
1000
*
1000
);
last
.
setEndLongitude
(
endLongitude
);
last
.
setEndLatitude
(
endLatitude
);
...
...
@@ -114,10 +114,13 @@ public class ThreadCar extends Thread {
last
.
setTravel
(
new
BigDecimal
(
travel
/
1000
).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
iWlCarMileageService
.
updateById
(
last
);
this
.
pushCarInfoToMap
(
jsonObject
,
topic
);
System
.
out
.
println
(
"============================================================更新结束坐标成功==========:"
+
topic
);
this
.
interrupt
();
}
}
catch
(
Exception
exception
)
{
if
(
last
!=
null
)
{
iWlCarMileageService
.
updateById
(
last
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment