| | |
| | | */ |
| | | @VciUnLog |
| | | @Override |
| | | public UIContentVO UIContentDO2VO(PLUILayout pageLayoutDefination, boolean queryDetail,Map<String, RoleRightVO> roleRightMap){ |
| | | public UIContentVO UIContentDO2VO(PLUILayout pageLayoutDefination, boolean queryDetail,Map<String, List<RoleRightVO>> roleRightMap){ |
| | | UIContentVO contentVO = new UIContentVO(); |
| | | if(pageLayoutDefination !=null){ |
| | | contentVO.setOid(pageLayoutDefination.plOId); |
| | |
| | | * @param pkContent UI上下文的主键 |
| | | * @return 上下文 |
| | | */ |
| | | private List<UILayoutVO> listLayoutByContent(String pkContent,Map<String, RoleRightVO> roleRightMap){ |
| | | private List<UILayoutVO> listLayoutByContent(String pkContent,Map<String, List<RoleRightVO>> roleRightMap){ |
| | | try { |
| | | List<PLTabPage> tabPageList = Arrays.stream(platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(pkContent)).collect(Collectors.toList()); |
| | | //过滤掉没有访问权限的UI |
| | |
| | | * @param tabPageList |
| | | * @param roleRightMap |
| | | */ |
| | | private List<PLTabPage> filterTabPageByRoleRight(List<PLTabPage> tabPageList, Map<String, RoleRightVO> roleRightMap){ |
| | | private List<PLTabPage> filterTabPageByRoleRight(List<PLTabPage> tabPageList, Map<String, List<RoleRightVO>> roleRightMap){ |
| | | if(Func.isEmpty(roleRightMap) || Func.isEmpty(tabPageList)){ |
| | | return tabPageList; |
| | | } |
| | |
| | | * @param plPageDefinationList |
| | | * @param roleRightMap |
| | | */ |
| | | private List<PLPageDefination> filterPageDefByRoleRight(List<PLPageDefination> plPageDefinationList, Map<String, RoleRightVO> roleRightMap){ |
| | | private List<PLPageDefination> filterPageDefByRoleRight(List<PLPageDefination> plPageDefinationList, Map<String, List<RoleRightVO>> roleRightMap){ |
| | | if(Func.isEmpty(roleRightMap) || Func.isEmpty(plPageDefinationList)){ |
| | | return plPageDefinationList; |
| | | } |
| | |
| | | * @param pages 区域的数据对象 |
| | | * @return 显示对象 |
| | | */ |
| | | private List<UILayoutVO> UILayoutDO2VOs(Collection<PLTabPage> pages, boolean queryDetail, Map<String, RoleRightVO> roleRightMap){ |
| | | private List<UILayoutVO> UILayoutDO2VOs(Collection<PLTabPage> pages, boolean queryDetail, Map<String, List<RoleRightVO>> roleRightMap){ |
| | | List<UILayoutVO> contentVOS = new ArrayList<>(); |
| | | Map<String, OsAttributeVO> attributeVOMap; |
| | | if(pages != null && pages.size() > 0){ |
| | |
| | | * @return 区域的显示对象 |
| | | */ |
| | | @VciUnLog |
| | | private UILayoutVO UILayoutDO2VO(PLTabPage page, boolean queryDetail,Map<String, OsAttributeVO> attributeVOMap, Map<String, RoleRightVO> roleRightMap){ |
| | | private UILayoutVO UILayoutDO2VO(PLTabPage page, boolean queryDetail,Map<String, OsAttributeVO> attributeVOMap, Map<String, List<RoleRightVO>> roleRightMap){ |
| | | UILayoutVO layoutVO = new UILayoutVO(); |
| | | if(page !=null ){ |
| | | layoutVO.setOid(page.plOId); |
| | |
| | | * @param pages 数据对象 |
| | | * @return 显示对象 |
| | | */ |
| | | private List<UIComponentVO> uiComponentDO2VOs(Collection<PLPageDefination> pages, boolean queryDetail,Map<String, OsAttributeVO> attributeVOMap, Map<String, RoleRightVO> roleRightMap){ |
| | | private List<UIComponentVO> uiComponentDO2VOs(Collection<PLPageDefination> pages, boolean queryDetail,Map<String, OsAttributeVO> attributeVOMap, Map<String, List<RoleRightVO>> roleRightMap){ |
| | | List<UIComponentVO> componentVOS = new ArrayList<>(); |
| | | pages.stream().forEach(page->{ |
| | | componentVOS.add(uiComponentDO2VO(page,queryDetail,attributeVOMap,roleRightMap)); |
| | |
| | | * @return 显示对象 |
| | | */ |
| | | @VciUnLog |
| | | private UIComponentVO uiComponentDO2VO(PLPageDefination page, boolean queryDetail, Map<String, OsAttributeVO> attributeVOMap, Map<String, RoleRightVO> roleRightMap){ |
| | | private UIComponentVO uiComponentDO2VO(PLPageDefination page, boolean queryDetail, Map<String, OsAttributeVO> attributeVOMap, Map<String, List<RoleRightVO>> roleRightMap){ |
| | | UIComponentVO componentVO = new UIComponentVO(); |
| | | if(page !=null){ |
| | | componentVO.setOid(page.plOId); |
| | |
| | | * @return 按钮的信息 |
| | | */ |
| | | @Override |
| | | public List<UIButtonDefineVO> listButtonByComponent(String pkComponent, Map<String, RoleRightVO> roleRightMap){ |
| | | public List<UIButtonDefineVO> listButtonByComponent(String pkComponent, Map<String, List<RoleRightVO>> roleRightMap){ |
| | | try { |
| | | List<UIButtonDefineVO> buttonDefineVOS = buttonDO2VOs(Arrays.stream(platformClientUtil.getUIService().getPLTabButtonsByTableOId(pkComponent)).collect(Collectors.toSet())).stream().sorted(((o1, o2) -> o1.getOrderNum().compareTo(o2.getOrderNum()))).collect(Collectors.toList()); |
| | | if(Func.isEmpty(roleRightMap)){ |
| | |
| | | while (buttonDefineVO.hasNext()){ |
| | | UIButtonDefineVO buttonDefine = buttonDefineVO.next(); |
| | | if(roleRightMap.containsKey(buttonDefine.getPkComponent())) { |
| | | Long rightValue = roleRightMap.get(buttonDefine.getPkComponent()).getRightValue(); |
| | | List<Long> rightValues = roleRightMap.get(buttonDefine.getPkComponent()).stream() |
| | | .map(e -> e.getRightValue()).collect(Collectors.toList()); |
| | | int nodeValue = buttonDefine.getOrderNum(); |
| | | if (nodeValue >= 0 && nodeValue <= 63) { |
| | | boolean authFlag = false; |
| | | //进行位与操作,如果相等则表示具有当前操作的权限 |
| | | for (Long rightValue : rightValues) { |
| | | long preValue = (rightValue >> nodeValue) & 1; |
| | | if (preValue != 1) { |
| | | if (preValue == 1) { |
| | | authFlag = true; |
| | | break; |
| | | } |
| | | } |
| | | if(!authFlag){ |
| | | buttonDefineVO.remove(); |
| | | } |
| | | } |
| | |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | // 1、根据当前角色判断是管理人员还是普通用户(正常来说只有普通用户才会用到该查询接口) |
| | | Map<String, RoleRightVO> roleRightMap = uiManagerServiceI.getRoleRightMap(null); |
| | | Map<String, List<RoleRightVO>> roleRightMap = uiManagerServiceI.getRoleRightMap(null); |
| | | // 2、按照当前登录用户查询权限(功能权限和UI授权的授权信息都是放在同一张表里的) |
| | | // 3、找出当前要查询的UI上下文 |
| | | PLUILayout context = null; |