fix: 修复无法生成大写扩展名HTML问题

This commit is contained in:
2023-04-28 17:43:27 +08:00
parent d058fdf6a6
commit 6a80f96797
@@ -475,37 +475,21 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
}
String html = null;
switch (fileEntity.getFileType()) {
//03excel
case "xls":
html = ExcelUtil.excel03Html(new FileInputStream(path));
break;
//07excel
case "xlsx":
html = ExcelUtil.excel07Html(new FileInputStream(path));
break;
//03word
case "doc":
html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress);
break;
//07word
case "docx":
html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress);
break;
//03ppt
case "ppt":
html = PptUtil.doPpt2003toImage(new FileInputStream(path), uploadFile, ipAddress);
break;
//07ppt
case "pptx":
html = PptUtil.doPpt2007toImage(new FileInputStream(path), uploadFile, ipAddress);
break;
//pdf
case "pdf":
html = PdfUtil.pdfStreamToPng(new FileInputStream(path), uploadFile, ipAddress);
break;
default:
break;
if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType())) {
html = ExcelUtil.excel03Html(new FileInputStream(path));
} else if (ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
html = ExcelUtil.excel07Html(new FileInputStream(path));
} else if (ReportConstants.FILE_EXTENSIONS_DOC.equalsIgnoreCase(fileEntity.getFileType())) {
html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress);
} else if (ReportConstants.FILE_EXTENSIONS_DOCX.equalsIgnoreCase(fileEntity.getFileType())) {
html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress);
} else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType())) {
html = PptUtil.doPpt2003toImage(new FileInputStream(path), uploadFile, ipAddress);
} else if (ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
html = PptUtil.doPpt2007toImage(new FileInputStream(path), uploadFile, ipAddress);
} else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
html = PdfUtil.pdfStreamToPng(new FileInputStream(path), uploadFile, ipAddress);
}
FileUtil.deleteFile(path);
return html;