From 8327a1973d70825b172d4e3d69021ce75e55b3c7 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 9 Sep 2025 22:40:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/user/RechargeUserServiceImpl.java | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java index 800bbd0b..f45d8a36 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/user/RechargeUserServiceImpl.java @@ -27,6 +27,7 @@ import com.red.circle.wallet.inner.model.cmd.UserFreightBalancePageQryCmd; import com.red.circle.wallet.inner.model.dto.UserFreightBalanceDTO; import lombok.RequiredArgsConstructor; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.springframework.stereotype.Service; import java.math.BigDecimal; @@ -54,23 +55,8 @@ public class RechargeUserServiceImpl implements RechargeUserService { ResponseAssert.failure(CommonErrorCode.OPERATING_FAILURE); } - List bdList = businessDevelopmentBaseInfoService.query() - .eq(BusinessDevelopmentBaseInfo::getSysOrigin,cmd.getReqSysOrigin()) - .eq(BusinessDevelopmentBaseInfo::getBdLeadUserId, cmd.getReqUserId()) - .orderByDesc(BusinessDevelopmentBaseInfo::getCreateTime) - .list(); - if (bdList.isEmpty()) { - return null; - } - - List collect = bdList.stream().map(e -> { - UserFreightBalanceDTO result = freightGoldClient.getByUserId(e.getUserId()).getBody(); - return result != null ? result.getUserId() : null; - }).filter(Objects::nonNull).toList(); - - if (CollectionUtils.isEmpty(collect)) { - return null; - } + List collect = getBdGoldUserIdList(cmd); + if (collect == null) return null; Map userMonthlyAmountMap = getThisMonthRechargeAmount(collect); Map userLastMonthAmountMap = getLastMonthRechargeAmount(collect); @@ -93,6 +79,27 @@ public class RechargeUserServiceImpl implements RechargeUserService { return result; } + private List getBdGoldUserIdList(AppExtCommand cmd) { + List bdList = businessDevelopmentBaseInfoService.query() + .eq(BusinessDevelopmentBaseInfo::getSysOrigin, cmd.getReqSysOrigin().getOrigin()) + .eq(BusinessDevelopmentBaseInfo::getBdLeadUserId, cmd.getReqUserId()) + .orderByDesc(BusinessDevelopmentBaseInfo::getCreateTime) + .list(); + if (bdList.isEmpty()) { + return null; + } + + List collect = bdList.stream().map(e -> { + UserFreightBalanceDTO result = freightGoldClient.getByUserId(e.getUserId()).getBody(); + return result != null ? result.getUserId() : null; + }).filter(Objects::nonNull).toList(); + + if (CollectionUtils.isEmpty(collect)) { + return null; + } + return collect; + } + @Override public List getRechargeSummary(AppExtCommand cmd) { return userMonthlyRechargeClient.getMonthlyRechargeSummary().getBody();