| | |
| | | |
| | | private final LightReportDataService lightReportDataService; |
| | | |
| | | /** |
| | | * 灯杆绑定设备 |
| | | * |
| | | * @param poleId |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public boolean bindPole(Long poleId, PoleBindingParam param) { |
| | | Integer deviceType = param.getDeviceType(); |
| | | // if (PoleBindingEnums.LIGHT.getCode().equals(deviceType)) { |
| | |
| | | } else { |
| | | throw new BusinessException("该设备已绑定过"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 灯杆解绑设备,删除设备前需要解绑 |
| | | * |
| | | * @param deviceCode |
| | | */ |
| | | public void unBindPole(String deviceCode) { |
| | | if (deviceCode == null) |
| | | throw new BusinessException("设备编号不能为空"); |
| | | |
| | | // return false; |
| | | |
| | | PoleBinding one = getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, deviceCode)); |
| | | if (one != null) { |
| | | removeById(one.getId()); |
| | | } |
| | | } |
| | | } |