From 28ca3d9f9e6e7eeeb7a7f2a7f50012350f3934c3 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期三, 13 十一月 2024 18:07:11 +0800 Subject: [PATCH] 优化业务数据的查询接口;修改业务数据保存和编辑接口没有保存基础默认属性问题。 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java | 38 +++++++++++++++++++++++++++++--------- 1 files changed, 29 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 73a4fac..4b60a12 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 @@ -246,7 +246,7 @@ vo.setDelimiter(btmItem.delimiter); vo.setfName(btmItem.fName); vo.setVersionRule(String.valueOf(btmItem.verRuleName)); - if (StringUtils.isNotBlank(vo.getRevisionRuleName()) || vo.isInputRevisionFlag()) { + if (StringUtils.isNotBlank(vo.getRevisionRuleId()) || vo.isInputRevisionFlag()) { vo.setRevisionFlag(true); } vo.setLifeCycleIds(Arrays.stream(btmItem.lifeCycles).collect(Collectors.joining(","))); @@ -313,6 +313,25 @@ } return self.selectAllBtmMap().getOrDefault(id.toLowerCase(), null); } + + /** + * 浣跨敤绫诲瀷鍚嶈幏鍙栦笟鍔$被鍨�,鏌ヤ笉鍒扮洿鎺ユ姤閿� + * @param btmName 绫诲瀷鍚� + * @return 涓氬姟绫诲瀷 + * @throws + */ + @Override + public OsBtmTypeVO getBtmByName(String btmName) throws PLException{ + if(Func.isBlank(btmName)){ + throw new PLException("500",new String[]{"鏌ヨ鏉′欢绫诲瀷鍚嶄笉鑳戒负绌猴紒"}); + } + BizType bizType = platformClientUtil.getBtmService().getBizTypeByName(btmName); + if(Func.isEmpty(bizType) || Func.isBlank(bizType.oid)){ + throw new PLException("500",new String[]{"鏍规嵁銆�"+btmName+"銆戞湭鏌ヨ鍒板搴斾笟鍔$被鍨嬶紒"}); + } + return btmDO2VO(bizType,null); + } + /** * 浣跨敤缂栧彿鑾峰彇涓氬姟绫诲瀷 * @@ -495,7 +514,6 @@ /** * 鍒ゆ柇璇ュ睘鎬ф槸鍚﹀凡缁忓湪涓氬姟绫诲瀷涓骇鐢熶簡鏁版嵁 - * * @param abName * @return * @throws PLException @@ -956,14 +974,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 +990,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 +1000,7 @@ lastAttrList.add(abName); } } - } + }*/ } } } @@ -1576,7 +1596,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