ludc
2024-10-18 af7122a81386da90cb04207e6ea83aa550088861
代码提交
已修改4个文件
55 ■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/constant/VConstant.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-base/src/main/java/com/vci/starter/web/constant/VConstant.java
@@ -84,7 +84,7 @@
    /**
     * 当前登录的用户总数cache key
     */
    public static final String CURRENT_LOGGED_USERS_KEY = "current_logged_users";
    public static final String CURRENT_LOGGED_USERS_KEY = "CURRENT_LOGGED_USERS_KEY";
    /**
     * 资源映射路径 前缀
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java
@@ -622,18 +622,18 @@
     * @return
     * @throws PLException
     */
    @GetMapping( "/getRightListByRoleId")
/*    @GetMapping( "/getRightListByRoleId")
    @VciBusinessLog(operateName = "根据角色主键获取已授权的UI主键集合")
    public BaseResult getRightListByRoleId(String roleId){
        try {
            return BaseResult.dataList(uiManagerService.getRightListByRoleId(roleId));
            return BaseResult.success(uiManagerService.getRightListByRoleId(roleId));
        }catch (Throwable e) {
            e.printStackTrace();
            String exceptionMessage = "获取已授权信息时错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    }*/
    /***
     * @param uiAuthorDTO 勾选的需要保存的数据对象
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java
@@ -206,13 +206,13 @@
     */
    List<Tree> getUIAuthor(BaseQueryObject baseQueryObject)throws Exception;
    /**
/*    *//**
     * 根据角色主键获取已授权的信息
     * @param roleId
     * @return
     * @throws PLException
     */
    List<RoleRightVO> getRightListByRoleId(String roleId) throws PLException;
     *//*
    Map<String,RoleRightVO> getRightListByRoleId(String roleId) throws PLException;*/
    /**
     * UI授权
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);
                }
            }*/
            }
        });
    }