From ede630639ad494189282c2c02dbcd4b88741cc30 Mon Sep 17 00:00:00 2001 From: 唐耀东 <18861537@qq.com> Date: 星期四, 12 五月 2022 17:43:37 +0800 Subject: [PATCH] 提交代码 --- ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java index 656fc9a..ecca73a 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java @@ -16,6 +16,7 @@ import com.ruoyi.oa.domain.SgConstructionBatch; import com.ruoyi.oa.mapper.SgConstructionBatchMapper; import com.ruoyi.oa.service.ISgConstructionBatchService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -50,16 +51,16 @@ 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()); + lqw.orderByDesc(SgConstructionBatch::getUpdateTime); return lqw; } @Override + @Transactional(rollbackFor = Exception.class) 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); } @@ -73,9 +74,12 @@ } @Override + @Transactional(rollbackFor = Exception.class) 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); } -- Gitblit v1.9.1