...
|
...
|
@@ -17,8 +17,7 @@ public class VipPriceLogicService { |
|
|
* 设置计划的vip价格
|
|
|
*/
|
|
|
public void fillProductPricePlanVipPrice(ProductPricePlan p) {
|
|
|
VipPriceBO vipPriceBO = this.getVipPriceBO(p.getCurrentSaleprice(), p.getVipDiscountType(), p.getVipPrice(), p.getVip1Price(), p.getVip2Price(), p.getVip3Price(),
|
|
|
p.getVipDiscount());
|
|
|
VipPriceBO vipPriceBO = this.getVipPriceBO(p.getCurrentSaleprice(), p.getVipDiscountType(),p.getVipDiscount());
|
|
|
p.setVip1Price(vipPriceBO.getVip1PriceBigDecimal());
|
|
|
p.setVip2Price(vipPriceBO.getVip2PriceBigDecimal());
|
|
|
p.setVip3Price(vipPriceBO.getVip3PriceBigDecimal());
|
...
|
...
|
@@ -32,8 +31,7 @@ public class VipPriceLogicService { |
|
|
* salesPrice等于productPrice表的currentPrice,
|
|
|
* type是productPrice表的currentVipDiscountType
|
|
|
*/
|
|
|
VipPriceBO vipPriceBO = this.getVipPriceBO(productPriceBO.getSalesPrice(), productPriceBO.getVipDiscountType(), productPriceBO.getVipPrice(),
|
|
|
productPriceBO.getVip1Price(), productPriceBO.getVip2Price(), productPriceBO.getVip3Price(), productPriceBO.getVipDiscount());
|
|
|
VipPriceBO vipPriceBO = this.getVipPriceBO(productPriceBO.getSalesPrice(), productPriceBO.getVipDiscountType(), productPriceBO.getVipDiscount());
|
|
|
productPriceBO.setVip1Price(vipPriceBO.getVip1PriceBigDecimal());
|
|
|
productPriceBO.setVip2Price(vipPriceBO.getVip2PriceBigDecimal());
|
|
|
productPriceBO.setVip3Price(vipPriceBO.getVip3PriceBigDecimal());
|
...
|
...
|
@@ -56,8 +54,7 @@ public class VipPriceLogicService { |
|
|
|
|
|
}
|
|
|
|
|
|
private VipPriceBO getVipPriceBO(BigDecimal currentSalesPrice, Integer currentVipDiscountType, BigDecimal vipPrice, BigDecimal vip1Price, BigDecimal vip2Price,
|
|
|
BigDecimal vip3Price, BigDecimal vipDiscount) {
|
|
|
private VipPriceBO getVipPriceBO(BigDecimal currentSalesPrice, Integer currentVipDiscountType, BigDecimal vipDiscount) {
|
|
|
double salesPriceDoubleCeil = Math.ceil(this.getDoubleFromBigDecimal(currentSalesPrice));
|
|
|
// 默认取销售价
|
|
|
double vip1PriceResult = salesPriceDoubleCeil;
|
...
|
...
|
@@ -86,15 +83,10 @@ public class VipPriceLogicService { |
|
|
vip2PriceResult = Double.valueOf(String.format("%.2f", salesPriceDoubleCeil));
|
|
|
vip3PriceResult = Double.valueOf(String.format("%.2f", salesPriceDoubleCeil));
|
|
|
break;
|
|
|
case 4:
|
|
|
vip1PriceResult = this.getDoubleFromBigDecimal(vipPrice);
|
|
|
vip2PriceResult = vip1PriceResult;
|
|
|
vip3PriceResult = vip1PriceResult;
|
|
|
break;
|
|
|
case 5:
|
|
|
vip1PriceResult = this.getDoubleFromBigDecimal(vip1Price);
|
|
|
vip2PriceResult = this.getDoubleFromBigDecimal(vip2Price);
|
|
|
vip3PriceResult = this.getDoubleFromBigDecimal(vip3Price);
|
|
|
default:
|
|
|
vip1PriceResult = Double.valueOf(String.format("%.2f", salesPriceDoubleCeil));
|
|
|
vip2PriceResult = Double.valueOf(String.format("%.2f", salesPriceDoubleCeil));
|
|
|
vip3PriceResult = Double.valueOf(String.format("%.2f", salesPriceDoubleCeil));
|
|
|
break;
|
|
|
}
|
|
|
return new VipPriceBO(vip1PriceResult, vip2PriceResult, vip3PriceResult);
|
...
|
...
|
|