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
0fce1fe6
Commit
0fce1fe6
authored
Nov 16, 2024
by
maoying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加从南南瑞平台过来的数据转发至中心
parent
277ecdc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+31
-0
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 @
0fce1fe6
...
...
@@ -537,6 +537,21 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
msg
.
put
(
equipmentSpeIndex
.
getEquipmentIndexKey
(),
value
);
mqttSendGateway
.
sendToMqtt
(
iotTopic
,
JSON
.
toJSONString
(
msg
));
//向中心级推送从数据站过来的数据实时数据
JSONObject
jsonObject
=
new
JSONObject
();
String
zxTopic
=
endIndex
+
"/property"
;
JSONObject
zxmsg
=
new
JSONObject
();
zxmsg
.
put
(
"traceId"
,
equipmentSpeIndex
.
getId
()
+
""
);
zxmsg
.
put
(
equipmentSpeIndex
.
getEquipmentIndexKey
(),
value
);
jsonObject
.
put
(
"topic"
,
zxTopic
);
jsonObject
.
put
(
"data"
,
zxmsg
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"emq.iot.created"
,
jsonObject
.
toString
().
getBytes
(),
2
,
false
);
}
catch
(
MqttException
e
)
{
log
.
info
(
String
.
format
(
"发送eqm转kafka消息失败:%s"
,
e
.
getMessage
()));
}
List
<
EquipmentSpecificVo
>
eqIotCodeList
=
iEquipmentSpecificSerivce
.
getEquipAndCarIotcodeByIotcode
(
iotCode
);
if
(
eqIotCodeList
.
isEmpty
())
{
...
...
@@ -830,6 +845,22 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
msg
.
put
(
"traceId"
,
equipmentSpeIndex
.
getId
()
+
""
);
mqttSendGateway
.
sendToMqtt
(
iotTopic
,
JSON
.
toJSONString
(
msg
));
//向中心级推送从数据站过来的数据实时数据
JSONObject
jsonObject
=
new
JSONObject
();
String
zxTopic
=
endIndex
+
"/property"
;
JSONObject
zxmsg
=
new
JSONObject
();
zxmsg
.
put
(
"traceId"
,
equipmentSpeIndex
.
getId
()
+
""
);
zxmsg
.
put
(
equipmentSpeIndex
.
getEquipmentIndexKey
(),
value
);
jsonObject
.
put
(
"topic"
,
zxTopic
);
jsonObject
.
put
(
"data"
,
zxmsg
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"emq.iot.created"
,
jsonObject
.
toString
().
getBytes
(),
2
,
false
);
}
catch
(
MqttException
e
)
{
log
.
info
(
String
.
format
(
"发送eqm转kafka消息失败:%s"
,
e
.
getMessage
()));
}
List
<
EquipmentSpecificVo
>
eqIotCodeList
=
iEquipmentSpecificSerivce
.
getEquipAndCarIotcodeByIotcode
(
iotCode
);
if
(
eqIotCodeList
.
isEmpty
())
{
...
...
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