| | |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.oa.domain.SgNvr; |
| | | import com.ruoyi.oa.mapper.SgNvrMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | */ |
| | | @Service |
| | | public class SgIpcServiceImpl extends ServicePlusImpl<SgIpcMapper, SgIpc, SgIpcVo> implements ISgIpcService { |
| | | |
| | | @Autowired |
| | | private SgNvrMapper nvrMapper; |
| | | |
| | | @Override |
| | | public SgIpcVo queryById(Long id) { |
| | |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("MAC重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | 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); |
| | | boolean flag = save(add); |
| | |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("MAC重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | 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); |