| | |
| | | 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"); |
| | |
| | | |
| | | 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(); |
| | |
| | | * @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授权 |
| | |
| | | * @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<>(); |
| | |
| | | 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; |
| | |
| | | }); |
| | | } |
| | | if(!CollectionUtil.isEmpty(chiledTreeList)) { |
| | | setChildNode(chiledTreeList, contextList, isShowCheckBox); |
| | | setChildNode(chiledTreeList, contextList,roleRightVOMap, isShowCheckBox); |
| | | } |
| | | pTree.setChildren(chiledTreeList); |
| | | }else if (funcObj instanceof PLTabPage) {//上下文 |
| | |
| | | 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; |
| | |
| | | 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)){ |
| | |
| | | }else{ |
| | | pTree.setChecked(false); |
| | | } |
| | | }*/ |
| | | } |
| | | }); |
| | | } |
| | | |