From 9d39e2cad67e4ca5b1d8a45980dc9749dad3c42d Mon Sep 17 00:00:00 2001 From: eason Date: Fri, 6 Jul 2018 16:02:59 +0800 Subject: [PATCH] fix --- .../bdprize/support/impls/BDPrizeCalculatorDefaultImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/bdprize/support/impls/BDPrizeCalculatorDefaultImpl.java b/src/main/java/au/com/royalpay/payment/manage/bdprize/support/impls/BDPrizeCalculatorDefaultImpl.java index 0ea9da667..cf130a9d3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/bdprize/support/impls/BDPrizeCalculatorDefaultImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/bdprize/support/impls/BDPrizeCalculatorDefaultImpl.java @@ -231,6 +231,9 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator { } private int getKpiPrizeLevel(BigDecimal transactionAmount,BigDecimal kpiAmount){ + if (kpiAmount.equals(BigDecimal.ZERO)){//未设置kpi金额的按照最小完成度来计算 + return 1; + } BigDecimal rate = transactionAmount.divide(kpiAmount,2,BigDecimal.ROUND_HALF_DOWN); if (rate.compareTo(BigDecimal.valueOf(0.5))<0){ return 1;