From efeeca6d05edb5720dc4edebeefb10e8de19f009 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Fri, 13 Feb 2026 15:01:17 +0800 Subject: [PATCH] =?UTF-8?q?vip=E8=B5=A0=E9=80=81=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=BD=93=E6=97=A5=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/task/CheckInServiceImpl.java | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/task/CheckInServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/task/CheckInServiceImpl.java index 74b02ff5..ce97f1b5 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/task/CheckInServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/task/CheckInServiceImpl.java @@ -30,6 +30,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.List; import java.util.Map; import java.util.Objects; @@ -104,13 +106,26 @@ public class CheckInServiceImpl implements CheckInService { // 1. 调用wallet客户端查询VIP赠送记录(仅包含基础record信息) ResultResponse> response = walletGoldClient.getLatestVipGiveawayRecords(userId, limit); - - List records = ResponseAssert.requiredSuccess(response); - - if (CollectionUtils.isEmpty(records)) { + + List body = response.getBody(); + if (CollectionUtils.isEmpty(body)) { return CollectionUtils.newArrayList(); } - + + // 过滤出 createTime 是当天的记录 + List records = body.stream() + .filter(record -> { + if (record.getCreateTime() == null) { + return false; + } + LocalDateTime createDateTime = record.getCreateTime().toLocalDateTime(); + return createDateTime.toLocalDate().equals(LocalDate.now()); + }) + .toList(); + if (CollectionUtils.isEmpty(body)) { + return CollectionUtils.newArrayList(); + } + // 2. 收集所有eventId (商品ID) Set commodityIds = records.stream() .map(WalletGoldAssetRecordDTO::getEventId)