| | |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.oa.domain.BsRules; |
| | | import com.ruoyi.oa.domain.DevEquipment; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | private LambdaQueryWrapper<BsTemplate> buildQueryWrapper(BsTemplateBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<BsTemplate> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(bo.getTemplateName() != null, BsTemplate::getTemplateName, bo.getTemplateName()); |
| | | return lqw; |
| | | } |
| | | |
| | |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("模板重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | List<BsTemplate> vList = baseMapper.selectList(new LambdaQueryWrapper<BsTemplate>().eq(BsTemplate::getVersionCode, bo.getVersionCode())); |
| | | if (vList.size() > 0) { |
| | | throw new ServiceException("发布版本重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | // List<BsTemplate> vList = baseMapper.selectList(new LambdaQueryWrapper<BsTemplate>().eq(BsTemplate::getVersionCode, bo.getVersionCode())); |
| | | // if (vList.size() > 0) { |
| | | // throw new ServiceException("发布版本重复", HttpStatus.HTTP_PARTIAL); |
| | | // } |
| | | BsTemplate add = BeanUtil.toBean(bo, BsTemplate.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = save(add); |
| | |
| | | if (list.size() > 0) { |
| | | throw new ServiceException("模板重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | List<BsTemplate> vList = baseMapper.selectList(new LambdaQueryWrapper<BsTemplate>() |
| | | .eq(BsTemplate::getVersionCode, bo.getVersionCode()) |
| | | .ne(BsTemplate::getId, bo.getId())); |
| | | if (vList.size() > 0) { |
| | | throw new ServiceException("发布版本重复", HttpStatus.HTTP_PARTIAL); |
| | | } |
| | | // List<BsTemplate> vList = baseMapper.selectList(new LambdaQueryWrapper<BsTemplate>() |
| | | // .eq(BsTemplate::getVersionCode, bo.getVersionCode()) |
| | | // .ne(BsTemplate::getId, bo.getId())); |
| | | // if (vList.size() > 0) { |
| | | // throw new ServiceException("发布版本重复", HttpStatus.HTTP_PARTIAL); |
| | | // } |
| | | BsTemplate update = BeanUtil.toBean(bo, BsTemplate.class); |
| | | validEntityBeforeSave(update); |
| | | return updateById(update); |