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 |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 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 73a4fac..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
@@ -495,7 +495,6 @@
 
     /**
      * 鍒ゆ柇璇ュ睘鎬ф槸鍚﹀凡缁忓湪涓氬姟绫诲瀷涓骇鐢熶簡鏁版嵁
-     *
      * @param abName
      * @return
      * @throws PLException
@@ -956,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]));
@@ -972,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)) {
@@ -980,7 +981,7 @@
                                 lastAttrList.add(abName);
                             }
                         }
-                    }
+                    }*/
                 }
             }
         }
@@ -1576,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();

--
Gitblit v1.9.3