From 1e495270a90d07628263858316d792da6a414218 Mon Sep 17 00:00:00 2001 From: shi Date: Sat, 22 Feb 2025 17:51:51 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ff-admin):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BD=99=E9=A2=9D=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在获取余额时使用 NumberUtil.add 方法,确保结果不会为 null - 避免潜在的 NullPointerException,提高代码健壮性 --- .../ff/common/service/impl/TenantGameQuotaServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ff-admin/src/main/java/com/ff/common/service/impl/TenantGameQuotaServiceImpl.java b/ff-admin/src/main/java/com/ff/common/service/impl/TenantGameQuotaServiceImpl.java index de57751..e731a55 100644 --- a/ff-admin/src/main/java/com/ff/common/service/impl/TenantGameQuotaServiceImpl.java +++ b/ff-admin/src/main/java/com/ff/common/service/impl/TenantGameQuotaServiceImpl.java @@ -323,12 +323,12 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService { .tenantKey(gameBalanceExchange.getTenantKey()) .memberId(member.getId()) .build()); - BigDecimal balanceOut = tenantGameQuotaFlowService.getExchangeMoneyByMemberId(TenantGameQuotaFlow.builder() + BigDecimal balanceOut = NumberUtil.add(tenantGameQuotaFlowService.getExchangeMoneyByMemberId(TenantGameQuotaFlow.builder() .isOut(Boolean.FALSE) .quotaType(quotaType) .tenantKey(gameBalanceExchange.getTenantKey()) .memberId(member.getId()) - .build()); + .build()),BigDecimal.ZERO); // 初始化平台额度 BigDecimal platformBalance = BigDecimal.ZERO;