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
73d45681
Commit
73d45681
authored
May 27, 2022
by
maoying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实时消息画图数据推送异常
parent
2c25df06
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+3
-6
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
73d45681
...
@@ -300,6 +300,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -300,6 +300,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
public
void
publishDataToCanvas
(
List
<
EquipmentSpecificIndex
>
indexList
)
{
public
void
publishDataToCanvas
(
List
<
EquipmentSpecificIndex
>
indexList
)
{
if
(!
ObjectUtils
.
isEmpty
(
indexList
))
{
if
(!
ObjectUtils
.
isEmpty
(
indexList
))
{
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
EquipmentSpecificIndex
index
=
indexList
.
stream
().
filter
(
x
->
x
.
getUpdateDate
()
!=
null
)
EquipmentSpecificIndex
index
=
indexList
.
stream
().
filter
(
x
->
x
.
getUpdateDate
()
!=
null
)
.
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
.
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
.
collect
(
Collectors
.
toList
()).
get
(
0
);
.
collect
(
Collectors
.
toList
()).
get
(
0
);
...
@@ -323,16 +326,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -323,16 +326,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
Map
<
String
,
Object
>
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentStateVo
));
Map
<
String
,
Object
>
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentStateVo
));
map
.
put
(
canvasTopic
,
topicObject
);
map
.
put
(
canvasTopic
,
topicObject
);
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCompletion
(
int
status
)
{
if
(
TransactionSynchronization
.
STATUS_COMMITTED
==
status
)
{
// 发送数据至画布
// 发送数据至画布
mqttSendGateway
.
sendToMqtt
(
canvasTopic
,
JSON
.
toJSONString
(
map
));
mqttSendGateway
.
sendToMqtt
(
canvasTopic
,
JSON
.
toJSONString
(
map
));
}
}
}
});
});
}
}
}
}
...
...
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