From 35acf55f64d060d7beb188c1f1c766b6a6000b8b Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 30 Aug 2022 10:58:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=B7=A5=E4=BD=9C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E3=80=91=E6=9C=8D=E5=8A=A1=E6=97=B6=E9=97=B4=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WorkdiaryServiceRecordServiceImpl.java | 44 +++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkdiaryServiceRecordServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkdiaryServiceRecordServiceImpl.java index f44d157e22..7534b9a918 100755 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkdiaryServiceRecordServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkdiaryServiceRecordServiceImpl.java @@ -70,6 +70,8 @@ import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; /** @@ -98,6 +100,17 @@ public class WorkdiaryServiceRecordServiceImpl extends BaseServiceImpl> importResultDescTl = new ThreadLocal<>(); + /** + * 工作日志-服务时间-正则表达式 + * 支持模式: + * 2022-01-01 + * 2022-1-1 + * 2022/01/01 + * 2022/01-1 + * ... + */ + private static final Pattern WORKDIARY_SERVICE_TIME_REGEX = Pattern.compile("^(\\s*)(?\\d{4})[-/](?\\d{1,2})[-/](?\\d{1,2})(\\s*)$"); + /** * 导入结果描述 */ @@ -466,24 +479,29 @@ public class WorkdiaryServiceRecordServiceImpl extends BaseServiceImpl