Commit 3ff5f8bf authored by 赵啸非's avatar 赵啸非

添加设备告警

parent 077e0cb6
......@@ -15,7 +15,7 @@ public class DeviceResp implements Serializable {
/**
* 0.正常,1.重启,2.关机
*/
private Integer type;
private Integer cmd;
}
......@@ -7,6 +7,7 @@ import com.mortals.xhx.busiz.req.DeviceReq;
import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.busiz.rsp.DeviceResp;
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.UploadTask;
import com.mortals.xhx.module.device.service.DeviceLogService;
......@@ -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);
if (!ObjectUtils.isEmpty(type)) {
DeviceResp deviceResp = new DeviceResp();
deviceResp.setType(type);
rsp.setData(deviceResp);
deviceResp.setCmd(type);
}
rsp.setData(deviceResp);
cacheService.del(KEY_DEVICE_TYPE_CACHE + req.getDevicenum());
//if(!ObjectUtils.isEmpty(type))
log.debug("响应【设备数据上报】【响应体】--> " + JSONObject.toJSONString(rsp));
......
......@@ -19,7 +19,7 @@ devicenum|String|是|设备编码唯一
ip|String|否|ip地址
sitenum|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|否|端口
centernum|String|否|中心编码
......@@ -42,7 +42,7 @@ centernum|String|否|中心编码
code|Integer|结果码|见附录码表
msg|String|消息|-
data|object|数据对象|-
 type|Int|设备命令返回| 0.正常,1.重启,2.关机
 cmd|Int|设备命令返回| 0.正常,1.重启,2.关机
......@@ -51,7 +51,7 @@ data|object|数据对象|-
{
"code":1,
"data":{
"type":1
"cmd":1
}
}
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment