|
@@ -7,6 +7,7 @@ import cn.hutool.core.map.MapUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.extra.mail.JakartaUserPassAuthenticator;
|
|
import cn.hutool.extra.mail.JakartaUserPassAuthenticator;
|
|
import com.simuwang.base.common.conts.DateConst;
|
|
import com.simuwang.base.common.conts.DateConst;
|
|
|
|
+import com.simuwang.base.common.conts.EmailTypeConst;
|
|
import com.simuwang.base.pojo.dto.EmailContentInfoDTO;
|
|
import com.simuwang.base.pojo.dto.EmailContentInfoDTO;
|
|
import com.simuwang.base.pojo.dto.MailboxInfoDTO;
|
|
import com.simuwang.base.pojo.dto.MailboxInfoDTO;
|
|
import com.sun.mail.imap.IMAPStore;
|
|
import com.sun.mail.imap.IMAPStore;
|
|
@@ -175,11 +176,11 @@ public class EmailUtil {
|
|
*
|
|
*
|
|
* @param subject 邮件主题
|
|
* @param subject 邮件主题
|
|
* @param emailTypeMap 邮件类型识别规则映射表
|
|
* @param emailTypeMap 邮件类型识别规则映射表
|
|
- * @return 邮件类型:1-净值,2-估值表,3-定期报告,null代表不支持该邮件解析
|
|
|
|
|
|
+ * @return 邮件类型:1-净值,2-估值表,3-定期报告 -> 兜底为净值类型
|
|
*/
|
|
*/
|
|
public static Integer getEmailTypeBySubject(String subject, Map<Integer, List<String>> emailTypeMap) {
|
|
public static Integer getEmailTypeBySubject(String subject, Map<Integer, List<String>> emailTypeMap) {
|
|
if (MapUtil.isEmpty(emailTypeMap)) {
|
|
if (MapUtil.isEmpty(emailTypeMap)) {
|
|
- return null;
|
|
|
|
|
|
+ return EmailTypeConst.NAV_EMAIL_TYPE;
|
|
}
|
|
}
|
|
for (Map.Entry<Integer, List<String>> emailTypeEntry : emailTypeMap.entrySet()) {
|
|
for (Map.Entry<Integer, List<String>> emailTypeEntry : emailTypeMap.entrySet()) {
|
|
for (String field : emailTypeEntry.getValue()) {
|
|
for (String field : emailTypeEntry.getValue()) {
|
|
@@ -188,7 +189,7 @@ public class EmailUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
|
|
+ return EmailTypeConst.NAV_EMAIL_TYPE;
|
|
}
|
|
}
|
|
|
|
|
|
public static Store getStoreNew(MailboxInfoDTO mailboxInfoDTO) {
|
|
public static Store getStoreNew(MailboxInfoDTO mailboxInfoDTO) {
|