From e3f2259fcece27f7b98d466b08cbc571de043fd7 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 26 一月 2024 16:59:59 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java |   89 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 88 insertions(+), 1 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 577c911..cc1ae87 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
@@ -497,7 +497,7 @@
 			transaction = dataSourceTransactionManager.getTransaction(def);
 			// 鑾峰緱浜嬪姟鐘舵��
 		}*/
-//		checkBtmTypeBeforeSave(btmTypeDTO);
+		//checkBtmTypeBeforeSave(btmTypeDTO);
 		BtmType btmTypeDO = Optional.ofNullable(BeanUtil.copy(btmTypeDTO, BtmType.class)).orElseGet(BtmType::new);
 		btmTypeDO.setBizDomain(btmTypeDTO.getBizDomain());
 		List<BtmTypeLinkAttributesDTO> attributes = btmTypeDTO.getAttributes();
@@ -969,4 +969,91 @@
 		});
 		return total[0];
 	}
+
+	/**
+	 * 鑾峰彇榛樿灞炴��
+	 * @param defaultAttrType
+	 * @return
+	 */
+	@Override
+	public List<BtmTypeAttributeVO> getDefaultAttr(String defaultAttrType) {
+		List<BtmTypeAttributeVO> list = new ArrayList<>();
+		// 涓氬姟绫诲瀷鐨勯粯璁ゅ熀鏈瓧娈�
+		if(defaultAttrType.equals("defaultAttr")){
+			BtmTypeFieldConstant.BASIC_FIELD_MAP.forEach((id,name) -> {
+				id = id.toLowerCase(Locale.ROOT);
+				BtmTypeAttributeVO vo = new BtmTypeAttributeVO();
+				vo.setId(id);
+				vo.setName(name);
+				vo.setIseDfaultAttr(true);
+				if ("oid".equals(id)){
+					vo.setNullableFlag(false);
+				}
+				if (Arrays.asList("createtime","lastmodifytime","ts").contains(id)){
+					vo.setAttrDataType(VciFieldTypeEnum.VTDateTime.name());
+					vo.setAttributeLength(6);
+				}else {
+					vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
+					vo.setAttributeLength(150);
+				}
+				list.add(vo);
+			});
+
+			BtmTypeFieldConstant.MASTERDATA_FIELD_MAP.forEach((id,name) -> {
+				id = id.toLowerCase(Locale.ROOT);
+				BtmTypeAttributeVO vo = new BtmTypeAttributeVO();
+				vo.setId(id);
+				vo.setName(name);
+				vo.setIseDfaultAttr(false);
+				if (Arrays.asList("codeclsfpath").contains(id)){
+					vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
+					vo.setAttributeLength(500);
+				}else {
+					vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
+					vo.setAttributeLength(255);
+				}
+				list.add(vo);
+			});
+		}
+
+		// 鐗堟湰瑙勫垯瀛楁
+		if (defaultAttrType.equals("reVersionRule")){
+			BtmTypeFieldConstant.REVISION_MANAGE_FIELD_MAP.forEach((id,name) -> {
+				BtmTypeAttributeVO vo = new BtmTypeAttributeVO();
+				vo.setId(id);
+				vo.setName(name);
+				vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
+				// 鐗堟湰瑙勫垯瀛楁涓嶈兘涓虹┖
+//				vo.setNullableFlag(false);
+				vo.setAttributeLength(150);
+				vo.setIseDfaultAttr(true);
+				if (Arrays.asList("revisionseq","versionseq").contains(id)){
+					vo.setAttributeLength(5);
+					vo.setAttrDataType(VciFieldTypeEnum.VTInteger.name());
+				}
+				if (Arrays.asList("checkintime","checkouttime").contains(id)){
+					vo.setAttrDataType(VciFieldTypeEnum.VTDateTime.name());
+					vo.setAttributeLength(6);
+				}
+				list.add(vo);
+			});
+		}
+
+		// 鐢熷懡鍛ㄦ湡瀛楁
+		if (defaultAttrType.equals("lifeCycle")){
+			BtmTypeFieldConstant.LIFECYCLE_MANAGE_FIELD_MAP.forEach((id,name) -> {
+				BtmTypeAttributeVO vo = new BtmTypeAttributeVO();
+				vo.setId(id);
+				vo.setName(name);
+//				vo.setNullableFlag(false);
+				vo.setIseDfaultAttr(true);
+				vo.setAttributeLength(50);
+				vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
+				list.add(vo);
+			});
+		}
+
+		return list;
+	}
+
 }

--
Gitblit v1.9.3