From e937d0111a52e2c13c50bbc3386d20a12d125899 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期五, 06 九月 2024 10:54:54 +0800
Subject: [PATCH] 链接类型查询模板
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java | 214 +++++++++++++++++++++++------------------------------
1 files changed, 92 insertions(+), 122 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
index 7ee7870..daa7f5c 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
@@ -508,78 +508,47 @@
return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
}
- public List<MenuVO> findChildAuthFunctionVO(String parentId,MenuVO functionVO) throws PLException {
-// List<FunctionInfo> menus = map.get(parentOid);
+ public void findChildAuthFunctionVO(MenuVO functionVO, boolean isAll) throws PLException {
//0琛ㄧず娌℃湁妯″潡涔熸病鏈夋搷浣滐紝1琛ㄧず鏈夋ā鍧楋紝2琛ㄧず鏈夋搷浣�
- long l = platformClientUtil.getFrameworkService().checkChildObject(parentId);
-
-// funcObj.setFuncType(funcType);
-//
-// if(funcType == 1){
-// FunctionObject[] funcObjs = new FunctionClientDelegate().getModuleListByParentId(funcObj.getId(),false);
-// for(int i=0;i<funcObjs.length;i++){
-// VCIBaseTreeNode curNode = new VCIBaseTreeNode(funcObjs[i].getName(), funcObjs[i]);
-// treeModel.insertNodeInto(curNode, node,node.getChildCount());
-// setChildNode(curNode,funcObjs[i]);
-// }
-// }else if(funcType == 2){
-// FuncOperationObject[] funcOperateObjs = new FuncOperationClientDelegate().getFuncOperationByModuleId(funcObj.getId(), "", true);
-// for (int j = 0; j < funcOperateObjs.length; j++) {
-// VCIBaseTreeNode childNode = new VCIBaseTreeNode(funcOperateObjs[j].getOperAlias(),funcOperateObjs[j]);
-// UserObject user = rightManagementClient.fetchUserInfoByName(PLTApplication.getUserEntityObject().getUserName());
-//// if(user.getUserType() == 0 || childNode.toString().equals("鏌ョ湅")){
-//// treeModel.insertNodeInto(childNode, node,node.getChildCount());
-//// childNode.setLeaf(true);
-//// }else{
-//// boolean res = initRoleRightByType(childNode);
-//// if(res){
-// treeModel.insertNodeInto(childNode, node,node.getChildCount());
-// childNode.setLeaf(true);
-//// }
-//// }
-// }
-// }else{
-// functionVO.setHasChildren(false);
-// }
-//
-//
-//
-//
-//
-// int funcType = funcDel.checkChildObject(funcObj.getId());
-// funcObj.setFuncType(funcType);
-//
-//
- List<MenuVO> functionVOList = new ArrayList<>();
-// if(menus == null){
-// return functionVOList;
-// }
-// for (FunctionInfo menu : menus) {
-// if(!menu.isValid){
-// continue;
-// }
-// MenuVO functionVO = new MenuVO();
-// functionVO.setId(menu.id);
-// functionVO.setSource(menu.image);
-//// if(StringUtils.isBlank(menu.resourceB) ){
-//// continue;
-//// }
-// functionVO.setPath(menu.resourceB);
-// functionVO.setCode(menu.aliasName);
-// functionVO.setAlias(menu.aliasName);
-// functionVO.setParentId(menu.parentId);
-// functionVO.setName(menu.name);
-// functionVO.getMeta().put("keepAlive",false);
-// functionVO.setSort((int) menu.seq);
-// functionVO.setChildren(findChildAuthFunctionVO(menu.id,functionVO));
-// if(functionVO.getChildren().size() > 0){
-// functionVO.setHasChildren(true);
-// }else {
-// functionVO.setHasChildren(false);
-// }
-// functionVOList.add(functionVO);
-// }
- return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
+ long type = platformClientUtil.getFrameworkService().checkChildObject(functionVO.getId());
+ if(type == 1){
+ FunctionInfo[] funcObjs = platformClientUtil.getFrameworkService().getModuleListByParentId(functionVO.getId(), isAll);
+ for (FunctionInfo funcObj : funcObjs) {
+ MenuVO menuVO = new MenuVO();
+ menuVO.setId(funcObj.id);
+ menuVO.setSource(funcObj.image);
+ menuVO.setPath(funcObj.resourceB);
+ menuVO.setCode(funcObj.aliasName);
+ menuVO.setAlias(funcObj.aliasName);
+ menuVO.setParentId(funcObj.parentId);
+ menuVO.setChildType((int) type);
+ menuVO.setName(funcObj.name);
+ menuVO.getMeta().put("keepAlive",false);
+ menuVO.setSort((int) funcObj.seq);
+ findChildAuthFunctionVO(menuVO, isAll);
+ functionVO.getChildren().add(menuVO);
+ }
+ }else if(type == 2){
+ FuncOperationInfo[] infos = platformClientUtil.getFrameworkService().getFuncOperationByModule(functionVO.getId(), "", true);
+ for (FuncOperationInfo info : infos) {
+ MenuVO menuVO = new MenuVO();
+ menuVO.setChildType((int) type);
+ menuVO.setId(info.id);
+ menuVO.setFuncId(info.funcId);
+ menuVO.setCode(info.operIndentify);
+ menuVO.setOperId(info.operId);
+ menuVO.setName(info.operName);
+ menuVO.setAlias(info.operAlias);
+ menuVO.setRemark(info.operDesc);
+ menuVO.setSort((int) info.number);
+ menuVO.setModeType("FunctionObject");
+ menuVO.setIsValid(info.isValid);
+ menuVO.setHasChildren(false);
+ functionVO.getChildren().add(menuVO);
+ }
+ }else{
+ functionVO.setHasChildren(false);
+ }
}
@Override
@@ -943,9 +912,9 @@
@Override
public List<MenuVO> getSysModelAuthTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException, PLException {
List<MenuVO> menuVOList = new ArrayList<>();
- if(Func.isBlank(parentId)){
- return menuVOList;
- }
+// if(Func.isBlank(parentId)){
+// return menuVOList;
+// }
SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException();
boolean adminOrDeveloperOrRoot = rightControlUtil.isAdminOrDeveloperOrRoot(sessionInfo.getUserId());
if (adminOrDeveloperOrRoot) {
@@ -974,6 +943,7 @@
functionVO.setName(menu.name);
functionVO.getMeta().put("keepAlive",false);
functionVO.setSort((int) menu.seq);
+ findChildAuthFunctionVO(functionVO, isAll);
// try {
// functionVO.setChildren(findChildAuthFunctionVO(menu.id));
// } catch (PLException e) {
@@ -989,58 +959,58 @@
}
functionVOList.add(functionVO);
}
+ return functionVOList;
-
- RoleRightInfo[] userRoleRights = rightControlUtil.getRoleRightByUserName(sessionInfo.getUserId());
- Map<String, List<FunctionInfo>> map = rightControlUtil.getAllChildrenFunctionsByUserName(
- parentId, sessionInfo.getUserId(), userRoleRights);
-
- if(Func.isEmpty(map.get(parentId))) {
- return functionVOList;
- }
- for (FunctionInfo menu : map.get(parentId)) {
- if(!menu.isValid){
- continue;
- }
- MenuVO functionVO = new MenuVO();
- functionVO.setId(menu.id);
- functionVO.setSource(menu.image);
- //if(StringUtils.isBlank(menu.resourceB)){
- // continue;
- //}
- functionVO.setPath(menu.resourceB);
- functionVO.setParentId(menu.parentId);
- functionVO.setCode(menu.aliasName);
- functionVO.setAlias(menu.aliasName);
- functionVO.setName(menu.name);
- functionVO.getMeta().put("keepAlive",false);
- functionVO.setSort((int) menu.seq);
-// try {
-// functionVO.setChildren(findChildAuthFunctionVO(menu.id, map));
-// } catch (PLException e) {
-// e.printStackTrace();
-// String errorMsg = "鑿滃崟鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
-// logger.error(errorMsg);
-// throw new VciBaseException(errorMsg);
+// RoleRightInfo[] userRoleRights = rightControlUtil.getRoleRightByUserName(sessionInfo.getUserId());
+// Map<String, List<FunctionInfo>> map = rightControlUtil.getAllChildrenFunctionsByUserName(
+// parentId, sessionInfo.getUserId(), userRoleRights);
+//
+// if(Func.isEmpty(map.get(parentId))) {
+// return functionVOList;
+// }
+// for (FunctionInfo menu : map.get(parentId)) {
+// if(!menu.isValid){
+// continue;
// }
- if(functionVO.getChildren().size() > 0){
- functionVO.setHasChildren(true);
- }else {
- functionVO.setHasChildren(false);
- }
- functionVOList.add(functionVO);
- }
- //濡傛灉鏄紑鍙戞垨鑰呮祴璇曠敤鎴凤紝闇�鍝熻幏鍙栫郴缁熸ā鍧楅厤缃彍鍗�
- if(adminOrDeveloperOrRoot){
- //鑾峰彇棣栭〉绯荤粺妯″潡閰嶇疆鑿滃崟
- MenuVO menuVO = JsonConfigReader.getSysModuleConf().getSysModuleNode();
- if(Func.isNotEmpty(menuVO)){
- functionVOList.add(menuVO);
- }
- }
- return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
+// MenuVO functionVO = new MenuVO();
+// functionVO.setId(menu.id);
+// functionVO.setSource(menu.image);
+// //if(StringUtils.isBlank(menu.resourceB)){
+// // continue;
+// //}
+// functionVO.setPath(menu.resourceB);
+// functionVO.setParentId(menu.parentId);
+// functionVO.setCode(menu.aliasName);
+// functionVO.setAlias(menu.aliasName);
+// functionVO.setName(menu.name);
+// functionVO.getMeta().put("keepAlive",false);
+// functionVO.setSort((int) menu.seq);
+//// try {
+//// functionVO.setChildren(findChildAuthFunctionVO(menu.id, map));
+//// } catch (PLException e) {
+//// e.printStackTrace();
+//// String errorMsg = "鑿滃崟鏌ヨ鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
+//// logger.error(errorMsg);
+//// throw new VciBaseException(errorMsg);
+//// }
+// if(functionVO.getChildren().size() > 0){
+// functionVO.setHasChildren(true);
+// }else {
+// functionVO.setHasChildren(false);
+// }
+// functionVOList.add(functionVO);
+// }
+// //濡傛灉鏄紑鍙戞垨鑰呮祴璇曠敤鎴凤紝闇�鍝熻幏鍙栫郴缁熸ā鍧楅厤缃彍鍗�
+// if(adminOrDeveloperOrRoot){
+// //鑾峰彇棣栭〉绯荤粺妯″潡閰嶇疆鑿滃崟
+// MenuVO menuVO = JsonConfigReader.getSysModuleConf().getSysModuleNode();
+// if(Func.isNotEmpty(menuVO)){
+// functionVOList.add(menuVO);
+// }
+// }
+// return functionVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList());
--
Gitblit v1.9.3