From 1ef6f0362228a5d44bed8c3d53f02ca7434a854f Mon Sep 17 00:00:00 2001 From: gaowdong Date: Thu, 5 Jun 2025 15:25:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canteen/core/account/business/AccWalletInfoBusiness.java | 2 ++ .../com/bonus/canteen/core/order/business/OrderBusiness.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java index 3028b0a..e1a6296 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java @@ -181,11 +181,13 @@ public class AccWalletInfoBusiness { } private void reduceAccWalletInfo(WalletBalanceOperation operation) { + log.info("钱包扣款入参:{}", JacksonUtil.writeValueAsString(operation)); AccWalletInfo walletInfo = selectAccWalletInfoByUserIdAndWalletType(operation.getUserId(), operation.getWalletType()); if(Objects.isNull(walletInfo) || walletInfo.getWalletBal().compareTo(BigDecimal.ZERO) < 0 || (walletInfo.getWalletBal().compareTo(operation.getAmount()) < 0)) { + log.info("钱包余额:{}", walletInfo.getWalletBal()); throw new ServiceException("钱包余额不足"); } if(AccTradeTypeEnum.CLEAR.getKey().equals(operation.getOperationType())) { diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/business/OrderBusiness.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/business/OrderBusiness.java index af1e01d..b98861d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/business/OrderBusiness.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/business/OrderBusiness.java @@ -123,6 +123,8 @@ public class OrderBusiness { throw new ServiceException("钱包余额不足"); } for(OrderInfo orderInfo : orderInfoList) { + walletInfoList = accWalletInfoService.selectAccWalletInfoByUserId(orderPayDTO.getUserId()); + subsidyWalletBal = getWalletBalance(walletInfoList, AccWalletTypeEnum.SUBSIDY); deductFromWallets(orderInfo, subsidyWalletBal); } } catch (ServiceException ex) {