diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumParsingActuator.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumParsingActuator.java index 583d38ed..978edf7a 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumParsingActuator.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumParsingActuator.java @@ -1,5 +1,6 @@ package org.jeecg.modules.spectrum; +import cn.hutool.core.io.FileUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.jeecg.common.email.EmailLogEvent; @@ -8,6 +9,7 @@ import org.jeecg.common.email.EmailServiceManager; import org.jeecg.modules.email.EmailProperties; import org.jeecg.modules.enums.SpectrumSource; import javax.mail.Message; +import java.io.File; import java.util.concurrent.CountDownLatch; /** @@ -68,15 +70,17 @@ public class SpectrumParsingActuator implements Runnable{ //获取邮件主题 subject = emailServiceManager.getMailSubject(message); - //获取邮件内容 - StringBuilder mailContent = new StringBuilder(); - emailServiceManager.getMailContent(message,mailContent); - //所有邮件都需以.eml格式存储到eml文件夹中 - emailServiceManager.downloadEmailToEmlDir(message,emailCounter.getCurrValue()); + final File emlFile = emailServiceManager.downloadEmailToEmlDir(message, emailCounter.getCurrValue()); //保存邮件日志到PG数据库 this.spectrumServiceQuotes.getMailLogService().create(message,emailProperties); + //获取邮件内容 + StringBuilder mailContent = new StringBuilder(); + if(StringUtils.isNotBlank(emlFile.toString()) && emlFile.length() > 0){ + mailContent.append(FileUtil.readUtf8String(emlFile)); + } + //判断是否是IMS2.0协议文件 if(checkMailContent(mailContent,subject)){ AbstractSpectrumHandler spectrumHandler = new SamplephdSpectrum();