...
|
...
|
@@ -132,7 +132,20 @@ public class PromotionPriceService { |
|
|
isPromotionPriceActive = true;
|
|
|
}
|
|
|
if ("Degressdiscount".equals(promotionTag.get("type"))) {
|
|
|
currentSalesPrice = countDegressdiscountPrice(actionParamJson, currentSalesPrice);
|
|
|
if (actionParamJson.get("degress_discount_list") == null||salesPrice==null) {
|
|
|
continue;
|
|
|
}
|
|
|
String degressDiscountList = actionParamJson.get("degress_discount_list").toString();
|
|
|
String[] degress = degressDiscountList.split(";");
|
|
|
if (degress[0] == null) {
|
|
|
continue;
|
|
|
}
|
|
|
String[] one = degress[0].split(":");
|
|
|
if (one[1] == null || Double.valueOf(one[1]) == 1) {
|
|
|
continue;
|
|
|
}
|
|
|
Double discount = Double.valueOf(one[1]);
|
|
|
currentSalesPrice = salesPrice * discount;
|
|
|
if (currentSalesPrice != null) {
|
|
|
isPromotionPriceActive = true;
|
|
|
}
|
...
|
...
|
@@ -193,26 +206,6 @@ public class PromotionPriceService { |
|
|
}
|
|
|
|
|
|
|
|
|
private Double countDegressdiscountPrice(JSONObject actionParamJson, Double salesPrice) {
|
|
|
Double tempPrice = null;
|
|
|
if (actionParamJson.get("degress_discount_list") == null||salesPrice==null) {
|
|
|
return tempPrice;
|
|
|
}
|
|
|
String degressDiscountList = actionParamJson.get("degress_discount_list").toString();
|
|
|
String[] degress = degressDiscountList.split(";");
|
|
|
if (degress[0] == null) {
|
|
|
return tempPrice;
|
|
|
}
|
|
|
String[] one = degress[0].split(":");
|
|
|
if (one[1] == null || Double.valueOf(one[1]) == 1) {
|
|
|
return tempPrice;
|
|
|
}
|
|
|
|
|
|
Double discount = Double.valueOf(one[1]);
|
|
|
tempPrice = salesPrice * discount;
|
|
|
return tempPrice;
|
|
|
}
|
|
|
|
|
|
private static Integer getIntCeilPrice(Double price) {
|
|
|
return Double.valueOf(Math.ceil(price)).intValue();
|
|
|
}
|
...
|
...
|
|