From 73163e31f2eb19dedc7d5a4fe63cd05a99939fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A2=A8=E5=A4=A7=E5=8F=94?= <494979559@qq.com> Date: Mon, 19 Aug 2024 17:25:09 +0800 Subject: [PATCH] =?UTF-8?q?debug=EF=BC=9A=E6=B8=A0=E9=81=93=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/ss/payBill/service/impl/PayBillConverterImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/payBill/service/impl/PayBillConverterImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/payBill/service/impl/PayBillConverterImpl.java index c1481db6..a7b207fc 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/payBill/service/impl/PayBillConverterImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/payBill/service/impl/PayBillConverterImpl.java @@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; /** * @author wjh @@ -68,11 +69,14 @@ public class PayBillConverterImpl implements PayBillConverter { return po; } + /** + * 计算渠道成本 + */ private BigDecimal calcChannelCost(ChannelVO channel, BigDecimal amount) { if (channel == null || amount == null) { return null; } - return channel.getCostRate().multiply(amount); + return channel.getCostRate().multiply(amount).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); } @Override