Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-platform
Commits
3ff5f8bf
Commit
3ff5f8bf
authored
Aug 05, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加设备告警
parent
077e0cb6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
device-manager/src/main/java/com/mortals/xhx/busiz/rsp/DeviceResp.java
...r/src/main/java/com/mortals/xhx/busiz/rsp/DeviceResp.java
+1
-1
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
...n/java/com/mortals/xhx/busiz/web/DeviceApiController.java
+5
-3
doc/api.md
doc/api.md
+3
-3
No files found.
device-manager/src/main/java/com/mortals/xhx/busiz/rsp/DeviceResp.java
View file @
3ff5f8bf
...
@@ -15,7 +15,7 @@ public class DeviceResp implements Serializable {
...
@@ -15,7 +15,7 @@ public class DeviceResp implements Serializable {
/**
/**
* 0.正常,1.重启,2.关机
* 0.正常,1.重启,2.关机
*/
*/
private
Integer
type
;
private
Integer
cmd
;
}
}
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
View file @
3ff5f8bf
...
@@ -7,6 +7,7 @@ import com.mortals.xhx.busiz.req.DeviceReq;
...
@@ -7,6 +7,7 @@ import com.mortals.xhx.busiz.req.DeviceReq;
import
com.mortals.xhx.busiz.rsp.ApiResp
;
import
com.mortals.xhx.busiz.rsp.ApiResp
;
import
com.mortals.xhx.busiz.rsp.DeviceResp
;
import
com.mortals.xhx.busiz.rsp.DeviceResp
;
import
com.mortals.xhx.common.code.ApiRespCodeEnum
;
import
com.mortals.xhx.common.code.ApiRespCodeEnum
;
import
com.mortals.xhx.common.code.DeviceActionEnum
;
import
com.mortals.xhx.common.utils.SendTaskThreadPool
;
import
com.mortals.xhx.common.utils.SendTaskThreadPool
;
import
com.mortals.xhx.common.utils.UploadTask
;
import
com.mortals.xhx.common.utils.UploadTask
;
import
com.mortals.xhx.module.device.service.DeviceLogService
;
import
com.mortals.xhx.module.device.service.DeviceLogService
;
...
@@ -57,12 +58,13 @@ public class DeviceApiController {
...
@@ -57,12 +58,13 @@ public class DeviceApiController {
}
}
//判断当前设备是否设置了标志类型,如果设置了 则访问
//判断当前设备是否设置了标志类型,如果设置了 则访问
DeviceResp
deviceResp
=
new
DeviceResp
();
deviceResp
.
setCmd
(
DeviceActionEnum
.
正常
.
getValue
());
Integer
type
=
cacheService
.
get
(
KEY_DEVICE_TYPE_CACHE
+
req
.
getDevicenum
(),
Integer
.
class
);
Integer
type
=
cacheService
.
get
(
KEY_DEVICE_TYPE_CACHE
+
req
.
getDevicenum
(),
Integer
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
type
))
{
if
(!
ObjectUtils
.
isEmpty
(
type
))
{
DeviceResp
deviceResp
=
new
DeviceResp
();
deviceResp
.
setCmd
(
type
);
deviceResp
.
setType
(
type
);
rsp
.
setData
(
deviceResp
);
}
}
rsp
.
setData
(
deviceResp
);
cacheService
.
del
(
KEY_DEVICE_TYPE_CACHE
+
req
.
getDevicenum
());
cacheService
.
del
(
KEY_DEVICE_TYPE_CACHE
+
req
.
getDevicenum
());
//if(!ObjectUtils.isEmpty(type))
//if(!ObjectUtils.isEmpty(type))
log
.
debug
(
"响应【设备数据上报】【响应体】--> "
+
JSONObject
.
toJSONString
(
rsp
));
log
.
debug
(
"响应【设备数据上报】【响应体】--> "
+
JSONObject
.
toJSONString
(
rsp
));
...
...
doc/api.md
View file @
3ff5f8bf
...
@@ -19,7 +19,7 @@ devicenum|String|是|设备编码唯一
...
@@ -19,7 +19,7 @@ devicenum|String|是|设备编码唯一
ip|String|否|ip地址
ip|String|否|ip地址
sitenum|String|是|站点编码、
sitenum|String|是|站点编码、
siteName|String|否|站点名称
siteName|String|否|站点名称
type|Int|
是
|设备类型(1.呼叫器,2.窗口屏, 3.评价器,4.集中屏, 5.排号机,6.im设备, 7.样表设备,8.取件柜, 9.信息发布,10.导视机,11.开标室设备,12.背靠背,13.无感一码通,14.桌面式自助终端,15.可视化触控大屏,16.人脸识别考勤机)
type|Int|
否
|设备类型(1.呼叫器,2.窗口屏, 3.评价器,4.集中屏, 5.排号机,6.im设备, 7.样表设备,8.取件柜, 9.信息发布,10.导视机,11.开标室设备,12.背靠背,13.无感一码通,14.桌面式自助终端,15.可视化触控大屏,16.人脸识别考勤机)
port|String|否|端口
port|String|否|端口
centernum|String|否|中心编码
centernum|String|否|中心编码
...
@@ -42,7 +42,7 @@ centernum|String|否|中心编码
...
@@ -42,7 +42,7 @@ centernum|String|否|中心编码
code|Integer|结果码|见附录码表
code|Integer|结果码|见附录码表
msg|String|消息|-
msg|String|消息|-
data|object|数据对象|-
data|object|数据对象|-
 
type
|Int|设备命令返回| 0.正常,1.重启,2.关机
 
cmd
|Int|设备命令返回| 0.正常,1.重启,2.关机
...
@@ -51,7 +51,7 @@ data|object|数据对象|-
...
@@ -51,7 +51,7 @@ data|object|数据对象|-
{
{
"code":1,
"code":1,
"data":{
"data":{
"
type
":1
"
cmd
":1
}
}
}
}
```
```
\ No newline at end of file
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