From ed38499b75ab101109c3d2b6b7cc95034f868be3 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期四, 14 十一月 2024 17:26:22 +0800 Subject: [PATCH] 模板属性查询,配置去除密级为默认属性 --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java | 42 ++++++++++++++++++++++++++++++++---------- 1 files changed, 32 insertions(+), 10 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..325921d 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); + } + /** * 浣跨敤缂栧彿鑾峰彇涓氬姟绫诲瀷 * @@ -424,9 +443,10 @@ if (attrVOs == null) { attrVOs = new ArrayList<>(); } - if (!CollectionUtils.isEmpty(attributeService.getDefaultAttributeVOs())) { + List<OsAttributeVO> defaultAttributeVOs = attributeService.getDefaultAttributeVOs(); + if (!CollectionUtils.isEmpty(defaultAttributeVOs)) { List<OsBtmTypeAttributeVO> finalAttrVOs = attrVOs; - attributeService.getDefaultAttributeVOs().stream().forEach(attr -> { + defaultAttributeVOs.stream().forEach(attr -> { OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO(); BeanUtil.convert(attr, attributeVO); attributeVO.setAttributeDataType(attr.getAttributeDataType()); @@ -955,14 +975,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 +991,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 +1001,7 @@ lastAttrList.add(abName); } } - } + }*/ } } } @@ -1575,7 +1597,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