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; + } }