fix 条款导出空图片问题
This commit is contained in:
@@ -17,5 +17,7 @@ public class FileSplitValExportDto {
|
|||||||
|
|
||||||
private String valContent;
|
private String valContent;
|
||||||
|
|
||||||
|
private boolean hasImg;
|
||||||
|
|
||||||
private List<SarFileSplitItemsTableEO> tableEOList;
|
private List<SarFileSplitItemsTableEO> tableEOList;
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-14
@@ -4046,7 +4046,6 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
|||||||
String imgUUIndex = "img" + String.valueOf(imgIndex);
|
String imgUUIndex = "img" + String.valueOf(imgIndex);
|
||||||
if (MyStringUtils.isNotEmpty(imgContent)){
|
if (MyStringUtils.isNotEmpty(imgContent)){
|
||||||
lastOne.setValContent(imgUUIndex+".png");
|
lastOne.setValContent(imgUUIndex+".png");
|
||||||
valContent.add(lastOne);
|
|
||||||
FileSplitValImgExportDto fileSplitValImgExportDto = new FileSplitValImgExportDto();
|
FileSplitValImgExportDto fileSplitValImgExportDto = new FileSplitValImgExportDto();
|
||||||
fileSplitValImgExportDto.setImgName(imgUUIndex+".png");
|
fileSplitValImgExportDto.setImgName(imgUUIndex+".png");
|
||||||
String url = imgContent.substring(imgContent.lastIndexOf("=") + 1);
|
String url = imgContent.substring(imgContent.lastIndexOf("=") + 1);
|
||||||
@@ -4055,7 +4054,11 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
|||||||
if (StringUtils.isNotBlank(imgTranslation)){
|
if (StringUtils.isNotBlank(imgTranslation)){
|
||||||
String urlTranslation = imgTranslation.substring(imgTranslation.lastIndexOf("=") + 1);
|
String urlTranslation = imgTranslation.substring(imgTranslation.lastIndexOf("=") + 1);
|
||||||
fileSplitValImgExportDto.setImgPathTranslation(urlTranslation);
|
fileSplitValImgExportDto.setImgPathTranslation(urlTranslation);
|
||||||
|
lastOne.setHasImg(true);
|
||||||
|
}else {
|
||||||
|
lastOne.setHasImg(false);
|
||||||
}
|
}
|
||||||
|
valContent.add(lastOne);
|
||||||
|
|
||||||
allImgList.add(fileSplitValImgExportDto);
|
allImgList.add(fileSplitValImgExportDto);
|
||||||
imgIndex++;
|
imgIndex++;
|
||||||
@@ -4368,10 +4371,12 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
|||||||
} else if ("IMG".equals(fileSplitValExportDto.getValType())) {
|
} else if ("IMG".equals(fileSplitValExportDto.getValType())) {
|
||||||
/* 连接跳转*/
|
/* 连接跳转*/
|
||||||
CreationHelper createHelper = workbook.getCreationHelper();
|
CreationHelper createHelper = workbook.getCreationHelper();
|
||||||
Hyperlink hyperlink1 = createHelper.createHyperlink(HyperlinkType.FILE);
|
//Hyperlink hyperlink1 = createHelper.createHyperlink(HyperlinkType.FILE);
|
||||||
String imgName = content;
|
String imgName = content;
|
||||||
hyperlink1.setAddress(imgName);
|
//hyperlink1.setAddress(imgName);
|
||||||
cell2.setHyperlink(hyperlink1);// 链接
|
//cell2.setHyperlink(hyperlink1);// 链接
|
||||||
|
row1.getCell(cellNum).setCellFormula("HYPERLINK(\"" + ".\\附件\\" + imgName + "\", \"" + "附件/" + imgName + "\")");
|
||||||
|
row1.getCell(cellNum).setCellValue("附件\\" + imgName);
|
||||||
row1.getCell(cellNum).setCellStyle(cellStyleLink);
|
row1.getCell(cellNum).setCellStyle(cellStyleLink);
|
||||||
}
|
}
|
||||||
cell2.setCellValue(content); // IllegalArgumentException异常,excel单元格最大字符长度有限制
|
cell2.setCellValue(content); // IllegalArgumentException异常,excel单元格最大字符长度有限制
|
||||||
@@ -4401,17 +4406,19 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
|||||||
row1.getCell(cellNum).setCellStyle(cellStyleLink);
|
row1.getCell(cellNum).setCellStyle(cellStyleLink);
|
||||||
} else if ("IMG".equals(fileSplitValExportDto.getValType())) {
|
} else if ("IMG".equals(fileSplitValExportDto.getValType())) {
|
||||||
/* 连接跳转*/
|
/* 连接跳转*/
|
||||||
content = fileSplitValExportDto.getValContent();
|
if (fileSplitValExportDto.isHasImg()) {
|
||||||
content = content.substring(0,content.indexOf("."))+"translation.png";
|
content = fileSplitValExportDto.getValContent();
|
||||||
CreationHelper createHelper = workbook.getCreationHelper();
|
content = content.substring(0,content.indexOf("."))+"translation.png";
|
||||||
// Hyperlink hyperlink1 = createHelper.createHyperlink(HyperlinkType.FILE);
|
CreationHelper createHelper = workbook.getCreationHelper();
|
||||||
String imgName = content;
|
// Hyperlink hyperlink1 = createHelper.createHyperlink(HyperlinkType.FILE);
|
||||||
// hyperlink1.setAddress("附件\\" + imgName);
|
String imgName = content;
|
||||||
// cell2.setHyperlink(hyperlink1);// 链接
|
// hyperlink1.setAddress("附件\\" + imgName);
|
||||||
|
// cell2.setHyperlink(hyperlink1);// 链接
|
||||||
|
|
||||||
row1.getCell(cellNum).setCellFormula("HYPERLINK(\"" + ".\\附件\\" + imgName + "\", \"" + "附件/" + imgName + "\")");
|
row1.getCell(cellNum).setCellFormula("HYPERLINK(\"" + ".\\附件\\" + imgName + "\", \"" + "附件/" + imgName + "\")");
|
||||||
row1.getCell(cellNum).setCellValue("附件\\" + imgName);
|
row1.getCell(cellNum).setCellValue("附件\\" + imgName);
|
||||||
row1.getCell(cellNum).setCellStyle(cellStyleLink);
|
row1.getCell(cellNum).setCellStyle(cellStyleLink);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cell2.setCellValue(content); // IllegalArgumentException异常,excel单元格最大字符长度有限制
|
cell2.setCellValue(content); // IllegalArgumentException异常,excel单元格最大字符长度有限制
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user