| | |
| | | .map(item -> new CabinetCandidate(item.adapterCode(), item.adapterId(), item.deviceCode(), |
| | | item.devtype(), item.devid(), item.ip(), item.mac(), item.name(), item.manufacturer(), item.model(), |
| | | item.channels().stream().map(channel -> new ChannelCandidate(channel.identity(), false, |
| | | DeviceWorkStatus.UNOBSERVABLE, failedAt, null, channel.lastDataAt())).toList(), |
| | | DeviceWorkStatus.UNOBSERVABLE, failedAt, null, channel.lastDataAt(), |
| | | channel.sourceDisplayNo())).toList(), |
| | | failedAt, item.expiresAt(), item.lastDataAt())) |
| | | .toList()); |
| | | detectionCabinetMapper.markRegisteredFactsUnobservable(adapterCode); |
| | |
| | | DeviceWorkStatus workStatus = snapshot == null || snapshot.workStatus() == null |
| | | ? DeviceWorkStatus.UNKNOWN : snapshot.workStatus(); |
| | | detectionCabinetMapper.updateRegisteredChannelObservation(source.adapterCode(), identity.devtype(), |
| | | identity.devid(), identity.subdevid(), identity.chlid(), channel.available() ? "ONLINE" : "OFFLINE", |
| | | identity.devid(), identity.subdevid(), identity.chlid(), |
| | | // 来源自己报了叫法就跟着刷新显示号;没报就保持原样,不去改操作员已登记的显示 |
| | | channel.sourceDisplayNo(), |
| | | channel.available() ? "ONLINE" : "OFFLINE", |
| | | workStatus.name(), observedAt, successfulObservation); |
| | | if (channel.available() && !successfulObservation) |
| | | detectionCabinetMapper.touchRegisteredChannelObservation(source.adapterCode(), identity.devtype(), |
| | |
| | | DeviceWorkStatus status = snapshot == null || snapshot.workStatus() == null |
| | | ? DeviceWorkStatus.UNKNOWN : snapshot.workStatus(); |
| | | return new ChannelCandidate(item.identity(), item.available(), status, observedAt, |
| | | snapshots.get(item.identity()), item.lastDataAt()); |
| | | snapshots.get(item.identity()), item.lastDataAt(), item.sourceDisplayNo()); |
| | | }).toList(); |
| | | Instant lastDataAt = channels.stream().map(DetectedChannel::lastDataAt) |
| | | .filter(java.util.Objects::nonNull).max(Instant::compareTo).orElse(null); |