From 93db5b42a725ded6bd1cc41981804bc8649c03ba Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期四, 14 三月 2024 15:30:13 +0800
Subject: [PATCH] func vaildate添加说明注释
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java | 283 +++++++++++++++++++++++++++++++++++---------------------
1 files changed, 178 insertions(+), 105 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 e910019..db7167c 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
@@ -3,7 +3,6 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.common.utils.StringUtils;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.protobuf.ServiceException;
import com.vci.ubcs.code.applyjtcodeservice.feign.IMdmInterJtClient;
@@ -13,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;
@@ -27,7 +27,6 @@
import com.vci.ubcs.omd.feign.IBtmTypeClient;
import com.vci.ubcs.omd.feign.IWebSecretClient;
import com.vci.ubcs.omd.vo.BtmTypeVO;
-import com.vci.ubcs.omd.vo.RevisionRuleVO;
import com.vci.ubcs.starter.bo.WriteExcelData;
import com.vci.ubcs.starter.exception.VciBaseException;
import com.vci.ubcs.starter.poi.bo.ReadExcelOption;
@@ -56,7 +55,6 @@
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.Workbook;
-import org.aspectj.apache.bcel.classfile.Code;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
@@ -70,7 +68,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
+import javax.xml.bind.ValidationEvent;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
@@ -87,7 +85,9 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import static com.alibaba.druid.util.FnvHash.Constants.LIMIT;
@@ -98,7 +98,6 @@
@Service
@Slf4j
public class MdmIOServiceImpl implements MdmIOService {
-
/**
* 瀛楁
@@ -144,7 +143,7 @@
* 妯℃澘鐨勬湇鍔�
*/
@Resource
- private CodeClstemplateServiceImpl templateService;
+ private ICodeClstemplateService templateService;
/**
* 涓绘暟鎹紩鎿庣殑鏈嶅姟
@@ -167,30 +166,40 @@
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;
+
/**
* 鏃ュ織淇濆瓨宸ュ叿绫�
*/
@@ -201,6 +210,11 @@
* 瀹㈡埛鐜板満excel涓鸿�佺増鏈紝瀵煎嚭鐨勬�绘暟闄愬埗涓�65535
*/
public static final int EXPORT_LIMIT = 65535;
+
+ /**
+ * 鑷畾涔夊苟鍙慒orkJoinPool
+ */
+ private static final ForkJoinPool customForkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()-1);
/**
* 鎵归噺鐢宠锛氶�夊彇閫変腑鍒嗙被涓嬬殑鎵�鏈夋ā鏉垮叧閿睘鎬э紝鐩镐技灞炴�э紝蹇呭~灞炴�э紝鍐欏叆execl涓�
@@ -928,12 +942,12 @@
Set<String> keyAttrRepeatRowIndexList = keyResultVO.getKeyAttrRepeatRowIndexList();
if(!CollectionUtils.isEmpty(selfRepeatRowIndexList)){
selfRepeatRowIndexList.stream().forEach(rowIndex->{
- errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";鍦ㄥ綋鍓嶅鐞嗙殑鏁版嵁鏂囦欢涓叧閿睘鎬ч噸澶�" );
+ errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + String.format(";鍦ㄥ綋鍓嶅鐞嗙殑鏁版嵁鏂囦欢涓叧閿睘鎬ч噸澶峓%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
});
}
if(!CollectionUtils.isEmpty(keyAttrRepeatRowIndexList)){
keyAttrRepeatRowIndexList.stream().forEach(rowIndex->{
- errorMap.put(rowIndex, "鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅;" + errorMap.getOrDefault(rowIndex,"") );
+ errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + String.format("鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅[%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
});
}
//鍒嗙被娉ㄥ叆
@@ -956,9 +970,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);
@@ -968,6 +980,7 @@
Map<String,String>resembleMap=new HashMap<>();
List<DataResembleVO> dataResembleVOS=new ArrayList<>();
String btmtypeid= classifyFullInfo.getTopClassifyVO().getBtmTypeId();
+ //鐩镐技椤规煡璇㈣鍒�
bathcResembleQuery(codeClassifyOid,templateVO,needSaveCboList,resembleMap,btmtypeid,dataResembleVOS);
if(resembleMap.size()>0) {
if(!CollectionUtils.isEmpty(dataResembleVOS)) {
@@ -1201,12 +1214,12 @@
Set<String> keyAttrRepeatRowIndexList = keyResultVO.getKeyAttrRepeatRowIndexList();
if (!CollectionUtils.isEmpty(selfRepeatRowIndexList)) {
selfRepeatRowIndexList.stream().forEach(rowIndex -> {
- errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + ";鍦ㄥ綋鍓峞xcel鏂囦欢涓叧閿睘鎬ч噸澶�");
+ errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + String.format(";鍦ㄥ綋鍓峞xcel鏂囦欢涓叧閿睘鎬ч噸澶峓%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
});
}
if (!CollectionUtils.isEmpty(keyAttrRepeatRowIndexList)) {
keyAttrRepeatRowIndexList.stream().forEach(rowIndex -> {
- errorMap.put(rowIndex, "鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅;" + errorMap.getOrDefault(rowIndex, ""));
+ errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + String.format("鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅[%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
});
}
//4.鏍¢獙瑙勫垯
@@ -1277,6 +1290,7 @@
Map<String, String> resembleMap = new HashMap<>();
List<DataResembleVO> dataResembleVOS = new ArrayList<>();
String btmtypeid = classifyFullInfo.getTopClassifyVO().getBtmTypeId();
+ // 鐩镐技椤规煡璇�
bathcResembleQuery(templateVO.getCodeclassifyoid(), templateVO, needSaveCboList, resembleMap, btmtypeid, dataResembleVOS);
if (resembleMap.size() > 0) {
if (!CollectionUtils.isEmpty(dataResembleVOS)) {
@@ -1284,6 +1298,7 @@
createRedisDatas(uuid + "-resemble", templateVO, rowIndexCboMap, dataSet, fieldIndexMap, resembleMap, false);
}
}
+
//鐢熸垚class缂撳瓨
Map<String, String> rowIndexClsOidMap = cboList.stream().filter(cbo -> cbo != null).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getAttributeValue((IMPORT_ROW_INDEX)), t -> t.getAttributeValue(CODE_CLASSIFY_OID_FIELD)));
createRedisByCodeClassify(uuid + "-class",templateVO,dataSet,fieldIndexMap,true);
@@ -1344,8 +1359,6 @@
engineService.batchSaveSelectChar(templateVO, dataCBOIdList);
}
}
- //long end = System.currentTimeMillis();
- //log.info("=============for鎵ц鏃堕棿================="+String.valueOf((end-start)/1000));
String excelFileName="";
if(isExport&&!CollectionUtils.isEmpty(shetNameMap)) {
excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + "閿欒淇℃伅.xls";
@@ -1359,14 +1372,17 @@
throw new VciBaseException(LangBaseUtil.getErrorMsg(e));
}
ExcelUtil.writeDataToFile(excelFileName, eo);
+ saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",true, StringUtil.format("閿欒淇℃伅锛歿}",JSON.toJSONString(shetNameMap)));
+ }else{
+ // 鍘嗗彶鏁版嵁瀵煎叆鏃跺嚭鐜颁簡鐩镐技椤硅繑鍥炵粨鏋滄椂涓嶇畻瀵煎叆鎴愬姛
+ if(shetNameMap.isEmpty() || !isCreateUUid){
+ saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",false, StringUtil.format("瀵煎叆鍒板垎绫粄}涓紝瀵煎叆鎴愬姛鎬绘暟涓猴細{}", JSON.toJSONString(classifyFullInfo), Func.isEmpty(importCount) ? 0:importCount.get(0)));
+ }
}
CodeImProtRusultVO codeImProtRusultVO=new CodeImProtRusultVO();
if(StringUtils.isNotBlank(excelFileName)) {
codeImProtRusultVO.setFilePath(excelFileName);
codeImProtRusultVO.setFileOid("");
- saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",true, StringUtil.format("閿欒淇℃伅锛歿}",JSON.toJSONString(shetNameMap)));
- }else{
- saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",false, StringUtil.format("瀵煎叆鍒板垎绫粄}涓紝瀵煎叆鎴愬姛鎬绘暟涓猴細{}", JSON.toJSONString(classifyFullInfo),importCount.get(0)));
}
if(isCreateUUid){
codeImProtRusultVO.setRedisUuid(uuid);
@@ -1715,12 +1731,12 @@
Set<String> keyAttrRepeatRowIndexList = keyResultVO.getKeyAttrRepeatRowIndexList();
if(!CollectionUtils.isEmpty(selfRepeatRowIndexList)){
selfRepeatRowIndexList.stream().forEach(rowIndex->{
- errorMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";鍦ㄥ綋鍓嶅鐞嗙殑鏁版嵁鏂囦欢涓叧閿睘鎬ч噸澶�" );
+ errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + String.format(";鍦ㄥ綋鍓嶅鐞嗙殑鏁版嵁鏂囦欢涓叧閿睘鎬ч噸澶峓%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
});
}
if(!CollectionUtils.isEmpty(keyAttrRepeatRowIndexList)){
keyAttrRepeatRowIndexList.stream().forEach(rowIndex->{
- errorMap.put(rowIndex,"鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅;" + errorMap.getOrDefault(rowIndex,""));
+ errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + String.format("鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅[%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
});
}
//鍒嗙被娉ㄥ叆
@@ -1755,6 +1771,7 @@
Map<String,String>resembleMap=new HashMap<>();
List<DataResembleVO> dataResembleVOS=new ArrayList<>();
String btmtypeid= classifyFullInfo.getTopClassifyVO().getBtmTypeId();
+ //鐩镐技椤规煡璇�
bathcResembleQuery(orderDTO.getCodeClassifyOid(),templateVO,needSaveCboList,resembleMap,btmtypeid,dataResembleVOS);
if(resembleMap.size()>0) {
isCreateUUid=true;
@@ -2113,10 +2130,18 @@
ExcelUtil.writeDataToFile(excelName, excelOption);
}
+ /**
+ * 鐩镐技椤规煡璇㈠嚭鏉ヤ箣鍚庡啀鐐瑰嚮纭鏃惰皟鐢ㄧ殑
+ * @param codeImprotSaveDatVOList
+ * @param classifyAttr
+ * @param isImprot
+ * @return
+ */
@Override
public R batchImportData(List<CodeImprotSaveDatVO> codeImprotSaveDatVOList, String classifyAttr, boolean isImprot) {
WriteExcelOption eo = new WriteExcelOption();
AtomicBoolean success= new AtomicBoolean(true);
+ AtomicReference<CodeClassifyTemplateVO> codeClassifyTemplateVO = new AtomicReference<>();
codeImprotSaveDatVOList.stream().forEach(codeImprotSaveDatVO -> {
List<SheetRowData> rowDataList = new ArrayList<>();
List<ClientBusinessObject>cboList=new ArrayList<>();
@@ -2145,16 +2170,16 @@
log.info("鍒嗙被锛�"+classifyFullInfo.getCurrentClassifyVO().getName()+"鏁版嵁:"+codeImprotSaveDatVO.getDataList().size());
// CodeClassifyTemplateVO codeClassifyTemplateVO= engineService.getUsedTemplateByClassifyOid(orderDTO.getCodeClassifyOid());
- CodeClassifyTemplateVO codeClassifyTemplateVO= templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid());
+ codeClassifyTemplateVO.set(templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()));
//瑙勫垯鐨勪富閿渶瑕佸幓鑾峰彇
CodeRuleVO ruleVO = engineService.getCodeRuleByClassifyFullInfo(classifyFullInfo);
//闄ゅ幓榛樿鐨勫睘鎬�.杩樻湁鍙湁琛ㄥ崟鏄剧ず鐨勫瓧娈垫墠瀵煎叆
- List<CodeClassifyTemplateAttrVO> attrVOS = codeClassifyTemplateVO.getAttributes().stream().filter(s ->
+ List<CodeClassifyTemplateAttrVO> attrVOS = codeClassifyTemplateVO.get().getAttributes().stream().filter(s ->
!DEFAULT_ATTR_LIST.contains(s.getId()) &&
((Func.isNotEmpty(s.getClassifyInvokeAttr()) || Func.isNotEmpty(s.getClassifyInvokeAttrName())) || VciBaseUtil.getBoolean(s.getFormDisplayFlag()))
).collect(Collectors.toList());
String fullPath = getFullPath(classifyFullInfo);
- excelToCbo(classifyFullInfo,fieldIndexMap,rowDataList, codeClassifyTemplateVO,cboList,fullPath,!isImprot);
+ excelToCbo(classifyFullInfo,fieldIndexMap,rowDataList, codeClassifyTemplateVO.get(),cboList,fullPath,!isImprot);
Map<String,String> errorMap=new ConcurrentHashMap<>();
Map<String/**璺緞**/, CodeClassifyVO> pathMap=new HashMap<>() ;
//鏍¢獙缂栫爜瑙勫垯鍜岀爜娈垫槸鍚︽纭�
@@ -2200,12 +2225,12 @@
//鏈�鍚庡紕缁勫悎瑙勫垯
batchSwitchComponentAttrOnOrder(attrVOS,cboList);
//3.鍒ゆ柇鍏抽敭灞炴��
- CodeImportResultVO keyResultVO = batchCheckKeyAttrOnOrder(classifyFullInfo, codeClassifyTemplateVO, cboList,false,errorMap);
+ CodeImportResultVO keyResultVO = batchCheckKeyAttrOnOrder(classifyFullInfo, codeClassifyTemplateVO.get(), cboList,false,errorMap);
Set<String> selfRepeatRowIndexList = keyResultVO.getSelfRepeatRowIndexList();
Set<String> keyAttrRepeatRowIndexList = keyResultVO.getKeyAttrRepeatRowIndexList();
if(!CollectionUtils.isEmpty(keyAttrRepeatRowIndexList)){
keyAttrRepeatRowIndexList.stream().forEach(rowIndex->{
- errorMap.put(rowIndex,"鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅;" + errorMap.getOrDefault(rowIndex,""));
+ errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + String.format("鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅[%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
});
}
//4.鏍¢獙瑙勫垯
@@ -2231,7 +2256,7 @@
dataCBOList.add(baseModel);
});
try {
- productCodeService.productCodeAndSaveData(classifyFullInfo, codeClassifyTemplateVO, finalRuleVOMap.get(ruleOid), null, dataCBOList, user);
+ productCodeService.productCodeAndSaveData(classifyFullInfo, codeClassifyTemplateVO.get(), finalRuleVOMap.get(ruleOid), null, dataCBOList, user);
} catch (Throwable e) {
//success=false;
log.error("鎵归噺浜х敓缂栫爜鐨勬椂鍊欏嚭閿欎簡", e);
@@ -2241,7 +2266,7 @@
});
}
}
- engineService.batchSaveSelectChar(codeClassifyTemplateVO, dataCBOList);
+ engineService.batchSaveSelectChar(codeClassifyTemplateVO.get(), dataCBOList);
});
}else {
final BladeUser user = AuthUtil.getUser();
@@ -2258,7 +2283,7 @@
dataCBOList.add(baseModel);
});
try {
- productCodeService.productCodeAndSaveData(classifyFullInfo, codeClassifyTemplateVO, ruleVO, orderDTO.getSecDTOList(), dataCBOList,user);
+ productCodeService.productCodeAndSaveData(classifyFullInfo, codeClassifyTemplateVO.get(), ruleVO, orderDTO.getSecDTOList(), dataCBOList,user);
} catch (Exception e) {
log.error("鎵归噺浜х敓缂栫爜鐨勬椂鍊欏嚭閿欎簡", e);
needSaveCboList.stream().forEach(cbo -> {
@@ -2267,7 +2292,7 @@
});
}
//濡傛灉鏄紪鐮佺敓鎴愬け璐ワ紝鍒欑洿鎺ュ氨澶辫触浜嗭紝鍏朵粬鐨勫垽鏂嚭鏉ユ湁閿欒鐨勬垜浠兘缁熶竴杩斿洖鍒癳xcel閲岄潰
- engineService.batchSaveSelectChar(codeClassifyTemplateVO, dataCBOList);
+ engineService.batchSaveSelectChar(codeClassifyTemplateVO.get(), dataCBOList);
}
}
if(errorMap.size()>0) {
@@ -2278,14 +2303,16 @@
errorMap.forEach((key,v)->{
excelDataList.add(new WriteExcelData(index[0]++, 0, "绗�"+(Integer.parseInt(key)+1)+"琛屾暟鎹細"+v));
});
- eo.addSheetDataList(codeClassifyTemplateVO.getName() + "瀵煎叆妯℃澘", excelDataList);
+ eo.addSheetDataList(codeClassifyTemplateVO.get().getName() + "瀵煎叆妯℃澘", excelDataList);
}
});
if(!success.get()){
String excelName = LocalFileUtil.getDefaultTempFolder() + File.separator + (isImprot?"鎵归噺鍘嗗彶閿欒淇℃伅.xls":"鎵归噺鐢宠閿欒淇℃伅.xls");
ExcelUtil.writeDataToFile(excelName,eo);
- return R.fail(excelName);
+ saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",true, StringUtil.format("閿欒淇℃伅锛歿}",JSON.toJSONString(eo.getWriteDataMap())));
+ return R.fail(excelName);
}else {
+ saveLogUtil.operateLog("鍘嗗彶鏁版嵁瀵煎叆",false, StringUtil.format("瀵煎叆鍒板垎绫粄}涓紝瀵煎叆鎴愬姛鎬绘暟涓猴細{}", JSON.toJSONString(codeClassifyTemplateVO), Func.isEmpty(codeImprotSaveDatVOList.get(0).getDataList().size())));
return R.success(isImprot ? "鎵归噺鍘嗗彶瀵煎叆鎴愬姛" : "鎵归噺鐢宠鎴愬姛");
}
}
@@ -2427,7 +2454,7 @@
resultDataObjectDetailDO.setMsg(errorMap.getOrDefault(rowIndex,"") + ";鍏抽敭灞炴�ч噸澶�");
resultDataObjectDetailDOs.add(resultDataObjectDetailDO);
*/
- errorKeyMap.put(rowIndex,errorMap.getOrDefault(rowIndex,"") + ";浼犲叆鐨勬暟鎹腑鍏抽敭灞炴�ч噸澶�");
+ errorKeyMap.put(rowIndex, errorKeyMap.getOrDefault(rowIndex, "") + String.format(";浼犲叆鐨勬暟鎹腑鍏抽敭灞炴�ч噸澶峓%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
});
}
/****
@@ -2448,7 +2475,7 @@
if(indexTODataMap.containsKey(rowIndex)){
List<BaseModel> baseModelList= indexTODataMap.get(rowIndex);
}
- errorKeyMap.put(rowIndex, "鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅;" + errorKeyMap.getOrDefault(rowIndex,""));
+ errorKeyMap.put(rowIndex, errorKeyMap.getOrDefault(rowIndex, "") + String.format("鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅[%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
});
}
//鏍¢獙灞炴�ф槸鍚︽纭敊璇俊鎭�
@@ -3069,18 +3096,27 @@
//娉ㄦ剰鐨勬槸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));
+ // 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()){
+ // 鏌ヨ杩戜箟璇嶈鍒欙紝瀛樺偍鏂瑰紡key锛氬睘鎬d锛寁alue杩戜箟璇嶆煡璇㈣鍒欏垪琛�
+ codeSynonymMaps = codeSynonymService.getCodeSynonymByOids(sysonymAttrMaps);
+ }
Map<String, String> conditionMap = new HashMap<>();
boolean trimAll = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnoreallspaceflag());
//鍏ㄩ儴鍘荤┖鐨勪紭鍏堢骇澶т簬鍘荤┖
boolean trim = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorespaceflag());
boolean ignoreCase = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorecaseflag());
boolean ignoreWidth = keyRuleVO == null ? false : VciBaseUtil.getBoolean(keyRuleVO.getIgnorewidthflag());
+ Map<String, List<CodeSynonym>> finalCodeSynonymMaps = codeSynonymMaps;
ketAttrMap.forEach((attrId, attrVO) -> {
String value = getValueFromOrderDTO(orderDTO, attrId);
if (value == null) {
value = "";
}
- engineService.wrapperKeyAttrConditionMap(value, keyRuleVO, attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap);
+ engineService.wrapperKeyAttrConditionMap(value, keyRuleVO, finalCodeSynonymMaps.get(attrId), attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap);
});
//娌℃湁闄愬埗鍒嗙被锛屼絾鏄竴涓ā鏉垮彧鍙兘鍦ㄤ竴涓笟鍔$被鍨嬮噷闈紝鎵�浠ョ洿鎺ユ煡璇㈣繖涓笟鍔$被鍨嬪嵆鍙�
@@ -4355,8 +4391,9 @@
});
}
}
+
/**
- * 鏍¢獙鍏抽敭灞炴��
+ * 鏍¢獙鍏抽敭灞炴�э紝鍜岃繎涔夎瘝鏌ヨ瑙勫垯
* @param classifyFullInfo 鍒嗙被鐨勫叏閮ㄤ俊鎭�
* @param templateVO 妯℃澘鐨勫唴瀹癸紝蹇呴』鍖呭惈妯℃澘灞炴��
* @param cboList 鎵归噺鐨勬暟鎹�
@@ -4368,7 +4405,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()){
+ // 鏌ヨ杩戜箟璇嶈鍒欙紝瀛樺偍鏂瑰紡key锛氬睘鎬d锛寁alue杩戜箟璇嶆煡璇㈣鍒欏垪琛�
+ codeSynonymMaps = codeSynonymService.getCodeSynonymByOids(sysonymAttrMaps);
+ }
boolean trimAll =keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnoreallspaceflag());
//鍏ㄩ儴鍘荤┖鐨勪紭鍏堢骇澶т簬鍘荤┖
@@ -4378,71 +4424,89 @@
//1. 鎴戜滑闇�瑕佸厛鍒ゆ柇excel瀵煎叆鐨勫唴瀹规槸鍚︽纭�
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);
+ StringBuilder synonymResString = new StringBuilder();
+ if(Func.isNotEmpty(codeSynonymMaps)){
+ codeSynonymMaps.keySet().stream().forEach(item->{
+ synonymResString.append(item);
+ synonymResString.append("锛�");
+ });
+ }
+ resultVO.setSynonymRuleInfo(Func.isEmpty(codeSynonymMaps) ? "":String.format("浠ヤ笅[%s]琚缃簡杩戜箟璇嶆煡璇㈣鍒欑殑鍏抽敭灞炴��,涓嚭鐜颁簡閲嶅锛�",synonymResString));
+ resultVO.setKeyAttrRuleInfo(keyRuleVO == null ? "":String.format("鏌ヨ瑙勫垯锛氬幓闄ょ┖鏍�--{%s},蹇界暐澶у皬鍐�--{%s},蹇界暐鍏ㄥ崐瑙�--{%s},蹇界暐鍏ㄩ儴绌烘牸--{%s}"
+ ,trim?"鏄�":"鍚�",ignoreCase?"鏄�":"鍚�",ignoreWidth?"鏄�":"鍚�",trimAll?"鏄�":"鍚�"));
+ //resultVO.setSelfRepeatRowIndexList(getSelfRepeatRowIndex(keyAttrMap,cboList,keyRuleVO));
+ // 鍏堝湪琛ㄦ牸涓煡璇㈠叧閿睘鎬у拰杩戜箟璇嶈浆鎹㈠悗閲嶅鐨勫垪
+ getSelfRepeatRowIndex(keyAttrMap,cboList,keyRuleVO,codeSynonymMaps,resultVO);
+ // 鍐嶅湪琛ㄦ牸涓煡璇㈣繎涔夎瘝鏌ヨ瑙勫垯鐨勫垪
+ //getSelfRepeatSysnomRowIndex(sysonymAttrMaps,cboList,codeSynonymMaps,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());
final BladeUser user = AuthUtil.getUser();
- //cboList = new CopyOnWriteArrayList<>(cboList);
- // TODO:Thread limit exceeded replacing blocked 寮傚父鏄繖閮ㄥ垎浠g爜鎶涘嚭鐨�,鎵�浠ユ殏鏃跺皢parallelStream鏀规垚浜唖tream
- List<ClientBusinessObject> repeatDataMap = cboList.stream().filter(cbo -> {
- //姣忚閮藉緱鏌ヨ.濡傛灉鍏朵腑鍑虹幇浜嗛敊璇紝鎴戜滑灏辩洿鎺ユ姏鍑哄紓甯革紝鍏朵綑鐨勬樉绀�
- //VciBaseUtil.setCurrentUserSessionInfo(sessionInfo);
- Map<String, String> conditionMap = new HashMap<>();
- ketAttrMap.forEach((attrId, attrVO) -> {
- String value =cbo.getAttributeValue(attrId.toLowerCase(Locale.ROOT));
- if (value == null) {
- value = "";
- }
- value= value.replace(REQUIRED_CHAR,SPECIAL_CHAR);
- engineService.wrapperKeyAttrConditionMap(value, keyRuleVO, attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap);
- });
- if (!CollectionUtils.isEmpty(ketAttrMap)) {
- // 娣诲姞涓嶅弬涓庡叧閿睘鎬ф牎楠岀殑鍒嗙被oid鍒ゆ柇
- if(Func.isNotBlank(isParticipateCheckOids)){
- conditionMap.put("t.codeclsfid",QueryOptionConstant.NOTIN+isParticipateCheckOids);
- }
- if(isEdit){//濡傛灉鏄洿鏀瑰垯闇�鎺掗櫎绯荤粺鏈韩
- conditionMap.put("t.id",QueryOptionConstant.NOTEQUAL+cbo.getId());
- }
- conditionMap.put("t.lastr", "1");
- conditionMap.put("t.lastv", "1");
-
- CodeTemplateAttrSqlBO sqlBO = engineService.getSqlByTemplateVO(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), templateVO, conditionMap, null);
- List<String> repeatData = commonsMapper.selectList(sqlBO.getSqlId());
- if(!repeatData.isEmpty()){
- final List<Map<String,String>> newDataList = commonsMapper.queryByOnlySqlForMap(sqlBO.getSqlUnPage());
- DefaultAttrAssimtUtil.mapToLowerCase(newDataList,true);
- //List<ClientBusinessObject> newCboList=ChangeMapTOClientBusinessObjects(newDataList);
- List<BaseModel> newCboList = new ArrayList<>();
- newDataList.stream().forEach(stringStringMap -> {
- BaseModel baseModel=new BaseModel();
- DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(stringStringMap,baseModel,false,user);
- baseModel.setData(stringStringMap);
- newCboList.add(baseModel);
- });
- // 娣诲姞閿欒鍊�
- String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX);
- errorMap.put(rowIndex, "閲嶅鐨勮褰曠紪鍙蜂负:"+repeatData.stream().collect(Collectors.joining(",")));
- if(!CollectionUtils.isEmpty(newCboList)) {
- indexTODataMap.put(cbo.getAttributeValue(IMPORT_ROW_INDEX), newCboList);
+ // TODO:Thread limit exceeded replacing blocked 寮傚父鏄繖閮ㄥ垎浠g爜鎶涘嚭鐨�
+ // ,鎵�浠ユ殏鏃跺皢parallelStream鏀规垚浜唖tream锛屾敼鎴愪簡stream涔嬪悗鍙戠幇宸ㄦ參
+ // customForkJoinPool鎺у埗骞跺彂搴�
+ List<ClientBusinessObject> finalCboList = cboList;
+ Map<String, List<CodeSynonym>> finalCodeSynonymMaps = codeSynonymMaps;
+ List<ClientBusinessObject> repeatDataMap = (List<ClientBusinessObject>) customForkJoinPool.submit(()->{
+ finalCboList.parallelStream().filter(cbo -> {
+ //姣忚閮藉緱鏌ヨ.濡傛灉鍏朵腑鍑虹幇浜嗛敊璇紝鎴戜滑灏辩洿鎺ユ姏鍑哄紓甯革紝鍏朵綑鐨勬樉绀�
+ //VciBaseUtil.setCurrentUserSessionInfo(sessionInfo);
+ Map<String, String> conditionMap = new HashMap<>();
+ keyAttrMap.forEach((attrId, attrVO) -> {
+ String value =cbo.getAttributeValue(attrId.toLowerCase(Locale.ROOT));
+ if (value == null) {
+ value = "";
}
+ value= value.replace(REQUIRED_CHAR,SPECIAL_CHAR);
+ // 鍏抽敭灞炴�ф煡璇㈡潯浠秏ap鑾峰彇
+ engineService.wrapperKeyAttrConditionMap(value, keyRuleVO, finalCodeSynonymMaps.get(attrId), attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap);
+ });
+
+ if (!CollectionUtils.isEmpty(keyAttrMap)) {
+ // 娣诲姞涓嶅弬涓庡叧閿睘鎬ф牎楠岀殑鍒嗙被oid鍒ゆ柇
+ if(Func.isNotBlank(isParticipateCheckOids)){
+ conditionMap.put("t.codeclsfid",QueryOptionConstant.NOTIN+isParticipateCheckOids);
+ }
+ //濡傛灉鏄洿鏀瑰垯闇�鎺掗櫎绯荤粺鏈韩
+ if(isEdit){
+ conditionMap.put("t.id",QueryOptionConstant.NOTEQUAL+cbo.getId());
+ }
+ conditionMap.put("t.lastr", "1");
+ conditionMap.put("t.lastv", "1");
+
+ CodeTemplateAttrSqlBO sqlBO = engineService.getSqlByTemplateVO(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), templateVO, conditionMap, null);
+ List<String> repeatData = commonsMapper.selectList(sqlBO.getSqlId());
+ if(!repeatData.isEmpty()){
+ final List<Map<String,String>> newDataList = commonsMapper.queryByOnlySqlForMap(sqlBO.getSqlUnPage());
+ DefaultAttrAssimtUtil.mapToLowerCase(newDataList,true);
+ //List<ClientBusinessObject> newCboList=ChangeMapTOClientBusinessObjects(newDataList);
+ List<BaseModel> newCboList = new ArrayList<>();
+ newDataList.stream().forEach(stringStringMap -> {
+ BaseModel baseModel=new BaseModel();
+ DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(stringStringMap,baseModel,false,user);
+ baseModel.setData(stringStringMap);
+ newCboList.add(baseModel);
+ });
+ // 娣诲姞閿欒鍊�
+ String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX);
+ errorMap.put(rowIndex, "閲嶅鐨勮褰曠紪鍙蜂负:"+repeatData.stream().collect(Collectors.joining(",")));
+ if(!CollectionUtils.isEmpty(newCboList)) {
+ indexTODataMap.put(cbo.getAttributeValue(IMPORT_ROW_INDEX), newCboList);
+ }
+ }
+ return !repeatData.isEmpty();
+ }else{
+ return false;
}
- return !repeatData.isEmpty();
- }else{
- return false;
- }
- }).collect(Collectors.toList());
+ }).collect(Collectors.toList());
+ }).join();
if(!CollectionUtils.isEmpty(repeatDataMap)){
resultVO.setKeyAttrRepeatRowIndexList(repeatDataMap.stream().map(s->s.getAttributeValue(IMPORT_ROW_INDEX)).collect(Collectors.toSet()));
}
@@ -4556,16 +4620,16 @@
}
/**
- * 鑾峰彇瀵煎叆鐨勫唴瀹逛腑鍏抽敭灞炴�ч噸澶嶇殑琛屽彿
+ * 鑾峰彇瀵煎叆鐨勫唴瀹逛腑鍏抽敭灞炴�ц繎涔夎瘝杞崲鍚庨噸澶嶇殑琛屽彿
* @param ketAttrMap 鍏抽敭灞炴�х殑鏄犲皠
* @param dataList 瀵煎叆鐨勬暟鎹�
* @param keyRuleVO 鍏抽敭灞炴�ф帶鍒惰鍒�
* @return 閲嶅鐨勮鍙�
*/
private void getSelfRepeatRowIndex(Map<String/**灞炴�х殑缂栧彿**/, CodeClassifyTemplateAttrVO> ketAttrMap,
- List<ClientBusinessObject> dataList,CodeKeyAttrRepeatVO keyRuleVO,CodeImportResultVO resultVO){
+ List<ClientBusinessObject> dataList,CodeKeyAttrRepeatVO keyRuleVO,/*杩戜箟璇嶆煡璇㈣鍒�*/Map<String,List<CodeSynonym>> codeSynonymMaps, CodeImportResultVO resultVO){
Set<String> selfRepeatRowIndexList = new CopyOnWriteArraySet<>();
- Map<String,List<String>> keyAttrOkOidTORepeatOidMap=new HashMap<>();
+ Map<String,List<String>> keyAttrOkOidTORepeatOidMap=new ConcurrentHashMap<>();
boolean trimAll =keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnoreallspaceflag());
//鍏ㄩ儴鍘荤┖鐨勪紭鍏堢骇澶т簬鍘荤┖
boolean trim =keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnorespaceflag());
@@ -4573,16 +4637,16 @@
boolean ignoreWidth = keyRuleVO ==null?false: VciBaseUtil.getBoolean(keyRuleVO.getIgnorewidthflag());
//蹇呴』灏嗗睘鎬ф寜鐓ч『搴忔帓搴忓ソ
List<CodeClassifyTemplateAttrVO> attrVOList = ketAttrMap.values().stream().sorted(((o1, o2) -> o1.getOrderNum().compareTo(o2.getOrderNum()))).collect(Collectors.toList());
- Map<String/**琛屽彿**/,String/**鍏抽敭灞炴�х殑缁勫悎鍐呭**/> rowIndexKeyStringMap = new HashMap<>();
- Map<String/**鍏抽敭灞炴�х殑缁勫悎鍐呭**/,String/**绗竴涓叧閿睘鎬х殑鏁版嵁oid**/> okOidKeyStringMap = new HashMap<>();
- dataList.parallelStream().forEach(cbo-> {
+ Map<String/**琛屽彿**/,String/**鍏抽敭灞炴�х殑缁勫悎鍐呭**/> rowIndexKeyStringMap = new ConcurrentHashMap<>();
+ Map<String/**鍏抽敭灞炴�х殑缁勫悎鍐呭**/,String/**绗竴涓叧閿睘鎬х殑鏁版嵁oid**/> okOidKeyStringMap = new ConcurrentHashMap<>();
+ dataList.stream().forEach(cbo-> {
String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX);
String oid=cbo.getOid();
StringBuilder sb = new StringBuilder();
- for (int i = 0; i < attrVOList.size(); i++) {
- CodeClassifyTemplateAttrVO attrVO = attrVOList.get(i);
- String attrId = attrVO.getId().toLowerCase(Locale.ROOT);
- String value = cbo.getAttributeValue( attrId);
+ // TODO锛� 2024-02-25鏀归�犲疄鐜拌繎涔夎瘝鏌ヨ瑙勫垯鍔熻兘锛涘叧閿睘鎬ч噸澶嶆牎楠屽�煎鐞�
+ attrVOList.stream().forEach(item->{
+ String attrId = item.getId().toLowerCase(Locale.ROOT);
+ String value = cbo.getAttributeValue(attrId);
if (value == null) {
value = "";
}
@@ -4598,8 +4662,9 @@
if(ignoreWidth){
value = VciBaseUtil.toDBC(value);
}
+ value = mdmEngineService.getValueToSynony(codeSynonymMaps.get(attrId),value);
sb.append(value).append("${ks}");
- }
+ });
String keyString = sb.toString();
if(rowIndexKeyStringMap.containsValue(keyString) && StringUtils.isNotBlank(keyString)){
selfRepeatRowIndexList.add(rowIndex);
@@ -4610,17 +4675,17 @@
if(keyAttrOkOidTORepeatOidMap.containsKey(okOid)){
List<String> oldOidList = keyAttrOkOidTORepeatOidMap.get(okOid);
newOidList.addAll(oldOidList);
-
}
keyAttrOkOidTORepeatOidMap.put(okOid,newOidList);
}
}else {
okOidKeyStringMap.put(sb.toString(),oid);
- rowIndexKeyStringMap.put(rowIndex, sb.toString());
+ rowIndexKeyStringMap.put(rowIndex, keyString);
}
});
//鍥犱负鍙槸鍏抽敭灞炴�ч噸澶嶏紝鎵�浠ユ垜浠笉鑳介噸澶嶇殑澶氭潯閫変竴鏉℃潵鎶ラ敊
- resultVO.setKeyAttrRepeatRowIndexList(selfRepeatRowIndexList);
+// resultVO.setKeyAttrRepeatRowIndexList(selfRepeatRowIndexList);
+ resultVO.setSelfRepeatRowIndexList(selfRepeatRowIndexList);
resultVO.setKeyAttrOkOidTORepeatOidMap(keyAttrOkOidTORepeatOidMap);
}
@@ -4649,6 +4714,7 @@
}
}
}
+
private List<ClientBusinessObject> ChangeMapTOClientBusinessObjects(List<Map<String,String>> oldDataMap){
List<ClientBusinessObject> clientBusinessObjectList=new ArrayList<>();
DefaultAttrAssimtUtil.mapToLowerCase(oldDataMap,true);
@@ -5052,6 +5118,7 @@
bladeRedis.expire(uuid, BATCHADD_REDIS_TIME);//redis杩囨湡鏃堕棿
}
}
+
/**
* 鎷疯礉涓氬姟绫诲瀷鍒癿ap
* @param cbo 涓氬姟鏁版嵁
@@ -5293,12 +5360,14 @@
Set<String> keyAttrRepeatRowIndexList = keyResultVO.getKeyAttrRepeatRowIndexList();
if (!CollectionUtils.isEmpty(selfRepeatRowIndexList)) {
selfRepeatRowIndexList.stream().forEach(rowIndex -> {
- errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + ";鍦ㄥ綋鍓峞xcel鏂囦欢涓叧閿睘鎬ч噸澶�");
+ errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + String.format(";浼犲叆鐨勬暟鎹腑鍏抽敭灞炴�ч噸澶峓%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
+ // errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + ";鍦ㄥ綋鍓峞xcel鏂囦欢涓叧閿睘鎬ч噸澶�");
});
}
if (!CollectionUtils.isEmpty(keyAttrRepeatRowIndexList)) {
keyAttrRepeatRowIndexList.stream().forEach(rowIndex -> {
- errorMap.put(rowIndex, "鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅;" + errorMap.getOrDefault(rowIndex, ""));
+ errorMap.put(rowIndex, errorMap.getOrDefault(rowIndex, "") + String.format("鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅[%s],[%s];",keyResultVO.getKeyAttrRuleInfo(),keyResultVO.getSynonymRuleInfo()));
+ // errorMap.put(rowIndex, "鍏抽敭灞炴�т笌绯荤粺涓殑閲嶅;" + errorMap.getOrDefault(rowIndex, ""));
});
}
Map<String,List<WriteExcelData>> shetNameMap=new HashMap<>();
@@ -5344,6 +5413,7 @@
}
return excelFileName;
}
+
public void batchSwitchCheckExist(Map<String,String> errorMap,List<ClientBusinessObject> cboList,CodeClassifyFullInfoBO classifyFullInfo,CodeClassifyTemplateVO templateVO,ExecGroupCodePortDataDTO execGroupCodePortDataDTO,Map<Integer/**鍒楀彿**/,String/**瀛楁鐨勫悕绉�**/> fieldIndexMap){
List<BaseModel> oldBaseModelList=new ArrayList<>();
List<CodeAllCode> codeAllCodeList=new ArrayList<>();
@@ -5463,6 +5533,7 @@
execGroupCodePortDataDTO.setOldList(oldBaseModelList);
execGroupCodePortDataDTO.setCodeAllCodeList(codeAllCodeList);
}
+
/**
*
* @param fieldIndexMap
@@ -5491,6 +5562,7 @@
cboList.add(cbo);
});
}
+
/***
* 闆嗗洟瀵煎嚭妯℃澘灞炴�ф槧灏勪俊鎭幏鍙�
* @param templateVO
@@ -5554,6 +5626,7 @@
}
+
/***
* 鏌ヨ鏈湁闆嗗洟鐮佺殑鏁版嵁
* @param classifyFullInfo
--
Gitblit v1.9.3