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

Commit 34c9eed3 authored by 胡佳晨's avatar 胡佳晨

使用平台券

parent 386ebf32
...@@ -118,6 +118,9 @@ public class GoblinOrderUtils { ...@@ -118,6 +118,9 @@ public class GoblinOrderUtils {
voucher = voucher.add(value); voucher = voucher.add(value);
break; break;
case 2://满减 case 2://满减
if (targetList.size() == 0) {
targetPrice = totalPrice;
} else {
for (String targetId : targetList) { for (String targetId : targetList) {
for (GoblinOrderSku skuOrderVo : goblinOrderSkuList) { for (GoblinOrderSku skuOrderVo : goblinOrderSkuList) {
if (targetId.equals(skuOrderVo.getSpuId())) { if (targetId.equals(skuOrderVo.getSpuId())) {
...@@ -125,6 +128,7 @@ public class GoblinOrderUtils { ...@@ -125,6 +128,7 @@ public class GoblinOrderUtils {
} }
} }
} }
}
if (fullValue.compareTo(targetPrice) >= 0) { if (fullValue.compareTo(targetPrice) >= 0) {
voucher = voucher.add(value); voucher = voucher.add(value);
} else { } else {
...@@ -138,6 +142,9 @@ public class GoblinOrderUtils { ...@@ -138,6 +142,9 @@ public class GoblinOrderUtils {
voucher = voucher.add(totalPrice); voucher = voucher.add(totalPrice);
break; break;
case 4://折扣 case 4://折扣
if (targetList.size() == 0) {
targetPrice = totalPrice;
} else {
for (String targetId : targetList) { for (String targetId : targetList) {
for (GoblinOrderSku skuOrderVo : goblinOrderSkuList) { for (GoblinOrderSku skuOrderVo : goblinOrderSkuList) {
if (targetId.equals(skuOrderVo.getSpuId())) { if (targetId.equals(skuOrderVo.getSpuId())) {
...@@ -145,6 +152,7 @@ public class GoblinOrderUtils { ...@@ -145,6 +152,7 @@ public class GoblinOrderUtils {
} }
} }
} }
}
voucher = totalPrice.subtract(targetPrice.multiply(value)); voucher = totalPrice.subtract(targetPrice.multiply(value));
break; break;
default: default:
......
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