Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5e18ff152c
|
|
@ -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())) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue