From 1f238ae264c0dfca87bba9ea9da5456153991eaa Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 04 七月 2023 17:22:03 +0800 Subject: [PATCH] 修改system服务部分接口 --- Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java index 3a3f857..565deda 100644 --- a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java @@ -34,6 +34,7 @@ import org.springblade.core.tool.node.ForestNodeMerger; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringPool; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.util.List; @@ -50,6 +51,11 @@ private static final String TENANT_ID = "tenantId"; private static final String PARENT_ID = "parentId"; + /** + * nacos閰嶇疆鐨勭鐞嗙粍绉熸埛id + */ + @Value("${user-info.tenant-id}") + private String tenantId; @Override public IPage<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param, Query query) { @@ -80,10 +86,10 @@ return baseMapper.lazyList(tenantId, parentId, param, Condition.getPage(query)); } - @Override public List<DeptVO> tree(String tenantId) { - List<DeptVO> tree = baseMapper.tree(tenantId); + // 杩欓噷鍒ゆ柇鎴戜滑鑷繁閰嶇疆鐨勭鐞嗙粍绉熸埛锛屽彲浠ユ煡璇㈡墍鏈� + List<DeptVO> tree = baseMapper.tree(tenantId.equals(this.tenantId) ? "":tenantId); return ForestNodeMerger.merge(tree); } -- Gitblit v1.9.3