From 986aa62ed00bee39363bab41b4eeb8259d446efd Mon Sep 17 00:00:00 2001 From: ludc <ludc@vci-tech.com> Date: 星期四, 16 一月 2025 18:20:32 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java | 34 +++++++++++++++++++++------------- 1 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java index 36e4986..e989fdf 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java @@ -894,7 +894,7 @@ */ @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); @@ -1014,7 +1014,7 @@ * @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 @@ -1030,7 +1030,7 @@ * @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; } @@ -1060,7 +1060,7 @@ * @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; } @@ -1136,7 +1136,7 @@ * @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){ @@ -1174,7 +1174,7 @@ * @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); @@ -1274,7 +1274,7 @@ * @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)); @@ -1288,7 +1288,7 @@ * @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); @@ -1466,7 +1466,7 @@ * @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)){ @@ -1478,12 +1478,20 @@ 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; //杩涜浣嶄笌鎿嶄綔锛屽鏋滅浉绛夊垯琛ㄧず鍏锋湁褰撳墠鎿嶄綔鐨勬潈闄� - long preValue = (rightValue >> nodeValue) & 1; - if (preValue != 1) { + for (Long rightValue : rightValues) { + long preValue = (rightValue >> nodeValue) & 1; + if (preValue == 1) { + authFlag = true; + break; + } + } + if(!authFlag){ buttonDefineVO.remove(); } } @@ -1642,7 +1650,7 @@ throw WebUtil.getVciBaseException(vciError); } // 1銆佹牴鎹綋鍓嶈鑹插垽鏂槸绠$悊浜哄憳杩樻槸鏅�氱敤鎴凤紙姝e父鏉ヨ鍙湁鏅�氱敤鎴锋墠浼氱敤鍒拌鏌ヨ鎺ュ彛锛� - Map<String, RoleRightVO> roleRightMap = uiManagerServiceI.getRoleRightMap(null); + Map<String, List<RoleRightVO>> roleRightMap = uiManagerServiceI.getRoleRightMap(null); // 2銆佹寜鐓у綋鍓嶇櫥褰曠敤鎴锋煡璇㈡潈闄愶紙鍔熻兘鏉冮檺鍜孶I鎺堟潈鐨勬巿鏉冧俊鎭兘鏄斁鍦ㄥ悓涓�寮犺〃閲岀殑锛� // 3銆佹壘鍑哄綋鍓嶈鏌ヨ鐨刄I涓婁笅鏂� PLUILayout context = null; -- Gitblit v1.9.3