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