| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.vci.client.common.oq.OQTool; |
| | | import com.vci.common.qt.object.*; |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.atm.AttributeDef; |
| | | import com.vci.corba.omd.data.LinkObject; |
| | | 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.QTInfoDTO; |
| | | import com.vci.omd.objects.OtherInfo; |
| | | import com.vci.po.OsLinkTypePO; |
| | | import com.vci.starter.poi.bo.ReadExcelOption; |
| | | import com.vci.starter.poi.bo.WriteExcelData; |
| | | import com.vci.starter.poi.bo.WriteExcelOption; |
| | | import com.vci.starter.poi.constant.ExcelLangCodeConstant; |
| | | import com.vci.starter.poi.util.ExcelUtil; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.Tree; |
| | | import com.vci.starter.web.util.*; |
| | | import com.vci.web.other.LinkQTExportData; |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.util.DateUtil; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.dom4j.Element; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¨¡æ¿æå¡ |
| | |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult getCriteria(HashMap<String,Object> dataMap) throws PLException { |
| | | QueryTemplate qt = getQT(dataMap); |
| | | public BaseResult getCriteria(QTInfoDTO qtInfoDTO) throws PLException { |
| | | QueryTemplate qt = getQT(qtInfoDTO); |
| | | String checkInfo = OQTool.checkQT(qt); |
| | | if(!checkInfo.equals("OK")){ |
| | | throw new PLException("500", new String[]{checkInfo}); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 龿¥ç±»åæ¥è¯¢æ¨¡æ¿æ æ¥è¯¢ï¼ç¨äºçé¢ç导åºåè½ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult getLinkTree() throws PLException { |
| | | LinkType[] linkTypes= null; |
| | | QTInfo[] qts = null; |
| | | HashMap<String,Object> tree = new HashMap(); |
| | | tree.put("text","ä¸å¡ç±»å"); |
| | | if (linkTypes == null) { |
| | | List<LinkType> es = new ArrayList<LinkType>(); |
| | | linkTypes = platformClientUtil.getLinkTypeService().getLinkTypes(); |
| | | for (LinkType lt : linkTypes) { |
| | | QTInfo[] qtWrappers = platformClientUtil.getQTDService().getObjTypeQTs(lt.name); |
| | | if (qtWrappers.length!=0) { |
| | | es.add(lt); |
| | | } |
| | | } |
| | | linkTypes = es.toArray(new LinkType[es.size()]); |
| | | //TODO:éä¿®æ£æ²¡æå
³èæ¥è¯¢æ¨¡æ¿ä¸å¡ç±»å廿 |
| | | qts = platformClientUtil.getQTDService().getAllQTs();//è·åæææ¥è¯¢æ¨¡æ¿ |
| | | } |
| | | List<HashMap<String,Object>> childList = new ArrayList<>(); |
| | | //æ·»å ä¸å¡ç±»åæ ¹èç¹ |
| | | for (LinkType plAction : linkTypes) { |
| | | HashMap<String,Object> childTree = new HashMap(); |
| | | childTree.put("text", plAction.tag + "/" +plAction.name); |
| | | childTree.put("oid", plAction.oid); |
| | | // tree.put("children", childTree); |
| | | addExportTreeNode(plAction, qts, childTree); |
| | | childList.add(childTree); |
| | | } |
| | | tree.put("children", childList); |
| | | return BaseResult.success(tree); |
| | | } |
| | | |
| | | /** |
| | | * çæå¯¼åºæ 鿩以å导å
¥æ æ¾ç¤º |
| | | * @param linkType |
| | | * @param qts |
| | | * @param tree |
| | | */ |
| | | private void addExportTreeNode(LinkType linkType/*ä¸å¡ç±»å*/,QTInfo[] qts/*æ¥è¯¢æ¨¡æ¿å¯¹è±¡*/,HashMap<String,Object> tree) { |
| | | List<String> childList = new ArrayList<>(); |
| | | // æ·»å æ¥è¯¢æ¨¡æ¿å¯¹è±¡åèç¹ |
| | | for (QTInfo qtItem : qts) { |
| | | //å¤ç导å
¥æ¶æ æ³è¿è¡ç±»å夿 |
| | | int splitLength = linkType.name.indexOf("ã"); |
| | | if(splitLength == -1){ |
| | | splitLength = linkType.name.length(); |
| | | } |
| | | if (qtItem.btmName.equals(linkType.name.substring(0, |
| | | splitLength))) { |
| | | childList.add(qtItem.qtName); |
| | | } |
| | | } |
| | | tree.put("children",childList); |
| | | } |
| | | |
| | | /** |
| | | * å°é«çº§æ¡ä»¶æ°æ®è½¬ä¸ºxml |
| | | * @param qtInfoDTO æ¥è¯¢æ¨¡æ¿åè¡¨ä¼ è¾å¯¹è±¡ |
| | | * @return xmlæ°æ® |
| | | */ |
| | | private String getSeniorXML(QTInfoDTO qtInfoDTO){ |
| | | HashMap<String, Object> tree = qtInfoDTO.getTree(); |
| | | if(tree.isEmpty()){ |
| | |
| | | return xmlStr.append("</root>").toString(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å°é«çº§æ¡ä»¶æ°æ®è½¬ä¸ºxml |
| | | * @param childs é«çº§æ¡ä»¶æ°æ® |
| | | * @return xmlæ°æ® |
| | | */ |
| | | private String getSeniorChildXML(JSONObject childs){ |
| | | |
| | | StringBuilder xmlStr = new StringBuilder("<child>" + childs.get("connector")); |
| | |
| | | //é«çº§æ¥è¯¢æ¡ä»¶ |
| | | }else if(qtInfoDTO.getLevelFlag() == 1){ |
| | | ciMap = getCIMapForSeniorTree(qtInfoDTO); |
| | | |
| | | // OQTool.parseTreeToDoc(seniorTree); |
| | | } |
| | | return ciMap; |
| | | } |
| | |
| | | return qt; |
| | | } |
| | | |
| | | /** |
| | | * ç»è£
æ¥è¯¢æ¨¡æ¿ |
| | | * @return |
| | | */ |
| | | public QueryTemplate getQT(HashMap<String,Object> dataMap){ |
| | | QueryTemplate qt = new QueryTemplate(); |
| | | qt.setType(QTConstants.TYPE_LINK); |
| | | //TODO String qtId = |
| | | qt.setLinkType((String) dataMap.get("linkTypeName")); |
| | | qt.setDirection( (Boolean)dataMap.get("rdPositive") ? QTConstants.DIRECTION_POSITIVE : QTConstants.DIRECTION_OPPOSITE); |
| | | qt.setBtmType((String) dataMap.get("btmName")); |
| | | if("ææç±»å".equals(dataMap.get("combRelaType"))){ |
| | | qt.setBtmType("*"); |
| | | } |
| | | qt.setVersion(getVersion((String) dataMap.get("versionValue"))); |
| | | qt.setQueryISLeaf((Boolean) dataMap.get("isQueryIsLeaf")); |
| | | qt.setLevel(StringUtils.isBlank((CharSequence) dataMap.get("level")) ? 1 : Integer.valueOf(String.valueOf(dataMap.get("level")))); |
| | | List<String> clauseList = new ArrayList<String>(); |
| | | //TODO æ¥è¯¢å æ¾ç¤ºå |
| | | clauseList.add("*"); |
| | | qt.setClauseList(clauseList); |
| | | // /** |
| | | // * ç»è£
æ¥è¯¢æ¨¡æ¿ |
| | | // * @return |
| | | // */ |
| | | // public QueryTemplate getQT(HashMap<String,Object> dataMap){ |
| | | // QueryTemplate qt = new QueryTemplate(); |
| | | // qt.setType(QTConstants.TYPE_LINK); |
| | | // //TODO String qtId = |
| | | // qt.setLinkType((String) dataMap.get("linkTypeName")); |
| | | // qt.setDirection( (Boolean)dataMap.get("rdPositive") ? QTConstants.DIRECTION_POSITIVE : QTConstants.DIRECTION_OPPOSITE); |
| | | // qt.setBtmType((String) dataMap.get("btmName")); |
| | | // if("ææç±»å".equals(dataMap.get("combRelaType"))){ |
| | | // qt.setBtmType("*"); |
| | | // } |
| | | // qt.setVersion(getVersion((String) dataMap.get("versionValue"))); |
| | | // qt.setQueryISLeaf((Boolean) dataMap.get("isQueryIsLeaf")); |
| | | // qt.setLevel(StringUtils.isBlank((CharSequence) dataMap.get("level")) ? 1 : Integer.valueOf(String.valueOf(dataMap.get("level")))); |
| | | // List<String> clauseList = new ArrayList<String>(); |
| | | // //TODO æ¥è¯¢å æ¾ç¤ºå |
| | | // clauseList.add("*"); |
| | | // qt.setClauseList(clauseList); |
| | | // Condition con = new Condition(); |
| | | // qt.setCondition(con); |
| | | // HashMap<String, ConditionItem> ciMap = getCIMap(); |
| | | // con.setCIMap(ciMap); |
| | | // con.setRootCIName(con.getRootCINameByCIMap(ciMap)); |
| | | return qt; |
| | | } |
| | | // return qt; |
| | | // } |
| | | |
| | | |
| | | /** |
| | |
| | | throw new PLException("500", new String[]{"该模æ¿å®ä¹åå·²ç»è¢«ä½¿ç¨, è¯·æ´æ¢"}); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导åºé¾æ¥ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | * names æ¥è¯¢æ¨¡æ¿å |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void expLinkTemplate(List<String> names, HttpServletResponse response) throws PLException, IOException { |
| | | String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); |
| | | String vciqtmfFileName = defaultTempFolder + File.separator + "LinkTemplateExp" + new Date().getTime() + ".vciqtf"; |
| | | LinkQTExportData exportData = new LinkQTExportData(); |
| | | for (String name : names) { |
| | | QTInfo qt = platformClientUtil.getQTDService().getQT(name); |
| | | exportData.getAllQTs().put(qt.qtName,qt); |
| | | LinkType linkType = platformClientUtil.getLinkTypeService().getLinkType(qt.btmName); |
| | | if(linkType != null && !linkType.oid.equals("")){ |
| | | exportData.getSelectedBtmItems().put(linkType.name, linkType); |
| | | exportData.getSelectedBtmAttrs().put(linkType.name, linkType.attributes); |
| | | exportData.getAllQTDs().put(linkType.name, platformClientUtil.getQTDService().getLinkTypeQTDs(linkType.name)); |
| | | } |
| | | } |
| | | ObjectOutputStream vciamfFileStream = null; |
| | | try { |
| | | File vciqtmfFile = new File(vciqtmfFileName); |
| | | vciamfFileStream = new ObjectOutputStream(new FileOutputStream(vciqtmfFile)); |
| | | vciamfFileStream.writeObject(exportData); |
| | | }finally { |
| | | try { |
| | | if (vciamfFileStream != null) { |
| | | vciamfFileStream.flush(); |
| | | vciamfFileStream.close(); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new PLException("500",new String[]{"å¯¼åºæµå
³éå¼å¸¸ï¼"}); |
| | | } |
| | | } |
| | | ControllerUtil.writeFileToResponse(response,vciqtmfFileName); |
| | | FileUtil.del(defaultTempFolder + File.separator); |
| | | } |
| | | /** |
| | | * 导å
¥é¾æ¥ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | * @param file ä¸ä¼ çæä»¶ |
| | | * @return 导å
¥ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult impLinkTemplate(MultipartFile file) throws IOException, ClassNotFoundException { |
| | | |
| | | if (file == null) { |
| | | return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"æ 导å
¥çæä»¶"}); |
| | | } |
| | | if (!file.getOriginalFilename().endsWith(".vciqtf")) { |
| | | throw new VciBaseException("ä»
è½ä¸ä¼ .vciqtfæ ¼å¼æä»¶ï¼è¯·éæ°ä¸ä¼ ï¼"); |
| | | } |
| | | ObjectInputStream obj = new ObjectInputStream( |
| | | file.getInputStream()); |
| | | LinkQTExportData qtExportData = (LinkQTExportData) obj.readObject(); |
| | | List<LinkType> ltsNew = new ArrayList<>(); |
| | | List<QTInfo> qTWrapperNew = new ArrayList<>(); |
| | | Map<String/* ç±»ååç§° */, QTD[]/* æ¥è¯¢æ¨¡æ¿å®ä¹ */> norepQTDs = new HashMap<String, QTD[]>(); |
| | | addImportData(qtExportData, ltsNew, qTWrapperNew, norepQTDs); |
| | | QTInfo[] qts = qTWrapperNew |
| | | .toArray(new QTInfo[qTWrapperNew.size()]); |
| | | //å¤çæ çè¿å |
| | | HashMap<String,Object> tree = new HashMap(); |
| | | tree.put("text","龿¥ç±»å"); |
| | | List<HashMap<String,Object>> childList = new ArrayList<>(); |
| | | //æ·»å ä¸å¡ç±»åæ ¹èç¹ |
| | | for (LinkType plAction : ltsNew) { |
| | | HashMap<String,Object> childTree = new HashMap(); |
| | | childTree.put("text", plAction.tag + "/" +plAction.name); |
| | | childTree.put("oid", plAction.oid); |
| | | addExportTreeNode(plAction, qts, childTree); |
| | | childList.add(childTree); |
| | | } |
| | | tree.put("children", childList); |
| | | return BaseResult.success(tree); |
| | | } |
| | | |
| | | // æ°æ®è¿æ»¤ |
| | | private void addImportData(LinkQTExportData qtExportData, List<LinkType> ltsNew, List<QTInfo> qTWrapperNew, |
| | | Map<String/* ç±»ååç§° */, QTD[]/* æ¥è¯¢æ¨¡æ¿å®ä¹ */> norepQTDs) { |
| | | Map<String/* ç±»ååç§° */, QTD[]/* æ¥è¯¢æ¨¡æ¿å®ä¹ */> allQTDs = qtExportData |
| | | .getAllQTDs(); |
| | | Map<String/* ç±»ååç§° */, LinkType/* ç±»å对象 */> selectedBtmItems = qtExportData |
| | | .getSelectedBtmItems(); |
| | | Map<String/* ç±»ååç§° */, String[]/* ç±»åæå±å±æ§ */> selectedBtmAttrs = qtExportData |
| | | .getSelectedBtmAttrs(); |
| | | Map<String/* æ¥è¯¢æ¨¡æ¿åç§° */, QTInfo/* æ¥è¯¢æ¨¡æ¿å¯¹è±¡ */> allSelectedQTs = qtExportData |
| | | .getAllQTs(); |
| | | if (allQTDs.size() == 0 || allQTDs == null |
| | | || selectedBtmItems.size() == 0 || selectedBtmItems == null |
| | | || selectedBtmAttrs.size() == 0 || selectedBtmAttrs == null |
| | | || allSelectedQTs.size() == 0 || allSelectedQTs == null) { |
| | | throw new VciBaseException("导å
¥çæ¨¡æ¿æ°æ®æè¯¯!!!"); |
| | | } |
| | | Set<Map.Entry<String, QTD[]>> pLActions = allQTDs.entrySet(); |
| | | Set<Map.Entry<String, QTInfo>> pLQts = allSelectedQTs.entrySet(); |
| | | Set<Map.Entry<String, LinkType>> LinkpLQts = selectedBtmItems.entrySet(); |
| | | for (Map.Entry<String, QTD[]> entry : pLActions) { |
| | | String string = entry.getKey(); |
| | | QTD[] qtds = entry.getValue(); |
| | | getPLQtIsInDB(string, qtds, norepQTDs); |
| | | } |
| | | for (Map.Entry<String, LinkType> entry : LinkpLQts) { |
| | | String string = entry.getKey(); |
| | | LinkType LinkType = entry.getValue(); |
| | | getPLQtBtmItem(string, LinkType, ltsNew); |
| | | } |
| | | Map<String/*ç±»ååç§°*/, QTD[]/*æ¥è¯¢æ¨¡æ¿å®ä¹*/> newNorepQTDs = getnewNorepQTDs(norepQTDs,allSelectedQTs); |
| | | for (Map.Entry<String, QTInfo> entry : pLQts) { |
| | | String string = entry.getKey(); |
| | | QTInfo qtWrapper = entry.getValue(); |
| | | getPLQtWrapper(string, qtWrapper, ltsNew, qTWrapperNew, newNorepQTDs); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¨¡æ¿å®ä¹çå¤ç |
| | | * @param string |
| | | * @param qtds |
| | | */ |
| | | private void getPLQtIsInDB(String string, QTD[] qtds, Map<String/* ç±»ååç§° */, QTD[]/* æ¥è¯¢æ¨¡æ¿å®ä¹ */> norepQTDs) { |
| | | // TODO Auto-generated method stub |
| | | try { |
| | | QTD[] qtds2 = platformClientUtil.getQTDService().getBizTypeQTDs(string); |
| | | QTD[] qtdsNewQtds = null; |
| | | List<QTD> es = new ArrayList<>(); |
| | | for (QTD qtd : qtds) { |
| | | boolean isleat = true; |
| | | for (int i = 0; i < qtds2.length; i++) { |
| | | if (qtd.name.equals(qtds2[i].name)) { |
| | | isleat = false; |
| | | break; |
| | | } |
| | | } |
| | | if (isleat) { |
| | | es.add(qtd); |
| | | } |
| | | } |
| | | if (es.size() != 0) { |
| | | qtdsNewQtds = es.toArray(new QTD[es.size()]); |
| | | norepQTDs.put(string, qtdsNewQtds); |
| | | } |
| | | } catch (PLException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | private void getPLQtBtmItem(String string, LinkType linkType, List<LinkType> ltsNew) { |
| | | // TODO Auto-generated method stub |
| | | try { |
| | | LinkType queryLinkType = platformClientUtil.getLinkTypeService().getLinkType(string); |
| | | LinkType[] btmArray = platformClientUtil.getLinkTypeService().getLinkTypes(); |
| | | String[] strings = queryLinkType.attributes; |
| | | String[] stringsFrom = queryLinkType.btmItemsFrom; |
| | | String[] stringsTo = queryLinkType.btmItemsTo; |
| | | boolean b = true; |
| | | for (int i = 0; i < btmArray.length; i++) { |
| | | if (btmArray[i].name.equals(string)) { |
| | | b = false; |
| | | if (Arrays.equals(linkType.attributes, strings) |
| | | && Arrays |
| | | .equals(linkType.btmItemsFrom, stringsFrom) |
| | | && Arrays.equals(linkType.btmItemsTo, stringsTo)) { |
| | | btmArray[i].name += "ã龿¥ç±»åå·²åå¨ã"; |
| | | /* this.btmArray[i] = btmArray[i]; */ |
| | | ltsNew.add(btmArray[i]); |
| | | } else { |
| | | btmArray[i].name += "ã龿¥ç±»ååå¨ä½å±æ§ä¸ä¸è´ã"; |
| | | ltsNew.add(btmArray[i]); |
| | | } |
| | | } |
| | | } |
| | | if (b) { |
| | | linkType.name += "ã龿¥ç±»åä¸åå¨ã"; |
| | | ltsNew.add(linkType); |
| | | } |
| | | } catch (PLException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | private void getPLQtWrapper(String string, QTInfo qtWrapper, List<LinkType> ltsNew, List<QTInfo> qTWrapperNew, Map<String/*ç±»ååç§°*/, QTD[]/*æ¥è¯¢æ¨¡æ¿å®ä¹*/> newNorepQTDs) { |
| | | try { |
| | | QTInfo[] qtws = platformClientUtil.getQTDService().getAllQTs(); |
| | | boolean islaet = true; |
| | | for (int i = 0; i < qtws.length; i++) { |
| | | if (string.equals(qtws[i].qtName)) { |
| | | islaet = false; |
| | | for (LinkType lt : ltsNew) { |
| | | if (qtWrapper.btmName.equals(lt.name.substring(0, |
| | | lt.name.indexOf("ã")))) { |
| | | if (lt.name.endsWith("ã龿¥ç±»åå·²åå¨ã")) { |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿å·²åå¨ï¼ä¸å¯¼å
¥ã"; |
| | | qTWrapperNew.add(qtWrapper); |
| | | }else if(lt.name.endsWith("ã龿¥ç±»ååå¨ä½å±æ§ä¸ä¸è´ã")){ |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿æå±é¾æ¥ç±»å屿§ä¸ä¸è´ï¼ä¸å¯¼å
¥ã"; |
| | | qTWrapperNew.add(qtWrapper); |
| | | }else{ |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿æå±é¾æ¥ç±»åä¸åå¨ï¼ä¸å¯¼å
¥ã"; |
| | | qTWrapperNew.add(qtWrapper); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (islaet) { |
| | | for (LinkType btmItem : ltsNew) { |
| | | if (qtWrapper.btmName.equals(btmItem.name.substring(0, |
| | | btmItem.name.indexOf("ã")))) { |
| | | if (btmItem.name.endsWith("ã龿¥ç±»åå·²åå¨ã")) { |
| | | //夿æ¥è¯¢æ¨¡æ¿å®ä¹æ¯å¦åå¨ï¼è¿è¡ä¿å |
| | | QTD[] qtds = newNorepQTDs.get(qtWrapper.btmName); |
| | | if(qtds != null){ |
| | | for (QTD qtd : qtds) { |
| | | QTD qtdByName = platformClientUtil.getQTDService().getQTDByName(qtd.name); |
| | | if(!(qtdByName != null && StringUtils.isNotBlank(qtdByName.name))){ |
| | | boolean b = platformClientUtil.getQTDService().addQTD(qtd); |
| | | if(!b){ |
| | | qtWrapper.qtName += qtWrapper.qtName+"导å
¥æ¥è¯¢æ¨¡æ¿å®ä¹ã" + qtdByName.name + "ã失败ï¼"; |
| | | } |
| | | } |
| | | } |
| | | newNorepQTDs.remove(qtWrapper.btmName); |
| | | } |
| | | boolean success = platformClientUtil.getQTDService().saveQT(qtWrapper); |
| | | if(!success){ |
| | | qtWrapper.qtName += qtWrapper.qtName+"导å
¥å¤±è´¥ï¼"; |
| | | }else { |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿å¯¼å
¥æåï¼ã"; |
| | | } |
| | | qTWrapperNew.add(qtWrapper); |
| | | }else if(btmItem.name.endsWith("ã龿¥ç±»ååå¨ä½å±æ§ä¸ä¸è´ã")){ |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿æå±é¾æ¥ç±»å屿§ä¸ä¸è´ï¼ä¸å¯¼å
¥ã"; |
| | | qTWrapperNew.add(qtWrapper); |
| | | }else{ |
| | | qtWrapper.qtName += "ãæ¥è¯¢æ¨¡æ¿æå±é¾æ¥ç±»åä¸åå¨ï¼ä¸å¯¼å
¥ã"; |
| | | qTWrapperNew.add(qtWrapper); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | //æ ¹æ®éæ©çæ¥è¯¢æ¨¡æ¿è¿æ»¤æ¨¡æ¿å®ä¹ |
| | | private Map<String, QTD[]> getnewNorepQTDs(Map<String, QTD[]> norepQTDs, |
| | | Map<String, QTInfo> allQTs) { |
| | | // TODO Auto-generated method stub |
| | | Map<String, QTD[]> map = new HashMap<String, QTD[]>(); |
| | | Set<Map.Entry<String, QTInfo>> pLQts = allQTs.entrySet(); |
| | | Set<Map.Entry<String, QTD[]>> pLActions = norepQTDs.entrySet(); |
| | | for (Map.Entry<String, QTD[]> entrys : pLActions) { |
| | | for (Map.Entry<String, QTInfo> entry : pLQts) { |
| | | if(entry.getValue().btmName.equals(entrys.getKey())){ |
| | | map.put(entrys.getKey(), entrys.getValue()); |
| | | } |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | /** |
| | | * æ¥è¯¢æ¹æ¡å é¤ |
| | | * @param templateNames æ¥è¯¢æ¹æ¡å |
| | | * @return æä½ç»æ |
| | | */ |
| | | @Override |
| | | public BaseResult deleteLinkTemplate(List<String> templateNames) throws PLException { |
| | | boolean b = platformClientUtil.getQTDService().deleteQTs(templateNames.toArray(new String[0])); |
| | | if(!b){ |
| | | return BaseResult.fail("å é¤å¤±è´¥ï¼ï¼ï¼"); |
| | | } |
| | | return BaseResult.success(); |
| | | } |
| | | } |