Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
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
pseer
gxpt_ht
Commits
c6249b21
Commit
c6249b21
authored
Dec 28, 2023
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mqtt回复消息写入
parent
6682a26e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
MqttReportType.java
...mmon/src/main/java/share/common/enums/MqttReportType.java
+1
-1
MqttxServiceImpl.java
...main/java/share/system/service/impl/MqttxServiceImpl.java
+3
-1
No files found.
share-common/src/main/java/share/common/enums/MqttReportType.java
View file @
c6249b21
...
...
@@ -17,7 +17,7 @@ public enum MqttReportType {
// topic: 解析网关下属锁id信息: 锁id、信号值、电量、锁状态
MQTT_GATEWAY_BATCH_REPORT
(
"batch_report"
,
"解析网关下属锁id信息"
,
"/thing/data/batch_report"
),
// topic: 下发组号、锁id/取电开关id列表 回复主题
MQTT_GATEWAY_PROPERTY_SET
(
"property_set"
,
"下发组号、锁id/取电开关id信息回复主题"
,
"/thing/property/set
"
),
MQTT_GATEWAY_PROPERTY_SET
_RESPONSE
(
"property_set_response"
,
"下发组号、锁id/取电开关id信息回复主题"
,
"/thing/property/set_response
"
),
MQTT_GATEWAY_EXECUTE_RESPONSE
(
"execute_response"
,
"开门、取电、语音返回信息主题"
,
"/thing/action/execute_response"
)
;
private
String
code
;
...
...
share-system/src/main/java/share/system/service/impl/MqttxServiceImpl.java
View file @
c6249b21
...
...
@@ -140,6 +140,8 @@ public class MqttxServiceImpl implements MqttxService {
isSuccess
=
this
.
updateDevice
(
topic
,
payload
);
}
else
if
(
topic
.
endsWith
(
MqttReportType
.
getTopicStr
(
"execute_response"
)))
{
isSuccess
=
this
.
updateDeviceLog
(
topic
,
payload
);
}
else
if
(
topic
.
endsWith
(
MqttReportType
.
getTopicStr
(
"property_set_response"
)))
{
isSuccess
=
this
.
updateDeviceLog
(
topic
,
payload
);
}
return
isSuccess
;
}
...
...
@@ -533,7 +535,7 @@ public class MqttxServiceImpl implements MqttxService {
JSONObject
json
=
JSONUtil
.
parseObj
(
payload
);
if
(
json
.
size
()
>
0
)
{
JSONArray
array
=
json
.
getJSONArray
(
"params"
);
if
(
array
!=
null
)
{
if
(
array
!=
null
&&
array
.
size
()
>
0
)
{
List
<
Device
>
list
=
new
ArrayList
<>();
for
(
Object
o
:
array
)
{
JSONArray
jsonArray
=
JSONUtil
.
parseArray
(
o
);
...
...
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