From 545f0bd4b0b2f84fb54c165bc551aa08ca9c073e Mon Sep 17 00:00:00 2001 From: 抓蛙师 <770492966@qq.com> Date: 星期三, 25 八月 2021 20:24:35 +0800 Subject: [PATCH] saveAll支持有id则更新和无id则插入 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java index 82d09e8..30d4075 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java @@ -4,7 +4,7 @@ import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.exception.CustomException; +import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.SysPost; @@ -152,7 +152,7 @@ for (Long postId : postIds) { SysPost post = selectPostById(postId); if (countUserPostById(postId) > 0) { - throw new CustomException(String.format("%1$s宸插垎閰�,涓嶈兘鍒犻櫎", post.getPostName())); + throw new ServiceException(String.format("%1$s宸插垎閰�,涓嶈兘鍒犻櫎", post.getPostName())); } } return baseMapper.deleteBatchIds(Arrays.asList(postIds)); -- Gitblit v1.9.3