Commit 483165ff authored by 赵啸非's avatar 赵啸非

添加告警统计信息

parent 28db3b8a
...@@ -233,7 +233,8 @@ public class DeviceApiController { ...@@ -233,7 +233,8 @@ public class DeviceApiController {
deviceEntity.setDeviceStatus(DeviceStatusEnum.在线.getValue()); deviceEntity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
deviceEntity.setDeviceVersion(req.getDeviceVersion() == null ? "" : req.getDeviceVersion()); deviceEntity.setDeviceVersion(req.getDeviceVersion() == null ? "" : req.getDeviceVersion());
//todo 延迟队列更新 此时进入redis 队列 //todo 延迟队列更新 此时进入redis 队列
cacheService.rpush(RedisKey.KEY_DEVICE_ONLINE_QUEUE,deviceEntity); Long lpush = cacheService.lpush(RedisKey.KEY_DEVICE_ONLINE_QUEUE, deviceEntity);
log.info("lpush:{}",lpush);
//deviceService.getDeviceDao().update(deviceEntity); //deviceService.getDeviceDao().update(deviceEntity);
rsp.setData(deviceResp); rsp.setData(deviceResp);
......
...@@ -18,7 +18,7 @@ public class RedisKey { ...@@ -18,7 +18,7 @@ public class RedisKey {
/** /**
* 设备上线更新队列 * 设备上线更新队列
*/ */
public static final String KEY_DEVICE_ONLINE_QUEUE = "device:online:queue"; public static final String KEY_DEVICE_ONLINE_QUEUE = "device:queue";
public static final String KEY_SITE_CACHE = "siteDict"; public static final String KEY_SITE_CACHE = "siteDict";
......
...@@ -46,6 +46,7 @@ public class DeviceStatTaskImpl implements ITaskExcuteService { ...@@ -46,6 +46,7 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
while (true) { while (true) {
DeviceEntity deviceEntity = cacheService.lpop(RedisKey.KEY_DEVICE_ONLINE_QUEUE, DeviceEntity.class); DeviceEntity deviceEntity = cacheService.lpop(RedisKey.KEY_DEVICE_ONLINE_QUEUE, DeviceEntity.class);
if (ObjectUtils.isEmpty(deviceEntity)) { if (ObjectUtils.isEmpty(deviceEntity)) {
log.info("等待更新队列为空");
break; break;
} else { } else {
waitDeviceInfos.add(deviceEntity); waitDeviceInfos.add(deviceEntity);
......
...@@ -98,7 +98,7 @@ POST {{baseUrl}}/api/register ...@@ -98,7 +98,7 @@ POST {{baseUrl}}/api/register
Content-Type: application/json Content-Type: application/json
{ {
"deviceCode": "0c-cf-89-09-d1-c8" "deviceCode": "B8-13-32-86-3E-F4"
} }
> {% > {%
......
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