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
c0ee0f4c
Commit
c0ee0f4c
authored
Aug 05, 2021
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
websocket 接口 gengdidi
parent
7eaad711
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
20 deletions
+48
-20
WebSocketController.java
.../zehong/web/controller/webSocket/WebSocketController.java
+0
-20
WebSocketController.java
.../zehong/web/controller/websocket/WebSocketController.java
+47
-0
TDeviceAlarmMapper.xml
...m/src/main/resources/mapper/system/TDeviceAlarmMapper.xml
+1
-0
No files found.
gassafety-admin/src/main/java/com/zehong/web/controller/webSocket/WebSocketController.java
deleted
100644 → 0
View file @
7eaad711
package
com
.
zehong
.
web
.
controller
.
webSocket
;
import
com.zehong.system.service.WebSocketServer
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/websocket"
)
public
class
WebSocketController
{
@Autowired
private
WebSocketServer
webSocketServer
;
@GetMapping
(
"/send"
)
public
void
send
(){
webSocketServer
.
batchSendMessage
(
"dafdfafdas======="
);
}
}
gassafety-admin/src/main/java/com/zehong/web/controller/websocket/WebSocketController.java
0 → 100644
View file @
c0ee0f4c
package
com
.
zehong
.
web
.
controller
.
websocket
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zehong.system.domain.TDeviceAlarm
;
import
com.zehong.system.service.ITDeviceAlarmService
;
import
com.zehong.system.service.ITDeviceInfoService
;
import
com.zehong.system.service.ITPipeService
;
import
com.zehong.system.service.WebSocketServer
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/websocket"
)
public
class
WebSocketController
{
@Autowired
private
WebSocketServer
webSocketServer
;
@Autowired
private
ITDeviceAlarmService
itDeviceAlarmService
;
@Autowired
private
ITDeviceInfoService
itDeviceInfoService
;
@Autowired
private
ITPipeService
itPipeService
;
private
final
static
String
PIPE_TYPE
=
"0"
;
@GetMapping
(
"/send"
)
public
void
send
(
int
alarmId
){
TDeviceAlarm
alarm
=
itDeviceAlarmService
.
selectTDeviceAlarmById
(
alarmId
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"alarmInfo"
,
alarm
);
if
(
PIPE_TYPE
.
equals
(
alarm
.
getAlarmType
())){
json
.
put
(
"deviceInfo"
,
itPipeService
.
selectTPipeById
(
alarm
.
getDeviceId
()));
}
else
{
json
.
put
(
"deviceInfo"
,
itDeviceInfoService
.
selectTDeviceInfoById
(
alarm
.
getDeviceId
()));
}
webSocketServer
.
batchSendMessage
(
alarm
.
toString
());
}
}
gassafety-system/src/main/resources/mapper/system/TDeviceAlarmMapper.xml
View file @
c0ee0f4c
...
@@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"endTime != null "
>
and end_time = #{endTime}
</if>
<if
test=
"endTime != null "
>
and end_time = #{endTime}
</if>
<if
test=
"dealStatus != null and dealStatus != ''"
>
and deal_status = #{dealStatus}
</if>
<if
test=
"dealStatus != null and dealStatus != ''"
>
and deal_status = #{dealStatus}
</if>
</where>
</where>
ORDER BY create_time DESC
</select>
</select>
<select
id=
"selectTDeviceAlarmById"
parameterType=
"int"
resultMap=
"TDeviceAlarmResult"
>
<select
id=
"selectTDeviceAlarmById"
parameterType=
"int"
resultMap=
"TDeviceAlarmResult"
>
...
...
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