From aa6be631961866afbee6b866b1fbb84a50da3910 Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期三, 02 八月 2023 12:20:01 +0800
Subject: [PATCH] 1、通用查询数据类型报错问题。 2、通用更新列重复问题。

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

diff --git a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmAttributeServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmAttributeServiceImpl.java
index af80c13..99d2e3c 100644
--- a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmAttributeServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmAttributeServiceImpl.java
@@ -60,7 +60,7 @@
 			attributesDTOList.stream().forEachOrdered(s -> {
 				attributeService.checkAttribute(s);
 				btmTypeAttributeDOList.add(BtmTypeAttributeWrapper.build().copyBtmTypeAttributeDTO2Entity(s,btmTypeOid, creator, now));
-				attributeIdList.add(s.getId().toLowerCase().trim());
+				attributeIdList.add(s.getId().trim());
 			});
 			//妫�鏌ュ睘鎬ф槸鍚﹂兘瀛樺湪
 			boolean exists = attributeService.checkAttributeExists(attributeIdList);
@@ -107,7 +107,7 @@
 			attributesDTOList.stream().forEachOrdered(s -> {
 				attributeService.checkAttribute(s);
 				btmTypeAttributeDOList.add(BtmTypeAttributeWrapper.build().copyBtmTypeAttributeDTO2Entity(s,btmTypeOid, creator, now));
-				attributeIdList.add(s.getId().toLowerCase().trim());
+				attributeIdList.add(s.getId().trim());
 			});
 			//妫�鏌ュ睘鎬ф槸鍚﹂兘瀛樺湪
 			boolean exists = attributeService.checkAttributeExists(attributeIdList);
@@ -177,7 +177,7 @@
 
 	/**
 	 * 鑾峰彇榛樿瀛楁
-	 *
+	 * 榛樿瀛楁鍧囦笉鍙负绌�
 	 * @param btmType 涓氬姟绫诲瀷
 	 * @return 鎵ц缁撴灉
 	 */
@@ -186,16 +186,15 @@
 		List<BtmTypeAttributeVO> list = new ArrayList<>();
 		// 涓氬姟绫诲瀷鐨勫熀鏈瓧娈�
 		BtmTypeFieldConstant.BASIC_FIELD_MAP.forEach((id,name) -> {
+			id = id.toLowerCase(Locale.ROOT);
 			BtmTypeAttributeVO vo = new BtmTypeAttributeVO();
 			vo.setId(id);
 			vo.setName(name);
 			vo.setPkBtmType(btmType.getOid());
-			if (StringUtils.equals(id,"oid")){
+			if ("oid".equals(id)){
 				vo.setNullableFlag(false);
-			}else {
-				vo.setNullableFlag(true);
 			}
-			if (Arrays.asList("createtime","lastmodifytime","owner").contains(id)){
+			if (Arrays.asList("createtime","lastmodifytime","ts").contains(id)){
 				vo.setAttrDataType(VciFieldTypeEnum.VTDateTime.name());
 				vo.setAttributeLength(6);
 			}else {
@@ -213,8 +212,10 @@
 				vo.setName(name);
 				vo.setPkBtmType(btmType.getOid());
 				vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
+				// 鐗堟湰瑙勫垯瀛楁涓嶈兘涓虹┖
+//				vo.setNullableFlag(false);
 				vo.setAttributeLength(150);
-				if (Arrays.asList("lastr","firstr","lastv","firstv","revisionseq","versionseq","revisionvalue","versionvalue").contains(id)){
+				if (Arrays.asList("lastr","firstr","lastv","firstv").contains(id)){
 					vo.setAttributeLength(5);
 					vo.setAttrDataType(VciFieldTypeEnum.VTInteger.name());
 				}
@@ -233,6 +234,7 @@
 				vo.setId(id);
 				vo.setName(name);
 				vo.setPkBtmType(btmType.getOid());
+//				vo.setNullableFlag(false);
 				vo.setAttributeLength(50);
 				vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
 				list.add(vo);
@@ -246,6 +248,7 @@
 				vo.setId(id);
 				vo.setName(name);
 				vo.setPkBtmType(btmType.getOid());
+//				vo.setNullableFlag(false);
 				vo.setAttributeLength(5);
 				vo.setAttrDataType(VciFieldTypeEnum.VTInteger.name());
 				list.add(vo);

--
Gitblit v1.9.3