From cf087f55cd127b5ab61008628cfc8a0310ff3360 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Tue, 18 Jul 2023 15:15:19 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E6=B6=88=E6=81=AF=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6LocalTime?= =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message/service/impl/MessagePushRecordServiceImpl.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java index 5b80f93..c149068 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java @@ -39,10 +39,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; import javax.validation.Valid; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.Year; -import java.time.YearMonth; +import java.time.*; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -119,12 +116,8 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl getQueryWrapper(MessagePushRecordEntity request) { LambdaQueryWrapper lambda = Condition.getQueryWrapper(request).lambda(); - if (Func.isNotEmpty(request.getStartTime())) { - lambda.ge(MessagePushRecordEntity::getPushTime, request.getStartTime()); - } - if (Func.isNotEmpty(request.getEndTime())) { - lambda.le(MessagePushRecordEntity::getPushTime, request.getEndTime()); - } + lambda.ge(Func.isNotEmpty(request.getStartTime()),MessagePushRecordEntity::getPushTime, LocalDateTime.of(request.getStartTime(), LocalTime.MIN)); + lambda.le(Func.isNotEmpty(request.getEndTime()),MessagePushRecordEntity::getPushTime, LocalDateTime.of(request.getEndTime(), LocalTime.MAX)); lambda.orderByDesc(MessagePushRecordEntity::getPushTime); return lambda; }