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) {
|
private void reduceAccWalletInfo(WalletBalanceOperation operation) {
|
||||||
|
log.info("钱包扣款入参:{}", JacksonUtil.writeValueAsString(operation));
|
||||||
AccWalletInfo walletInfo = selectAccWalletInfoByUserIdAndWalletType(operation.getUserId(),
|
AccWalletInfo walletInfo = selectAccWalletInfoByUserIdAndWalletType(operation.getUserId(),
|
||||||
operation.getWalletType());
|
operation.getWalletType());
|
||||||
if(Objects.isNull(walletInfo)
|
if(Objects.isNull(walletInfo)
|
||||||
|| walletInfo.getWalletBal().compareTo(BigDecimal.ZERO) < 0
|
|| walletInfo.getWalletBal().compareTo(BigDecimal.ZERO) < 0
|
||||||
|| (walletInfo.getWalletBal().compareTo(operation.getAmount()) < 0)) {
|
|| (walletInfo.getWalletBal().compareTo(operation.getAmount()) < 0)) {
|
||||||
|
log.info("钱包余额:{}", walletInfo.getWalletBal());
|
||||||
throw new ServiceException("钱包余额不足");
|
throw new ServiceException("钱包余额不足");
|
||||||
}
|
}
|
||||||
if(AccTradeTypeEnum.CLEAR.getKey().equals(operation.getOperationType())) {
|
if(AccTradeTypeEnum.CLEAR.getKey().equals(operation.getOperationType())) {
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,8 @@ public class OrderBusiness {
|
||||||
throw new ServiceException("钱包余额不足");
|
throw new ServiceException("钱包余额不足");
|
||||||
}
|
}
|
||||||
for(OrderInfo orderInfo : orderInfoList) {
|
for(OrderInfo orderInfo : orderInfoList) {
|
||||||
|
walletInfoList = accWalletInfoService.selectAccWalletInfoByUserId(orderPayDTO.getUserId());
|
||||||
|
subsidyWalletBal = getWalletBalance(walletInfoList, AccWalletTypeEnum.SUBSIDY);
|
||||||
deductFromWallets(orderInfo, subsidyWalletBal);
|
deductFromWallets(orderInfo, subsidyWalletBal);
|
||||||
}
|
}
|
||||||
} catch (ServiceException ex) {
|
} catch (ServiceException ex) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue