|
@@ -910,8 +910,12 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
for (OrderDon orderDon : orderDonList) {
|
|
for (OrderDon orderDon : orderDonList) {
|
|
|
pay_money = pay_money.add(orderDon.getMoney());
|
|
pay_money = pay_money.add(orderDon.getMoney());
|
|
|
real_money = real_money.add(orderDon.getRealMoney());
|
|
real_money = real_money.add(orderDon.getRealMoney());
|
|
|
- pay_balance = pay_balance.add(orderDon.getBalance());
|
|
|
|
|
- pay_galaxycoin = pay_galaxycoin.add(orderDon.getGalaxycoin());
|
|
|
|
|
|
|
+ if (orderDon.getBalance() != null) {
|
|
|
|
|
+ pay_balance = pay_balance.add(orderDon.getBalance());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (orderDon.getGalaxycoin() != null) {
|
|
|
|
|
+ pay_galaxycoin = pay_galaxycoin.add(orderDon.getGalaxycoin());
|
|
|
|
|
+ }
|
|
|
orderIds.add(orderDon.getId());
|
|
orderIds.add(orderDon.getId());
|
|
|
}
|
|
}
|
|
|
orderMasterDon.setMoney(pay_money);
|
|
orderMasterDon.setMoney(pay_money);
|
|
@@ -919,6 +923,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
orderMasterDon.setUserId(userId);
|
|
orderMasterDon.setUserId(userId);
|
|
|
orderMasterDon.setBalance(pay_balance);
|
|
orderMasterDon.setBalance(pay_balance);
|
|
|
orderMasterDon.setGalaxycoin(pay_galaxycoin);
|
|
orderMasterDon.setGalaxycoin(pay_galaxycoin);
|
|
|
|
|
+ //默认支付宝支付
|
|
|
|
|
+ orderMasterDon.setType(OrderMasterDon.Type.ALI_PAY);
|
|
|
orderMasterDonService.save(orderMasterDon);
|
|
orderMasterDonService.save(orderMasterDon);
|
|
|
|
|
|
|
|
orderDonMapper.update(null, Wrappers.lambdaUpdate(OrderDon.class)
|
|
orderDonMapper.update(null, Wrappers.lambdaUpdate(OrderDon.class)
|
|
@@ -2484,9 +2490,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
subGalaxycoin = money.multiply(BigDecimal.valueOf(100));
|
|
subGalaxycoin = money.multiply(BigDecimal.valueOf(100));
|
|
|
orderDon.setType(OrderDon.Type.GALAXYCOIN);
|
|
orderDon.setType(OrderDon.Type.GALAXYCOIN);
|
|
|
}
|
|
}
|
|
|
- BigDecimal userGalaxycoin = user.getGalaxycoin();
|
|
|
|
|
//扣除余额 是否成功
|
|
//扣除余额 是否成功
|
|
|
- Integer success = userMapper.deductGalaxycoin(user.getId(), subGalaxycoin, userGalaxycoin);
|
|
|
|
|
|
|
+ Integer success = userMapper.deductGalaxycoin(user.getId(), subGalaxycoin);
|
|
|
if (success != 1) throw BusinessRuntimeException.getInstance("您的银河币不足!");
|
|
if (success != 1) throw BusinessRuntimeException.getInstance("您的银河币不足!");
|
|
|
orderDon.setGalaxycoin(subGalaxycoin);
|
|
orderDon.setGalaxycoin(subGalaxycoin);
|
|
|
userBenefitsService.recordGlaxycoinBySource(user.getId(), BigDecimal.valueOf(-galaxycoin.longValue()), UserGalaxycoinRecord.Source.payment);
|
|
userBenefitsService.recordGlaxycoinBySource(user.getId(), BigDecimal.valueOf(-galaxycoin.longValue()), UserGalaxycoinRecord.Source.payment);
|
|
@@ -2506,9 +2511,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
subBalance = money;
|
|
subBalance = money;
|
|
|
orderDon.setType(OrderDon.Type.BALANCE);
|
|
orderDon.setType(OrderDon.Type.BALANCE);
|
|
|
}
|
|
}
|
|
|
- BigDecimal userBalance = user.getBalance();
|
|
|
|
|
//扣除余额 是否成功
|
|
//扣除余额 是否成功
|
|
|
- Integer success = userMapper.deductBalance(user.getId(), subBalance, userBalance);
|
|
|
|
|
|
|
+ Integer success = userMapper.deductBalance(user.getId(), subBalance);
|
|
|
if (success != 1) throw BusinessRuntimeException.getInstance("您的余额不足!");
|
|
if (success != 1) throw BusinessRuntimeException.getInstance("您的余额不足!");
|
|
|
orderDon.setBalance(subBalance);
|
|
orderDon.setBalance(subBalance);
|
|
|
userBenefitsService.recordBalanceBySource(user.getId(), BigDecimal.valueOf(-subBalance.longValue()), UserBalanceSourceRecord.Source.payment);
|
|
userBenefitsService.recordBalanceBySource(user.getId(), BigDecimal.valueOf(-subBalance.longValue()), UserBalanceSourceRecord.Source.payment);
|