| | |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("MAC重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | if (null != bo.getNvrId()) { |
| | | SgNvr nvr = nvrMapper.selectById(bo.getNvrId()); |
| | | if (!bo.getOrganizationId().equals(nvr.getOrganizationId())) { |
| | | throw new ServiceException("IPC所属单位与所选NVR所属单位不符", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | } |
| | | SgIpc add = BeanUtil.toBean(bo, SgIpc.class); |
| | | validEntityBeforeSave(add); |
| | |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("MAC重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | if (null != bo.getNvrId()) { |
| | | SgNvr nvr = nvrMapper.selectById(bo.getNvrId()); |
| | | if (!bo.getOrganizationId().equals(nvr.getOrganizationId())) { |
| | | throw new ServiceException("IPC所属单位与所选NVR所属单位不符", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | } |
| | | SgIpc update = BeanUtil.toBean(bo, SgIpc.class); |
| | | validEntityBeforeSave(update); |
| | | return updateById(update); |