|
@@ -528,20 +528,25 @@ public class EmailTemplateService {
|
|
|
|
|
|
public List<EmailFileContentDTO> getRealFilePath(String filePath, String content) {
|
|
public List<EmailFileContentDTO> getRealFilePath(String filePath, String content) {
|
|
List<EmailFileContentDTO> emailFileContentDTOList = CollUtil.newArrayList();
|
|
List<EmailFileContentDTO> emailFileContentDTOList = CollUtil.newArrayList();
|
|
|
|
+ log.info("文件路径:"+filePath);
|
|
if (StrUtil.isBlank(filePath)) {
|
|
if (StrUtil.isBlank(filePath)) {
|
|
return emailFileContentDTOList;
|
|
return emailFileContentDTOList;
|
|
}
|
|
}
|
|
if (ExcelUtil.isExcel(filePath)) {
|
|
if (ExcelUtil.isExcel(filePath)) {
|
|
|
|
+ log.info("excel文件路径:"+filePath);
|
|
emailFileContentDTOList.add(new EmailFileContentDTO(filePath, null));
|
|
emailFileContentDTOList.add(new EmailFileContentDTO(filePath, null));
|
|
} else if (ExcelUtil.isHTML(filePath)) {
|
|
} else if (ExcelUtil.isHTML(filePath)) {
|
|
|
|
+ log.info("html文件路径:"+filePath);
|
|
String excelFilePath = filePath.replace(".html", ".xlsx");
|
|
String excelFilePath = filePath.replace(".html", ".xlsx");
|
|
excelFilePath = ExcelUtil.contentConvertToExcel(content, excelFilePath);
|
|
excelFilePath = ExcelUtil.contentConvertToExcel(content, excelFilePath);
|
|
emailFileContentDTOList.add(new EmailFileContentDTO(excelFilePath, getTextFromHtml(content)));
|
|
emailFileContentDTOList.add(new EmailFileContentDTO(excelFilePath, getTextFromHtml(content)));
|
|
} else if (ExcelUtil.isPdf(filePath)) {
|
|
} else if (ExcelUtil.isPdf(filePath)) {
|
|
|
|
+ log.info("pdf文件路径:"+filePath);
|
|
String excelFilePath = filePath.replace(".pdf", ".xlsx").replace(".PDF", ".xlsx");
|
|
String excelFilePath = filePath.replace(".pdf", ".xlsx").replace(".PDF", ".xlsx");
|
|
excelFilePath = ExcelUtil.pdfConvertToExcel(filePath, excelFilePath);
|
|
excelFilePath = ExcelUtil.pdfConvertToExcel(filePath, excelFilePath);
|
|
emailFileContentDTOList.add(new EmailFileContentDTO(excelFilePath, null));
|
|
emailFileContentDTOList.add(new EmailFileContentDTO(excelFilePath, null));
|
|
} else if (ExcelUtil.isZip(filePath)) {
|
|
} else if (ExcelUtil.isZip(filePath)) {
|
|
|
|
+ log.info("zip文件路径:"+filePath);
|
|
String destPath = filePath.replaceAll(".zip", "").replaceAll(".ZIP", "");
|
|
String destPath = filePath.replaceAll(".zip", "").replaceAll(".ZIP", "");
|
|
List<String> dir = ExcelUtil.extractCompressedFiles(filePath, destPath);
|
|
List<String> dir = ExcelUtil.extractCompressedFiles(filePath, destPath);
|
|
for (String zipFilePath : dir) {
|
|
for (String zipFilePath : dir) {
|