修改:根据权限返回参数

This commit is contained in:
zjh 2025-12-10 14:32:53 +08:00
parent f8155e1c1f
commit c16633143e

View File

@ -22,36 +22,9 @@ public class UserPermissionGetter {
@Resource @Resource
private RuntimeAppContextService runtimeAppContextService; private RuntimeAppContextService runtimeAppContextService;
// 获取子系统权限
public List<String> getSubsystemPermissions() {
// String currentUserId = runtimeAppContextService.getCurrentUserId();
String currentUserId = "zjh";
Set<String> result = new HashSet<>();
try {
// 获取用户权限
result = modelRoleService.selectPersByUser(currentUserId)
.stream().map(MenuParamView::getSubsystem).collect(Collectors.toSet());
// 获取用户所在部门权限
List<String> deptIds = businessDatabase.getBusinessDatabase()
.eq("user_id", currentUserId).doQuery(XdapDeptUsers.class)
.stream().map(XdapDeptUsers::getDepartmentId).collect(Collectors.toList());
for (String deptId : deptIds) {
Set<String> deptPermissions = modelRoleService.selectPersByUser(deptId)
.stream().map(MenuParamView::getSubsystem).collect(Collectors.toSet());
result.addAll(deptPermissions);
}
}
catch (Exception e) {
log.error(e.getMessage());
}
return new ArrayList<>(result);
}
// 获取子系统下的参数权限 // 获取子系统下的参数权限
public List<String> getParamPermissions(String subsystem) { public List<String> getParamPermissions(String subsystem) {
// String currentUserId = runtimeAppContextService.getCurrentUserId(); String currentUserId = runtimeAppContextService.getCurrentUserId();
String currentUserId = "zjh";
Set<String> result = new HashSet<>(); Set<String> result = new HashSet<>();
try { try {
// 获取用户权限 // 获取用户权限
@ -81,8 +54,7 @@ public class UserPermissionGetter {
// 获取全部参数权限 // 获取全部参数权限
public List<String> getParamPermissions() { public List<String> getParamPermissions() {
// String currentUserId = runtimeAppContextService.getCurrentUserId(); String currentUserId = runtimeAppContextService.getCurrentUserId();
String currentUserId = "zjh";
Set<String> result = new HashSet<>(); Set<String> result = new HashSet<>();
try { try {
// 获取用户权限 // 获取用户权限