From b86d97b09d1aca57291004c1a2bc014f90702918 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 26 一月 2024 16:14:39 +0800
Subject: [PATCH] 提交代码

---
 Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java |   91 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 89 insertions(+), 2 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 9dd2144..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
@@ -469,7 +469,7 @@
 	 * @throws ServiceException 鍙傛暟涓虹┖鐨勬椂鍊欎細鎶涘嚭寮傚父
 	 */
 	@Override
-	public String getTableName(String id,String domain) throws ServiceException {
+	public String getTableName(String id,String domain) throws VciBaseException {
 		VciBaseUtil.alertNotNull(id,"涓氬姟绫诲瀷鑻辨枃鍚嶇О",domain,"棰嗗煙鍚嶇О");
 		if (domain.contains("ubcs-")){
 			domain = domain.split("ubcs-")[1];
@@ -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