|
|
|
@ -180,19 +180,24 @@ public class BsGasServiceImpl implements BsGasService { |
|
|
|
|
// 每升优惠 国标价 - 优惠价格
|
|
|
|
|
payPriceModel.setLitersPreferences(payPriceModel.getPriceGun().subtract(payPriceModel.getPricePreferences())); |
|
|
|
|
|
|
|
|
|
// 加油优惠
|
|
|
|
|
payPriceModel.setDeductionOilPrice(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_HALF_UP)); |
|
|
|
|
|
|
|
|
|
// 服务费费率
|
|
|
|
|
payPriceModel.setServiceFeeRate(serviceFeeRate); |
|
|
|
|
|
|
|
|
|
// 服务费金额
|
|
|
|
|
payPriceModel.setServiceFeePrice(payPriceModel.getOilingPrice().multiply(serviceFeeRate.divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP)); |
|
|
|
|
// 总优惠 = 优惠券 + 加油优惠
|
|
|
|
|
BigDecimal totalPreferences = payPriceModel.getDeductionCouponPrice().add(payPriceModel.getDeductionOilPrice()); |
|
|
|
|
|
|
|
|
|
// 加油优惠
|
|
|
|
|
payPriceModel.setDeductionOilPrice(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_HALF_UP)); |
|
|
|
|
// 服务费金额【总优惠 * 服务费费率】
|
|
|
|
|
//payPriceModel.setServiceFeePrice(totalPreferences.multiply(serviceFeeRate.divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
|
|
// 服务费金额【加油金额 * 服务费费率】
|
|
|
|
|
payPriceModel.setServiceFeePrice(payPriceModel.getOilingPrice().multiply(serviceFeeRate.divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP)); |
|
|
|
|
|
|
|
|
|
// 本次优惠 优惠卷 + 加油优惠 - 服务费
|
|
|
|
|
payPriceModel.setTotalPreferences(payPriceModel.getDeductionCouponPrice().add(payPriceModel.getDeductionOilPrice()).subtract(payPriceModel.getServiceFeePrice())); |
|
|
|
|
// 本次优惠 总优惠 - 服务费
|
|
|
|
|
payPriceModel.setTotalPreferences(totalPreferences.subtract(payPriceModel.getServiceFeePrice())); |
|
|
|
|
|
|
|
|
|
// 支付价格 加油金额 - 本次优惠 + 服务费
|
|
|
|
|
// 支付价格 加油金额 - 本次优惠
|
|
|
|
|
payPriceModel.setPayPrice(refuelPrice.subtract(payPriceModel.getTotalPreferences())); |
|
|
|
|
|
|
|
|
|
return payPriceModel; |
|
|
|
|