From 98337ecc065e03c2f0e27a124cc3f1bbd7b6f2b6 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Thu, 22 Feb 2024 09:36:16 +0800 Subject: [PATCH] =?UTF-8?q?1.deptClient=E6=B7=BB=E5=8A=A0=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E9=83=A8=E9=97=A8id=E6=9F=A5=E8=AF=A2=E6=89=80?= =?UTF-8?q?=E6=9C=89=E7=A5=96=E5=85=88=E8=8A=82=E7=82=B9=E5=8F=8A=E8=87=AA?= =?UTF-8?q?=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/springblade/system/feign/IDeptClient.java | 5 +++++ .../java/org/springblade/system/feign/DeptClient.java | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/IDeptClient.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/IDeptClient.java index 752e33be..c8d034a0 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/IDeptClient.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/IDeptClient.java @@ -71,4 +71,9 @@ public interface IDeptClient { @GetMapping(API_PREFIX + "/findIdByName") Long findIdByName(@RequestParam("deptName") String deptName); + @GetMapping(API_PREFIX + "/getAncestorsByDeptId") + String getAncestorsByDeptId(@RequestParam("deptId") Long deptId); + + + } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/feign/DeptClient.java b/blade-service/blade-system/src/main/java/org/springblade/system/feign/DeptClient.java index 972383ec..f2f9c0a9 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/feign/DeptClient.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/feign/DeptClient.java @@ -84,4 +84,14 @@ public class DeptClient implements IDeptClient { } return null; } + + @Override + public String getAncestorsByDeptId(Long deptId) { + Dept dept = service.getById(deptId); + if(!Objects.isNull(dept)){ + String ancestors = dept.getAncestors(); + return ancestors+","+deptId; + } + return null; + } }