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
19848713
Commit
19848713
authored
Dec 11, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.车辆里程异常结束问题处理。
parent
19f1338c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
JxiopCarIotListerServiceImpl.java
...quipmanage/service/impl/JxiopCarIotListerServiceImpl.java
+5
-5
WlCarMileageServiceImpl.java
...oin/equipmanage/service/impl/WlCarMileageServiceImpl.java
+4
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/JxiopCarIotListerServiceImpl.java
View file @
19848713
...
...
@@ -67,7 +67,7 @@ public class JxiopCarIotListerServiceImpl {
// public static final ConcurrentHashMap<String, String> deviceLastInfo = new ConcurrentHashMap();
// @Async("equipAsyncExecutor")
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
){
logger
.
info
(
"----收到物联消息::topic---------------"
+
topic
);
logger
.
info
(
"----收到物联消息::message---------------"
+
message
);
...
...
@@ -224,8 +224,8 @@ public class JxiopCarIotListerServiceImpl {
sendObj
.
put
(
"carNum"
,
car
.
getCarNum
());
sendObj
.
put
(
"bizOrgName"
,
car
.
getBizOrgName
());
sendArr
.
add
(
sendObj
);
MqttMessage
mqttMessage
=
new
MqttMessage
();
mqttMessage
.
setPayload
(
sendArr
.
toJSONString
().
getBytes
());
//
MqttMessage mqttMessage = new MqttMessage();
//
mqttMessage.setPayload(sendArr.toJSONString().getBytes());
car
.
setLongitude
(
startLongitude
);
car
.
setLatitude
(
startLatitude
);
if
(!
ObjectUtils
.
isEmpty
(
car
.
getMaxSpeed
()))
{
...
...
@@ -250,9 +250,9 @@ public class JxiopCarIotListerServiceImpl {
}
logger
.
info
(
"-----------推送车辆位置消息到到地图成功--------"
);
try
{
emqkeeper
.
getMqttClient
().
publish
(
"car/location"
,
mqttMessag
e
);
emqkeeper
.
getMqttClient
().
publish
(
"car/location"
,
sendArr
.
toJSONString
().
getBytes
(),
0
,
fals
e
);
}
catch
(
MqttException
e
)
{
throw
new
RuntimeException
(
e
);
e
.
printStackTrace
(
);
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/WlCarMileageServiceImpl.java
View file @
19848713
...
...
@@ -506,7 +506,6 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
// 里程耗时
long
takeTime
=
(
date
.
getTime
())
-
(
item
.
getStartTime
().
getTime
());
// 查询车辆最新位置
// 修改0点未结束里程记录
item
.
setEndSpeed
(
v
.
intValue
());
item
.
setEndTime
(
date
);
...
...
@@ -519,7 +518,11 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
}
item
.
setTravel
(
new
BigDecimal
(
travel
/
1000
).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
item
.
setTakeTime
(
takeTime
);
if
(
travel
>
0.5
){
this
.
getBaseMapper
().
updateById
(
item
);
}
else
{
this
.
getBaseMapper
().
deleteById
(
item
.
getId
());
}
log
.
info
(
"-----------结束里程成功:::"
+
JSONObject
.
toJSONString
(
item
)
+
"-----------------"
);
Car
car
=
iCarService
.
getOne
(
new
QueryWrapper
<
Car
>().
eq
(
"iot_code"
,
item
.
getIotCode
()));
car
.
setLongitude
(
startLongitude
);
...
...
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