From a756aed2072b98ed02967ddf2b013fc77be65f94 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期四, 31 十月 2024 09:42:19 +0800 Subject: [PATCH] 修改业务类型类型改变时和业务类型移除属性时校验逻辑 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java | 59 ++++++++++++++++++++++++----------------------------------- 1 files changed, 24 insertions(+), 35 deletions(-) diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java index 8f2a7fa..c4ba024 100644 --- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java +++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java @@ -265,9 +265,15 @@ if(column.contains(".")){ column = StringUtils.substringAfterLast(column, "."); } + if(column.contains(" ")){ + column = StringUtils.substringBefore(column, " "); + } AttributeDef att = platformClientUtil.getAttributeService().getAttributeDefByName(column); if(att == null || "".equals(att.oid)){ att = allSysAttr.get(column.toLowerCase()); + } + if(att == null){ + throw new PLException("500", new String[]{"灞炴�у瓧娈碉細" + column + "鍦ㄥ睘鎬ф睜涓湭鏌ヨ鍒帮紝璇风‘璁わ紒锛�"}); } leafInfoDTO.setClause(leafInfo.getClause()); @@ -321,6 +327,7 @@ HashMap<String, String> data = new HashMap<>(); data.put("column",child.getText().trim()); data.put("type",att.vtDataType); + childList.add(data); } } treeMap.put("child",childList); @@ -998,34 +1005,6 @@ 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); -// Condition con = new Condition(); -// qt.setCondition(con); -// HashMap<String, ConditionItem> ciMap = getCIMap(); -// con.setCIMap(ciMap); -// con.setRootCIName(con.getRootCINameByCIMap(ciMap)); -// return qt; -// } /** * 杩斿洖鏌ヨ鐨勭増鏈� @@ -1074,11 +1053,12 @@ * @return */ @Override - public void expLinkTemplate(List<String> names, HttpServletResponse response) throws PLException, IOException { + public void expLinkTemplate(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) { + String[] splits = names.split(","); + for (String name : splits) { QTInfo qt = platformClientUtil.getQTDService().getQT(name); exportData.getAllQTs().put(qt.qtName,qt); LinkType linkType = platformClientUtil.getLinkTypeService().getLinkType(qt.btmName); @@ -1464,8 +1444,13 @@ throw new PLException("500", new String[]{checkInfo}); } qt.setId("qt1"); - BusinessObject[] result = platformClientUtil.getQueryService().findBTMObjects(qt.getId(), OQTool.qtTOXMl(qt).asXML()); - return BaseResult.dataList(Arrays.asList(result)); + try { + BusinessObject[] result = platformClientUtil.getQueryService().findBTMObjects(qt.getId(), OQTool.qtTOXMl(qt).asXML()); + return BaseResult.dataList(Arrays.asList(result)); + }catch (Exception e){ + String errorLog = "鏌ヨ鏃跺嚭鐜伴棶棰橈紝璇锋鏌ラ厤缃殑鏉′欢鏄惁瀛樺湪闂锛屽叿浣撳師鍥狅細"+VciBaseUtil.getExceptionMessage(e); + throw new VciBaseException(errorLog); + } } /** @@ -1499,6 +1484,7 @@ if(!checkInfo.equals("OK")){ throw new PLException("500", new String[]{checkInfo}); } + qt.setId(qtInfoDTO.getQtName()); //璁剧疆鎺掑簭淇℃伅 qt.setOrderInfoList(qtInfoDTO.getQueryTemplate().getOrderInfoList()); QTInfo qtWrapper = new QTInfo(); @@ -1579,9 +1565,10 @@ * @return */ @Override - public String expBtmQTTemplate(List<String> names) throws PLException, IOException { + public String expBtmQTTemplate(String qtNames) throws PLException, IOException { String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); String vciqtmfFileName = defaultTempFolder + File.separator + "BtmTemplateExp" + new Date().getTime() + ".vciqtf"; + String[] names = qtNames.split(","); BtmQTExportData exportData = new BtmQTExportData(); for (String name : names) { QTInfo qt = platformClientUtil.getQTDService().getQT(name); @@ -1703,12 +1690,14 @@ if(direction != null) { if (direction.equals(QTConstants.DIRECTION_POSITIVE)) { if(att == null ){ - throw new PLException("500",new String[]{"灞炴�у瓧娈�:"+ abName +"鏈煡璇㈠埌锛岃纭锛�"}); + continue; +// throw new PLException("500",new String[]{"灞炴�у瓧娈�:"+ abName +"鏈煡璇㈠埌锛岃纭锛�"}); } att.name = "T_OID." + abName; } else if (direction.equals(QTConstants.DIRECTION_OPPOSITE)) { if(att == null ){ - throw new PLException("500",new String[]{"灞炴�у瓧娈�:"+ abName +"鏈煡璇㈠埌锛岃纭锛�"}); + continue; +// throw new PLException("500",new String[]{"灞炴�у瓧娈�:"+ abName +"鏈煡璇㈠埌锛岃纭锛�"}); } att.name = "F_OID." + abName; } -- Gitblit v1.9.3