From a24ad3db42715e2fd908d5b80abd6ae689be56e6 Mon Sep 17 00:00:00 2001 From: panbaolin <123456> Date: Fri, 29 Dec 2023 20:15:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:1.=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E5=86=85=E5=AE=B9=E6=94=B9=E4=B8=BA=E4=BB=8E?= =?UTF-8?q?.eml=E6=96=87=E4=BB=B6=E4=B8=AD=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/spectrum/SpectrumParsingActuator.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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();