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

Commit 17fa5a18 authored by 胡佳晨's avatar 胡佳晨

修改 下单逻辑

parent 54359c8b
...@@ -503,12 +503,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -503,12 +503,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
if (item.getStoreOrder().getPriceVoucher().compareTo(BigDecimal.ZERO) > 0) { if (item.getStoreOrder().getPriceVoucher().compareTo(BigDecimal.ZERO) > 0) {
if (preParam.getStoreSpuIds().size() > 0 || preParam.getPlatformSpuIds().size() > 0) {//指定范围商品券 if (preParam.getStoreSpuIds().size() > 0 || preParam.getPlatformSpuIds().size() > 0) {//指定范围商品券
if (preParam.getStoreSpuIds().contains(orderSku.getSpuId()) || preParam.getPlatformSpuIds().contains(orderSku.getSpuId())) { if (preParam.getStoreSpuIds().contains(orderSku.getSpuId()) || preParam.getPlatformSpuIds().contains(orderSku.getSpuId())) {
if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) { if (restVoucherPrice.compareTo(BigDecimal.ZERO) <= 0) {
restVoucherPrice = restVoucherPrice.subtract(orderSku.getSkuPrice());
} else {
restVoucherPrice = BigDecimal.ZERO; restVoucherPrice = BigDecimal.ZERO;
} }
if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) { if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) {
restVoucherPrice = restVoucherPrice.subtract(orderSku.getSkuPrice());
orderSku.setPriceVoucher(orderSku.getSkuPrice()); orderSku.setPriceVoucher(orderSku.getSkuPrice());
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);
...@@ -523,12 +522,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -523,12 +522,11 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
} }
} }
} else {//全部商品券 } else {//全部商品券
if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) { if (restVoucherPrice.compareTo(BigDecimal.ZERO) <= 0) {
restVoucherPrice = restVoucherPrice.subtract(orderSku.getSkuPrice());
} else {
restVoucherPrice = BigDecimal.ZERO; restVoucherPrice = BigDecimal.ZERO;
} }
if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) { if (restVoucherPrice.compareTo(BigDecimal.ZERO) > 0) {
restVoucherPrice = restVoucherPrice.subtract(orderSku.getSkuPrice());
orderSku.setPriceVoucher(orderSku.getSkuPrice()); orderSku.setPriceVoucher(orderSku.getSkuPrice());
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);
......
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