diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java index 141df3b8..63154d31 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java @@ -310,25 +310,24 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo } private void fillUserFirstRecharge(UserRunProfile newUserRunProfile) { - LocalDateTime createTime = newUserRunProfile.getCreateTime().toLocalDateTime(); + List allInvites = userInviteUserDAO.selectList( + new LambdaQueryWrapper() + .eq(UserInviteUser::getInviteUserId, newUserRunProfile.getId()) + .orderByDesc(UserInviteUser::getCreateTime) + ); + if (allInvites == null || allInvites.isEmpty()) { + return; + } + + UserInviteUser userInviteUser = allInvites.get(0); + + LocalDateTime createTime = userInviteUser.getCreateTime().toLocalDateTime(); Duration duration = Duration.between(createTime, LocalDateTime.now()); if (duration.toDays() < 7) { - List allInvites = userInviteUserDAO.selectList( - new LambdaQueryWrapper() - .eq(UserInviteUser::getInviteUserId, newUserRunProfile.getId()) - .orderByDesc(UserInviteUser::getCreateTime) - ); - if (allInvites == null || allInvites.isEmpty()) { - return; - } - - UserInviteUser userInviteUser = allInvites.get(0); - if (userInviteUser != null) { - newUserRunProfile.setFirstRecharge(true); - newUserRunProfile.setFirstRechargeEndTime(ZonedDateTimeUtils.toTimestampDefault(createTime.plusDays(7))); - } - + newUserRunProfile.setFirstRecharge(true); + newUserRunProfile.setFirstRechargeEndTime(ZonedDateTimeUtils.toTimestampDefault(createTime.plusDays(7))); } + } private Map> mapUserUseBadgeEntity(String sysOrigin,