| | |
| | | // } |
| | | LambdaQueryWrapper<PoleBinding> eq = Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId); |
| | | List<PoleBinding> list = list(eq); |
| | | if (list.size() != 0){ |
| | | if (list.size() != 0) { |
| | | for (PoleBinding poleBinding : list) { |
| | | if (poleBinding.getDeviceType().equals(deviceType)) { |
| | | throw new BusinessException("该灯杆已绑定过相同类型设备"); |
| | |
| | | poleBinding.setDeviceCode(param.getDeviceCode()); |
| | | return save(poleBinding); |
| | | } else { |
| | | throw new BusinessException("该设备已绑定过"); |
| | | one.setPoleId(poleId); |
| | | one.setDeviceType(param.getDeviceType()); |
| | | return updateById(one); |
| | | } |
| | | } |
| | | |