Commit 308bb8a5 authored by 赵啸非's avatar 赵啸非

添加设备告警

parent 72dde527
...@@ -17,10 +17,7 @@ import com.mortals.xhx.common.code.DeviceSourceEnum; ...@@ -17,10 +17,7 @@ import com.mortals.xhx.common.code.DeviceSourceEnum;
import com.mortals.xhx.common.key.ParamKey; import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.common.utils.SendTask; import com.mortals.xhx.common.utils.SendTask;
import com.mortals.xhx.common.utils.SendTaskThreadPool; import com.mortals.xhx.common.utils.SendTaskThreadPool;
import com.mortals.xhx.module.device.model.DeviceAlarmEntity; import com.mortals.xhx.module.device.model.*;
import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceLogEntity;
import com.mortals.xhx.module.device.model.DeviceLogQuery;
import com.mortals.xhx.module.device.service.DeviceAlarmService; import com.mortals.xhx.module.device.service.DeviceAlarmService;
import com.mortals.xhx.module.device.service.DeviceLogService; import com.mortals.xhx.module.device.service.DeviceLogService;
import com.mortals.xhx.module.device.service.DeviceService; import com.mortals.xhx.module.device.service.DeviceService;
...@@ -71,9 +68,9 @@ public class DeviceStatTaskImpl implements ITaskExcuteService { ...@@ -71,9 +68,9 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
try { try {
//获取所有设备,针对每个设备查询最近指定秒的日志,如果没有则更新下线 //获取所有设备,针对每个设备查询最近指定秒的日志,如果没有则更新下线
List<DeviceEntity> collect = deviceService.getCacheList().stream() List<DeviceEntity> collect = deviceService.find(new DeviceQuery().deviceSource(DeviceSourceEnum.大厅.getValue()).deviceOnlineStatus(DeviceOnlineStatusEnum.在线.getValue())).stream()
.filter(f -> f.getDeviceSource() == DeviceSourceEnum.大厅.getValue()) // .filter(f -> f.getDeviceSource() == DeviceSourceEnum.大厅.getValue())
.filter(f -> f.getDeviceOnlineStatus() == DeviceOnlineStatusEnum.在线.getValue()) // .filter(f -> f.getDeviceOnlineStatus() == DeviceOnlineStatusEnum.在线.getValue())
.map(device -> { .map(device -> {
DeviceLogQuery query = new DeviceLogQuery(); DeviceLogQuery query = new DeviceLogQuery();
......
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