| | |
| | | */ |
| | | @Component |
| | | public class RoleUtils { |
| | | /** |
| | | * 以角色继承角色显示出指定库信息按堆垛机限制 |
| | | */ |
| | | public static <T> String outRole(Long userId) { |
| | | // super账号 |
| | | if (userId == 9527) { |
| | | return "all"; |
| | | } |
| | | |
| | | UserService userService = SpringUtils.getBean(UserService.class); |
| | | User user = userService.selectById(userId); |
| | | String roleName = user.getRoleName(); |
| | | |
| | | // 管理员角色 |
| | | if (Cools.isEmpty(roleName)) { |
| | | |
| | | } else if (roleName.equals("管理员")) { |
| | | return "all"; |
| | | } |
| | | |
| | | // 其他角色看继承角色 |
| | | String roleLeaderCode = user.getRoleLeaderCode(); |
| | | if (Cools.isEmpty(roleLeaderCode)) { |
| | | |
| | | } else if (roleLeaderCode.equals("stacker_hangar")) { // 堆垛机库 |
| | | return "stacker_hangar"; |
| | | } else if (roleLeaderCode.equals("four_directional_library")) { // 四向库 |
| | | return "four_directional_library"; |
| | | } else if (roleLeaderCode.equals("ctu_library")) { // ctu库 |
| | | return "ctu_library"; |
| | | |
| | | } |
| | | return "all"; |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 以角色继承角色显示出指定库信息按堆垛机限制 |