소스 검색

fix:修复部分报告日期无法用正则匹配的问题

wangzaijun 1 개월 전
부모
커밋
369f47ee39

+ 43 - 33
mo-daq/src/main/java/com/smppw/modaq/application/components/ReportParseUtils.java

@@ -475,46 +475,56 @@ public final class ReportParseUtils {
 //        text = "大岩市场中性2号私募证券投资基金_2025年_4月_月报.pdf";
 //        System.out.println(matchReportDate(matchReportType(EmailUtil.getEmailTypeBySubject(text), text), text));
 
-//        text = "投资策略调整.pdf";
-//        emailType = EmailUtil.getEmailTypeBySubject(text);
-//        System.out.println(emailType + "," + matchReportType(emailType, text));
-
-//        text = "SSH640_天演恒心精选3号私募证券投资基金(SSH640SM200010202504).pdf";
-//        emailType = EmailUtil.getEmailTypeBySubject(text);
-//        reportType = matchReportType(emailType, text);
-//        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
-//
-//        text = "【复胜周度观点】 2025_04_07-2025_04_11.pdf";
-//        emailType = EmailUtil.getEmailTypeBySubject(text);
-//        reportType = matchReportType(emailType, text);
-//        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
-//
-//        text = "交睿宏观配置2号私募证券投资基金B类_孙怡乐_20250429_073248861_赎回确认单.pdf";
-//        emailType = EmailUtil.getEmailTypeBySubject(text);
-//        reportType = matchReportType(emailType, text);
-//        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
-//
-//        text = "远澜宏观周报20250418.pdf";
-//        emailType = EmailUtil.getEmailTypeBySubject(text);
-//        reportType = matchReportType(emailType, text);
-//        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
+        text = "投资策略调整.pdf";
+        emailType = EmailUtil.getEmailTypeBySubject(text);
+        System.out.println(emailType + "," + matchReportType(emailType, text));
 
+        text = "SSH640_天演恒心精选3号私募证券投资基金(SSH640SM200010202504).pdf";
+        emailType = EmailUtil.getEmailTypeBySubject(text);
+        reportType = matchReportType(emailType, text);
+        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
+
+        text = "【复胜周度观点】 2025_04_07-2025_04_11.pdf";
+        emailType = EmailUtil.getEmailTypeBySubject(text);
+        reportType = matchReportType(emailType, text);
+        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
+
+        text = "交睿宏观配置2号私募证券投资基金B类_孙怡乐_20250429_073248861_赎回确认单.pdf";
+        emailType = EmailUtil.getEmailTypeBySubject(text);
+        reportType = matchReportType(emailType, text);
+        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
+
+        text = "远澜宏观周报20250418.pdf";
+        emailType = EmailUtil.getEmailTypeBySubject(text);
+        reportType = matchReportType(emailType, text);
+        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
+
+
+        text = "官方公众号市场周报披露250430(1).docx";
+        emailType = EmailUtil.getEmailTypeBySubject(text);
+        reportType = matchReportType(emailType, text);
+        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
 
-//        text = "官方公众号市场周报披露250430(1).docx";
-//        emailType = EmailUtil.getEmailTypeBySubject(text);
-//        reportType = matchReportType(emailType, text);
-//        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
-//
-//
-//        text = "涌津涌赢11号私募证券投资基金-月度报告-25250508.pdf";
-//        emailType = EmailUtil.getEmailTypeBySubject(text);
-//        reportType = matchReportType(emailType, text);
-//        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
+
+        text = "涌津涌赢11号私募证券投资基金-月度报告-25250508.pdf";
+        emailType = EmailUtil.getEmailTypeBySubject(text);
+        reportType = matchReportType(emailType, text);
+        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
 
         text = "年报_多元化CTA私募证券基金_2024年年度报告.pdf";
         emailType = EmailUtil.getEmailTypeBySubject(text);
         reportType = matchReportType(emailType, text);
         System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
 
+        text = "投资基金C_20250515_刁志勋-确认单";
+        emailType = EmailUtil.getEmailTypeBySubject(text);
+        reportType = matchReportType(emailType, text);
+        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
+
+        text = "投资基金C_2025年05月15号_刁志勋-确认单";
+        emailType = EmailUtil.getEmailTypeBySubject(text);
+        reportType = matchReportType(emailType, text);
+        System.out.println(emailType + ",reportType=" + reportType + ",reportDate=" + matchReportDate(reportType, text));
+
     }
 }

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/common/conts/PatternConsts.java

@@ -21,7 +21,7 @@ public class PatternConsts {
     /**
      * 严格的年月日匹配
      */
-    public static final Pattern STRICT_DAY_PATTERN = Pattern.compile("(20[23]\\d)[年_-]*(\\d{1,2})[月_-]*(\\d{1,2})[日号_-]?(?!\\d)");
+    public static final Pattern STRICT_DAY_PATTERN = Pattern.compile("(20[23]\\d)[年_-]*(\\d{1,2})[月_-]*(\\d{1,2})(?!\\d)");
     /**
      * 宽泛的日期匹配
      */