|
|
@@ -324,5 +324,26 @@ public class RoleServiceImpl implements IRoleService { |
|
|
|
return JsonResult.success("权限保存成功"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 初始化租户固定角色 |
|
|
|
* @param ids |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public JsonResult roleToTenant(Integer[] ids) { |
|
|
|
for (Integer id : ids) { |
|
|
|
//批量初始化租户对应角色配置 |
|
|
|
List<Role> roles = roleMapper.selectList(Wrappers.<Role>lambdaQuery() |
|
|
|
.eq(Role::getMark, 1).eq(Role::getStatus, 1) |
|
|
|
.eq(Role::getTenantId, 1) |
|
|
|
.ne(Role::getCode, "super")); |
|
|
|
for (Role role : roles) { |
|
|
|
role.setTenantId(id.toString()); |
|
|
|
roleMapper.insert(role); |
|
|
|
} |
|
|
|
} |
|
|
|
return JsonResult.success(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |