From ca420bd9c09b51a404ade3e0106257725df727be Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 01 十一月 2023 11:32:28 +0800
Subject: [PATCH] 整合代码
---
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleServiceImpl.java | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleServiceImpl.java
index dc6025a..d90ff86 100644
--- a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleServiceImpl.java
@@ -24,10 +24,12 @@
import com.vci.ubcs.system.service.IRoleMenuService;
import com.vci.ubcs.system.service.IRoleScopeService;
import com.vci.ubcs.system.service.IRoleService;
+import com.vci.ubcs.system.vo.DeptVO;
import com.vci.ubcs.system.wrapper.RoleWrapper;
import lombok.AllArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.node.ForestNodeMerger;
@@ -76,6 +78,13 @@
excludeRole = RoleConstant.ADMINISTRATOR;
}
return ForestNodeMerger.merge(baseMapper.tree(tenantId, excludeRole));
+ }
+
+ @Override
+ public List<RoleVO> roleList(String tenantId) {
+ // 杩欓噷鍒ゆ柇鎴戜滑鑷繁閰嶇疆鐨勭鐞嗙粍绉熸埛锛屽彲浠ユ煡璇㈡墍鏈�
+ List<RoleVO> tree = baseMapper.roleList(tenantId.equals(tenantId) ? "":tenantId);
+ return tree;
}
@Override
@@ -187,8 +196,11 @@
}
}
if (Func.isEmpty(role.getParentId())) {
- role.setTenantId(AuthUtil.getTenantId());
role.setParentId(BladeConstant.TOP_PARENT_ID);
+ // 鍓嶇浼犱簡鏄睘浜庨偅涓鎴穒d涓嬬殑瑙掕壊
+ if(Func.isEmpty(role.getTenantId())){
+ role.setTenantId(AuthUtil.getTenantId());
+ }
}
if (role.getParentId() > 0) {
Role parent = getById(role.getParentId());
--
Gitblit v1.9.3