记得上下班打卡 | git大法好,push需谨慎

Commit 5a77f434 authored by 胡佳晨's avatar 胡佳晨

提交 正在下单用券bug

parent 85e12546
...@@ -513,7 +513,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -513,7 +513,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
} }
if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) { if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) {
restVoucherPrice = restVoucherPrice.subtract(orderSku.getSkuPrice()); restVoucherPrice = restVoucherPrice.subtract(orderSku.getSkuPrice());
orderSku.setPriceVoucher(orderSku.getSkuPrice()); if(restVoucherPrice.compareTo(BigDecimal.ZERO) >= 0) {
orderSku.setPriceVoucher(orderSku.getSkuPrice());
}else{
orderSku.setPriceVoucher(restVoucherPrice);
}
BigDecimal skuPriceActual = orderSku.getSkuPrice().subtract(orderSku.getSkuPrice()); BigDecimal skuPriceActual = orderSku.getSkuPrice().subtract(orderSku.getSkuPrice());
orderSku.setSkuPriceActual(skuPriceActual.compareTo(BigDecimal.ZERO) > 0 ? skuPriceActual : BigDecimal.ZERO); orderSku.setSkuPriceActual(skuPriceActual.compareTo(BigDecimal.ZERO) > 0 ? skuPriceActual : BigDecimal.ZERO);
} else if (restVoucherPrice.compareTo(BigDecimal.ZERO) == 0) { } else if (restVoucherPrice.compareTo(BigDecimal.ZERO) == 0) {
...@@ -532,7 +536,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -532,7 +536,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
} }
if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) { if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) {
restVoucherPrice = restVoucherPrice.subtract(orderSku.getSkuPrice()); restVoucherPrice = restVoucherPrice.subtract(orderSku.getSkuPrice());
orderSku.setPriceVoucher(orderSku.getSkuPrice()); if(restVoucherPrice.compareTo(BigDecimal.ZERO) >= 0) {
orderSku.setPriceVoucher(orderSku.getSkuPrice());
}else{
orderSku.setPriceVoucher(restVoucherPrice);
}
BigDecimal skuPriceActual = orderSku.getSkuPrice().subtract(orderSku.getSkuPrice()); BigDecimal skuPriceActual = orderSku.getSkuPrice().subtract(orderSku.getSkuPrice());
orderSku.setSkuPriceActual(skuPriceActual.compareTo(BigDecimal.ZERO) > 0 ? skuPriceActual : BigDecimal.ZERO); orderSku.setSkuPriceActual(skuPriceActual.compareTo(BigDecimal.ZERO) > 0 ? skuPriceActual : BigDecimal.ZERO);
} else if (restVoucherPrice.compareTo(BigDecimal.ZERO) == 0) { } else if (restVoucherPrice.compareTo(BigDecimal.ZERO) == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment