From 3b574875cb5f4e1eab24bfedbeff4cd3c2b19ea5 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期三, 10 十一月 2021 10:07:28 +0800 Subject: [PATCH] update hutool 5.7.15 => 5.7.16 update okhttp 4.9.1 => 4.9.2 update spring-boot-admin 2.5.2 => 2.5.3 update redisson 3.16.3 => 3.16.4 update tlog 1.3.3 => 1.3.4 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 0a2f8e6..995bd2d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -111,8 +111,7 @@ @Override public boolean hasChildByDeptId(Long deptId) { long result = count(new LambdaQueryWrapper<SysDept>() - .eq(SysDept::getParentId, deptId) - .last("limit 1")); + .eq(SysDept::getParentId, deptId)); return result > 0; } @@ -138,11 +137,11 @@ @Override public String checkDeptNameUnique(SysDept dept) { Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); - SysDept info = getOne(new LambdaQueryWrapper<SysDept>() + long count = count(new LambdaQueryWrapper<SysDept>() .eq(SysDept::getDeptName, dept.getDeptName()) .eq(SysDept::getParentId, dept.getParentId()) - .last("limit 1")); - if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) { + .ne(SysDept::getDeptId, deptId)); + if (count > 0) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; -- Gitblit v1.9.3