From 079dc12fe13d4b24d9b652f22f335e4f6b7b0465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Mon, 31 May 2021 16:55:26 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20system=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=20=E5=88=A0=E9=99=A4=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/system/service/impl/SysConfigServiceImpl.java | 3 ++- .../ruoyi/system/service/impl/SysDictDataServiceImpl.java | 3 ++- .../ruoyi/system/service/impl/SysDictTypeServiceImpl.java | 6 ++---- .../com/ruoyi/system/service/impl/SysUserServiceImpl.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java index 7b5d061c..d0b37c5e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; +import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map; @@ -157,9 +158,9 @@ public class SysConfigServiceImpl extends ServiceImpl dictDatas = baseMapper.selectDictDataByType(data.getDictType()); DictUtils.setDictCache(data.getDictType(), dictDatas); } + baseMapper.deleteBatchIds(Arrays.asList(dictCodes)); } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java index 79a4036e..c4f9d955 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -21,6 +21,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; +import java.util.Arrays; import java.util.List; import java.util.Map; @@ -32,9 +33,6 @@ import java.util.Map; @Service public class SysDictTypeServiceImpl extends ServiceImpl implements ISysDictTypeService { - @Autowired - private SysDictTypeMapper dictTypeMapper; - @Autowired private SysDictDataMapper dictDataMapper; @@ -149,9 +147,9 @@ public class SysDictTypeServiceImpl extends ServiceImpl 0) { throw new CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName())); } - dictTypeMapper.deleteById(dictId); DictUtils.removeDictCache(dictType.getDictType()); } + baseMapper.deleteBatchIds(Arrays.asList(dictIds)); } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index f729a818..3133703f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -100,7 +100,7 @@ public class SysUserServiceImpl extends ServiceImpl impl @Override public String selectUserRoleGroup(String userName) { List list = roleMapper.selectRolesByUserName(userName); - StringBuffer idsStr = new StringBuffer(); + StringBuilder idsStr = new StringBuilder(); for (SysRole role : list) { idsStr.append(role.getRoleName()).append(","); } @@ -119,7 +119,7 @@ public class SysUserServiceImpl extends ServiceImpl impl @Override public String selectUserPostGroup(String userName) { List list = postMapper.selectPostsByUserName(userName); - StringBuffer idsStr = new StringBuffer(); + StringBuilder idsStr = new StringBuilder(); for (SysPost post : list) { idsStr.append(post.getPostName()).append(","); }