From eb844e3260657b6bb9de03c1e5feca50bdf8190d Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期三, 17 十一月 2021 13:50:58 +0800 Subject: [PATCH] fix 修复 OssFactory 在程序启动未调用api 没有初始化 导致无法订阅配置更改问题 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java index 6e0ed78..7bad297 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -117,7 +117,7 @@ * @return 閫変腑瑙掕壊ID鍒楄〃 */ @Override - public List<Integer> selectRoleListByUserId(Long userId) { + public List<Long> selectRoleListByUserId(Long userId) { return baseMapper.selectRoleListByUserId(userId); } @@ -141,9 +141,10 @@ @Override public String checkRoleNameUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); - SysRole info = getOne(new LambdaQueryWrapper<SysRole>() - .eq(SysRole::getRoleName, role.getRoleName()).last("limit 1")); - if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { + long count = count(new LambdaQueryWrapper<SysRole>() + .eq(SysRole::getRoleName, role.getRoleName()) + .ne(SysRole::getRoleId, roleId)); + if (count > 0) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -158,9 +159,10 @@ @Override public String checkRoleKeyUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); - SysRole info = getOne(new LambdaQueryWrapper<SysRole>() - .eq(SysRole::getRoleKey, role.getRoleKey()).last("limit 1")); - if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { + long count = count(new LambdaQueryWrapper<SysRole>() + .eq(SysRole::getRoleKey, role.getRoleKey()) + .ne(SysRole::getRoleId, roleId)); + if (count > 0) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; -- Gitblit v1.9.3