Merge branch 'master' into SecondStage

This commit is contained in:
fengchenchen
2024-10-12 17:31:34 +08:00
7 changed files with 37 additions and 8 deletions
@@ -3549,8 +3549,14 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
String valContent = "";
String valContentTranslation = "";
if ("TEXT".equals(type)) {
itemContent = itemContent.replace("<", "&lt;").replace(">", "&gt;")
.replace("&lt;sub&gt;", "<sub>").replace("&lt;/sub&gt;", "</sub>")
.replace("&lt;sup&gt;", "<sup>").replace("&lt;/sup&gt;", "</sup>");
valContent += "<p>" + itemContent + "</p>";
if (StringUtils.isNotBlank(translation)){
translation = translation.replace("<", "&lt;").replace(">", "&gt;")
.replace("&lt;sub&gt;", "<sub>").replace("&lt;/sub&gt;", "</sub>")
.replace("&lt;sup&gt;", "<sup>").replace("&lt;/sup&gt;", "</sup>");
valContentTranslation += "<p>" + translation + "</p>";
}
} else if ("IMG".equals(type)) {
@@ -3559,9 +3565,26 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
valContentTranslation += "<img class=\"wordImg\" style=\"width:100%;height:100%\" src=\""+ translation +"\">";
}
} else if ("TABLE".equals(type)) {
itemContent = itemContent.replace("<", "&lt;").replace(">", "&gt;")
.replace("&lt;sub&gt;", "<sub>").replace("&lt;/sub&gt;", "</sub>")
.replace("&lt;sup&gt;", "<sup>").replace("&lt;/sup&gt;", "</sup>")
.replace("&lt;table border=\"1\" style=\"border-collapse:collapse;width:100%;\"&gt;", "<table border=\"1\" style=\"border-collapse:collapse;width:100%;\">")
.replace("&lt;/table&gt;", "</table>")
.replace("&lt;tr&gt;", "<tr>").replace("&lt;/tr&gt;", "</tr>")
.replace("&lt;td &gt;", "<td>").replace("&lt;/td&gt;", "</td>")
;
valEO.setItemContent(itemContent.replaceAll("\n","<br/>"));
valContent += itemContent;
if (StringUtils.isNotBlank(translation)){
translation = translation.replace("<", "&lt;").replace(">", "&gt;")
.replace("&lt;sub&gt;", "<sub>").replace("&lt;/sub&gt;", "</sub>")
.replace("&lt;sup&gt;", "<sup>").replace("&lt;/sup&gt;", "</sup>")
.replace("&lt;table border=\"1\" style=\"border-collapse:collapse;width:100%;\"&gt;", "<table border=\"1\" style=\"border-collapse:collapse;width:100%;\">")
.replace("&lt;/table&gt;", "</table>")
.replace("&lt;tr&gt;", "<tr>").replace("&lt;/tr&gt;", "</tr>")
.replace("&lt;td &gt;", "<td>").replace("&lt;/td&gt;", "</td>")
;
valEO.setTranslation(translation.replaceAll("\n","<br/>"));
valContentTranslation += translation;
}
@@ -3598,7 +3621,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
if (StringUtils.isBlank(value)) {
continue;
}
String str = map.get(key).toString();
String str = map.get(key).toString().replace("<", "&lt;").replace(">", "&gt;");
if (StringUtils.isBlank(str)) {
map.put(key,value);
}else {
@@ -107,7 +107,7 @@ public class POIReadExcelToHtml {
}
if (null == row) {
sb.append("<tr><td > </td></tr>");
sb.append("<tr><td> </td></tr>");
continue;
}else if(row.getZeroHeight()){
continue;