fix:1.修改获取邮件内容改为从.eml文件中获取

This commit is contained in:
panbaolin 2023-12-29 20:18:57 +08:00
parent eae304a2f7
commit 7b2fda268d
2 changed files with 5 additions and 2 deletions

View File

@ -492,7 +492,7 @@ public class EmailServiceManager {
* 格式为发件人_主题_年月日_时分秒毫秒_计数0-10000
* 当计数大于10000后从0开始服务重启后也从0开始
*/
public void downloadEmailToEmlDir(@NotNull Message message,Integer emailCounter) throws MessagingException, IOException {
public File downloadEmailToEmlDir(@NotNull Message message,Integer emailCounter) throws MessagingException, IOException {
String subject = "";
File emlFile = null;
String status = EmailLogManager.STATUS_SUCCESS;
@ -534,6 +534,8 @@ public class EmailServiceManager {
(Objects.isNull(emlFile)?" ":emlFile.getAbsolutePath()));
EmailLogManager.getInstance().offer(Thread.currentThread().getId(),event);
}
return emlFile;
}
/**

View File

@ -10,6 +10,7 @@ import org.jeecg.modules.email.EmailProperties;
import org.jeecg.modules.enums.SpectrumSource;
import javax.mail.Message;
import java.io.File;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
/**
@ -77,7 +78,7 @@ public class SpectrumParsingActuator implements Runnable{
//获取邮件内容
StringBuilder mailContent = new StringBuilder();
if(StringUtils.isNotBlank(emlFile.toString()) && emlFile.length() > 0){
if(Objects.nonNull(emlFile) && emlFile.length() > 0){
mailContent.append(FileUtil.readUtf8String(emlFile));
}