From 540c9ecc28dab3b1fd2f25b5f8244f346468d89c Mon Sep 17 00:00:00 2001 From: WenG <450292408@qq.com> Date: Thu, 17 Sep 2020 21:59:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cm/common/plugin/IApiConsts.java | 36 +++++ .../service/position/IPositionService.java | 10 ++ .../position/impl/PositionServiceImpl.java | 17 +++ .../oauth/service/role/IRoleService.java | 12 +- .../service/role/impl/RoleServiceImpl.java | 2 - .../oauth/service/user/IUserService.java | 68 +++++++++ .../service/user/impl/UserServiceImpl.java | 138 +++++++++++++++++- .../plugin/pojo/bos/UserResourceBO.java | 0 .../bos/department/DepartmentResourceBO.java | 69 +++++++++ .../bos/user/UserDepartmentResourceBO.java | 46 ++++++ 10 files changed, 393 insertions(+), 5 deletions(-) rename {cloud-common-plugin-oauth => cloud-common-plugin}/src/main/java/com/cm/common/plugin/pojo/bos/UserResourceBO.java (100%) create mode 100644 cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/department/DepartmentResourceBO.java create mode 100644 cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/user/UserDepartmentResourceBO.java 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 700e02a..1c4aae5 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 @@ -122,6 +122,10 @@ public interface IApiConsts { * 角色zTree */ String LIST_ZTREE_ROLE = "%s/resource/role/listztreerole"; + /** + * 职位zTree + */ + String LIST_ZTREE_POSITION = "%s/resource/role/listztreeposition"; /** * 获取所有用户列表(通过上级区域ID) */ @@ -146,5 +150,37 @@ public interface IApiConsts { * 用户动态详情列表(通过id列表) */ String LIST_DYNAMIC_USER_INFO_BY_IDS = "%s/resource/userinfo/listdynamicuserinfobyids"; + /** + * 用户动态详情(通过id列表) + */ String GET_DYNAMIC_USER_INFO_BY_ID = "%s/resource/userinfo/getdynamicuserinfobyid/%s"; + /** + * 获取用户(通过ID) + */ + String GET_USER_DEPARTMENT_RESOURCE_BY_ID = "%s/resource/user/getuserdepartmentresourcebyid/%s"; + /** + * 获取用户列表(通过ID) + */ + String LIST_USER_DEPARTMENT_RESOURCE_BY_IDS = "%s/resource/user/listuserdepartmentresourcebyids"; + /** + * 获取用户列表(通过部门ID列表) + */ + String LIST_USER_DEPARTMENT_RESOURCE_BY_DEPARTMENT_IDS = "%s/resource/user/listuserdepartmentresourcebydepartmentids"; + /** + * 获取所在部门用户列表(通过用户ID和角色ID列表) + */ + String LIST_USER_DEPARTMENT_RESOURCE_BY_USER_ID_AND_ROLE_IDS = "%s/resource/user/listuserdepartmentresourcebyuseridandroleids/%s"; + /** + * 获取用户列表(通过角色ID列表) + */ + String LIST_USER_DEPARTMENT_RESOURCE_BY_ROLE_IDS = "%s/resource/user/listuserdepartmentresourcebyroleids"; + /** + * 获取所在部门用户列表(通过用户ID和职位ID列表) + */ + String LIST_USER_DEPARTMENT_RESOURCE_BY_USER_ID_AND_POSITION_IDS = "%s/resource/user/listuserdepartmentresourcebyuseridandpositionids/%s"; + /** + * 获取所在部门用户列表(通过职位ID列表) + */ + String LIST_USER_DEPARTMENT_RESOURCE_BY_POSITION_IDS = "%s/resource/user/listuserdepartmentresourcebypositionids"; + } diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/position/IPositionService.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/position/IPositionService.java index 5b547e5..3052d0a 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/position/IPositionService.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/position/IPositionService.java @@ -28,4 +28,14 @@ public interface IPositionService { */ JSONArray listUserPosition(Map params) throws AccessTokenException, SearchException; + /** + * 职位树 + * + * @param positionParentId + * @return + * @throws AccessTokenException + * @throws SearchException + */ + JSONArray listZTreePosition(String positionParentId) throws AccessTokenException, SearchException; + } diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/position/impl/PositionServiceImpl.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/position/impl/PositionServiceImpl.java index ea8bccf..453c04f 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/position/impl/PositionServiceImpl.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/position/impl/PositionServiceImpl.java @@ -7,10 +7,12 @@ import com.cm.common.exception.AccessTokenException; import com.cm.common.exception.SearchException; import com.cm.common.plugin.IApiConsts; import com.cm.common.plugin.oauth.service.position.IPositionService; +import com.cm.common.plugin.oauth.token.ClientTokenManager; import com.cm.common.plugin.utils.RestTemplateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.Map; /** @@ -43,4 +45,19 @@ public class PositionServiceImpl extends AbstractService implements IPositionSer return JSONArray.parseArray(result); } + @Override + public JSONArray listZTreePosition(String positionParentId) throws AccessTokenException, SearchException { + Map params = new HashMap<>(1); + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); + params.put("id", positionParentId); + String result = restTemplateUtil.doGetFormNormal(String.format(IApiConsts.LIST_ZTREE_POSITION, apiPathProperties.getUserCenter()), params); + if (result == null) { + throw new AccessTokenException("认证失败"); + } + if (result.isEmpty()) { + throw new SearchException("获取列表失败"); + } + return JSONArray.parseArray(result); + } + } diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/role/IRoleService.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/role/IRoleService.java index 738b783..692009a 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/role/IRoleService.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/role/IRoleService.java @@ -1,6 +1,8 @@ package com.cm.common.plugin.oauth.service.role; import com.alibaba.fastjson.JSONArray; +import com.cm.common.exception.AccessTokenException; +import com.cm.common.exception.SearchException; /** * When you feel like quitting. Think about why you started @@ -13,5 +15,13 @@ import com.alibaba.fastjson.JSONArray; * @Version: 1.0 **/ public interface IRoleService { - JSONArray listZTreeRole(String roleParentId); + /** + * 角色树 + * + * @param roleParentId + * @return + * @throws AccessTokenException + * @throws SearchException + */ + JSONArray listZTreeRole(String roleParentId) throws AccessTokenException, SearchException; } diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/role/impl/RoleServiceImpl.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/role/impl/RoleServiceImpl.java index 1cdfc91..ded5e97 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/role/impl/RoleServiceImpl.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/role/impl/RoleServiceImpl.java @@ -29,8 +29,6 @@ import java.util.Map; @Service public class RoleServiceImpl extends AbstractService implements IRoleService { - @Autowired - private OAuth2ClientProperties oAuth2ClientProperties; @Autowired private ApiPathProperties apiPathProperties; @Autowired diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/user/IUserService.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/user/IUserService.java index c9340e5..46b446d 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/user/IUserService.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/user/IUserService.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; import com.cm.common.exception.AccessTokenException; import com.cm.common.exception.SearchException; import com.cm.common.plugin.pojo.bos.UserResourceBO; +import com.cm.common.plugin.pojo.bos.user.UserDepartmentResourceBO; import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultList; import org.aspectj.lang.annotation.DeclareError; @@ -263,4 +264,71 @@ public interface IUserService { * @throws SearchException */ JSONObject getDynamicUserInfoByUserId(String userId) throws AccessTokenException, SearchException; + + + /** + * 获取用户(通过ID) + * + * @param userId + * @return + * @throws SearchException + */ + UserDepartmentResourceBO getUserDepartmentResourceById(String userId) throws SearchException; + + /** + * 获取用户列表(通过ID) + * + * @param userIds + * @return + * @throws SearchException + */ + List listUserDepartmentResourceByIds(List userIds) throws SearchException; + + /** + * 获取用户列表(通过部门ID列表) + * + * @param departmentIds + * @return + * @throws SearchException + */ + List listUserDepartmentResourceByDepartmentIds(List departmentIds) throws SearchException; + + /** + * 获取所在部门用户列表(通过用户ID和角色ID列表) + * + * @param userId + * @param roleIds + * @return + * @throws SearchException + */ + List listUserDepartmentResourceByUserIdAndRoleIds(String userId, List roleIds) throws SearchException; + + /** + * 获取所在部门用户列表(通过角色ID列表) + * + * @param roleIds + * @return + * @throws SearchException + */ + List listUserDepartmentResourceByRoleIds(List roleIds) throws SearchException; + + /** + * 获取所在部门用户列表(通过用户ID和职位ID列表) + * + * @param userId + * @param positionIds + * @return + * @throws SearchException + */ + List listUserDepartmentResourceByUserIdAndPositionIds(String userId, List positionIds) throws SearchException; + + /** + * 获取所在部门用户列表(通过职位ID列表) + * + * @param positionIds + * @return + * @throws SearchException + */ + List listUserDepartmentResourceByPositionIds(List positionIds) throws SearchException; + } diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/user/impl/UserServiceImpl.java b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/user/impl/UserServiceImpl.java index f7beaa4..658f3fb 100644 --- a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/user/impl/UserServiceImpl.java +++ b/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/oauth/service/user/impl/UserServiceImpl.java @@ -11,6 +11,7 @@ import com.cm.common.plugin.IApiConsts; import com.cm.common.plugin.oauth.service.user.IUserService; import com.cm.common.plugin.oauth.token.ClientTokenManager; import com.cm.common.plugin.pojo.bos.UserResourceBO; +import com.cm.common.plugin.pojo.bos.user.UserDepartmentResourceBO; import com.cm.common.plugin.utils.RestTemplateUtil; import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultList; @@ -19,6 +20,7 @@ import org.apache.poi.util.StringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.print.attribute.standard.PageRanges; import java.util.*; /** @@ -197,7 +199,7 @@ public class UserServiceImpl extends AbstractService implements IUserService { @Override public List listUserResourceByIds(List userIds) throws AccessTokenException, SearchException { - if (userIds.isEmpty()) { + if (userIds == null || userIds.isEmpty()) { return new ArrayList<>(); } StringBuilder userIdsSB = new StringBuilder(); @@ -217,7 +219,7 @@ public class UserServiceImpl extends AbstractService implements IUserService { @Override public JSONArray listDynamicUserInfoByIds(List userIds) throws AccessTokenException, SearchException { - if (userIds.isEmpty()) { + if (userIds == null || userIds.isEmpty()) { return new JSONArray(); } StringBuilder userIdsSB = new StringBuilder(); @@ -246,4 +248,136 @@ public class UserServiceImpl extends AbstractService implements IUserService { searchResourceResult(result, "获取动态人员信息失败"); return JSONObject.parseObject(result); } + + @Override + public UserDepartmentResourceBO getUserDepartmentResourceById(String userId) throws SearchException { + if (StringUtils.isBlank(userId)) { + return null; + } + Map params = getHashMap(2); + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); + String result = restTemplateUtil.doGetFormNormal(String.format(IApiConsts.GET_USER_DEPARTMENT_RESOURCE_BY_ID, apiPathProperties.getUserCenter(), userId), params); + searchResourceResult(result, "获取人员信息失败"); + return JSONObject.parseObject(result, UserDepartmentResourceBO.class); + } + + @Override + public List listUserDepartmentResourceByIds(List userIds) throws SearchException { + if (userIds == null || userIds.isEmpty()) { + return new ArrayList<>(); + } + StringBuilder userIdsSB = new StringBuilder(); + for (String userId : userIds) { + if (userIdsSB.length() > 0) { + userIdsSB.append("_"); + } + userIdsSB.append(userId); + } + Map params = getHashMap(2); + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); + params.put("userIds", userIdsSB.toString()); + String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_USER_DEPARTMENT_RESOURCE_BY_IDS, apiPathProperties.getUserCenter()), params); + searchResourceResult(result, "获取人员信息失败"); + return JSONArray.parseArray(result, UserDepartmentResourceBO.class); + } + + @Override + public List listUserDepartmentResourceByDepartmentIds(List departmentIds) throws SearchException { + if (departmentIds == null || departmentIds.isEmpty()) { + return new ArrayList<>(); + } + StringBuilder departmentIdsSB = new StringBuilder(); + for (String departmentId : departmentIds) { + if (departmentIdsSB.length() > 0) { + departmentIdsSB.append("_"); + } + departmentIdsSB.append(departmentId); + } + Map params = getHashMap(2); + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); + params.put("departmentIds", departmentIdsSB.toString()); + String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_USER_DEPARTMENT_RESOURCE_BY_DEPARTMENT_IDS, apiPathProperties.getUserCenter()), params); + searchResourceResult(result, "获取人员信息失败"); + return JSONArray.parseArray(result, UserDepartmentResourceBO.class); + } + + @Override + public List listUserDepartmentResourceByUserIdAndRoleIds(String userId, List roleIds) throws SearchException { + if (StringUtils.isBlank(userId) || roleIds == null || roleIds.isEmpty()) { + return new ArrayList<>(); + } + StringBuilder roleIdsSB = new StringBuilder(); + for (String roleId : roleIds) { + if (roleIdsSB.length() > 0) { + roleIdsSB.append("_"); + } + roleIdsSB.append(roleId); + } + Map params = getHashMap(4); + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); + params.put("roleIds", roleIdsSB.toString()); + String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_USER_DEPARTMENT_RESOURCE_BY_USER_ID_AND_ROLE_IDS, apiPathProperties.getUserCenter(), userId), params); + searchResourceResult(result, "获取人员信息失败"); + return JSONArray.parseArray(result, UserDepartmentResourceBO.class); + } + + @Override + public List listUserDepartmentResourceByRoleIds(List roleIds) throws SearchException { + if (roleIds == null || roleIds.isEmpty()) { + return new ArrayList<>(); + } + StringBuilder roleIdsSB = new StringBuilder(); + for (String roleId : roleIds) { + if (roleIdsSB.length() > 0) { + roleIdsSB.append("_"); + } + roleIdsSB.append(roleId); + } + Map params = getHashMap(2); + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); + params.put("roleIds", roleIdsSB.toString()); + String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_USER_DEPARTMENT_RESOURCE_BY_ROLE_IDS, apiPathProperties.getUserCenter()), params); + searchResourceResult(result, "获取人员信息失败"); + return JSONArray.parseArray(result, UserDepartmentResourceBO.class); + } + + @Override + public List listUserDepartmentResourceByUserIdAndPositionIds(String userId, List positionIds) throws SearchException { + if (StringUtils.isBlank(userId) || positionIds == null || positionIds.isEmpty()) { + return new ArrayList<>(); + } + StringBuilder positionIdsSB = new StringBuilder(); + for (String positionId : positionIds) { + if (positionIdsSB.length() > 0) { + positionIdsSB.append("_"); + } + positionIdsSB.append(positionId); + } + Map params = getHashMap(4); + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); + params.put("positionIds", positionIdsSB.toString()); + String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_USER_DEPARTMENT_RESOURCE_BY_USER_ID_AND_POSITION_IDS, apiPathProperties.getUserCenter(), userId), params); + searchResourceResult(result, "获取人员信息失败"); + return JSONArray.parseArray(result, UserDepartmentResourceBO.class); + } + + @Override + public List listUserDepartmentResourceByPositionIds(List positionIds) throws SearchException { + if (positionIds == null || positionIds.isEmpty()) { + return new ArrayList<>(); + } + StringBuilder positionIdsSB = new StringBuilder(); + for (String positionId : positionIds) { + if (positionIdsSB.length() > 0) { + positionIdsSB.append("_"); + } + positionIdsSB.append(positionId); + } + Map params = getHashMap(4); + params.put(IApiConsts.ACCESS_TOKEN, ClientTokenManager.getInstance().getClientToken().getAccessToken()); + params.put("positionIds", positionIdsSB.toString()); + String result = restTemplateUtil.doPostFormNormal(String.format(IApiConsts.LIST_USER_DEPARTMENT_RESOURCE_BY_POSITION_IDS, apiPathProperties.getUserCenter()), params); + searchResourceResult(result, "获取人员信息失败"); + return JSONArray.parseArray(result, UserDepartmentResourceBO.class); + } } diff --git a/cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/pojo/bos/UserResourceBO.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/UserResourceBO.java similarity index 100% rename from cloud-common-plugin-oauth/src/main/java/com/cm/common/plugin/pojo/bos/UserResourceBO.java rename to cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/UserResourceBO.java diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/department/DepartmentResourceBO.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/department/DepartmentResourceBO.java new file mode 100644 index 0000000..b19b3f4 --- /dev/null +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/department/DepartmentResourceBO.java @@ -0,0 +1,69 @@ +package com.cm.common.plugin.pojo.bos.department; + +import java.io.Serializable; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: DepartmentResourceBO + * @Description: + * @Author: WangGeng + * @Date: 2020/9/16 18:37 + * @Version: 1.0 + **/ +public class DepartmentResourceBO implements Serializable { + + private static final long serialVersionUID = -6925619505625197420L; + private String userId; + private String departmentId; + private String departmentName; + private String departmentCode; + + public String getUserId() { + return userId == null ? "" : userId.trim(); + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getDepartmentId() { + return departmentId == null ? "" : departmentId.trim(); + } + + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public String getDepartmentName() { + return departmentName == null ? "" : departmentName.trim(); + } + + public void setDepartmentName(String departmentName) { + this.departmentName = departmentName; + } + + public String getDepartmentCode() { + return departmentCode == null ? "" : departmentCode.trim(); + } + + public void setDepartmentCode(String departmentCode) { + this.departmentCode = departmentCode; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"userId\":\"") + .append(userId).append('\"'); + sb.append(",\"departmentId\":\"") + .append(departmentId).append('\"'); + sb.append(",\"departmentName\":\"") + .append(departmentName).append('\"'); + sb.append(",\"departmentCode\":\"") + .append(departmentCode).append('\"'); + sb.append('}'); + return sb.toString(); + } +} diff --git a/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/user/UserDepartmentResourceBO.java b/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/user/UserDepartmentResourceBO.java new file mode 100644 index 0000000..5df15fc --- /dev/null +++ b/cloud-common-plugin/src/main/java/com/cm/common/plugin/pojo/bos/user/UserDepartmentResourceBO.java @@ -0,0 +1,46 @@ +package com.cm.common.plugin.pojo.bos.user; + +import com.cm.common.plugin.pojo.bos.UserResourceBO; +import com.cm.common.plugin.pojo.bos.department.DepartmentResourceBO; + +import java.util.ArrayList; +import java.util.List; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: UserDepartmentResourceBO + * @Description: 用户部门资源 + * @Author: WangGeng + * @Date: 2020/9/16 18:14 + * @Version: 1.0 + **/ +public class UserDepartmentResourceBO extends UserResourceBO { + + public UserDepartmentResourceBO() { + super(); + } + + public UserDepartmentResourceBO(UserResourceBO userResourceBO) { + super(); + super.setUserId(userResourceBO.getUserId()); + super.setUserUsername(userResourceBO.getUserUsername()); + super.setUserName(userResourceBO.getUserName()); + super.setUserPhone(userResourceBO.getUserPhone()); + super.setUserEmail(userResourceBO.getUserEmail()); + } + + private List departments; + + public List getDepartments() { + if (departments == null) { + return new ArrayList<>(); + } + return departments; + } + + public void setDepartments(List departments) { + this.departments = departments; + } +}