Merge remote-tracking branch 'origin/master'

This commit is contained in:
sxu 2025-06-05 16:21:29 +08:00
commit 5e18ff152c
2 changed files with 4 additions and 0 deletions

View File

@ -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())) {

View File

@ -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) {