From bfa2d1307c6faea916088a40dc09a360b17f7499 Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期五, 30 六月 2023 18:04:33 +0800
Subject: [PATCH] 1、主要对查询返回数据进行联查

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 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 c324801..ad6059a 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
@@ -1895,9 +1895,30 @@
 		getFieldIndexMap(titleRowData, attrNameIdMap, fieldIndexMap);
 		Map<String, String> cboOidMap = new HashMap<>();
 		cboOidMap.put("id", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0])) + ")");
-		R<BtmTypeVO>  r= btmTypeClient.getDetail(templateVO.getBtmTypeId());
-		BtmTypeVO btmTypeVO =r.getData();
-		String tableName=btmTypeVO.getTableName();
+		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){
+			log.error("鏌ヨ涓氬姟瀵硅薄琛�"+e);
+			XMLResultDataObjectDetailDO xmlResultDataObjectDetailDO=new XMLResultDataObjectDetailDO();
+			xmlResultDataObjectDetailDO.setErrorid("103");
+			xmlResultDataObjectDetailDO.setMsg("鏌ヨ涓氬姟瀵硅薄琛�"+e);
+			xmlResultDataObjectDetailDO.setId("");
+			xmlResultDataObjectDetailDO.setCode("");
+			resultDataObjectDetailDOs.add(xmlResultDataObjectDetailDO);
+			return;
+		}
 
 		StringBuffer sb=new StringBuffer();
 		sb.append(" select * from ");
@@ -2188,7 +2209,7 @@
 			} else if (StringUtils.isNotBlank(orderDTO.getCopyFromVersion())) {
 				sql[0] += " and oid != '" + orderDTO.getCopyFromVersion() + "'";
 			}
-			sql[0] += " and islastR = '1' and islastV = '1' ";
+			sql[0] += " and lastR = '1' and lastV = '1' ";
 			if (commonsMapper.queryCountBySql(sql[0]) > 0) {
 				String ruleInfoMsg = keyRuleVO == null ? "" : "鏌ヨ瑙勫垯锛氬幓闄ょ┖鏍�--{0},蹇界暐澶у皬鍐�--{1},蹇界暐鍏ㄥ崐瑙�--{2},蹇界暐鍏ㄩ儴绌烘牸--{3}";
 				String[] objs = new String[]{trim ? "鏄�" : "鍚�", ignoreCase ? "鏄�" : "鍚�", ignoreWidth ? "鏄�" : "鍚�", trimAll ? "鏄�" : "鍚�"};
@@ -3829,8 +3850,8 @@
 			}else{
 				if (!CollectionUtils.isEmpty(conditionMap)) {
 					Map<String, String> andConditionMap = new HashMap<>();
-					andConditionMap.put("islastr", "1");
-					andConditionMap.put("islastv", "1");
+					andConditionMap.put("lastr", "1");
+					andConditionMap.put("lastv", "1");
 					conditionMap.putAll(andConditionMap);
 					PageHelper pageHelper = new PageHelper(-1);
 					pageHelper.addDefaultDesc("id");

--
Gitblit v1.9.3