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)