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