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/OsBtmServiceImpl.java | 16 +++++++++-------
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java | 9 +++++++--
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
index a5c6e59..2eff972 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
@@ -955,14 +955,14 @@
String[] unRemovableFields = null;
List<String> unRemovableFields_ = null;
//闇�瑕佺Щ闄ょ殑灞炴��
- List<String> removableFields = null;
+ List<String> removableFields = new ArrayList<>();
//淇敼鍓嶄笟鍔$被鍨嬪湪鏁版嵁搴撲腑宸插瓨鍦ㄧ殑鎵�鏈夊睘鎬�
- String[] apNameArray = btmTypeDTO.getApNameArray().split(",");
+ List<String> apNameArray = Func.toStrList(btmTypeDTO.getApNameArray());
Set<String> dbApNameArray = Arrays.stream(dbBizType.apNameArray)
.collect(Collectors.toSet());
//杩囨护鍑洪渶瑕佺Щ闄ょ殑灞炴��
- removableFields = Arrays.stream(apNameArray)
- .filter(ap -> !dbApNameArray.contains(ap)) // 杩囨护涓嶅湪 dbApSet 涓殑鍏冪礌
+ removableFields = dbApNameArray.stream()
+ .filter(ap -> !apNameArray.contains(ap)) // 杩囨护涓嶅湪 dbApSet 涓殑鍏冪礌
.collect(Collectors.toList());
// 褰撲笟鍔$被鍨嬭〃涓煇灞炴�у凡缁忔湁鍊�, 涓嶅垹闄よ灞炴��, 灏嗗凡缁忕Щ闄ょ殑灞炴�ф坊鍔犲洖鏉�
unRemovableFields = platformClientUtil.getBtmService().getUnRemovableFields(id, removableFields.toArray(new String[0]));
@@ -971,7 +971,9 @@
if (this.hasInstanceByBtmName(id)) {
//涓氬姟绫诲瀷宸叉湁瀹炰緥, 鍙兘鍒犻櫎娌℃湁鏁版嵁鐨勫垪
if (unRemovableFields != null && unRemovableFields.length > 0) {
- unRemovableFields_ = Arrays.asList(unRemovableFields);
+ //绉婚櫎浜嗕笉鍙慨鏀圭殑灞炴�х洿鎺ユ姤閿欙紝灏变笉寰�涓嬫墽琛屼簡
+ throw new VciBaseException("涓氬姟绫诲瀷宸叉湁瀹炰緥, 鍙兘鍒犻櫎娌℃湁鏁版嵁鐨勫垪");
+ /*unRemovableFields_ = Arrays.asList(unRemovableFields);
for (int i = 0; i < removableFields.size(); i++) {
String abName = removableFields.get(i);
if (unRemovableFields_.contains(abName)) {
@@ -979,7 +981,7 @@
lastAttrList.add(abName);
}
}
- }
+ }*/
}
}
}
@@ -1575,7 +1577,7 @@
//boolean flag = DDLToolClient.getService().hasInstanceOralce(tableName);
boolean flag = false;
try {
- flag = ClientServiceProvider.getOMDService().getBTMService().hasData(btmName);
+ flag = platformClientUtil.getBtmService().hasData(btmName);
} catch (PLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
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 1ee2d5f..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
@@ -1444,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);
+ }
}
/**
--
Gitblit v1.9.3