新增客户端部门列表

This commit is contained in:
wenc000 2020-01-01 21:08:46 +08:00
parent 00dc0293f0
commit fb93a08e9f
4 changed files with 34 additions and 0 deletions

View File

@ -113,4 +113,9 @@ public interface IApiConsts {
* 部门人员列表
*/
String LIST_DEPARTMENT_USER_BY_USER_DEPARTMENT_ID = "%s/resource/user/listdepartmentuserbyuserdepartmentid";
/**
* 部门zTree
*/
String LIST_ZTREE_DEPARTMENT = "%s/resource/department/listztreedepartment";
}

View File

@ -49,6 +49,17 @@ public class DepartmentController extends AbstractController {
return departmentService.listDepartments(params);
}
@ApiOperation(value = "部门列表zTree", notes = "部门列表zTree接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "上级部门ID", paramType = "form")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listztreedepartment")
public JSONArray listZTreeDepartment() throws AccessTokenException, SearchException {
Map<String, Object> params = requestParams();
return departmentService.listZTreeDepartment(params);
}
@ApiOperation(value = "部门人员列表", notes = "部门人员列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "上级部门ID", paramType = "form")

View File

@ -48,4 +48,14 @@ public interface IDepartmentService {
* @throws SearchException
*/
JSONArray listZTreeDepartmentWithUser(String departmentParentId) throws AccessTokenException, SearchException;
/**
* 部门ZTree列表
*
* @param params
* @return
* @throws AccessTokenException
* @throws SearchException
*/
JSONArray listZTreeDepartment(Map<String, Object> params) throws AccessTokenException, SearchException;
}

View File

@ -67,4 +67,12 @@ public class DepartmentServiceImpl extends AbstractService implements IDepartmen
searchResourceResult(result, "获取部门人员列表失败");
return JSONArray.parseArray(result);
}
@Override
public JSONArray listZTreeDepartment(Map<String, Object> params) throws AccessTokenException, SearchException {
params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String result = restTemplateUtil.doGetFormNormal(String.format(IApiConsts.LIST_ZTREE_DEPARTMENT, apiPathProperties.getUserCenter()), params);
searchResourceResult(result, "获取部门人员列表失败");
return JSONArray.parseArray(result);
}
}