|
@@ -32,4 +32,25 @@ public class CommonUtils {
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 判断当前用户是否拥有 “ 财务员工 ” 的角色
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static boolean haveRoleCwYg() {
|
|
|
+ UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ List<RoleDTO> roles = new ArrayList<>(); // 当前用户拥有的角色
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
|
|
|
+ roles = userDTO.getRoleDTOList().stream().filter(item -> {
|
|
|
+ // 过滤当前用户是否拥有财务员工角色
|
|
|
+ if ("1579674195583508481".equals(item.getId())) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(roles)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|