|
|
|
@ -121,7 +121,7 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { |
|
|
|
|
// 优惠比例 / 100 = 最终优惠比例
|
|
|
|
|
tradeOrder.setStoreDiscountSatisfy(true); |
|
|
|
|
BigDecimal priceRate = tradeOrder.getStoreDiscountPrice().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); |
|
|
|
|
tradeOrder.setStoreDiscountActualPrice(tradeOrder.getTradeActualAmount().multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP)); |
|
|
|
|
tradeOrder.setStoreDiscountActualPrice(tradeOrder.getTradeActualAmount().subtract(tradeOrder.getTradeActualAmount().multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP))); |
|
|
|
|
tradeOrder.setTradeActualAmount(tradeOrder.getTradeActualAmount().subtract(tradeOrder.getStoreDiscountActualPrice())); |
|
|
|
|
} else { |
|
|
|
|
tradeOrder.setStoreDiscountSatisfy(true); |
|
|
|
@ -146,8 +146,8 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { |
|
|
|
|
|
|
|
|
|
} else if (userDiscount.getDiscountType().equals(UserDiscountTypeEnum.type3.getNumber())) { |
|
|
|
|
// 优惠比例 / 100 = 最终优惠比例
|
|
|
|
|
BigDecimal priceRate = tradeOrder.getUserDiscountPrice().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); |
|
|
|
|
tradeOrder.setUserDiscountActualPrice(tradeOrder.getTradeActualAmount().multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP)); |
|
|
|
|
BigDecimal priceRate = tradeOrder.getUserDiscountPrice().setScale(2, BigDecimal.ROUND_DOWN); |
|
|
|
|
tradeOrder.setUserDiscountActualPrice(tradeOrder.getTradeActualAmount().subtract(tradeOrder.getTradeActualAmount().multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP))); |
|
|
|
|
tradeOrder.setTradeActualAmount(tradeOrder.getTradeActualAmount().subtract(tradeOrder.getUserDiscountActualPrice())); |
|
|
|
|
} else { |
|
|
|
|
tradeOrder.setUserDiscountActualPrice(userDiscount.getDiscountPrice()); |
|
|
|
|