Browse Source

fix:修复报告日期错误的解析问题

wangzaijun 1 day ago
parent
commit
2bdac1b358

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

@@ -318,7 +318,7 @@ public final class ReportParseUtils {
         Pattern pat2 = Pattern.compile("\\d{4}-\\d{2}-\\d{2}");  // 2023-12-31
         Pattern pat2 = Pattern.compile("\\d{4}-\\d{2}-\\d{2}");  // 2023-12-31
         Pattern pat3 = Pattern.compile("(2\\d{3})年年度");  // 2023年年度
         Pattern pat3 = Pattern.compile("(2\\d{3})年年度");  // 2023年年度
         Pattern pat4 = Pattern.compile("(\\d{4})年(\\d{1,2})月");  // 2023年12月
         Pattern pat4 = Pattern.compile("(\\d{4})年(\\d{1,2})月");  // 2023年12月
-        Pattern pat5 = Pattern.compile("\\d{4}\\d{2}\\d{2}");  // 20231231
+        Pattern pat5 = Pattern.compile("^\\d{4}\\d{2}\\d{2}$");  // 20231231
         Pattern pat6 = Pattern.compile("(2\\d{3})年度");  // 2023年度
         Pattern pat6 = Pattern.compile("(2\\d{3})年度");  // 2023年度
         // 创建Matcher对象
         // 创建Matcher对象
         Matcher matcher1 = pat1.matcher(string);
         Matcher matcher1 = pat1.matcher(string);