|
@@ -25,7 +25,7 @@ import java.util.List;
|
|
|
* Created by macro on 2018/9/30.
|
|
|
*/
|
|
|
@Service
|
|
|
-public class UmsRoleServiceImpl extends ServiceImpl<UmsRoleMapper,UmsRole>implements UmsRoleService {
|
|
|
+public class UmsRoleServiceImpl extends ServiceImpl<UmsRoleMapper, UmsRole> implements UmsRoleService {
|
|
|
@Autowired
|
|
|
private UmsAdminCacheService adminCacheService;
|
|
|
@Autowired
|
|
@@ -36,6 +36,7 @@ public class UmsRoleServiceImpl extends ServiceImpl<UmsRoleMapper,UmsRole>implem
|
|
|
private UmsMenuMapper menuMapper;
|
|
|
@Autowired
|
|
|
private UmsResourceMapper resourceMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public boolean create(UmsRole role) {
|
|
|
role.setCreateTime(new Date());
|
|
@@ -53,13 +54,13 @@ public class UmsRoleServiceImpl extends ServiceImpl<UmsRoleMapper,UmsRole>implem
|
|
|
|
|
|
@Override
|
|
|
public Page<UmsRole> list(String keyword, Integer pageSize, Integer pageNum) {
|
|
|
- Page<UmsRole> page = new Page<>(pageNum,pageSize);
|
|
|
+ Page<UmsRole> page = new Page<>(pageNum, pageSize);
|
|
|
QueryWrapper<UmsRole> wrapper = new QueryWrapper<>();
|
|
|
LambdaQueryWrapper<UmsRole> lambda = wrapper.lambda();
|
|
|
- if(StrUtil.isNotEmpty(keyword)){
|
|
|
- lambda.like(UmsRole::getName,keyword);
|
|
|
+ if (StrUtil.isNotEmpty(keyword)) {
|
|
|
+ lambda.like(UmsRole::getName, keyword);
|
|
|
}
|
|
|
- return page(page,wrapper);
|
|
|
+ return page(page, wrapper);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -81,7 +82,7 @@ public class UmsRoleServiceImpl extends ServiceImpl<UmsRoleMapper,UmsRole>implem
|
|
|
public int allocMenu(Long roleId, List<Long> menuIds) {
|
|
|
//先删除原有关系
|
|
|
QueryWrapper<UmsRoleMenuRelation> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.lambda().eq(UmsRoleMenuRelation::getRoleId,roleId);
|
|
|
+ wrapper.lambda().eq(UmsRoleMenuRelation::getRoleId, roleId);
|
|
|
roleMenuRelationService.remove(wrapper);
|
|
|
//批量插入新关系
|
|
|
List<UmsRoleMenuRelation> relationList = new ArrayList<>();
|
|
@@ -99,7 +100,7 @@ public class UmsRoleServiceImpl extends ServiceImpl<UmsRoleMapper,UmsRole>implem
|
|
|
public int allocResource(Long roleId, List<Long> resourceIds) {
|
|
|
//先删除原有关系
|
|
|
QueryWrapper<UmsRoleResourceRelation> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.lambda().eq(UmsRoleResourceRelation::getRoleId,roleId);
|
|
|
+ wrapper.lambda().eq(UmsRoleResourceRelation::getRoleId, roleId);
|
|
|
roleResourceRelationService.remove(wrapper);
|
|
|
//批量插入新关系
|
|
|
List<UmsRoleResourceRelation> relationList = new ArrayList<>();
|