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