| | |
| | | */ |
| | | public boolean bindPole(Long poleId, PoleBindingParam param) { |
| | | Integer deviceType = param.getDeviceType(); |
| | | // if (PoleBindingEnums.LIGHT.getCode().equals(deviceType)) { |
| | | // } |
| | | |
| | | int size = 0; |
| | | switch (deviceType.toString()) { |
| | |
| | | size = SpringContextHolder.getBean(C3ChargingService.class).list(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, param.getDeviceCode())).size(); |
| | | break; |
| | | case PoleBindingEnums.ATMOSPHERIC: |
| | | Pole byId = SpringContextHolder.getBean(PoleService.class).getById(poleId); |
| | | if (byId == null) { |
| | | throw new BusinessException("未找到灯杆"); |
| | | } |
| | | if (byId.getDeviceCode() != null || !byId.getDeviceCode().isEmpty()) { |
| | | if (!param.getDeviceCode().equals(byId.getDeviceCode())) { |
| | | throw new BusinessException("灯杆mac和大气mac不一致, 无法绑定"); |
| | | } |
| | | } else { |
| | | throw new BusinessException("灯杆mac为空,无法绑定大气设备"); |
| | | } |
| | | |
| | | size = SpringContextHolder.getBean(AirEquipmentService.class).list(Wrappers.lambdaQuery(AirEquipment.class).eq(AirEquipment::getMac, param.getDeviceCode())).size(); |
| | | break; |
| | | case PoleBindingEnums.WATER: |