| | |
| | | // } |
| | | 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)) { |
| | | //充电桩的绑定是网络请求是带过来的灯杆信息,要允许直接修改 |
| | | if (poleBinding.getDeviceType().equals(deviceType) && deviceType != 2) { |
| | | throw new BusinessException("该灯杆已绑定过相同类型设备"); |
| | | } |
| | | } |
| | |
| | | poleBinding.setDeviceCode(param.getDeviceCode()); |
| | | return save(poleBinding); |
| | | } else { |
| | | throw new BusinessException("该设备已绑定过"); |
| | | one.setPoleId(poleId); |
| | | one.setDeviceType(param.getDeviceType()); |
| | | one.setDeviceName(param.getDeviceName()); |
| | | one.setDeviceCode(param.getDeviceCode()); |
| | | return updateById(one); |
| | | } |
| | | } |
| | | |