|
@@ -24,7 +24,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
* 角色 业务层处理
|
|
@@ -138,9 +143,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
|
*/
|
|
|
@Override
|
|
|
public boolean checkRoleNameUnique(SysRole role) {
|
|
|
- Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
|
|
+ long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
|
|
SysRole info = roleMapper.checkRoleNameUnique(role);
|
|
|
- if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
|
|
+ if (StringUtils.isNotNull(info) && info.getRoleId() != roleId) {
|
|
|
return UserConstants.NOT_UNIQUE;
|
|
|
}
|
|
|
return UserConstants.UNIQUE;
|
|
@@ -154,9 +159,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
|
*/
|
|
|
@Override
|
|
|
public boolean checkRoleKeyUnique(SysRole role) {
|
|
|
- Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
|
|
+ long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
|
|
SysRole info = roleMapper.checkRoleKeyUnique(role);
|
|
|
- if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
|
|
|
+ if (StringUtils.isNotNull(info) && info.getRoleId() != roleId) {
|
|
|
return UserConstants.NOT_UNIQUE;
|
|
|
}
|
|
|
return UserConstants.UNIQUE;
|
|
@@ -285,7 +290,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
|
rm.setMenuId(menuId);
|
|
|
list.add(rm);
|
|
|
}
|
|
|
- if (list.size() > 0) {
|
|
|
+ if (!list.isEmpty()) {
|
|
|
rows = roleMenuMapper.batchRoleMenu(list);
|
|
|
}
|
|
|
return rows;
|
|
@@ -306,7 +311,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
|
rd.setDeptId(deptId);
|
|
|
list.add(rd);
|
|
|
}
|
|
|
- if (list.size() > 0) {
|
|
|
+ if (!list.isEmpty()) {
|
|
|
rows = roleDeptMapper.batchRoleDept(list);
|
|
|
}
|
|
|
return rows;
|