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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
28 deletions
+25
-28
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+25
-28
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,39 +300,36 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -300,39 +300,36 @@ 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
))
{
EquipmentSpecificIndex
index
=
indexList
.
stream
().
filter
(
x
->
x
.
getUpdateDate
()
!=
null
)
.
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
.
collect
(
Collectors
.
toList
()).
get
(
0
);
EquipmentStateVo
equipmentStateVo
=
new
EquipmentStateVo
();
equipmentStateVo
.
setEquipName
(
index
.
getEquipmentSpecificName
());
equipmentStateVo
.
setOrgCode
(
index
.
getOrgCode
());
equipmentStateVo
.
setSpecificId
(
index
.
getEquipmentSpecificId
());
equipmentStateVo
.
setEquipCode
(
index
.
getQrCode
());
equipmentStateVo
.
setEquipIotCode
(
index
.
getIotCode
());
equipmentStateVo
.
setStatus
(
""
);
equipmentStateVo
.
setColor
(
index
.
getEmergencyLevelColor
());
// 添加性能指标项
equipmentStateVo
.
setSpeindexList
(
fireFightingSystemService
.
getSpeIndex
(
index
.
getEquipmentSpecificId
()));
Map
<
String
,
Object
>
topicObject
=
new
HashMap
<>();
topicObject
.
put
(
"equipCode"
,
equipmentStateVo
.
getEquipCode
());
if
(
TrueOrFalseEnum
.
real
.
value
.
toUpperCase
().
equals
(
index
.
getValue
().
toUpperCase
()))
{
topicObject
.
put
(
"color"
,
equipmentStateVo
.
getColor
());
}
else
{
topicObject
.
put
(
"color"
,
""
);
}
Map
<
String
,
Object
>
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentStateVo
));
map
.
put
(
canvasTopic
,
topicObject
);
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
@Override
public
void
afterCompletion
(
int
status
)
{
public
void
afterCommit
()
{
if
(
TransactionSynchronization
.
STATUS_COMMITTED
==
status
)
{
EquipmentSpecificIndex
index
=
indexList
.
stream
().
filter
(
x
->
x
.
getUpdateDate
()
!=
null
)
// 发送数据至画布
.
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
mqttSendGateway
.
sendToMqtt
(
canvasTopic
,
JSON
.
toJSONString
(
map
));
.
collect
(
Collectors
.
toList
()).
get
(
0
);
EquipmentStateVo
equipmentStateVo
=
new
EquipmentStateVo
();
equipmentStateVo
.
setEquipName
(
index
.
getEquipmentSpecificName
());
equipmentStateVo
.
setOrgCode
(
index
.
getOrgCode
());
equipmentStateVo
.
setSpecificId
(
index
.
getEquipmentSpecificId
());
equipmentStateVo
.
setEquipCode
(
index
.
getQrCode
());
equipmentStateVo
.
setEquipIotCode
(
index
.
getIotCode
());
equipmentStateVo
.
setStatus
(
""
);
equipmentStateVo
.
setColor
(
index
.
getEmergencyLevelColor
());
// 添加性能指标项
equipmentStateVo
.
setSpeindexList
(
fireFightingSystemService
.
getSpeIndex
(
index
.
getEquipmentSpecificId
()));
Map
<
String
,
Object
>
topicObject
=
new
HashMap
<>();
topicObject
.
put
(
"equipCode"
,
equipmentStateVo
.
getEquipCode
());
if
(
TrueOrFalseEnum
.
real
.
value
.
toUpperCase
().
equals
(
index
.
getValue
().
toUpperCase
()))
{
topicObject
.
put
(
"color"
,
equipmentStateVo
.
getColor
());
}
else
{
topicObject
.
put
(
"color"
,
""
);
}
}
Map
<
String
,
Object
>
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentStateVo
));
map
.
put
(
canvasTopic
,
topicObject
);
// 发送数据至画布
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