| | |
| | | package com.ruoyi.oa.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.http.HttpStatus; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | 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.SgReserveIp; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | import com.ruoyi.oa.domain.SgNvr; |
| | | import com.ruoyi.oa.mapper.SgNvrMapper; |
| | | import com.ruoyi.oa.service.ISgNvrService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.swing.text.html.HTML; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | |
| | | lqw.eq(bo.getConstructionBatchId() != null, SgNvr::getConstructionBatchId, bo.getConstructionBatchId()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getModel()), SgNvr::getModel, bo.getModel()); |
| | | lqw.eq(SgNvr::getSchoolId, bo.getSchoolId()); |
| | | lqw.orderByDesc(SgNvr::getUpdateTime); |
| | | return lqw; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean insertByBo(SgNvrBo bo) { |
| | | List<SgNvr> list = baseMapper.selectList(new LambdaQueryWrapper<SgNvr>() |
| | | .eq(SgNvr::getDeploymentName, bo.getDeploymentName()) |
| | | .eq(SgNvr::getSchoolId, bo.getSchoolId())); |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("部署名称重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | SgNvr add = BeanUtil.toBean(bo, SgNvr.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = save(add); |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateByBo(SgNvrBo bo) { |
| | | List<SgNvr> list = baseMapper.selectList(new LambdaQueryWrapper<SgNvr>() |
| | | .ne(SgNvr::getId, bo.getId()) |
| | | .eq(SgNvr::getDeploymentName, bo.getDeploymentName()) |
| | | .eq(SgNvr::getSchoolId, bo.getSchoolId())); |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("部署名称重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | SgNvr update = BeanUtil.toBean(bo, SgNvr.class); |
| | | validEntityBeforeSave(update); |
| | | return updateById(update); |