自动化立体仓库 - WMS系统
#
zjj
2024-12-31 dd5a31d7eb01fa754a37f5cdcc7f7d2ba7397600
src/main/java/com/zy/common/utils/RoleUtils.java
@@ -14,6 +14,42 @@
 */
@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";
    }
    /**
     * 以角色继承角色显示出指定库信息按堆垛机限制