修改拆分条款导入验证

This commit is contained in:
梁琦涛
2024-09-13 19:46:48 +08:00
parent d6467388f6
commit ce48098cb4
@@ -2263,10 +2263,14 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
} }
SplitTableInfo splitTableInfo = new SplitTableInfo(); SplitTableInfo splitTableInfo = new SplitTableInfo();
splitTableInfo.setTableName(sheet.getSheetName()); splitTableInfo.setTableName(sheet.getSheetName());
String tableHtml = POIReadExcelToHtml.readExcelToHtml(workbook,i,false); try {
tableHtml = tableHtml.replaceAll("\'","\""); String tableHtml = POIReadExcelToHtml.readExcelToHtml(workbook,i,false);
tableHtml = tableHtml.replaceAll("style","border=\"1\" style");// 解决导入的表格没线 tableHtml = tableHtml.replaceAll("\'","\"");
splitTableInfo.setTableHtml(tableHtml); tableHtml = tableHtml.replaceAll("style","border=\"1\" style");// 解决导入的表格没线
splitTableInfo.setTableHtml(tableHtml);
}catch (Exception e){
throw new JeroBootException(sheet.getSheetName() + "页签数据异常");
}
getSheetTableList.add(splitTableInfo); getSheetTableList.add(splitTableInfo);
} }
int i = 0 ; int i = 0 ;
@@ -3203,25 +3207,43 @@ 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 =
sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath())) sysDictItemLists.stream().filter(o -> treePath.equals(o.getItemText()))
.collect(Collectors.toList()); .collect(Collectors.toList());
if(!path.isEmpty()){ if (!path.isEmpty()){
if (path.size() > 1) { // 如果有多个,按照全路径去匹配一遍
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) { if(path.size() > 1){
errorMsg += fieldName + "中" + treePath + "存在多个;"; List<SysDictItem> sysDictItemList = getLevelPath(sysDictItemLists);
countError++; List<SysDictItem> pathOther =
valueList = Collections.emptyList(); sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath()))
} else { .collect(Collectors.toList());
errorMsg += fieldName + " " + treePath + "Exist in multiple;"; 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;";
}
continue;
}
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;";
}
continue;
} }
continue;
} }
valueList.add(path.get(0).getItemValue()); }else {
}else{ List<SysDictItem> sysDictItemList = getLevelPath(sysDictItemLists);
List<SysDictItem> pathOther = List<SysDictItem> pathOther =
sysDictItemLists.stream().filter(o -> treePath.equals(o.getItemText())) sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath()))
.collect(Collectors.toList()); .collect(Collectors.toList());
if(!pathOther.isEmpty()){ if(!pathOther.isEmpty()){
if (path.size() > 1) { if (path.size() > 1) {