From 8ae15209bab20023f2ccf283fe728c343cc7a8e9 Mon Sep 17 00:00:00 2001 From: hu177768073 <177768073@qq.com> Date: Fri, 13 Sep 2024 15:18:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=9C=8D=E5=8A=A1=E8=B4=B9?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/BsGasOrderController.java | 2 ++ .../hfkj/model/order/ExportGasOrderModel.java | 4 ++++ .../service/gas/impl/BsGasServiceImpl.java | 19 ++++++++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) 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;