Merge remote-tracking branch 'origin/lixuetao' into lixuetao
This commit is contained in:
@@ -34,6 +34,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.poifs.filesystem.OfficeXmlFileException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@@ -42,6 +43,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -436,7 +438,7 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
@Override
|
||||
public String reportHtml(String reportId, String fileId) {
|
||||
try {
|
||||
String key = reportId + fileId;
|
||||
String key = reportId + "-" + fileId;
|
||||
String html = stringRedisTemplate.boundValueOps(key).get();
|
||||
//没有的话就生成
|
||||
if (StrUtil.isBlank(html)) {
|
||||
@@ -841,7 +843,13 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
} 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);
|
||||
try {
|
||||
html = PptUtil.doPpt2003toImage(new FileInputStream(path), uploadFile, ipAddress);
|
||||
} catch (OfficeXmlFileException e) {
|
||||
String newPath = path + "x";
|
||||
cn.hutool.core.io.FileUtil.rename(new File(path), newPath, false, false);
|
||||
html = PptUtil.doPpt2007toImage(new FileInputStream(newPath), 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())) {
|
||||
|
||||
Reference in New Issue
Block a user