| | |
| | | List<Pole> online = new ArrayList<>();//在线 |
| | | List<Pole> offline = new ArrayList<>();//离线 |
| | | list.forEach(onLinePole -> { |
| | | System.out.println("online---------------------------------------------------" + ("ONLINE").equals(onLinePole.getOnLineState())); |
| | | System.out.println("online---------------------------------------------------" + (onLinePole.getOnLineState())); |
| | | if (("ONLINE").equals(onLinePole.getOnLineState())) { |
| | | online.add(onLinePole); |
| | | } else if (("OFFLINE").equals(onLinePole.getOnLineState())) { |
| | |
| | | MacCodes.add(post.getDeviceCode()); |
| | | } |
| | | } |
| | | // |
| | | List<BatchGetDeviceStateResponse.DeviceStatus> deviceStatuses = MainBoardInvokeSyncService.getInstance().batchGetDeviceState(MacCodes); |
| | | if (deviceStatuses != null) { |
| | | for (Pole post : list) { |
| | | for (BatchGetDeviceStateResponse.DeviceStatus deviceStatus : deviceStatuses) { |
| | | |
| | | List<BatchGetDeviceStateResponse.DeviceStatus> deviceStatuses=null; |
| | | if (post.getDeviceCode() != null && post.getDeviceCode().equals(deviceStatus.getDeviceName())) { |
| | | post.setOnLineState(deviceStatus.getStatus()); |
| | | |
| | | //拆分list |
| | | List<List<String>> split = CollectionUtil.split(MacCodes, 50); |
| | | |
| | | for (List<String> splist : split) { |
| | | deviceStatuses=MainBoardInvokeSyncService.getInstance().batchGetDeviceState(splist); |
| | | if (deviceStatuses != null) { |
| | | for (Pole post : list) { |
| | | for (BatchGetDeviceStateResponse.DeviceStatus deviceStatus : deviceStatuses) { |
| | | |
| | | if (post.getDeviceCode() != null && post.getDeviceCode().equals(deviceStatus.getDeviceName())) { |
| | | post.setOnLineState(deviceStatus.getStatus()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | // List<BatchGetDeviceStateResponse.DeviceStatus> deviceStatuses = MainBoardInvokeSyncService.getInstance().batchGetDeviceState(MacCodes); |
| | | |
| | | |
| | | return list; |
| | | } |