diff --git a/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java b/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java index c14b727..b7e7cc6 100644 --- a/bweb/src/main/java/com/bweb/controller/BsGasOrderController.java +++ b/bweb/src/main/java/com/bweb/controller/BsGasOrderController.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"); diff --git a/service/src/main/java/com/hfkj/model/order/ExportGasOrderModel.java b/service/src/main/java/com/hfkj/model/order/ExportGasOrderModel.java index d0a042f..301158d 100644 --- a/service/src/main/java/com/hfkj/model/order/ExportGasOrderModel.java +++ b/service/src/main/java/com/hfkj/model/order/ExportGasOrderModel.java @@ -92,6 +92,10 @@ public class ExportGasOrderModel { @ExcelProperty({ "支付信息", "加油优惠"}) private BigDecimal deductionOilPrice; + @ColumnWidth(15) + @ExcelProperty({ "支付信息", "服务费"}) + private BigDecimal serviceFeePrice; + @ColumnWidth(15) @ExcelProperty({ "支付信息", "应付金额"}) private BigDecimal payablePrice; diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java index 81f1747..826320a 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java @@ -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;