Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety
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
耿迪迪
gassafety
Commits
c1e012ed
Commit
c1e012ed
authored
Aug 10, 2021
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
socket 接口修改 gengdidi
parent
d5f664c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
WebSocketController.java
.../zehong/web/controller/websocket/WebSocketController.java
+5
-5
DeviceAlarmVo.java
.../main/java/com/zehong/system/domain/vo/DeviceAlarmVo.java
+17
-0
No files found.
gassafety-admin/src/main/java/com/zehong/web/controller/websocket/WebSocketController.java
View file @
c1e012ed
...
@@ -37,14 +37,14 @@ public class WebSocketController {
...
@@ -37,14 +37,14 @@ public class WebSocketController {
public
void
send
(
int
alarmId
){
public
void
send
(
int
alarmId
){
try
{
try
{
DeviceAlarmVo
alarm
=
itDeviceAlarmService
.
selectTDeviceAlarmById
(
alarmId
);
DeviceAlarmVo
alarm
=
itDeviceAlarmService
.
selectTDeviceAlarmById
(
alarmId
);
JSONObject
json
=
new
JSONObject
();
/*
JSONObject json = new JSONObject();
json
.
put
(
"alarmInfo"
,
alarm
);
json.put("alarmInfo",alarm);
*/
if
(
PIPE_TYPE
.
equals
(
alarm
.
getAlarmType
())){
/*
if(PIPE_TYPE.equals(alarm.getAlarmType())){
json.put("deviceInfo",itPipeService.selectTPipeById(alarm.getDeviceId()));
json.put("deviceInfo",itPipeService.selectTPipeById(alarm.getDeviceId()));
}else{
}else{
json.put("deviceInfo",itDeviceInfoService.selectTDeviceInfoById(alarm.getDeviceId()));
json.put("deviceInfo",itDeviceInfoService.selectTDeviceInfoById(alarm.getDeviceId()));
}
}
*/
webSocketServer
.
batchSendMessage
(
alarm
.
toString
(
));
webSocketServer
.
batchSendMessage
(
JSONObject
.
toJSONString
(
alarm
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"wesocket发送失败!"
);
log
.
error
(
"wesocket发送失败!"
);
}
}
...
...
gassafety-system/src/main/java/com/zehong/system/domain/vo/DeviceAlarmVo.java
View file @
c1e012ed
...
@@ -167,4 +167,21 @@ public class DeviceAlarmVo extends BaseEntity
...
@@ -167,4 +167,21 @@ public class DeviceAlarmVo extends BaseEntity
return
dealStatus
;
return
dealStatus
;
}
}
@Override
public
String
toString
()
{
return
"DeviceAlarmVo{"
+
"alarmId="
+
alarmId
+
", deviceId="
+
deviceId
+
", deviceType='"
+
deviceType
+
'\''
+
", deviceName='"
+
deviceName
+
'\''
+
", deviceCode='"
+
deviceCode
+
'\''
+
", iotNo='"
+
iotNo
+
'\''
+
", orderId='"
+
orderId
+
'\''
+
", alarmType='"
+
alarmType
+
'\''
+
", alarmValue='"
+
alarmValue
+
'\''
+
", startTime="
+
startTime
+
", endTime="
+
endTime
+
", dealStatus='"
+
dealStatus
+
'\''
+
'}'
;
}
}
}
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