修改拆分条款导入验证

This commit is contained in:
梁琦涛
2024-09-13 19:19:42 +08:00
parent cf73447a5b
commit 9a971e2066
@@ -3177,7 +3177,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
countError++; countError++;
valueList = Collections.emptyList(); valueList = Collections.emptyList();
break; continue;
}else { }else {
valueList.add(first.get().getId()); valueList.add(first.get().getId());
} }
@@ -3203,43 +3203,25 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
String[] treePathList = value.split(","); String[] treePathList = value.split(",");
for (String treePath : treePathList) { for (String treePath : treePathList) {
List<SysDictItem> sysDictItemList = getLevelPath(sysDictItemLists);
List<SysDictItem> path = List<SysDictItem> path =
sysDictItemLists.stream().filter(o -> treePath.equals(o.getItemText())) sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath()))
.collect(Collectors.toList()); .collect(Collectors.toList());
if (!path.isEmpty()){ if(!path.isEmpty()){
// 如果有多个,按照全路径去匹配一遍 if (path.size() > 1) {
if(path.size() > 1){ if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
List<SysDictItem> sysDictItemList = getLevelPath(sysDictItemLists); errorMsg += fieldName + "中" + treePath + "存在多个;";
List<SysDictItem> pathOther = countError++;
sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath())) valueList = Collections.emptyList();
.collect(Collectors.toList()); } else {
if(!pathOther.isEmpty()){ errorMsg += fieldName + " " + treePath + "Exist in multiple;";
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;
} }
continue;
} }
}else { valueList.add(path.get(0).getItemValue());
List<SysDictItem> sysDictItemList = getLevelPath(sysDictItemLists); }else{
List<SysDictItem> pathOther = List<SysDictItem> pathOther =
sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath())) sysDictItemLists.stream().filter(o -> treePath.equals(o.getItemText()))
.collect(Collectors.toList()); .collect(Collectors.toList());
if(!pathOther.isEmpty()){ if(!pathOther.isEmpty()){
if (path.size() > 1) { if (path.size() > 1) {
@@ -3250,7 +3232,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} else { } else {
errorMsg += fieldName + " " + treePath + "Exist in multiple;"; errorMsg += fieldName + " " + treePath + "Exist in multiple;";
} }
break; continue;
} }
valueList.add(pathOther.get(0).getItemValue()); valueList.add(pathOther.get(0).getItemValue());
}else{ }else{
@@ -3261,7 +3243,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} else { } else {
errorMsg += fieldName + " " + treePath + "Not exist;"; errorMsg += fieldName + " " + treePath + "Not exist;";
} }
break; continue;
} }
} }
} }
@@ -3284,7 +3266,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} else { } else {
errorMsg += fieldName + " " + treePath + "Exist in multiple;"; errorMsg += fieldName + " " + treePath + "Exist in multiple;";
} }
break; continue;
} }
valueList.add(path.get(0).getCode()); valueList.add(path.get(0).getCode());
}else { }else {
@@ -3295,7 +3277,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} else { } else {
errorMsg += fieldName + " " + treePath + "Not exist;"; errorMsg += fieldName + " " + treePath + "Not exist;";
} }
break; continue;
} }
} }
} }