From eae62469c0b1dbaf11f2ce7518bf5612644c6da9 Mon Sep 17 00:00:00 2001
From: fujunling <2984387807@qq.com>
Date: 星期二, 11 七月 2023 09:30:52 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs

---
 Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java
index a75265e..2dc1b5f 100644
--- a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java
@@ -204,7 +204,7 @@
 	 */
 	@Override
 	public List<BtmType> listBtmTypeDOByIdCollection(Collection<String> idCollection) throws ServiceException {
-		return CollectionUtils.isEmpty(idCollection) ? null : baseMapper.selectList(Wrappers.<BtmType>query().lambda().in(BtmType::getId, idCollection));
+		return CollectionUtils.isEmpty(idCollection) ? null : baseMapper.selectByIdCollection(idCollection);
 	}
 
 	/**
@@ -595,11 +595,14 @@
 		if (btmTypeDTO.getId().length() > 24) {
 			throw new VciBaseException("涓氬姟绫诲瀷鑻辨枃鍚嶇О涓嶈兘瓒呰繃18锛岀洰鍓嶉暱搴︿负{0}", new Object[]{btmTypeDTO.getId().length()});
 		}
-		List<BtmType> btmTypeDOList = listBtmTypeDOByIdCollection(VciBaseUtil.str2List(btmTypeDTO.getId()));
+		List<BtmType> btmTypeDOList = listBtmTypeDOByIdCollection(VciBaseUtil.str2List(btmTypeDTO.getId().toLowerCase(Locale.ROOT)));
 		if (!CollectionUtils.isEmpty(btmTypeDOList) && btmTypeDOList.size() > 0) {
+			boolean exist = btmTypeDOList.stream().filter(btm -> StringUtils.isNotBlank(btm.getOid())).anyMatch(btm -> !StringUtils.equals(btmTypeDTO.getOid(), btm.getOid()));
 			BtmType existBtmType = btmTypeDOList.get(0);
-			throw new VciBaseException("涓氬姟绫诲瀷鑻辨枃鍚嶇О宸茬粡瀛樺湪锛堜笉鍖哄垎澶у皬鍐欙級锛岃繖涓嫳鏂囧悕绉板搴旂殑涓枃鍚嶇О涓簕0},鍒涘缓浜簕1},鍒涘缓鏃堕棿{2}"
-				, new Object[]{existBtmType.getName(), existBtmType.getCreator(), VciDateUtil.date2Str(existBtmType.getCreateTime(), VciDateUtil.DateFormat)});
+			if (exist) {
+				throw new VciBaseException("涓氬姟绫诲瀷鑻辨枃鍚嶇О宸茬粡瀛樺湪锛堜笉鍖哄垎澶у皬鍐欙級锛岃繖涓嫳鏂囧悕绉板搴旂殑涓枃鍚嶇О涓簕0},鍒涘缓浜簕1},鍒涘缓鏃堕棿{2}"
+					, new Object[]{existBtmType.getName(), existBtmType.getCreator(), VciDateUtil.date2Str(existBtmType.getCreateTime(), VciDateUtil.DateFormat)});
+			}
 		}
 		if (btmTypeDTO.isRevisionFlag()){
 			// 闇�瑕佹帶鍒剁増鏈�

--
Gitblit v1.9.3