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; String html = null;
switch (fileEntity.getFileType()) {
//03excel if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType())) {
case "xls": html = ExcelUtil.excel03Html(new FileInputStream(path));
html = ExcelUtil.excel03Html(new FileInputStream(path)); } else if (ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
break; html = ExcelUtil.excel07Html(new FileInputStream(path));
//07excel } else if (ReportConstants.FILE_EXTENSIONS_DOC.equalsIgnoreCase(fileEntity.getFileType())) {
case "xlsx": html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress);
html = ExcelUtil.excel07Html(new FileInputStream(path)); } else if (ReportConstants.FILE_EXTENSIONS_DOCX.equalsIgnoreCase(fileEntity.getFileType())) {
break; html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress);
//03word } else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType())) {
case "doc": html = PptUtil.doPpt2003toImage(new FileInputStream(path), uploadFile, ipAddress);
html = WordUtil.doc2pdf(new FileInputStream(path), uploadFile, ipAddress); } else if (ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
break; html = PptUtil.doPpt2007toImage(new FileInputStream(path), uploadFile, ipAddress);
//07word } else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
case "docx": html = PdfUtil.pdfStreamToPng(new FileInputStream(path), uploadFile, ipAddress);
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;
} }
FileUtil.deleteFile(path); FileUtil.deleteFile(path);
return html; return html;