diff --git a/laws-modules/src/main/java/com/jero/modules/split/dto/FileSpiltValTableExportDto.java b/laws-modules/src/main/java/com/jero/modules/split/dto/FileSpiltValTableExportDto.java index 0724f4af..2fccfb56 100644 --- a/laws-modules/src/main/java/com/jero/modules/split/dto/FileSpiltValTableExportDto.java +++ b/laws-modules/src/main/java/com/jero/modules/split/dto/FileSpiltValTableExportDto.java @@ -18,4 +18,6 @@ public class FileSpiltValTableExportDto { private List> tableEOList; private String tableHtCon; + + private String tableHtConTranslation; } diff --git a/laws-modules/src/main/java/com/jero/modules/split/dto/FileSplitValImgExportDto.java b/laws-modules/src/main/java/com/jero/modules/split/dto/FileSplitValImgExportDto.java index 67ba9c37..f02cb7ef 100644 --- a/laws-modules/src/main/java/com/jero/modules/split/dto/FileSplitValImgExportDto.java +++ b/laws-modules/src/main/java/com/jero/modules/split/dto/FileSplitValImgExportDto.java @@ -13,4 +13,5 @@ public class FileSplitValImgExportDto { private String imgName; private String imgPath; + private String imgPathTranslation; } diff --git a/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java index e192a147..f3faddcb 100644 --- a/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java @@ -3876,6 +3876,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl ossFileList = ossFileService.getFileInfosByConnectId(connectId); List fileNameList = new ArrayList<>(); if (ossFileList != null && !ossFileList.isEmpty()) { @@ -4143,15 +4150,16 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl -1) { @@ -4159,7 +4167,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl -1) { + content = content.substring(0,content.lastIndexOf("\n")); + } + } + + if("TABLE".equals(fileSplitValExportDto.getValType())){ + /* 连接跳转*/ + content = fileSplitValExportDto.getValContent()+"translation"; + CreationHelper createHelper = workbook.getCreationHelper(); + Hyperlink hyperlink1 = createHelper.createHyperlink(HyperlinkType.DOCUMENT); + String tableName = "#\'"+ content + "\'!A1"; + hyperlink1.setAddress(tableName); + cell2.setHyperlink(hyperlink1);// 链接 + row1.getCell(cellNum).setCellStyle(cellStyleLink); + } else if ("IMG".equals(fileSplitValExportDto.getValType())) { + /* 连接跳转*/ + content = fileSplitValExportDto.getValContent()+"translation"; + CreationHelper createHelper = workbook.getCreationHelper(); + Hyperlink hyperlink1 = createHelper.createHyperlink(HyperlinkType.FILE); + String imgName = content; + hyperlink1.setAddress(imgName); + cell2.setHyperlink(hyperlink1);// 链接 + row1.getCell(cellNum).setCellStyle(cellStyleLink); + } + cell2.setCellValue(content); // IllegalArgumentException异常,excel单元格最大字符长度有限制 + } + else if ("interpretation_articles".equals(fieldName)) { // 条文解读特殊处理 HSSFCell cell2 = row1.createCell(cellNum); row1.getCell(cellNum).setCellStyle(cellStyle); @@ -4261,6 +4303,8 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl") < 0) { if (tableHtml.indexOf("") < 0) { tableHtml = tableHtml.replaceFirst("",""); @@ -4273,6 +4317,18 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl]*?>|<[\\s]*?\\/[\\s]*?br[\\s]*?>", cnt); workbook = ConvertHtml2Excel.table2Excel(tableHtml,workbook,tableName); + + if (StringUtils.isNotEmpty(tableHtmlTranslation) && tableHtmlTranslation.indexOf("") < 0) { + if (tableHtmlTranslation.indexOf("") < 0) { + tableHtmlTranslation = tableHtmlTranslation.replaceFirst("",""); + tableHtmlTranslation = tableHtmlTranslation.replaceFirst("",""); + } else { + tableHtmlTranslation = tableHtmlTranslation.replaceFirst("",""); + tableHtmlTranslation = tableHtmlTranslation.replaceFirst("",""); + } + } + tableHtmlTranslation = tableHtmlTranslation.replaceAll("<[\\s]*?br[^>]*?>|<[\\s]*?\\/[\\s]*?br[\\s]*?>", cnt); + workbook = ConvertHtml2Excel.table2Excel(tableHtmlTranslation,workbook,tableName+"translation"); // for (int r=0;r colTableList = rowtableList.get(r); // HSSFRow tRow = sheetTable.createRow(colTableList.get(0).getRowNum()-1);