唐耀东
2022-09-13 62fc5c26cf9a96eeefc4aff8590349ba75913006
ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsTemplateServiceImpl.java
@@ -8,6 +8,7 @@
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;
@@ -50,6 +51,7 @@
    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;
    }
@@ -59,10 +61,10 @@
        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);
@@ -80,12 +82,12 @@
        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);