From a2340107467fe78a71098dffc6c2280568a01213 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 04 十二月 2023 18:02:49 +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