| | |
| | | String type = StringUtils.isBlank(conditionMap.get("type")) ? "" : conditionMap.get("type"); |
| | | 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, List<RoleRightVO>> roleRightVOMap = new HashMap<>(); |
| | | if(StringUtils.isNotBlank(roleId)){ |
| | | roleRightVOMap = this.getRoleRightMap(roleId); |
| | | } |
| | |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public Map<String,RoleRightVO> getRoleRightMap(String roleId) throws PLException { |
| | | public Map<String, List<RoleRightVO>> getRoleRightMap(String roleId) throws PLException { |
| | | RoleRightInfo[] rightInfos = null; |
| | | String userName = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(); |
| | | if(Func.isBlank(roleId)){ |
| | |
| | | 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)); |
| | | //分组操作 |
| | | Map<String, List<RoleRightVO>> roleRightVOMap = roleRightVOList.stream().collect(Collectors.groupingBy(RoleRightVO::getFuncId, |
| | | Collectors.mapping(e ->e, Collectors.toList()))); |
| | | return roleRightVOMap; |
| | | } |
| | | |
| | |
| | | * @param contextList |
| | | * @param isShowCheckBox |
| | | */ |
| | | private void setChildNode(List<Tree> parentTree, List<PLUILayout>contextList,Map<String,RoleRightVO> roleRightVOMap, boolean isShowCheckBox){ |
| | | private void setChildNode(List<Tree> parentTree, List<PLUILayout>contextList,Map<String, List<RoleRightVO>> roleRightVOMap, boolean isShowCheckBox){ |
| | | Optional.ofNullable(parentTree).orElseGet(()->new ArrayList<>()).stream().forEach(pTree -> { |
| | | Object funcObj = pTree.getData(); |
| | | List<Tree> chiledTreeList = new ArrayList<>(); |
| | |
| | | PLTabButton plTabButton = (PLTabButton) funcObj; |
| | | String id = plTabButton.plTableOId; |
| | | if(roleRightVOMap.containsKey(id)){ |
| | | RoleRightVO roleRightVO = roleRightVOMap.get(id); |
| | | RoleRightVO roleRightVO = roleRightVOMap.get(id).get(0); |
| | | Long rightValue = roleRightVO.getRightValue(); |
| | | int nodeValue = plTabButton.plSeq; |
| | | if (nodeValue >= 0 && nodeValue <= 63) { |