完成服务费功能

master
胡锐 2 months ago
parent 31615080a6
commit 8ae15209ba
  1. 2
      bweb/src/main/java/com/bweb/controller/BsGasOrderController.java
  2. 4
      service/src/main/java/com/hfkj/model/order/ExportGasOrderModel.java
  3. 19
      service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java

@ -305,6 +305,7 @@ public class BsGasOrderController {
model.setTotalDeductionPrice(gasOrder.getTotalDeductionPrice());
model.setDeductionCouponPrice(gasOrder.getDeductionCouponPrice());
model.setDeductionOilPrice(gasOrder.getDeductionOilPrice());
model.setServiceFeePrice(gasOrder.getGasServiceFeePrice());
model.setPayablePrice(gasOrder.getPayablePrice());
model.setPayIntegral(gasOrder.getPayIntegral()==null?new BigDecimal("0"):new BigDecimal(""+gasOrder.getPayIntegral()).divide(new BigDecimal("100")));
model.setPayPrice(gasOrder.getActualPayPrice()!=null?gasOrder.getActualPayPrice().toString():"未支付");
@ -339,6 +340,7 @@ public class BsGasOrderController {
includeColumnFiledNames.add("totalDeductionPrice");
includeColumnFiledNames.add("deductionCouponPrice");
includeColumnFiledNames.add("deductionOilPrice");
includeColumnFiledNames.add("serviceFeePrice");
includeColumnFiledNames.add("payablePrice");
includeColumnFiledNames.add("payIntegral");
includeColumnFiledNames.add("payPrice");

@ -92,6 +92,10 @@ public class ExportGasOrderModel {
@ExcelProperty({ "支付信息", "加油优惠"})
private BigDecimal deductionOilPrice;
@ColumnWidth(15)
@ExcelProperty({ "支付信息", "服务费"})
private BigDecimal serviceFeePrice;
@ColumnWidth(15)
@ExcelProperty({ "支付信息", "应付金额"})
private BigDecimal payablePrice;

@ -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;

Loading…
Cancel
Save