wangzaijun 1 månad sedan
förälder
incheckning
342d15fcfb

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

@@ -351,13 +351,19 @@ public final class ReportParseUtils {
             }
         }
         if (ReportType.WEEKLY.equals(reportType) || ReportType.LETTER.equals(reportType) || ReportType.OTHER.equals(reportType)) {
-            Matcher matcher = PatternConsts.DAY_PATTERN.matcher(text);
+            // 先用严格的日期匹配
+            Matcher matcher = PatternConsts.STRICT_DAY_PATTERN.matcher(text);
+            if (matcher.find()) {
+                return matcher.group();
+            }
+            // 匹配不了时
+            matcher = PatternConsts.DAY_PATTERN.matcher(text);
             if (matcher.find()) {
                 String date = matcher.group();
                 if (NumberUtil.isNumber(date) && date.length() >= 10) {
                     return StrUtil.sub(date, 0, 10);
                 }
-                return matcher.group();
+                return date;
             }
         }
         return null;