| | |
| | | import com.vci.web.util.RightControlUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.el.stream.Stream; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | if(childType == 2){ |
| | | try{ |
| | | FuncOperationInfo[] infos = platformClientUtil.getFrameworkService().getFuncOperationByModule(parentId, "", false); |
| | | for(int i = 0;i < infos.length ;i++){ |
| | | FuncOperationInfo info = infos[i]; |
| | | MenuVO menuVO = new MenuVO(); |
| | | menuVO.setChildType(childType); |
| | | menuVO.setId(info.id); |
| | | menuVO.setCode(info.funcId); |
| | | menuVO.setId(info.operId); |
| | | menuVO.setName(info.operName); |
| | | //menuVO.setOperIndentify(info.operIndentify); |
| | | menuVO.setAlias(info.operAlias); |
| | | menuVO.setRemark(info.operDesc); |
| | | menuVO.setSort((int) info.number); |
| | | menuVO.setModeType("FunctionObject"); |
| | | menuVO.setIsValid(info.isValid); |
| | | menuVO.setHasChildren(false); |
| | | menuVOList.add(menuVO); |
| | | if(Func.isNotEmpty(infos.length)){ |
| | | childType = this.checkChildObject(infos[0].id); //都是同一层所以取第一个即可查询是什么类型 |
| | | for(int i = 0;i < infos.length ;i++){ |
| | | FuncOperationInfo info = infos[i]; |
| | | MenuVO menuVO = new MenuVO(); |
| | | menuVO.setChildType(childType); |
| | | 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); |
| | | menuVOList.add(menuVO); |
| | | } |
| | | } |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | |
| | | }else if(childType == 1){ |
| | | try{ |
| | | FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll); |
| | | for(int i = 0;i < funcInfos.length; i++){ |
| | | FunctionInfo funcInfo = funcInfos[i]; |
| | | MenuVO menuVO = this.functionInfoToMenuVO(funcInfo); |
| | | menuVO.setChildType(childType); |
| | | menuVO.setModeType("FunctionObject"); |
| | | menuVOList.add(menuVO); |
| | | if(Func.isNotEmpty(funcInfos.length)){ |
| | | childType = this.checkChildObject(funcInfos[0].id); //都是同一层所以取第一个即可查询是什么类型 |
| | | for(int i = 0;i < funcInfos.length; i++){ |
| | | FunctionInfo funcInfo = funcInfos[i]; |
| | | MenuVO menuVO = this.functionInfoToMenuVO(funcInfo); |
| | | menuVO.setChildType(childType); |
| | | menuVO.setModeType("FunctionObject"); |
| | | menuVOList.add(menuVO); |
| | | } |
| | | } |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | }else{ |
| | | try{ |
| | | MenuVO parentNode; |
| | | MenuVO parentNode = null; |
| | | //将返回的节点外层套上当前父节点 |
| | | if(parentId.equals("systemManagmentNode")){ |
| | | if("systemManagmentNode".equals(parentId)){ |
| | | parentNode = JsonConfigReader.getSysModuleConf().getSystemManagmentNode(); |
| | | }else{ |
| | | }else if("modelManagmentNode".equals(parentId)){ |
| | | parentNode = JsonConfigReader.getSysModuleConf().getModelManagmentNode(); |
| | | } |
| | | List<MenuVO> menuVOS = new ArrayList<>(); |
| | | //如果查询的是第一层节点就需要直接返回systemManagmentNode或modelManagmentNode节点 |
| | | if(Func.isNotBlank(modeType) && modeType.equals("firstNode")){ |
| | | menuVOList.add(parentNode); |
| | | return menuVOList; |
| | | } |
| | | //查询的三级节点 |
| | | FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll); |
| | | for(int i = 0;i < funcInfos.length; i++){ |
| | |
| | | MenuVO menuVO = this.functionInfoToMenuVO(funcInfo); |
| | | menuVO.setModeType("FunctionObject"); |
| | | menuVO.setChildType(childType); |
| | | menuVOS.add(menuVO); |
| | | menuVOList.add(menuVO); |
| | | } |
| | | parentNode.setChildren(menuVOS); |
| | | menuVOList.add(parentNode); |
| | | return menuVOList; |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(String.valueOf(e.code),e.messages); |
| | |
| | | @Override |
| | | public int checkChildObject(String moduleId) throws VciBaseException { |
| | | long res = 0; |
| | | try{ |
| | | res = ClientSession.getFrameworkService().checkChildObject(moduleId); |
| | | try{//20D63A69-C6BC-8519-8B2B-E5ACFEA62394 |
| | | res = platformClientUtil.getFrameworkService().checkChildObject(moduleId); |
| | | }catch (PLException e) { |
| | | e.printStackTrace(); |
| | | throw new VciBaseException(String.valueOf(e.code),e.messages); |