|
@@ -107,11 +107,11 @@ public class EmailParseService {
|
|
|
try {
|
|
|
emailContentMap = realEmail(mailboxInfoDTO, emailTypeMap, startDate, endDate);
|
|
|
} catch (Exception e) {
|
|
|
- log.info("采集邮件失败 -> 邮箱配置信息:{},堆栈信息:{}", mailboxInfoDTO, ExceptionUtil.stacktraceToString(e));
|
|
|
+ log.error("采集邮件失败 -> 邮箱配置信息:{},堆栈信息:{}", mailboxInfoDTO, ExceptionUtil.stacktraceToString(e));
|
|
|
return;
|
|
|
}
|
|
|
if (MapUtil.isEmpty(emailContentMap)) {
|
|
|
- log.info("未采集到邮件 -> 邮箱配置信息:{},开始时间:{},结束时间:{}", mailboxInfoDTO,
|
|
|
+ log.warn("未采集到邮件 -> 邮箱配置信息:{},开始时间:{},结束时间:{}", mailboxInfoDTO,
|
|
|
DateUtil.format(startDate, DateConst.YYYY_MM_DD_HH_MM_SS), DateUtil.format(endDate, DateConst.YYYY_MM_DD_HH_MM_SS));
|
|
|
return;
|
|
|
}
|
|
@@ -483,7 +483,7 @@ public class EmailParseService {
|
|
|
folder.open(Folder.READ_ONLY);
|
|
|
Message[] messages = getEmailMessage(folder, mailboxInfoDTO.getProtocol(), startDate);
|
|
|
if (messages == null || messages.length == 0) {
|
|
|
- log.info("获取不到邮件 -> 邮箱信息:{},开始时间:{},结束时间:{}", mailboxInfoDTO, startDate, endDate);
|
|
|
+ log.warn("获取不到邮件 -> 邮箱信息:{},开始时间:{},结束时间:{}", mailboxInfoDTO, startDate, endDate);
|
|
|
return MapUtil.newHashMap();
|
|
|
}
|
|
|
Map<String, List<EmailContentInfoDTO>> emailMessageMap = MapUtil.newHashMap();
|
|
@@ -498,15 +498,19 @@ public class EmailParseService {
|
|
|
Integer emailType;
|
|
|
String senderEmail;
|
|
|
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);
|
|
|
if (isNotParseConditionSatisfied) {
|
|
|
continue;
|
|
|
}
|
|
|
senderEmail = getSenderEmail(message);
|
|
|
emailType = EmailUtil.getEmailTypeBySubject(emailTitle, emailTypeMap);
|
|
|
- String emailDateStr = DateUtil.format(emailDate, DateConst.YYYY_MM_DD_HH_MM_SS);
|
|
|
if (emailType == null) {
|
|
|
- log.info("邮件不满足解析条件 -> 邮件主题:{},邮件日期:{}", emailTitle, emailDateStr);
|
|
|
+ log.warn("邮件不满足解析条件 -> 邮件主题:{},邮件日期:{}", emailTitle, emailDateStr);
|
|
|
continue;
|
|
|
}
|
|
|
log.info("邮件{} 基本信息获取完成,开始下载附件!邮件日期:{}", emailTitle, emailDateStr);
|