|
|
@@ -567,6 +567,7 @@ public class CheckBusiness {
|
|
|
return R.fail(new ErrorInfo(400, ApiErrorTypeConstants.CONSUME_CHECK_FAIL, "钱包余额不足",
|
|
|
MessageFormat.format("余额不足,总余额[{0}],消费金额[{1}]", totalBalance, consumeMoney)));
|
|
|
}
|
|
|
+
|
|
|
for (String bagCode : bagCodes) {
|
|
|
// 1.查询对应的钱包
|
|
|
PtBagVo bagVo = bagService.queryByUserBagCode(userId, bagCode);
|
|
|
@@ -576,11 +577,11 @@ public class CheckBusiness {
|
|
|
}
|
|
|
// 2.比较扣费金额
|
|
|
BigDecimal balance = bagVo.getBalance();
|
|
|
- log.info("钱包代码:{},钱包余额:{},消费金额:{}", bagCode, balance, doMoney);
|
|
|
- if (doMoney.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
+ log.info("钱包代码:{},钱包余额:{},消费金额:{},扣款金额:{},姓名:{}", bagCode, balance, consumeMoney,doMoney,userAccountVo.getRealName());
|
|
|
+ if (consumeMoney.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
// 如果是消费0元,设置为第一个钱包扣费
|
|
|
- bagVo.setReceiptMoney(doMoney);
|
|
|
- bagVo.setBalance(balance.subtract(doMoney));
|
|
|
+ bagVo.setReceiptMoney(BigDecimal.ZERO);
|
|
|
+ bagVo.setBalance(balance);
|
|
|
sb.append(BagNameEnum.getMessage(Integer.parseInt(bagCode)));
|
|
|
doBagVos.add(bagVo);
|
|
|
break;
|