| | |
| | | return false; |
| | | } |
| | | |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getHostMac(), PoleBindingEnums.FOR_HELP); |
| | | if (!belong) { |
| | | throw new BusinessException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | if(SecurityUtils.getClientId()!=null){ |
| | | boolean belong = SpringContextHolder.getBean(PoleBindingService.class).isBelong(byId.getHostMac(), PoleBindingEnums.FOR_HELP); |
| | | if (!belong) { |
| | | throw new BusinessException("该设备不属于您,不能修改设备信息"); |
| | | } |
| | | } |
| | | InterphoneHost interphoneHost = new InterphoneHost(); |
| | | interphoneHost.setHostId(id); |
| | | BeanUtils.copyProperties(interphoneHostParam, interphoneHost); |
| | |
| | | public boolean deleteHost(Integer id) { |
| | | InterphoneHost byId = getById(id); |
| | | |
| | | if (byId == null) { |
| | | throw new BusinessException("主机不存在!"); |
| | | } |
| | | |
| | | InterphoneHostSubPole one = interphoneHostSubService.getOne(Wrappers.lambdaQuery(InterphoneHostSubPole.class).eq(InterphoneHostSubPole::getHostId, id)); |
| | | if (one != null) { |
| | | throw new BusinessException("该主机存在绑定关系,不能删除"); |
| | | } |
| | | if (byId == null) { |
| | | return false; |
| | | } |
| | | |
| | | /** |