From 1d0042d823333554cc1b74b092496e5aff38d502 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 04 七月 2023 18:46:11 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs

---
 Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java |   38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java
index a8ffb74..bc9b2ad 100644
--- a/Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java
@@ -35,6 +35,7 @@
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import javax.annotation.Resource;
 import javax.validation.constraints.NotNull;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
@@ -64,13 +65,15 @@
 	/**
 	 * ddl鏁版嵁鎿嶄綔鏈嶅姟
 	 */
-	private final DdlMapperProcessor ddlMapper = DdlMapperProcessStrategy.getProcessor();
+	@Autowired
+	private DdlMapperProcessor ddlMapper;
 
 
 	/**
 	 * dll鏁版嵁鎿嶄綔鏈嶅姟
 	 */
-	private final DllMapperProcessor dllMapper = DllMapperProcessorStrategy.getProcessor();
+	@Autowired
+	private DllMapperProcessor dllMapper;
 
 	private static final String YES = "Y";
 
@@ -976,26 +979,39 @@
 	 */
 	@Override
 	public R<List<ModifyAttributeInfo>> submit(BtmAndLinkTypeDdlDTO ddlDTO) {
-		//try {
+		try {
 			List<ModifyAttributeInfo> changedList = new ArrayList<>();
 			if (!CollectionUtils.isEmpty(ddlDTO.getBtmTypeList())) {
 				List<BtmTypeVO> btmTypeList = ddlDTO.getBtmTypeList();
-				//putBtm(btmTypeList.toArray(new BtmTypeVO[0]));
+				putBtm(btmTypeList.toArray(new BtmTypeVO[0]));
 				changedList.addAll(checkDifferent(btmTypeList, null));
-				//removeBtm(btmTypeList.toArray(new BtmTypeVO[0]));
+				removeBtm(btmTypeList.toArray(new BtmTypeVO[0]));
 			}
 			if (!CollectionUtils.isEmpty(ddlDTO.getLinkTypeList())) {
 				List<LinkTypeVO> linkTypeList = ddlDTO.getLinkTypeList();
-				//putLink(linkTypeList.toArray(new LinkTypeVO[0]));
+				putLink(linkTypeList.toArray(new LinkTypeVO[0]));
 				changedList.addAll(checkDifferent(null,linkTypeList));
-				//removeLink(linkTypeList.toArray(new LinkTypeVO[0]));
+				removeLink(linkTypeList.toArray(new LinkTypeVO[0]));
 			}
 			R<List<ModifyAttributeInfo>> result = R.success("鏁版嵁搴撴搷浣滄垚鍔�");
 			result.setData(changedList);
 			return result;
-		//} catch (ServiceException e) {
-			//throw new RuntimeException(e.getMessage());
-//		}
+		} catch (VciBaseException e) {
+			try {
+				// 寤鸿〃澶辫触鏈夊紓甯革紝鎹曡幏鍚庤繑鍥烇紝骞堕噴鏀剧嚎绋嬩腑鐨勫唴瀹�
+				if (!CollectionUtils.isEmpty(ddlDTO.getBtmTypeList())) {
+					removeBtm(ddlDTO.getBtmTypeList().toArray(new BtmTypeVO[0]));
+				}
+				if (!CollectionUtils.isEmpty(ddlDTO.getLinkTypeList())) {
+					removeLink(ddlDTO.getLinkTypeList().toArray(new LinkTypeVO[0]));
+				}
+				return R.fail(e.getMessage());
+			}catch (ServiceException e2){
+				throw new RuntimeException(e2.getMessage());
+			}
+		} catch (ServiceException e) {
+			throw new RuntimeException(e.getMessage());
+		}
 	}
 
 	/**
@@ -1056,7 +1072,7 @@
 					BtmTypeAttributeVO attributeVO = new BtmTypeAttributeVO();
 					attributeVO.setId(col.getId().toLowerCase());
 					attributeVO.setName(col.getName());
-					attributeVO.setNullableFlag(col.getNullableFlag());
+					attributeVO.setNullableFlag(StringUtils.equals(col.getNullableFlag(), BooleanEnum.TRUE.getValue()));
 					attributeVO.setAttributeLength(col.getAttributeLength());
 					attributeVO.setPrecisionLength(col.getPrecisionLength());
 					attributeVO.setScaleLength(col.getScaleLength());

--
Gitblit v1.9.3