| | |
| | | List<Device> device = baseMapper.selectList(Wrappers.<Device>lambdaQuery() |
| | | .eq(Device::getIp, ip)); |
| | | if(device.size() > 1) { |
| | | throw new ErrorException("IP:" + ip + "配置了设备多个设备,无法进行数采!"); |
| | | String str = ""; |
| | | for (Device device1 : device) { |
| | | str += device1.getDeviceName() + ","; |
| | | } |
| | | throw new ErrorException("IP:" + ip + "配置了设备多个设备:" + str + ",无法进行数采!"); |
| | | } |
| | | if (ObjectUtils.isEmpty(device)) { |
| | | throw new ErrorException("未给该IP:" + ip + "配置设备,无法进行数采!"); |
| | |
| | | |
| | | return aDtos; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> treeDevice(String deviceName) { |
| | | List<Map<String, Object>> listMap = deviceMapper.treeDevice(deviceName); |
| | | /* Map<String, List<Device>> listMap = devices.stream() |
| | | .collect(Collectors.groupingBy(device -> |
| | | device.getLargeCategory() != null ? device.getLargeCategory() : "其他" |
| | | ));*/ |
| | | return listMap; |
| | | } |
| | | } |