Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/AttributeDefDTO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,39 @@ package com.vci.dto; import com.vci.corba.omd.atm.AttributeDef; import lombok.Data; import java.util.ArrayList; import java.util.List; /** * 屿§ä¼ è¾å¯¹è±¡ * @author yuxc * @date 2024/09/02 10:15 */ @Data public class AttributeDefDTO implements java.io.Serializable { /** * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ */ private static final long serialVersionUID = 2492852474710986720L; public String oid; public String name; public String label; public String vtDataType; public String defValue; public String ts; public String creator; public long createTime; public String modifier; public long modifyTime; public String description; public String rage; public String other; /** * 屿° */ public int layersNum; public List<AttributeDefDTO> attrs = new ArrayList<>(); } Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTDDTO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,46 @@ package com.vci.dto; import com.vci.corba.omd.atm.AttributeDef; import lombok.Data; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * æ¥è¯¢æ¨¡æ¿ä¼ è¾å¯¹è±¡ * @author weidy * @date 2019/10/14 17:50 */ @Data public class QTDDTO implements java.io.Serializable { /** * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ */ private static final long serialVersionUID = 2492852474710986720L; /** * 模æ¿åç§° */ public String name; /** * å建人 */ public String creator; /** * å建æ¶é´ */ public long createTime; /** * ä¸å¡ç±»å */ public String btmName; /** * 龿¥ç±»å */ public String linkTypeName; /** * æéæ©æ¥è¯¢çåæ®µå¯¹è±¡ */ public List<AttributeDefDTO> attrs = new ArrayList<>(); } Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/MenuVO.java
@@ -143,6 +143,10 @@ * 模åä¸å ³èçæä½ç±»åid */ private String operId; /** * æ¯å¦ææéï¼0没æï¼1æ */ private Integer havePermission; /** * å端æ¯å¦éè Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/ISmFunctionQueryService.java
@@ -62,6 +62,15 @@ * @throws VciBaseException */ List<MenuVO> getSysModelTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException; /** * éè¿æ¨¡åIDè·åå级å表 * @param parentId * @param modeType 模åç±»å * @param isAll æ¯å¦å æ¬æ æç模åï¼trueåå æ¬ * @return * @throws VciBaseException */ List<MenuVO> getSysModelAuthTreeMenuByPID(String parentId,String modeType,boolean isAll) throws VciBaseException, PLException; int checkChildObject(String moduleId) throws VciException; Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmFunctionQueryServicePlatformImpl.java
@@ -4,13 +4,11 @@ import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONReader; import com.vci.client.ClientSession; import com.vci.client.common.objects.RoleObject; import com.vci.common.exception.VciException; import com.vci.common.locale.LocaleDisplay; import com.vci.corba.common.PLException; import com.vci.corba.framework.data.FuncOperationInfo; import com.vci.corba.framework.data.FunctionInfo; import com.vci.corba.framework.data.OperateInfo; import com.vci.corba.framework.data.RoleRightInfo; import com.vci.corba.framework.data.*; import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.portal.data.PLUILayout; import com.vci.frameworkcore.compatibility.ISmFunctionQueryService; @@ -510,6 +508,80 @@ 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); //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()); } @Override public UIContentVO getUIContentByBtmTypeAndId(TreeQueryObject treeQueryObject, ResourceControlTypeEnum resourceControlTypeEnum) throws PLException { SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException(); @@ -858,4 +930,258 @@ public void clearCache() { } /** * éè¿æ¨¡åIDè·åå级å表 * @param parentId * @param modeType 模åç±»å * @param isAll æ¯å¦å æ¬æ æç模åï¼trueåå æ¬ * @return * @throws VciBaseException */ @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; } SessionInfo sessionInfo = WebUtil.getCurrentUserSessionInfoNotException(); boolean adminOrDeveloperOrRoot = rightControlUtil.isAdminOrDeveloperOrRoot(sessionInfo.getUserId()); if (adminOrDeveloperOrRoot) { //ç³»ç»èå parentId = SYSTEMMANAGMENTNODE; } else if (rightControlUtil.isThreeAdminCurUser()) { //ä¸åè¿å管çåè½æ¨¡åç¸å ³çèå parentId = SYSTEMMANAGMENTNODE; } else { //æ®éç¨æ·åªè¿åä¸å¡åè½æ¨¡åç¸å ³çèå parentId = ROOT_MENU_ID; } List<MenuVO> functionVOList = new ArrayList<>(); FunctionInfo[] moduleListByParentId = getModuleListByParentId(parentId, false); for (FunctionInfo menu : moduleListByParentId) { if(!menu.isValid){ continue; } MenuVO functionVO = new MenuVO(); functionVO.setId(menu.id); functionVO.setSource(menu.image); 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)); // } 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); } 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); // } 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()); // // // // // boolean isFunctionObject = Func.isNotBlank(modeType) && modeType.equalsIgnoreCase("FunctionObject"); // if(parentId.equals("systemManagmentNode") || parentId.equals("modelManagmentNode") || isFunctionObject){ // int childType = this.checkChildObject(parentId); // if(isFunctionObject){ // try { // /**å¤æè¯¥æ¨¡åä¸åå¯¹è±¡æ¯æ¨¡åè¿æ¯æä½ï¼0表示æ åèç¹ï¼1è¡¨ç¤ºæ¯æ¨¡åï¼2è¡¨ç¤ºæ¯æä½**/ // if(childType == 2){ // try{ // FuncOperationInfo[] infos = platformClientUtil.getFrameworkService().getFuncOperationByModule(parentId, "", false); // 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(); // throw new VciBaseException(String.valueOf(e.code), e.messages); // } // }else if(childType == 1){ // try{ // FunctionInfo[] funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll); // 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(); // throw new VciBaseException(String.valueOf(e.code),e.messages); // } // } // } catch (Exception e) { // e.printStackTrace(); // throw new VciBaseException("æ¨¡åæ¥è¯¢æ¶åºç°é误ï¼åå ï¼"+VciBaseUtil.getExceptionMessage(e)); // } // }else{ // try{ // MenuVO parentNode = null; // //å°è¿åçèç¹å¤å±å¥ä¸å½åç¶èç¹ // if("systemManagmentNode".equals(parentId)){ // parentNode = JsonConfigReader.getSysModuleConf().getSystemManagmentNode(); // }else if("modelManagmentNode".equals(parentId)){ // parentNode = JsonConfigReader.getSysModuleConf().getModelManagmentNode(); // } // //妿æ¥è¯¢çæ¯ç¬¬ä¸å±èç¹å°±éè¦ç´æ¥è¿å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++){ // FunctionInfo funcInfo = funcInfos[i]; // MenuVO menuVO = this.functionInfoToMenuVO(funcInfo); // menuVO.setModeType("FunctionObject"); // menuVO.setChildType(childType); // menuVOList.add(menuVO); // } // return menuVOList; // }catch (PLException e) { // e.printStackTrace(); // throw new VciBaseException(String.valueOf(e.code),e.messages); // } // } // } // else if(parentId.equals("operateNode")){ // //å è½½æææä½ // try{ // //å°è¿åçèç¹å¤å±å¥ä¸å½åç¶èç¹ // MenuVO parentNode = JsonConfigReader.getSysModuleConf().getOperateNode(); // //妿æ¥è¯¢çæ¯ç¬¬ä¸å±èç¹å°±éè¦ç´æ¥è¿åsysOptionNodeèç¹ // if(Func.isNotBlank(modeType) && modeType.equals("firstNode")){ // menuVOList.add(parentNode); // return menuVOList; // } // OperateInfo[] operateInfos = platformClientUtil.getFrameworkService().getOperateTreeList(parentId); // for(int i = 0; i < operateInfos.length;i++ ){ // OperateInfo operateInfo = operateInfos[i]; // MenuVO menuVO = new MenuVO(); // menuVO.setId(operateInfo.id); // menuVO.setName(operateInfo.name); // menuVO.setCode(operateInfo.identify); // menuVO.setAlias(operateInfo.alias); // menuVO.setCategory(2); // menuVO.setChildType(0); // menuVO.setRemark(operateInfo.desc); // menuVO.getMeta().put("keepAlive",false); // menuVO.setSort((int) operateInfo.seq); // menuVO.setModeType("operateObject"); // menuVO.setHasChildren(false); // menuVOList.add(menuVO); // } // }catch (PLException e) { // e.printStackTrace(); // throw new VciBaseException(String.valueOf(e.code),new String[]{VciBaseUtil.getExceptionMessage(e)}); // } // } // return null; // return menuVOList.stream().sorted(Comparator.comparing(s -> s.getSort())).collect(Collectors.toList()); } /** * éè¿æ¨¡åIDè·åå级å表 * @param parentId * @param isAll æ¯å¦å æ¬æ æç模åï¼trueåå æ¬ * @return * @throws VciException */ public FunctionInfo[] getModuleListByParentId(String parentId,boolean isAll) throws PLException { FunctionInfo[] funcInfos = null; funcInfos = platformClientUtil.getFrameworkService().getModuleListByParentId(parentId, isAll); return funcInfos; } } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java
@@ -1,37 +1,23 @@ package com.vci.web.controller; import com.vci.corba.common.PLException; import com.vci.corba.omd.ltm.LinkType; import com.vci.corba.omd.qtm.QTD; import com.vci.dto.QTInfoDTO; import com.vci.pagemodel.OsBtmTypeAttributeVO; import com.vci.pagemodel.OsBtmTypeVO; import com.vci.pagemodel.OsLinkTypeAttributeVO; import com.vci.pagemodel.OsLinkTypeVO; import com.vci.starter.web.annotation.controller.VciUnCheckRight; import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.util.VciBaseUtil; import com.vci.web.service.OsLinkTypeServiceI; import com.vci.web.service.OsQuereyTemplateServiceI; import org.apache.commons.lang3.StringUtils; import org.dom4j.DocumentException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; /** * æ¥è¯¢æ¨¡æ¿çæ§å¶å¨ @@ -63,6 +49,25 @@ public BaseResult queryTemplateList(String btmName,Boolean linkFlag){ try { return quereyTemplateServiceI.queryTemplateList(btmName,linkFlag); } catch (PLException e) { BaseResult objectBaseResult = new BaseResult<>(); objectBaseResult.setCode(Integer.parseInt(e.code)); objectBaseResult.setMsg(Arrays.toString(e.messages)); return objectBaseResult; } } /** * æ¥è¯¢æ¨¡æ¿çå表添å äºå段çç¸å ³å±æ§ * @param btmName ç±»å * @param linkFlag æ¯å¦é¾æ¥ç±»å ï¼true 龿¥ç±»å ï¼false ä¸å¡ç±»å * @return æ¥è¯¢æ¨¡æ¿çå表 */ @GetMapping("/queryTemplateListByAttr") public BaseResult queryTemplateListByAttr(String btmName,Boolean linkFlag, String direction){ try { return quereyTemplateServiceI.queryTemplateListByAttr(btmName,linkFlag,direction); } catch (PLException e) { BaseResult objectBaseResult = new BaseResult<>(); objectBaseResult.setCode(Integer.parseInt(e.code)); @@ -277,13 +282,13 @@ /** * æ¥è¯¢æ¹æ¡å é¤ * @param templateNames æ¥è¯¢æ¹æ¡å * @param names æ¥è¯¢æ¹æ¡å * @return æä½ç»æ */ @DeleteMapping("/deleteLinkTemplate") public BaseResult deleteLinkTemplate(@RequestBody List<String> templateNames){ public BaseResult deleteLinkTemplate(String names){ try { return quereyTemplateServiceI.deleteLinkTemplate(templateNames); return quereyTemplateServiceI.deleteLinkTemplate(names); } catch (PLException e) { BaseResult objectBaseResult = new BaseResult<>(); objectBaseResult.setCode(Integer.parseInt(e.code)); Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java
@@ -102,10 +102,10 @@ BaseResult impLinkTemplate(MultipartFile file) throws IOException, ClassNotFoundException; /** * æ¥è¯¢æ¹æ¡å é¤ * @param templateNames æ¥è¯¢æ¹æ¡å * @param names æ¥è¯¢æ¹æ¡å * @return æä½ç»æ */ BaseResult deleteLinkTemplate(List<String> templateNames) throws PLException; BaseResult deleteLinkTemplate(String names) throws PLException; /** * æ¥è¯¢æ¡ä»¶ä¸çæ¥è¯¢æé® @@ -153,5 +153,11 @@ * @return å¯¼å ¥ç»æ */ BaseResult impBtmTemplate(MultipartFile file) throws IOException, ClassNotFoundException; /** * æ¥è¯¢æ¨¡æ¿çå表添å äºå段çç¸å ³å±æ§ * @param btmName ç±»å * @param linkFlag æ¯å¦é¾æ¥ç±»å ï¼true 龿¥ç±»å ï¼false ä¸å¡ç±»å * @return æ¥è¯¢æ¨¡æ¿çå表 */ BaseResult queryTemplateListByAttr(String btmName, Boolean linkFlag, String direction) throws PLException; } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java
@@ -16,7 +16,10 @@ import com.vci.corba.omd.ltm.LinkType; import com.vci.corba.omd.qtm.QTD; import com.vci.corba.omd.qtm.QTInfo; import com.vci.dto.AttributeDefDTO; import com.vci.dto.QTDDTO; import com.vci.dto.QTInfoDTO; import com.vci.omd.constants.SystemAttribute; import com.vci.omd.objects.OtherInfo; import com.vci.po.OsLinkTypePO; import com.vci.starter.poi.bo.ReadExcelOption; @@ -1332,12 +1335,16 @@ } /** * æ¥è¯¢æ¹æ¡å é¤ * @param templateNames æ¥è¯¢æ¹æ¡å * @param names æ¥è¯¢æ¹æ¡å * @return æä½ç»æ */ @Override public BaseResult deleteLinkTemplate(List<String> templateNames) throws PLException { boolean b = platformClientUtil.getQTDService().deleteQTs(templateNames.toArray(new String[0])); public BaseResult deleteLinkTemplate(String names) throws PLException { if(StringUtils.isBlank(names)){ return BaseResult.fail("è¯·éæ©æ¥è¯¢æ¹æ¡ï¼"); } String[] nameSplit = names.split(","); boolean b = platformClientUtil.getQTDService().deleteQTs(nameSplit); if(!b){ return BaseResult.fail("å é¤å¤±è´¥ï¼ï¼ï¼"); } @@ -1565,6 +1572,225 @@ return BaseResult.success(tree); } @Override public BaseResult queryTemplateListByAttr(String btmName, Boolean linkFlag, String direction) throws PLException { //è¿åççé¢ä¸ææ¡æ¾ç¤ºæ List<QTDDTO> qtddtos = new ArrayList<>(); Map<String, AttributeDef> allSysAttr = Arrays.stream(platformClientUtil.getBtmService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e)); // if(linkFlag){ // QTD[] qtdArray = platformClientUtil.getQTDService().getLinkTypeQTDs(btmName); // for (QTD qtd : qtdArray) { // QTDDTO qtddto = new QTDDTO(); // qtddto.setName(qtd.name); // qtddto.setCreateTime(qtd.createTime); // qtddto.setLinkTypeName(qtd.linkTypeName); // qtddto.setBtmName(qtd.btmName); // qtddto.setCreator(qtd.creator); // for (String abName : qtd.abNames) { // AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName); // AttributeDefDTO attrDto = new AttributeDefDTO(); // attrDto.setDescription(att.description); // attrDto.setLabel(att.label); // attrDto.setOid(att.oid); // attrDto.setCreator(att.creator); // attrDto.setName(att.name); // attrDto.setDefValue(att.defValue); // attrDto.setRage(att.rage); // attrDto.setVtDataType(att.vtDataType); // attrDto.setOther(att.other); // qtddto.getAttrs().add(attrDto); // } // qtddtos.add(qtddto); // } // // }else { // Map<String, AttributeDef> lSysAttr = Arrays.stream(platformClientUtil.getLinkTypeService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e)); allSysAttr.putAll(Arrays.stream(platformClientUtil.getLinkTypeService().getSysAttributeDefs()).collect(Collectors.toMap(e -> e.name, e -> e))); QTD[] qtdArray = null; if(linkFlag){ qtdArray = platformClientUtil.getQTDService().getLinkTypeQTDs(btmName); }else { qtdArray = platformClientUtil.getQTDService().getBizTypeQTDs(btmName); } // QTD[] for (QTD qtd : qtdArray) { QTDDTO qtddto = new QTDDTO(); qtddto.setName(qtd.name); qtddto.setCreateTime(qtd.createTime); qtddto.setLinkTypeName(qtd.linkTypeName); qtddto.setBtmName(qtd.btmName); qtddto.setCreator(qtd.creator); for (String abName : qtd.abNames) { AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName); if(att == null || "".equals(att.oid)){ att = allSysAttr.get(abName.toLowerCase()); } if(direction != null) { if (direction.equals(QTConstants.DIRECTION_POSITIVE)) { att.name = "T_OID." + abName; } else if (direction.equals(QTConstants.DIRECTION_OPPOSITE)) { att.name = "F_OID." + abName; } }else{ att.name = abName; } AttributeDefDTO attrDto = new AttributeDefDTO(); attrDto.setDescription(att.description); attrDto.setLabel(att.label); attrDto.setOid(att.oid); attrDto.setCreator(att.creator); attrDto.setName(att.name); attrDto.setDefValue(att.defValue); attrDto.setLayersNum(1); attrDto.setRage(att.rage); attrDto.setVtDataType(att.vtDataType); attrDto.setOther(att.other); qtddto.getAttrs().add(attrDto); addNode(attrDto, allSysAttr); } qtddtos.add(qtddto); } // } return BaseResult.dataList(Arrays.asList(qtddtos)); } private void addNode(AttributeDefDTO attributeDefByName, Map<String, AttributeDef> allSysAttr){ if(attributeDefByName.getLayersNum() >= 3){ return; } String abName = attributeDefByName.name; //ånodeä¸çæåä¸ä¸ªå±æ§å if(abName.contains(".")){ abName = abName.substring(abName.lastIndexOf(".") + 1); } // qtddto.getAttrs().add(attributeDefByName); if(SystemAttribute.sysAttList().contains(abName.toUpperCase())){ return; } AttributeDef abItem = null; try { abItem = platformClientUtil.getAttributeService().getAttributeDefByName(abName); String other = abItem.other; // String btmName = ApProvider.getInstance().getOtherValueByType(other, BTM); OtherInfo otherInfo = OtherInfo.getOtherInfoByText(other); int refFlag = otherInfo.getRefFlag(); String refTypeName = otherInfo.getRefTypeName(); if(refFlag != -1){ //åç §ä¸å¡ç±»å if(refFlag == 0){ //pName: 为åç §å±æ§åå ä¸è·¯å¾ String pName = attributeDefByName.name + "."; String[] abNames = platformClientUtil.getBtmService().getAttributeNames(refTypeName); for(int i = 0; i < abNames.length; i++){ String abName_ = abNames[i]; AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName_); if(att == null || "".equals(att.oid)){ att = allSysAttr.get(abName_.toLowerCase()); } att.name = pName + abName_ ; AttributeDefDTO attrDto = new AttributeDefDTO(); attrDto.setDescription(att.description); attrDto.setLabel(att.label); attrDto.setOid(att.oid); attrDto.setLayersNum(attributeDefByName.getLayersNum() + 1); attrDto.setCreator(att.creator); attrDto.setName(att.name); attrDto.setDefValue(att.defValue); attrDto.setRage(att.rage); attrDto.setVtDataType(att.vtDataType); attrDto.setOther(att.other); attributeDefByName.getAttrs().add(attrDto); addNode(attrDto, allSysAttr); } //ç³»ç»å±æ§ID,NAME,DESCRIPTION // AttributeDef[] sysAttributeDefs = platformClientUtil.getBtmService().getSysAttributeDefs(); // for (int i = 0; i < sysAttributeDefs.length; i++) { for (int i = 0; i < SystemAttribute.bosysAttList().size(); i++) { // addNode(node, new DefaultMutableTreeNode(pName + SystemAttribute.bosysAttList().get(i))); AttributeDef attributeDef = allSysAttr.get(SystemAttribute.bosysAttList().get(i).toLowerCase()); AttributeDefDTO attrDto = new AttributeDefDTO(); attrDto.setDescription(attributeDef.description); attrDto.setLabel(attributeDef.label); attrDto.setOid(attributeDef.oid); attrDto.setLayersNum(attributeDefByName.getLayersNum() + 1); attrDto.setCreator(attributeDef.creator); attrDto.setName(pName + SystemAttribute.bosysAttList().get(i)); attrDto.setDefValue(attributeDef.defValue); attrDto.setRage(attributeDef.rage); attrDto.setVtDataType(attributeDef.vtDataType); attrDto.setOther(attributeDef.other); attributeDefByName.getAttrs().add(attrDto); addNode(attrDto, allSysAttr); } //åç §é¾æ¥ç±»å }else if(refFlag == 1){ //pName: 为åç §å±æ§åå ä¸è·¯å¾ String pName = attributeDefByName.name + "."; LinkType link = null; try { link = platformClientUtil.getLinkTypeService().getLinkType(refTypeName); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Throwable e) { // TODO Auto-generated catch block e.printStackTrace(); } if(link != null){ String[] abNames = link.attributes; for(int i = 0; i < abNames.length; i++){ String abName_ = abNames[i]; // DefaultMutableTreeNode node_ = new DefaultMutableTreeNode(pName + abName_); AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(abName_); if(att == null || att.oid.equals("")){ att = allSysAttr.get(abName_.toLowerCase()); } AttributeDefDTO attrDto = new AttributeDefDTO(); attrDto.setDescription(att.description); attrDto.setLabel(att.label); attrDto.setOid(att.oid); attrDto.setLayersNum(attributeDefByName.getLayersNum() + 1); attrDto.setCreator(att.creator); attrDto.setName(pName + abName_); attrDto.setDefValue(att.defValue); attrDto.setRage(att.rage); attrDto.setVtDataType(att.vtDataType); attrDto.setOther(att.other); attributeDefByName.getAttrs().add(attrDto); addNode(attrDto, allSysAttr); } //ç³»ç»å±æ§ID,NAME,DESCRIPTION for (int i = 0; i < SystemAttribute.losysAttList().size(); i++) { // addNode(node, new DefaultMutableTreeNode(pName + SystemAttribute.losysAttList().get(i))); // } // AttributeDef[] sysAttributeDefs = platformClientUtil.getLinkTypeService().getSysAttributeDefs(); // for (int i = 0; i < sysAttributeDefs.length; i++) { // addNode(node, new DefaultMutableTreeNode(pName + SystemAttribute.bosysAttList().get(i))); AttributeDef sysAttributeDefs = allSysAttr.get(SystemAttribute.losysAttList().get(i).toLowerCase()); AttributeDefDTO attrDto = new AttributeDefDTO(); attrDto.setDescription(sysAttributeDefs.description); attrDto.setLabel(sysAttributeDefs.label); attrDto.setOid(sysAttributeDefs.oid); attrDto.setLayersNum(attributeDefByName.getLayersNum() + 1); attrDto.setCreator(sysAttributeDefs.creator); attrDto.setName(pName + SystemAttribute.losysAttList().get(i)); attrDto.setDefValue(sysAttributeDefs.defValue); attrDto.setRage(sysAttributeDefs.rage); attrDto.setVtDataType(sysAttributeDefs.vtDataType); attrDto.setOther(sysAttributeDefs.other); attributeDefByName.getAttrs().add(attrDto); addNode(attrDto, allSysAttr); } } } } } catch (PLException e) { e.printStackTrace(); } } // æ°æ®è¿æ»¤ private void addImportBtmData(BtmQTExportData qtExportData, List<BizType> ltsNew, List<QTInfo> qTWrapperNew, Map<String/* ç±»ååç§° */, QTD[]/* æ¥è¯¢æ¨¡æ¿å®ä¹ */> norepQTDs) {