修改导入条款涉及系统/部件与专业领域验证

This commit is contained in:
梁琦涛
2024-09-09 18:09:17 +08:00
parent b101472fb9
commit f37d65bcd0
@@ -3196,33 +3196,69 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
if (firstDict.isPresent()){
List<SysDictItem> sysDictItemLists = sysDictItemService.list(new LambdaQueryWrapper<SysDictItem>()
.eq(SysDictItem::getDictId, firstDict.get().getId()));
List<SysDictItem> sysDictItemList = getLevelPath(sysDictItemLists);
String[] treePathList = value.split(",");
for (String treePath : treePathList) {
List<SysDictItem> path =
sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath()))
sysDictItemLists.stream().filter(o -> treePath.equals(o.getItemText()))
.collect(Collectors.toList());
if (!path.isEmpty()){
if (path.size() > 1) {
// 如果有多个按照全路径去匹配一遍
if(path.size() > 1){
List<SysDictItem> sysDictItemList = getLevelPath(sysDictItemLists);
List<SysDictItem> pathOther =
sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath()))
.collect(Collectors.toList());
if(pathOther.isEmpty()){
if (path.size() > 1) {
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
errorMsg += fieldName + "" + treePath + "存在多个;";
countError++;
valueList = Collections.emptyList();
} else {
errorMsg += fieldName + " " + treePath + "Exist in multiple;";
}
break;
}
valueList.add(pathOther.get(0).getItemValue());
}else{
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
errorMsg += fieldName + "" + treePath + "存在多个;";
countError++;
valueList = Collections.emptyList();
} else {
errorMsg += fieldName + " " + treePath + "Not exist;";
}
break;
}
}
}else {
List<SysDictItem> sysDictItemList = getLevelPath(sysDictItemLists);
List<SysDictItem> pathOther =
sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath()))
.collect(Collectors.toList());
if(!pathOther.isEmpty()){
if (path.size() > 1) {
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
errorMsg += fieldName + "" + treePath + "存在多个;";
countError++;
valueList = Collections.emptyList();
} else {
errorMsg += fieldName + " " + treePath + "Exist in multiple;";
}
break;
}
valueList.add(pathOther.get(0).getItemValue());
}else{
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
errorMsg += fieldName + "" + treePath + "存在多个";
errorMsg += fieldName + "" + treePath + "存在;";
countError++;
valueList = Collections.emptyList();
} else {
errorMsg += fieldName + " " + treePath + "Exist in multiple;";
errorMsg += fieldName + " " + treePath + "Not exist;";
}
break;
}
valueList.add(path.get(0).getItemValue());
}else {
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
errorMsg += fieldName + "" + treePath + "不存在;";
countError++;
valueList = Collections.emptyList();
} else {
errorMsg += fieldName + " " + treePath + "Not exist;";
}
break;
}
}
}
@@ -3231,15 +3267,10 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
// 特殊字段
if (StringUtils.isNotBlank(value) && SPECIAL_FIELD.contains(dbfieldName)){
if (partNameList.isEmpty()){
List<PartName> partNames = IPartNameService.list(new LambdaQueryWrapper<PartName>().ne(PartName::getCode, "Part"));
partNameList = partNameGetLevelPath(partNames);
}
String[] treePathList = value.split(",");
for (String treePath : treePathList) {
List<PartName> path =
partNameList.stream().filter(o -> treePath.equals(o.getLevelPath()))
.collect(Collectors.toList());
List<PartName> path = IPartNameService.list(new LambdaQueryWrapper<PartName>()
.eq(PartName::getName, treePath));
if (!path.isEmpty()){
if (path.size() > 1) {
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {