|
@@ -505,17 +505,20 @@ public class EmailParseService {
|
|
|
String senderEmail;
|
|
|
String emailTitle = null;
|
|
|
try {
|
|
|
+ emailTitle = message.getSubject();
|
|
|
Date emailDate = message.getSentDate();
|
|
|
String emailDateStr = DateUtil.format(emailDate, DateConst.YYYY_MM_DD_HH_MM_SS);
|
|
|
if (log.isInfoEnabled()) {
|
|
|
log.info("邮件{} 数据获取中,邮件时间:{}", emailTitle, emailDateStr);
|
|
|
}
|
|
|
|
|
|
- boolean isNotParseConditionSatisfied = emailDate == null || (endDate != null && emailDate.compareTo(endDate) > 0) || (startDate != null && emailDate.compareTo(startDate) < 0);
|
|
|
+ boolean isNotParseConditionSatisfied = emailDate == null
|
|
|
+ || (endDate != null && emailDate.compareTo(endDate) > 0)
|
|
|
+ || (startDate != null && emailDate.compareTo(startDate) < 0);
|
|
|
if (isNotParseConditionSatisfied) {
|
|
|
+ log.warn("邮件{} 没有日期{} 或者 邮件日期不在区间内【{} ~ {}】", emailTitle, emailDate, startDate, endDate);
|
|
|
continue;
|
|
|
}
|
|
|
- emailTitle = message.getSubject();
|
|
|
senderEmail = getSenderEmail(message);
|
|
|
emailType = EmailUtil.getEmailTypeBySubject(emailTitle, emailTypeMap);
|
|
|
if (emailType == null) {
|
|
@@ -540,13 +543,12 @@ public class EmailParseService {
|
|
|
});
|
|
|
emailMessageMap.put(uuidKey, emailContentInfoDTOList);
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("获取邮箱的邮件{} 报错,堆栈信息:{}", emailTitle, ExceptionUtil.stacktraceToString(e));
|
|
|
- } finally {
|
|
|
if (log.isInfoEnabled() && emailTitle != null) {
|
|
|
log.info("邮件{} 下载完成,总计耗时{} ms,文件内容如下\n {}",
|
|
|
emailTitle, System.currentTimeMillis() - start, emailContentInfoDTOList);
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("获取邮箱的邮件{} 报错,堆栈信息:{}", emailTitle, ExceptionUtil.stacktraceToString(e));
|
|
|
}
|
|
|
}
|
|
|
folder.close(false);
|