Browse Source

1.deptClient添加通过部门id查询所有祖先节点及自己

pull/1/head
zhenghaoyu 11 months ago
parent
commit
98337ecc06
  1. 5
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/IDeptClient.java
  2. 10
      blade-service/blade-system/src/main/java/org/springblade/system/feign/DeptClient.java

5
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);
}

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

Loading…
Cancel
Save