From 889842eb8b64a0b72c449ce23ff21e4e8c935cae Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期五, 26 七月 2024 16:06:49 +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/OsLinkTypeServiceImpl.java | 82 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 82 insertions(+), 0 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java index a5409db..d785735 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java @@ -1,6 +1,7 @@ package com.vci.web.service.impl; import com.vci.corba.common.PLException; +import com.vci.corba.omd.atm.AttributeDef; import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.ltm.LinkType; import com.vci.omd.utils.ObjectTool; @@ -407,4 +408,85 @@ public void clearCache() { } + + /** + * 淇敼閾炬帴绫诲瀷涓搴斿睘鎬у悕鐨勫睘鎬� + * @param apName + * @return + * @throws PLException + */ + @Override + public boolean alterAp(String apName) throws PLException { + String[] linkNames = null; + List<String> linkNameList = new ArrayList<String>(); + AttributeDef abItem = null; + try { + abItem = platformClientUtil.getAttributeService().getAttributeDefByName(apName); + } catch (PLException e1) { + e1.printStackTrace(); + } + if(abItem == null || abItem.equals("")){ + return true; + } + try { + linkNames = platformClientUtil.getLinkTypeService().getLTNamesByAPName(apName); + } catch (PLException e) { + e.printStackTrace(); + } + if(linkNames == null || linkNames.length <= 0){ + return true; + } + + linkNameList = Arrays.asList(linkNames); + for(Iterator<String> i = linkNameList.iterator(); i.hasNext();){ + String linkName = i.next(); + try { + platformClientUtil.getLinkTypeService().modifyLTAttribute(linkName, apName); + } catch (PLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + String erreMsg = "璋冩暣閾炬帴绫诲瀷涓��"+apName+"銆戝睘鎬ф椂鍑虹幇閿欒锛屽師鍥狅細"+e.getMessage(); + logger.error(erreMsg); + throw new PLException("500",new String[]{erreMsg}); + } + } + return false; + } + + /** + * 鍒ゆ柇璇ュ睘鎬ф槸鍚﹀凡缁忓湪閾炬帴绫诲瀷涓骇鐢熶簡鏁版嵁 + * @param abName + * @return + * @throws PLException + */ + @Override + public boolean hasInstance(String abName) throws PLException { + String[] btmNames = platformClientUtil.getLinkTypeService().getLTNamesByAPName(abName); + if(btmNames == null || btmNames.length == 0){ + return false; + } + for(int i = 0; i < btmNames.length; i++){ + String btmName = btmNames[i]; + boolean flag; + flag = platformClientUtil.getLinkTypeService().hasData(btmName); + if(flag){ + return flag; + } + } + return false; + } + + /** + * 鑾峰彇杩炴帴绫诲瀷鍚嶇О闆嗗悎 + * @return + */ + @Override + public List<String> getAllLtName() throws PLException { + LinkType[] linkTypes = platformClientUtil.getLinkTypeService().getLinkTypes(); + if(null != linkTypes && linkTypes.length > 0){ + return Arrays.stream(linkTypes).map(linkType -> linkType.name).collect(Collectors.toList()); + } + return null; + } + } -- Gitblit v1.9.3