Ver Fonte

feat:只解析净值邮件

mozuwen há 5 meses atrás
pai
commit
4b492d4a6a

+ 13 - 9
service-base/src/main/java/com/simuwang/base/common/util/EmailUtil.java

@@ -232,17 +232,21 @@ public class EmailUtil {
      * @return 邮件类型:1-净值,2-估值表,3-定期报告 -> 兜底为净值类型
      */
     public static Integer getEmailTypeBySubject(String subject, Map<Integer, List<String>> emailTypeMap) {
-        if (MapUtil.isEmpty(emailTypeMap) || StrUtil.isBlank(subject)) {
+        if (subject.contains("净值") || subject.contains("规模") || subject.contains("业绩报酬") || subject.contains("业绩提成")) {
             return EmailTypeConst.NAV_EMAIL_TYPE;
         }
-        for (Map.Entry<Integer, List<String>> emailTypeEntry : emailTypeMap.entrySet()) {
-            for (String field : emailTypeEntry.getValue()) {
-                if (subject.contains(field)) {
-                    return emailTypeEntry.getKey();
-                }
-            }
-        }
-        return EmailTypeConst.NAV_EMAIL_TYPE;
+        return null;
+//        if (MapUtil.isEmpty(emailTypeMap) || StrUtil.isBlank(subject)) {
+//            return EmailTypeConst.NAV_EMAIL_TYPE;
+//        }
+//        for (Map.Entry<Integer, List<String>> emailTypeEntry : emailTypeMap.entrySet()) {
+//            for (String field : emailTypeEntry.getValue()) {
+//                if (subject.contains(field)) {
+//                    return emailTypeEntry.getKey();
+//                }
+//            }
+//        }
+//        return EmailTypeConst.NAV_EMAIL_TYPE;
     }
 
     public static Store getStoreNew(MailboxInfoDTO mailboxInfoDTO) {

+ 12 - 12
service-daq/src/main/java/com/simuwang/daq/service/NavEmailParser.java

@@ -87,23 +87,23 @@ public class NavEmailParser extends AbstractEmailParser {
             Optional.ofNullable(fundNavDTOList).ifPresent(emailFundNavDTOList::addAll);
         }
 
-        // 兼容净值邮件,但附件是估值表的情况
-        if (CollUtil.isEmpty(emailFundNavDTOList)) {
-            // 判断文件名是否包含"估值表"
-            String fileName = emailContentInfoDTO.getFileName();
-            if (StrUtil.isNotBlank(fileName) && fileName.contains("估值表")) {
-                emailFundNavDTOList = valuationEmailParser.parse(emailContentInfoDTO, emailFieldMap);
-            }
-        }
+//        // 兼容净值邮件,但附件是估值表的情况
+//        if (CollUtil.isEmpty(emailFundNavDTOList)) {
+//            // 判断文件名是否包含"估值表"
+//            String fileName = emailContentInfoDTO.getFileName();
+//            if (StrUtil.isNotBlank(fileName) && fileName.contains("估值表")) {
+//                emailFundNavDTOList = valuationEmailParser.parse(emailContentInfoDTO, emailFieldMap);
+//            }
+//        }
         // email_fund_nav增加template_id字段
         if (CollUtil.isNotEmpty(emailFundNavDTOList)) {
             emailFundNavDTOList.forEach(e -> e.setTemplateId(0));
         }
 
-        // 通用模版解析 -> 根据配置的模板进行解析
-        if (CollUtil.isEmpty(emailFundNavDTOList) || forceTemplateEnable) {
-            emailFundNavDTOList = emailTemplateService.parseUsingTemplate(emailContentInfoDTO);
-        }
+//        // 通用模版解析 -> 根据配置的模板进行解析
+//        if (CollUtil.isEmpty(emailFundNavDTOList) || forceTemplateEnable) {
+//            emailFundNavDTOList = emailTemplateService.parseUsingTemplate(emailContentInfoDTO);
+//        }
         return emailFundNavDTOList;
     }