Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0dc30233
authored
Nov 04, 2024
by
姚冰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[add] 客流数据中断事件添加
1 parent
571762e0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
src/main/java/vion/constant/MqttMessageType.java
src/main/java/vion/event/mqtt/MqttClientMessageListener.java
src/main/java/vion/constant/MqttMessageType.java
View file @
0dc3023
...
@@ -8,9 +8,11 @@ import java.util.Arrays;
...
@@ -8,9 +8,11 @@ import java.util.Arrays;
public
enum
MqttMessageType
{
public
enum
MqttMessageType
{
REGISTER
(
"REGISTER"
),
REGISTER
(
"REGISTER"
),
DEVICE_OFFLINE
(
"DEVICE_OFFLINE"
),
DEVICE_OFFLINE
(
"DEVICE_OFFLINE"
),
//设备离线
UPGRADE
(
"UPGRADE"
),
UPGRADE
(
"UPGRADE"
),
WHOLEDAY_ANALYZE
(
"WHOLE_ANALYZE_EXCEPTION"
);
WHOLEDAY_ANALYZE
(
"WHOLE_ANALYZE_EXCEPTION"
),
//全天分析异常
DEVICE_REGISTRATION
(
"DEVICE_REGISTRATION"
),
//设备注册次数异常
PASSENGER_FLOW_INTERRUPT
(
"PASSENGER_FLOW_INTERRUPT"
);
//客流数据中断
private
final
String
type
;
private
final
String
type
;
...
...
src/main/java/vion/event/mqtt/MqttClientMessageListener.java
View file @
0dc3023
...
@@ -63,6 +63,10 @@ public class MqttClientMessageListener {
...
@@ -63,6 +63,10 @@ public class MqttClientMessageListener {
//全天分析异常
//全天分析异常
handleWholeDayAnalyze
(
payloadStr
);
handleWholeDayAnalyze
(
payloadStr
);
break
;
break
;
case
MqttMessageType
.
PASSENGER_FLOW_INTERRUPT
:
//客流数据中断
handlePassengerFlowInterrupt
(
payloadStr
);
break
;
default
:
default
:
log
.
info
(
"未定义的消息类型:{}, payload:{}"
,
type
,
payloadStr
);
log
.
info
(
"未定义的消息类型:{}, payload:{}"
,
type
,
payloadStr
);
break
;
break
;
...
@@ -130,5 +134,11 @@ public class MqttClientMessageListener {
...
@@ -130,5 +134,11 @@ public class MqttClientMessageListener {
EventRecord
eventRecord
=
JsonUtil
.
parseObject
(
payloadStr
,
EventRecord
.
class
);
EventRecord
eventRecord
=
JsonUtil
.
parseObject
(
payloadStr
,
EventRecord
.
class
);
recordService
.
save
(
eventRecord
);
recordService
.
save
(
eventRecord
);
}
}
//客流数据中断
private
void
handlePassengerFlowInterrupt
(
String
payloadStr
)
{
EventRecord
eventRecord
=
JsonUtil
.
parseObject
(
payloadStr
,
EventRecord
.
class
);
recordService
.
save
(
eventRecord
);
}
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment