456
Jinquan_Ou
2023-04-15 2bcbf32c439a5d7fbb20234b86e410347d5b806f
zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java
@@ -84,24 +84,7 @@
                //逗号隔开得到如下串:3{2007 2018 2015}
                String[] authorityList = secondFamilyAuthority.split(",");
                for (String authorityAndId : authorityList) {
                    //得到权限串
                    String authorities = authorityAndId.substring(2, authorityAndId.length() - 1);
                    if (authorities.contains(" ")) {
                        //空格隔开得到菜单id,看是否有对应的权限
                        String[] authorityIdList = authorities.split(" ");
                        for (String s : authorityIdList) {
                            if (s.equals(PROPERTY_LIST)) {
                                secondFamilyIdsBuffer.append(authorityAndId.charAt(0)).append(",");
                                break;
                            }
                        }
                    } else {
                        if (authorities.equals(PROPERTY_LIST)) {
                            secondFamilyIdsBuffer.append(authorityAndId.charAt(0)).append(",");
                        }
                    }
                    setSecondFamilyAuthority(secondFamilyIdsBuffer, authorityAndId);
                }
                //把后面的逗号去掉
@@ -110,31 +93,15 @@
                }
            }else{
                String authorities = secondFamilyAuthority.substring(2, secondFamilyAuthority.length() - 1);
                if (authorities.contains(" ")) {
                    //空格隔开得到菜单id,看是否有对应的权限
                    String[] authorityIdList = authorities.split(" ");
                    for (String s : authorityIdList) {
                        if (s.equals(PROPERTY_LIST)) {
                            secondFamilyIdsBuffer.append(secondFamilyAuthority.charAt(0)).append(",");
                            break;
                        }
                    }
                } else {
                    if (authorities.equals(PROPERTY_LIST)) {
                        secondFamilyIdsBuffer.append(secondFamilyAuthority.charAt(0)).append(",");
                    }
                }
                setSecondFamilyAuthority(secondFamilyIdsBuffer, secondFamilyAuthority);
                //把后面的逗号去掉
                if (secondFamilyIdsBuffer.length() > 1) {
                    secondFamilyIdsBuffer.deleteCharAt(secondFamilyIdsBuffer.length() - 1);
                }
            }
        }
        //将StringBuffer转成String
        String secondFamilyIds = secondFamilyIdsBuffer.toString();
        //第一家庭号的条件
        if (familyIds.contains(",")) {
@@ -183,6 +150,25 @@
        return lqw;
    }
    private void setSecondFamilyAuthority(StringBuilder secondFamilyIdsBuffer, String authorityAndId) {
        //得到权限串
        String authorities = authorityAndId.substring(2, authorityAndId.length() - 1);
        if (authorities.contains(" ")) {
            //空格隔开得到菜单id,看是否有对应的权限
            String[] authorityIdList = authorities.split(" ");
            for (String s : authorityIdList) {
                if (s.equals(PROPERTY_LIST)) {
                    secondFamilyIdsBuffer.append(authorityAndId.charAt(0)).append(",");
                    break;
                }
            }
        } else {
            if (authorities.equals(PROPERTY_LIST)) {
                secondFamilyIdsBuffer.append(authorityAndId.charAt(0)).append(",");
            }
        }
    }
    private ZInfoUser getMySelf() {
        SysUser user = SecurityUtils.getLoginUser().getUser();