From 4d5048435c5c48dad64cfbc086b1a59576bc6454 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期一, 08 十一月 2021 18:17:29 +0800 Subject: [PATCH] fix 修复 ruoyi 关于 配置应用前缀路径的bug 改为配置文件统一配置 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 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 9681b3d..4e04f3a 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 @@ -93,9 +93,10 @@ @Override public String checkPostNameUnique(SysPost post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); - SysPost info = getOne(new LambdaQueryWrapper<SysPost>() - .eq(SysPost::getPostName, post.getPostName()).last("limit 1")); - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { + long count = count(new LambdaQueryWrapper<SysPost>() + .eq(SysPost::getPostName, post.getPostName()) + .ne(SysPost::getPostId, postId)); + if (count > 0) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -110,9 +111,10 @@ @Override public String checkPostCodeUnique(SysPost post) { Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); - SysPost info = getOne(new LambdaQueryWrapper<SysPost>() - .eq(SysPost::getPostCode, post.getPostCode()).last("limit 1")); - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { + long count = count(new LambdaQueryWrapper<SysPost>() + .eq(SysPost::getPostCode, post.getPostCode()) + .ne(SysPost::getPostId, postId)); + if (count > 0) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; -- Gitblit v1.9.3