From 4d6ef8b333cb6b9a4ca97966c6a696d56b0f3c89 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 01 三月 2024 16:31:06 +0800
Subject: [PATCH] 近义词查询规则清空当前id和text
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 43 +++++++++++++++++++++++++++++++------------
1 files changed, 31 insertions(+), 12 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 8c7b56b..2965981 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
@@ -423,8 +423,7 @@
try {
VciBaseUtil.alertNotNull(baseModelDTO, "鏁版嵁淇℃伅", baseModelDTO.getOid(), "涓婚敭", baseModelDTO.getBtmname(), "涓氬姟绫诲瀷", baseModelDTO.getLcStatus(), "鐩爣鐘舵��");
List<String> oids = VciBaseUtil.str2List(baseModelDTO.getOid());
- List<BaseModel> baseModels = new ArrayList<>();
- baseModels = selectByTypeAndOid(baseModelDTO.getBtmname(), baseModelDTO.getOid());
+ List<BaseModel> baseModels = selectByTypeAndOid(baseModelDTO.getBtmname(), baseModelDTO.getOid());
if (baseModels.size() == 0) {
throw new VciBaseException("鏈煡璇㈠埌鐩稿叧鏁版嵁銆�");
}
@@ -1289,6 +1288,20 @@
}
/**
+ * 灏佽杩戜箟璇嶆煡璇㈣鍒欏睘鎬х殑鏌ヨ璇彞
+ * @param value 褰撳墠鐨勫��
+ * @param keyRuleVO 灞炴�х殑缂栧彿
+ * @param attrId
+ * @param conditionMap 鏌ヨ鏉′欢
+ */
+ @Override
+ public void wrapperSynonymAttrConditionMap(String value, CodeKeyAttrRepeatVO keyRuleVO, String attrId, Map<String, String> conditionMap) {
+ // map鏋勯�犳�濊矾锛�1銆佸厛瀹屾垚姝e悜鏇挎崲sql鍊�
+ // 2銆佸啀瀹屾垚鍙嶅悜鏇挎崲sql鍊�
+
+ }
+
+ /**
* 鏍¢獙鏋氫妇鐨勫唴瀹�
*
* @param templateVO 妯℃澘鐨勬樉绀哄璞★紝闇�瑕佸寘鍚睘鎬�
@@ -1948,7 +1961,7 @@
boolean ignoreCase = VciBaseUtil.getBoolean(resembleRuleVO.getIgnorecaseflag());
boolean ignoreWidth = VciBaseUtil.getBoolean(resembleRuleVO.getIgnorewidthflag());
boolean trimAll = VciBaseUtil.getBoolean(resembleRuleVO.getIgnoreallspaceflag());
- boolean trim = VciBaseUtil.getBoolean(resembleRuleVO.getIgnoreallspaceflag());
+ boolean trim = VciBaseUtil.getBoolean(resembleRuleVO.getIgnorecaseflag());
String temp = "";
if (ignoreCase && ignoreSpace && ignoreWidth) {
//蹇界暐澶у皬鍐欙紝涓斿幓绌猴紝蹇界暐鍏ㄥ崐瑙�
@@ -1982,7 +1995,7 @@
temp = "replace(" + temp + ",'" + s + "','')";
}
}
- queryValue = String.format(temp, (trim ? value.trim() : value));
+ queryValue = String.format(temp, (trim ? "'"+value.trim()+"'" : "'"+value+"'"));
temp = temp.replace("to_single_byte('%s')", "to_single_byte(%s)");
queryKey = String.format(temp, "t." + attrId);
conditionMap.put(queryKey, QueryOptionConstant.OR + queryValue);
@@ -2008,7 +2021,7 @@
} catch (Exception e) {
String errorMessage = e.getMessage();
if (errorMessage.contains("鏃犳硶瑙f瀽鐨勬垚鍛樿闂〃杈惧紡")) {
- throw new ServiceException("缂哄皯" + errorMessage.substring(errorMessage.indexOf("[t.") + 1, errorMessage.indexOf("]")) + "瀛楁");
+ throw new ServiceException("缂哄皯" + errorMessage.substring(errorMessage.indexOf("[T.") + 1, errorMessage.indexOf("]")) + "瀛楁");
}
throw new ServiceException(e.getMessage());
}
@@ -2982,6 +2995,9 @@
conditionMap.put("t.lastr", "1");
conditionMap.put("t.lastv", "1");
DataGrid<Map<String, String>> mapDataGrid = queryGrid(btmTypeId, templateVO, conditionMap, pageHelper);
+ if(templateVO.getAttributes().isEmpty()){
+ throw new ServiceException(String.format("涓婚敭涓猴細{}鐨勬ā鏉夸笅锛屾ā鏉垮睘鎬ч厤缃负绌猴紒",templateVO.getOid()));
+ }
//澶勭悊杩斿洖鏁版嵁涓庢ā鏉挎暟鎹厤缃殑瀛楁涓嶄竴鏍烽棶棰�
templateVO.getAttributes().stream().forEach(e -> {
for (Map<String, String> datum : mapDataGrid.getData()) {
@@ -3435,6 +3451,9 @@
dataList.add(cbo);
wrapperData(dataList, templateVO, sqlBO.getSelectFieldList(), true);
R<List<Map<String, String>>> result = R.data(Collections.singletonList(cbo));
+ if(templateVO.getAttributes().isEmpty()){
+ throw new ServiceException(String.format("涓婚敭涓猴細{}鐨勬ā鏉夸笅锛屾ā鏉垮睘鎬ч厤缃负绌猴紒",templateVO.getOid()));
+ }
//澶勭悊杩斿洖鏁版嵁涓庢ā鏉挎暟鎹厤缃殑瀛楁涓嶄竴鏍烽棶棰�
templateVO.getAttributes().stream().forEach(e -> {
for (Map<String, String> datum : result.getData()) {
@@ -3909,13 +3928,13 @@
MdmUIInfoVO uiInfoVO = getTableDefineByTemplateVO(getUsedTemplateByClassifyOid(codeClassifyOid));
uiInfoVO.setLeaf(classifyService.countChildrenByClassifyOid(codeClassifyOid) == 0);
if (StringUtils.isNotBlank(functionId) && !"~".equalsIgnoreCase(functionId)) {
- List<Menu> buttonVOS = iSysClient.getMenuButtonByType(codeClassifyOid, uiInfoVO.getTemplateVO().getBtmTypeId(), "data_auth").getData();
- // List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId);
- // if (operationVOS == null) {
- // operationVOS = new ArrayList<>();
- // }
- // //鏌ヨ鎵╁睍鎸夐挳
- // List<CodeButtonVO> buttonVOS = listButtonInToolbarByClassifyOid(codeClassifyOid);
+ // TODO:2024-1-25 18:42妯℃澘涓婄殑btmtypeid鏈夋椂鍊欎細瀛樺湪澶у皬鍐欑殑闂锛屾寜鐞嗘潵璇磋繖鍎跨洿鎺ョ敤functionId灏辫兘婊¤冻鏌ヨ鑿滃崟鎸夐挳浜唘iInfoVO.getTemplateVO().getBtmTypeId()
+ R<List<Menu>> buttonListR = iSysClient.getMenuButtonByType(codeClassifyOid, functionId, "data_auth");
+ if(!buttonListR.isSuccess()){
+ throw new ServiceException("鑾峰彇鎸夐挳鎺堟潈鍒楄〃澶辫触锛屽師鍥狅細"+buttonListR.getMsg());
+ }
+ List<Menu> buttonVOS = buttonListR.getData();
+
List<SmOperationVO> operationVOS = new ArrayList<>();
if (!CollectionUtils.isEmpty(buttonVOS)) {
for (int i = 0; i < buttonVOS.size(); i++) {
--
Gitblit v1.9.3