From eb3000389c4b9bdc5d836dc356932d551ff7c073 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期二, 20 六月 2023 10:54:20 +0800
Subject: [PATCH] 历史导入展现页面接口测试完善

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
index f5714e3..c324801 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -759,7 +759,7 @@
 	 * @return 鏈夐敊璇俊鎭殑excel
 	 */
 	@Override
-	public CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid, String classifyAttr,File file) {
+	public CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid, String classifyAttr,File file) throws  Throwable{
 		VciBaseUtil.alertNotNull(codeClassifyOid,"鍒嗙被鐨勪富閿�");
 		ReadExcelOption reo = new ReadExcelOption();
 		reo.setReadAllSheet(true);
@@ -2978,21 +2978,35 @@
 	 * @param cboList 鏁版嵁鐨勫垪琛�
 	 * @param errorMap 閿欒鐨勪俊鎭�
 	 */
-	private void batchCheckIdExistOnOrder(CodeClassifyTemplateVO templateVO,List<ClientBusinessObject> cboList,Map<String ,String> errorMap){
+	private void batchCheckIdExistOnOrder(CodeClassifyTemplateVO templateVO,List<ClientBusinessObject> cboList,Map<String ,String> errorMap) throws Throwable{
 		List<String> existIds = new ArrayList<>();
+		String tableName ="";
+		try {
+			R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId());
+			if(r.getCode()!=200) {
+				throw new Throwable(r.getMsg());
+			}
+			BtmTypeVO btmTypeVO = r.getData();
+			if (btmTypeVO == null) {
+				throw new Throwable("鏍规嵁涓氬姟绫诲瀷鏈煡璇㈠埌涓氬姟绫诲瀷瀵硅薄锛�");
+			}
+			tableName = btmTypeVO.getTableName();
+			if (StringUtils.isBlank(tableName)) {
+				throw new Throwable("鏍规嵁涓氬姟绫诲瀷鏈煡璇㈠埌涓氬姟绫诲瀷鐩稿叧鑱旂殑琛�");
+			}
+		}catch (Throwable e){
+			throw e;
+		}
+		String finalTableName = tableName;
 		VciBaseUtil.switchCollectionForOracleIn(cboList).stream().forEach(cbos -> {
 			Map<String, String> conditionMap = new HashMap<>();
 			conditionMap.put("id", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0])) + ")");
 
-			R<BtmTypeVO>  r= btmTypeClient.getDetail(templateVO.getBtmTypeId());
-			BtmTypeVO btmTypeVO =r.getData();
-			String tableName=btmTypeVO.getTableName();
-
 			StringBuffer sb=new StringBuffer();
 			sb.append(" select id from ");
-			sb.append(tableName);
+			sb.append(finalTableName);
 			sb.append(" where 1=1 ");
-			sb.append(" id in (");
+			sb.append(" and id in (");
 			sb.append(VciBaseUtil.toInSql(cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0])));
 			sb.append(")");
 			List<String> idList= commonsMapper.selectById(sb.toString());

--
Gitblit v1.9.3