From 124672f4dbf3752a7c7d54c91f583175a9606697 Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Tue, 3 Aug 2021 16:15:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=9A=E8=BF=87=E4=B8=8A?= =?UTF-8?q?=E7=BA=A7=E9=83=A8=E9=97=A8=E6=9F=A5=E8=AF=A2=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/cm/common/plugin/IApiConsts.java | 1 + .../oauth/service/department/IDepartmentService.java | 9 ++++++++- .../service/department/impl/DepartmentServiceImpl.java | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/IApiConsts.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/IApiConsts.java index d638fe0..3639794 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/IApiConsts.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/IApiConsts.java @@ -215,4 +215,5 @@ public interface IApiConsts { * 部门列表 */ String LIST_DEPARTMENT_SORT = "%s/resource/department/list-sort"; + } diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/IDepartmentService.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/IDepartmentService.java index 9325f60..3feb35c 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/IDepartmentService.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/IDepartmentService.java @@ -3,7 +3,6 @@ package com.cm.common.plugin.oauth.service.department; import com.alibaba.fastjson.JSONArray; import com.cm.common.exception.AccessTokenException; import com.cm.common.exception.SearchException; -import com.cm.common.plugin.pojo.bos.department.DepartmentResourceBO; import com.cm.common.pojo.dtos.department.DepartmentSortDTO; import java.util.List; @@ -69,4 +68,12 @@ public interface IDepartmentService { * @return */ List listSortByType(String type); + + /** + * 部门列表 + * + * @param parentId 上级ID + * @return + */ + List listSortByParentId(String parentId); } diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/impl/DepartmentServiceImpl.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/impl/DepartmentServiceImpl.java index cc5ef68..7061ccf 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/impl/DepartmentServiceImpl.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/department/impl/DepartmentServiceImpl.java @@ -89,4 +89,14 @@ public class DepartmentServiceImpl extends AbstractService implements IDepartmen searchResourceResult(result, "获取部门列表失败"); return JSONArray.parseArray(result, DepartmentSortDTO.class); } + + @Override + public List listSortByParentId(String parentId) { + Map params = new HashMap<>(2); + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); + params.put("departmentParentId", parentId); + String result = restTemplateUtil.doGetFormNormal(String.format(IApiConsts.LIST_DEPARTMENT_SORT, apiPathProperties.getUserCenter()), params); + searchResourceResult(result, "获取部门列表失败"); + return JSONArray.parseArray(result, DepartmentSortDTO.class); + } }