ludc
2024-10-18 af7122a81386da90cb04207e6ea83aa550088861
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -1693,17 +1693,17 @@
        if (conditionMap == null) {
            conditionMap = new HashMap<>();
        }
        //String roleId = StringUtils.isBlank(conditionMap.get("roleId")) ? "" : conditionMap.get("roleId");
        String roleId = StringUtils.isBlank(conditionMap.get("roleId")) ? "" : conditionMap.get("roleId");
        String type = StringUtils.isBlank(conditionMap.get("type")) ? "" : conditionMap.get("type");
        //String context = StringUtils.isBlank(conditionMap.get("context")) ? "" : conditionMap.get("context");
        String context = StringUtils.isBlank(conditionMap.get("context")) ? "" : conditionMap.get("context");
        boolean showCheckBox = Boolean.parseBoolean(conditionMap.get("showCheckBox"));
        /*Map<String,RoleRightVO> roleRightVOMap=new HashMap<>();
        Map<String,RoleRightVO> roleRightVOMap = new HashMap<>();
        if(StringUtils.isNotBlank(roleId)){
            String userName = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
            RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(roleId,userName);
            List<RoleRightVO> roleRightVOList = roleRightDOO2VOS(Arrays.asList(rightInfos));
            roleRightVOMap = roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVO,(oldValue,newOldValue)->oldValue));
        }*/
        }
        BizType[] bizTypes=osBtmServiceI.getBizTypes(type);
        List<Tree> treeList=new ArrayList<>();
        Tree rootNode =new Tree("root","功能模块","root");
@@ -1729,7 +1729,7 @@
            List<Tree> btmChildList = new ArrayList<>();
            btmChildList.add(bizTypeTree);
            setChildNode(btmChildList,contextList/*,roleRightVOMap*/,showCheckBox);
            setChildNode(btmChildList,contextList,roleRightVOMap,showCheckBox);
            childList.add(bizTypeTree);
        }
        //long endTime = System.currentTimeMillis();
@@ -1745,14 +1745,15 @@
     * @return
     * @throws PLException
     */
    @Override
    public List<RoleRightVO> getRightListByRoleId(String roleId) throws PLException {
        VciBaseUtil.alertNotNull(roleId,"查询条件角色主键");
        String userName = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
        RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(roleId,userName);
        List<RoleRightVO> roleRightVOList = roleRightDOO2VOS(Arrays.asList(rightInfos));
        return roleRightVOList;
    }
    /*    @Override
        public Map<String,RoleRightVO> getRightListByRoleId(String roleId) throws PLException {
            VciBaseUtil.alertNotNull(roleId,"查询条件角色主键");
            String userName = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
            RoleRightInfo[] rightInfos= platformClientUtil.getFrameworkService().getRoleRightList(roleId,userName);
            List<RoleRightVO> roleRightVOList = roleRightDOO2VOS(Arrays.asList(rightInfos));
            Map<String,RoleRightVO> roleRightVOMap = roleRightVOList.stream().collect(Collectors.toMap(RoleRightVO::getFuncId,roleRightVO ->roleRightVO,(oldValue,newOldValue)->oldValue));
            return roleRightVOMap;
        }*/
    /***
     * UI授权
@@ -2125,7 +2126,7 @@
     * @param contextList
     * @param isShowCheckBox
     */
    private void setChildNode(List<Tree> parentTree, List<PLUILayout>contextList, boolean isShowCheckBox){
    private void setChildNode(List<Tree> parentTree, List<PLUILayout>contextList,Map<String,RoleRightVO> roleRightVOMap, boolean isShowCheckBox){
        Optional.ofNullable(parentTree).orElseGet(()->new ArrayList<>()).stream().forEach(pTree -> {
            Object funcObj = pTree.getData();
            List<Tree> chiledTreeList = new ArrayList<>();
@@ -2143,7 +2144,7 @@
                    pTree.setChildren(chiledTreeList);
                }
                if(!CollectionUtil.isEmpty(chiledTreeList)) {
                    setChildNode(chiledTreeList, contextList, isShowCheckBox);
                    setChildNode(chiledTreeList, contextList,roleRightVOMap, isShowCheckBox);
                }
            }else  if (funcObj instanceof PLUILayout){//UI
                PLUILayout context = (PLUILayout) funcObj;
@@ -2160,7 +2161,7 @@
                    });
                }
                if(!CollectionUtil.isEmpty(chiledTreeList)) {
                    setChildNode(chiledTreeList, contextList, isShowCheckBox);
                    setChildNode(chiledTreeList, contextList,roleRightVOMap, isShowCheckBox);
                }
                pTree.setChildren(chiledTreeList);
            }else if (funcObj instanceof PLTabPage) {//上下文
@@ -2179,7 +2180,7 @@
                    pTree.setChildren(chiledTreeList);
                }
                if(!CollectionUtil.isEmpty(chiledTreeList)) {
                    setChildNode(chiledTreeList, contextList, isShowCheckBox);
                    setChildNode(chiledTreeList, contextList,roleRightVOMap, isShowCheckBox);
                }
            }else if (funcObj instanceof PLPageDefination) {
                PLPageDefination plPageDefination = (PLPageDefination) funcObj;
@@ -2198,9 +2199,9 @@
                    pTree.setChildren(chiledTreeList);
                }
                if(!CollectionUtil.isEmpty(chiledTreeList)) {
                    setChildNode(chiledTreeList, contextList, isShowCheckBox);
                    setChildNode(chiledTreeList, contextList,roleRightVOMap, isShowCheckBox);
                }
            }/*else if (funcObj instanceof PLTabButton) {//按钮
            }else if (funcObj instanceof PLTabButton) {//按钮
                PLTabButton plTabButton = (PLTabButton) funcObj;
                String id = plTabButton.plTableOId;
                if(roleRightVOMap.containsKey(id)){
@@ -2216,7 +2217,7 @@
                }else{
                    pTree.setChecked(false);
                }
            }*/
            }
        });
    }