| | |
| | | } |
| | | // 刷新过期任务 |
| | | String registerExpireTaskKey = registerExpireTaskKeyPrefix + device.getDeviceId(); |
| | | dynamicTask.startDelay(registerExpireTaskKey, ()-> offline(device.getDeviceId()), device.getExpires() * 1000); |
| | | // 增加一个10秒给设备重发消息的机会 |
| | | dynamicTask.startDelay(registerExpireTaskKey, ()-> offline(device.getDeviceId()), (device.getExpires() + 10) * 1000); |
| | | } |
| | | |
| | | @Override |
| | |
| | | device.setUpdateTime(DateUtil.getNow()); |
| | | if (deviceMapper.update(device) > 0) { |
| | | redisCatchStorage.updateDevice(device); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | if (parentId.length() < 14 ) { |
| | | return null; |
| | | } |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, parentId, null, null, null); |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, parentId, null, null, null,null); |
| | | List<BaseTree<DeviceChannel>> trees = transportChannelsToTree(deviceChannels, parentId); |
| | | return trees; |
| | | } |
| | |
| | | if (parentId.length() < 14 ) { |
| | | return null; |
| | | } |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, parentId, null, null, null); |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, parentId, null, null, null,null); |
| | | return deviceChannels; |
| | | } |
| | | |
| | |
| | | } |
| | | }else { |
| | | if (haveChannel) { |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, null, null, null, null); |
| | | List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, null, null, null, null,null); |
| | | if (deviceChannels != null && deviceChannels.size() > 0) { |
| | | result.addAll(deviceChannels); |
| | | } |