Browse Source

1.deptClient添加通过部门id查询部门名称接口

pull/1/head
zhenghaoyu 1 year ago
parent
commit
4c7527e0b7
  1. 9
      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

9
blade-service-api/blade-system-api/src/main/java/org/springblade/system/feign/IDeptClient.java

@ -51,7 +51,14 @@ public interface IDeptClient {
@GetMapping(TOP) @GetMapping(TOP)
List<Dept> getUserDeptNode(@RequestParam("deptId") Long deptId); List<Dept> getUserDeptNode(@RequestParam("deptId") Long deptId);
/**
* 查询用户下的所有子节点
*
* @param deptId 用户部门ID
* @return BladePage
*/
@GetMapping(API_PREFIX + "/findNameById")
String findNameById(@RequestParam("deptId") Long deptId);
} }

10
blade-service/blade-system/src/main/java/org/springblade/system/feign/DeptClient.java

@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
@ -49,4 +50,13 @@ public class DeptClient implements IDeptClient {
List<Dept> deptChild = service.getMyDeptNode(deptId); List<Dept> deptChild = service.getMyDeptNode(deptId);
return deptChild; return deptChild;
} }
@Override
public String findNameById(Long deptId) {
Dept dept = service.getById(deptId);
if(!Objects.isNull(dept)){
return dept.getDeptName();
}
return null;
}
} }

Loading…
Cancel
Save