| | |
| | | if (!permissionConfig.check(MenuEnum.UNBIND.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = poleService.unBindPole(poleId, param.getDeviceCode(),param.getDeviceType()); |
| | | boolean result = poleService.unBindPole(poleId, param.getDeviceCode(), param.getDeviceType()); |
| | | if (result) { |
| | | //设备类型,0路灯,1led屏幕,2充电桩,3大气监测,4水质监测,5ip音柱,6lcd广告机,7摄像头,8杆体倾测,9一键救助, 10熙讯, 11农耕 |
| | | switch (param.getDeviceType().toString()) { |
| | |
| | | throw new BusinessException("播放时间需大于零且小于86400000 !"); |
| | | } |
| | | VnnoxResult vnnoxResult = poleService.pushAirDataToNova(param); |
| | | if (vnnoxResult == null && vnnoxResult.getSuccess() != null && vnnoxResult.getSuccess().size() != 0) { |
| | | if (vnnoxResult != null && vnnoxResult.getSuccess() != null && !vnnoxResult.getSuccess().isEmpty()) { |
| | | return ResponseUtil.success("推送成功"); |
| | | } else { |
| | | return ResponseUtil.fail("推送失败"); |
| | |
| | | } |
| | | |
| | | |
| | | LambdaQueryWrapper<PoleBinding> eq = Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getPoleId, poleId); |
| | | LambdaQueryWrapper<PoleBinding> eq = Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceType, param.getDeviceType()).eq(PoleBinding::getPoleId, poleId); |
| | | List<PoleBinding> list = list(eq); |
| | | if (list.size() != 0) { |
| | | for (PoleBinding poleBinding : list) { |
| | |
| | | } |
| | | } |
| | | |
| | | PoleBinding one = getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, param.getDeviceCode())); |
| | | PoleBinding one = getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, param.getDeviceCode()) |
| | | .eq(PoleBinding::getDeviceType, param.getDeviceType())); |
| | | if (one == null) { |
| | | //充电桩保存绑定关系需要先判断是不是正确的灯杆 |
| | | if (deviceType == 2) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 灯杆解绑设备,删除设备前需要解绑 |
| | | * |
| | | * @param deviceCode |
| | | */ |
| | | public boolean unBindPole(Long poleId, String deviceCode,Integer deviceType) { |
| | | public boolean unBindPole(Long poleId, String deviceCode, Integer deviceType) { |
| | | if (deviceCode == null) { |
| | | throw new BusinessException("设备编号不能为空"); |
| | | } |
| | |
| | | } |
| | | |
| | | public PoleBinding getPoleIdByMac(String deviceCode) { |
| | | return getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, deviceCode).eq(PoleBinding::getDeviceType,0)); |
| | | return getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceCode, deviceCode).eq(PoleBinding::getDeviceType, 0)); |
| | | } |
| | | |
| | | |