唐耀东
2022-05-12 d44b855ffdda21a5abf8e00bc3381310882f9375
ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java
@@ -50,16 +50,14 @@
        Map<String, Object> params = bo.getParams();
        LambdaQueryWrapper<SgConstructionBatch> lqw = Wrappers.lambdaQuery();
        lqw.like(StringUtils.isNotBlank(bo.getBatch()), SgConstructionBatch::getBatch, bo.getBatch());
        lqw.eq(bo.getStartDate() != null, SgConstructionBatch::getStartDate, bo.getStartDate());
        lqw.eq(bo.getEndDate() != null, SgConstructionBatch::getEndDate, bo.getEndDate());
        lqw.eq(bo.getUserId() != null, SgConstructionBatch::getUserId, bo.getUserId());
        lqw.eq(SgConstructionBatch::getSchoolId, bo.getSchoolId());
        return lqw;
    }
    @Override
    public Boolean insertByBo(SgConstructionBatchBo bo) {
        List<SgConstructionBatch> list = baseMapper.selectList(new LambdaQueryWrapper<SgConstructionBatch>()
            .eq(SgConstructionBatch::getBatch, bo.getBatch()));
            .eq(SgConstructionBatch::getBatch, bo.getBatch()).eq(SgConstructionBatch::getSchoolId, bo.getSchoolId()));
        if (list.size() > 0) {
            throw new ServiceException("施工批次重复", HttpStatus.HTTP_PARTIAL);
        }
@@ -75,7 +73,9 @@
    @Override
    public Boolean updateByBo(SgConstructionBatchBo bo) {
        List<SgConstructionBatch> list = baseMapper.selectList(new LambdaQueryWrapper<SgConstructionBatch>()
            .eq(SgConstructionBatch::getBatch, bo.getBatch()).ne(SgConstructionBatch::getId, bo.getId()));
            .eq(SgConstructionBatch::getBatch, bo.getBatch())
            .ne(SgConstructionBatch::getId, bo.getId())
            .eq(SgConstructionBatch::getSchoolId, bo.getSchoolId()));
        if (list.size() > 0) {
            throw new ServiceException("施工批次重复", HttpStatus.HTTP_PARTIAL);
        }