From 980a7eab362b5a8c00f13427c73053382ca4ba44 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期三, 06 十二月 2023 09:31:31 +0800
Subject: [PATCH] 集团码导入功能开发

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

diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
index 2dd56b5..7d06620 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -44,6 +44,7 @@
 import com.vci.ubcs.starter.revision.service.RevisionModelUtil;
 import com.vci.ubcs.starter.util.MdmBtmTypeConstant;
 import com.vci.ubcs.starter.util.SaveLogUtil;
+import com.vci.ubcs.starter.util.SpecialCharacterConverter;
 import com.vci.ubcs.starter.util.UBCSSqlKeyword;
 import com.vci.ubcs.starter.web.constant.QueryOptionConstant;
 import com.vci.ubcs.starter.web.constant.RegExpConstant;
@@ -464,7 +465,7 @@
 			);
 		}catch (Exception e){
 			// 鎻掑叆鏇存敼鏃ュ織璁板綍
-			saveLogUtil.operateLog(CodeDefaultLC.getTextByValue(baseModelDTO.getLcStatus()),true,e.getMessage());
+			saveLogUtil.operateLog(CodeDefaultLC.getTextByValue(baseModelDTO.getLcStatus()),true,e.toString());
 			throw e;
 		}
     }
@@ -702,7 +703,6 @@
         }
     }
 
-
     /**
      * 璁剧疆鏂扮殑鍊煎埌鐢宠瀵硅薄涓�
      *
@@ -791,6 +791,7 @@
                 sql[0] += " and oid != '" + orderDTO.getCopyFromVersion() + "'";
             }
             sql[0] += " and lastR = '1' and lastV = '1' ";
+			// 鑾峰彇涓嶅弬涓庢牎楠岀殑鍒嗙被oid
 			String isParticipateCheckOids = classifyService.selectLeafByParentClassifyOid(classifyFullInfo.getTopClassifyVO().getOid(), classifyFullInfo.getCurrentClassifyVO().getOid());
 			if(Func.isNotEmpty(isParticipateCheckOids)){
 				sql[0] += " and codeclsfid not in(" + isParticipateCheckOids + ")";
@@ -1193,12 +1194,12 @@
                     temp = "%s";
                 }
                 queryKey = String.format(temp, "nvl("+ "t." + attrId +",'/')");
-                queryValue = String.format(temp, "'" + (trim ? value.trim() : value) + "'");
+                queryValue = String.format(temp, "'" + (trim ? SpecialCharacterConverter.escapeSpecialCharacters(value.trim()):SpecialCharacterConverter.escapeSpecialCharacters(value)) + "'");
                 conditionMap.put(queryKey, queryValue);
             } else {
 				if(StringUtils.isNotBlank(value)) {
 					//涓虹┖鐨勬椂鍊欎笉浠h〃涓嶆牎楠岋紝鍙槸涓嶅幓闄ょ浉鍏崇殑淇℃伅
-					conditionMap.put("nvl("+ "t." + attrId+",'/')", "'" + value + "'");
+					conditionMap.put("nvl("+ "t." + attrId+",'/')", "'" + SpecialCharacterConverter.escapeSpecialCharacters(value) + "'");
 				}else{
 					conditionMap.put("t." + attrId, QueryOptionConstant.ISNULL);
 				}
@@ -2433,7 +2434,15 @@
                 } else {
                     return (field.contains(".") ? "" : "t.") + field + SPACE + "= " + getStringValueInWhere(field, value, attrVOMap) + "" + SPACE;
                 }
-            } else {
+            } else if(key.endsWith("_in")){
+				String field = UBCSSqlKeyword.getColumn(key, "_in");
+				if (referFieldMap.containsKey(field)) {
+					return VciBaseUtil.toInSql(referFieldMap.get(field),value);  //referFieldMap.get(field) + SPACE + "= '" + value + "'" + SPACE;
+				} else {
+					return (field.contains(".") ? "" : "t.") + field + SPACE + "= " + getStringValueInWhere(field, value, attrVOMap) + "" + SPACE;
+				}
+
+			}else {
 //                if (referFieldMap.containsKey(key)) {
 //                    //璇存槑鏄弬鐓х殑锛屾垜浠弬鐓х殑鏌ヨ閮借涓烘槸瀛楃涓诧紝濡傛灉鏄椂闂存牸寮忕殑鏌ヨ鑲畾鏈夐棶棰橈紝
 //                    String selectKey = referFieldMap.get(key);
@@ -2472,7 +2481,6 @@
 				return getSqlByValue(key, value, attrVOMap,btmType);
 			}
 		}*/
-
     }
 
     /**
@@ -3112,7 +3120,7 @@
 			saveLogUtil.operateLog("鏁版嵁鏇存敼",false, StringUtil.format("{}\n淇敼涓�:\n{}",JSON.toJSONString(Collections.singletonList(oldCbo)),JSON.toJSONString(Collections.singletonList(cbo))));
 		} catch (Exception vciError) {
 			// 璁板綍鏁版嵁鏇存敼鎶ラ敊鏃剁殑鏃ュ織
-			saveLogUtil.operateLog("鏁版嵁鏇存敼",true,vciError.getMessage());
+			saveLogUtil.operateLog("鏁版嵁鏇存敼",true,vciError.toString());
 			throw new VciBaseException("鏁版嵁鏇存敼淇濆瓨鍑洪敊浜�", new String[0], vciError);
 		}
 

--
Gitblit v1.9.3