From 7323a4b0d5f7567c1156a5aa507ad4c898ed410f Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期日, 04 二月 2024 12:23:41 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java |   37 ++++++++++++++++++++++++++-----------
 1 files changed, 26 insertions(+), 11 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 0e551e1..acbecdf 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
@@ -12,6 +12,7 @@
 import com.vci.ubcs.code.bo.CodeTemplateAttrSqlBO;
 import com.vci.ubcs.code.dto.*;
 import com.vci.ubcs.code.entity.CodeAllCode;
+import com.vci.ubcs.code.entity.CodeSynonym;
 import com.vci.ubcs.code.enumpack.*;
 import com.vci.ubcs.code.lifecycle.CodeAllCodeLC;
 import com.vci.ubcs.code.mapper.CommonsMapper;
@@ -97,7 +98,6 @@
 @Slf4j
 public class MdmIOServiceImpl implements MdmIOService {
 
-
 	/**
 	 * 瀛楁
 	 */
@@ -164,36 +164,45 @@
 	@Autowired
 	private ICodeKeyAttrRepeatService keyRuleService;
 
+	@Autowired ICodeSynonymService codeSynonymService;
+
 	/**
 	 * 鍏紡鐨勬湇鍔�
 	 */
 	@Autowired
 	private FormulaServiceImpl formulaService;
+
 	/**
 	 * 瑙勫垯鐨勬湇鍔�
 	 */
 	@Autowired
 	private ICodeRuleService ruleService;
+
 	/**
 	 * 涓氬姟绫诲瀷鐨勬湇鍔�
 	 */
 	@Autowired
 	private IBtmTypeClient btmTypeClient;
+
 	/***
 	 * 鐢宠闆嗗洟缂栫爜鏈嶅姟
 	 */
 	@Resource
 	private IMdmInterJtClient mdmInterJtClient;
+
 	/***
 	 * 瀵嗙骇鏈嶅姟
 	 */
 	@Resource
 	private IWebSecretClient secretService;
+
 	/**
 	 * 鏃ュ織淇濆瓨宸ュ叿绫�
 	 */
 	@Autowired
 	private SaveLogUtil saveLogUtil;
+
+
 
 	/**
 	 * 瀹㈡埛鐜板満excel涓鸿�佺増鏈紝瀵煎嚭鐨勬�绘暟闄愬埗涓�65535
@@ -959,9 +968,7 @@
 			//鏈�鍚庡紕缁勫悎瑙勫垯
 			batchSwitchComponentAttrOnOrder(attrVOS,allCboList);
 
-
 			Map<String, ClientBusinessObject> rowIndexCboMap = allCboList.stream().filter(cbo -> cbo != null).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getAttributeValue((IMPORT_ROW_INDEX)), t -> t));
-
 
 			List<ClientBusinessObject> needSaveCboList = allCboList.stream().filter(cbo -> {
 				String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX);
@@ -4386,7 +4393,16 @@
 		CodeKeyAttrRepeatVO keyRuleVO = keyRuleService.getRuleByClassifyFullInfo(classifyFullInfo);
 		//娉ㄦ剰鐨勬槸keyRuleVO鍙兘涓虹┖锛岃〃绀轰笉浣跨敤瑙勫垯鎺у埗
 		//鑾峰彇鎵�鏈夌殑鍏抽敭灞炴��
-		Map<String/**灞炴�х殑缂栧彿**/, CodeClassifyTemplateAttrVO> ketAttrMap = templateVO.getAttributes().stream().filter(s -> VciBaseUtil.getBoolean(s.getKeyAttrFlag())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
+		Map<String/**灞炴�х殑缂栧彿**/, CodeClassifyTemplateAttrVO> keyAttrMap = templateVO.getAttributes().stream().filter(s -> VciBaseUtil.getBoolean(s.getKeyAttrFlag())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
+
+		// TODO:2024-02-01 鍏堣幏鍙栭厤缃簡杩戜箟璇嶆煡璇㈣鍒欑殑灞炴�э紝涓嶅悓浜庡叧閿睘鎬э紝璁剧疆浜嗚繎涔夎瘝鏌ヨ瑙勫垯鐨勫睘鎬у彲鑳芥槸澶氭潯涓嶅悓鐨勮繎涔夎瘝鏌ヨ瑙勫垯
+		Map<String, CodeClassifyTemplateAttrVO> sysonymAttrMaps = templateVO.getAttributes().stream().filter(item -> Func.isNotBlank(item.getSysonymRuleOids())).collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
+		//鏈夐厤缃繎涔夎瘝鏌ヨ瑙勫垯灞炴��
+		Map<String, List<CodeSynonym>> codeSynonymMaps = new HashMap<>();
+		if(!sysonymAttrMaps.isEmpty()){
+			// 鏌ヨ杩戜箟璇嶈鍒�
+			codeSynonymMaps = codeSynonymService.getCodeSynonymByOids(sysonymAttrMaps);
+		}
 
 		boolean trimAll =keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnoreallspaceflag());
 		//鍏ㄩ儴鍘荤┖鐨勪紭鍏堢骇澶т簬鍘荤┖
@@ -4398,15 +4414,13 @@
 		CodeImportResultVO resultVO = new CodeImportResultVO();
 		resultVO.setKeyAttrRuleInfo(String.format(keyRuleVO ==null?"":"鏌ヨ瑙勫垯锛氬幓闄ょ┖鏍�--{0},蹇界暐澶у皬鍐�--{1},蹇界暐鍏ㄥ崐瑙�--{2},蹇界暐鍏ㄩ儴绌烘牸--{3}",
 			new String[]{trim?"鏄�":"鍚�",ignoreCase?"鏄�":"鍚�",ignoreWidth?"鏄�":"鍚�",trimAll?"鏄�":"鍚�"}));
-		//resultVO.setSelfRepeatRowIndexList(getSelfRepeatRowIndex(ketAttrMap,cboList,keyRuleVO));
-		getSelfRepeatRowIndex(ketAttrMap,cboList,keyRuleVO,resultVO);
+		//resultVO.setSelfRepeatRowIndexList(getSelfRepeatRowIndex(keyAttrMap,cboList,keyRuleVO));
+		getSelfRepeatRowIndex(keyAttrMap,cboList,keyRuleVO,resultVO);
 		if(!CollectionUtils.isEmpty(resultVO.getSelfRepeatRowIndexList())){
 			//鎴戜滑绉婚櫎鏈韩閲嶅鐨勬暟鎹�
 			cboList = cboList.stream().filter(s->!resultVO.getSelfRepeatRowIndexList().contains(s.getAttributeValue(IMPORT_ROW_INDEX))).collect(Collectors.toList());
 		}
 		//2.鍒ゆ柇鍏抽敭灞炴�у湪绯荤粺閲屾槸鍚﹂噸澶�
-		//鍥犱负鏁版嵁閲忓緢澶э紝鎵�浠ュ緱鎯冲姙娉曞苟琛�
-		//SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo();
 		Map<String,List<BaseModel>> indexTODataMap=new ConcurrentHashMap<>();
 		// 鏌ヨ涓嶉渶瑕佸弬涓庡叧閿睘鎬ф牎楠岀殑闄よ嚜宸变互澶栫殑鎵�鏈夊垎绫籵id
 		final String isParticipateCheckOids = classifyService.selectLeafByParentClassifyOid(classifyFullInfo.getTopClassifyVO().getOid(), classifyFullInfo.getCurrentClassifyVO().getOid());
@@ -4420,7 +4434,7 @@
 				//姣忚閮藉緱鏌ヨ.濡傛灉鍏朵腑鍑虹幇浜嗛敊璇紝鎴戜滑灏辩洿鎺ユ姏鍑哄紓甯革紝鍏朵綑鐨勬樉绀�
 				//VciBaseUtil.setCurrentUserSessionInfo(sessionInfo);
 				Map<String, String> conditionMap = new HashMap<>();
-				ketAttrMap.forEach((attrId, attrVO) -> {
+				keyAttrMap.forEach((attrId, attrVO) -> {
 					String value =cbo.getAttributeValue(attrId.toLowerCase(Locale.ROOT));
 					if (value == null) {
 						value = "";
@@ -4428,12 +4442,13 @@
 					value= value.replace(REQUIRED_CHAR,SPECIAL_CHAR);
 					engineService.wrapperKeyAttrConditionMap(value, keyRuleVO, attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap);
 				});
-				if (!CollectionUtils.isEmpty(ketAttrMap)) {
+				if (!CollectionUtils.isEmpty(keyAttrMap)) {
 					// 娣诲姞涓嶅弬涓庡叧閿睘鎬ф牎楠岀殑鍒嗙被oid鍒ゆ柇
 					if(Func.isNotBlank(isParticipateCheckOids)){
 						conditionMap.put("t.codeclsfid",QueryOptionConstant.NOTIN+isParticipateCheckOids);
 					}
-					if(isEdit){//濡傛灉鏄洿鏀瑰垯闇�鎺掗櫎绯荤粺鏈韩
+					//濡傛灉鏄洿鏀瑰垯闇�鎺掗櫎绯荤粺鏈韩
+					if(isEdit){
 						conditionMap.put("t.id",QueryOptionConstant.NOTEQUAL+cbo.getId());
 					}
 					conditionMap.put("t.lastr", "1");

--
Gitblit v1.9.3