|
|
@@ -2691,10 +2691,10 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
//存在余额
|
|
|
deductBalancePayOrderMoney(orderDon, balance, user);
|
|
|
//存在银河币
|
|
|
- deductGalaxyCoinPayOrderMoney(orderDon, sku, galaxyCoin, user);
|
|
|
+ deductGalaxyCoinPayOrderMoney(orderDon, sku.getPrice(), galaxyCoin, user);
|
|
|
}
|
|
|
|
|
|
- public void deductGalaxyCoinPayOrderMoney(OrderDon orderDon, GoodsDonSku sku, BigDecimal toUseGalaxyCoin, User user) {
|
|
|
+ public void deductGalaxyCoinPayOrderMoney(OrderDon orderDon, BigDecimal renewSkuDiscountPrice, BigDecimal toUseGalaxyCoin, User user) {
|
|
|
//存在银河币
|
|
|
if (toUseGalaxyCoin != null && toUseGalaxyCoin.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
BigDecimal userGalaxyCoin = user.getGalaxyCoin();
|
|
|
@@ -2724,7 +2724,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
//此次使用抵扣金额
|
|
|
BigDecimal thisDeductMoney = toUseGalaxyCoin.multiply(deductMoneyEachCoin);
|
|
|
//该笔平台最高可抵扣金额
|
|
|
- BigDecimal maxDeductMoney = sku.getPrice().multiply(galaxyCoinPayConfigDto.getMaxRate());
|
|
|
+ BigDecimal maxDeductMoney = renewSkuDiscountPrice.multiply(galaxyCoinPayConfigDto.getMaxRate());
|
|
|
if (thisDeductMoney.compareTo(maxDeductMoney) > 0) {
|
|
|
thisDeductMoney = maxDeductMoney;
|
|
|
}
|
|
|
@@ -4393,7 +4393,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
//存在余额
|
|
|
deductBalancePayOrderMoney(orderDon, payRequest.getBalance(), user);
|
|
|
//存在银河币
|
|
|
- deductGalaxyCoinPayOrderMoney(orderDon, renewSku, payRequest.getGalaxyCoin(), user);
|
|
|
+ deductGalaxyCoinPayOrderMoney(orderDon, discountPrice, payRequest.getGalaxyCoin(), user);
|
|
|
|
|
|
orderDonMapper.insert(orderDon);
|
|
|
//记录续费升级的规格
|
|
|
@@ -4498,6 +4498,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
//续费订单
|
|
|
orderDon.setOrderType(2);
|
|
|
}
|
|
|
+ //订单实际支付金额
|
|
|
+ BigDecimal orderDonMoney = orderDon.getMoney();
|
|
|
if (orderDon.getMoney().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
throw BusinessRuntimeException.getInstance("订单金额错误");
|
|
|
}
|
|
|
@@ -4532,6 +4534,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
orderDon.setPayDesc(goodsDon.getPayDesc());
|
|
|
//设置订单支付商品信息
|
|
|
setOrderDonPayTile(null, null, null, orderDon, goodsDon, sku, null);
|
|
|
+ //存在银河币
|
|
|
+ deductGalaxyCoinPayOrderMoney(orderDon, orderDonMoney, orderPayRequest.getGalaxyCoin(), user);
|
|
|
this.saveOrUpdate(orderDon);
|
|
|
if (orderDon.getStatus() == OrderDon.Status.noPayment) {
|
|
|
jobManager.addJob(EXPIRY_TIME, () -> {
|