Showing
1 changed file
with
8 additions
and
2 deletions
@@ -93,12 +93,18 @@ public class BuyerCancelCompensateComputeHandler { | @@ -93,12 +93,18 @@ public class BuyerCancelCompensateComputeHandler { | ||
93 | if (Objects.nonNull(penaltyRule.getPenaltyMinAmount()) && penaltyAmount.compareTo(penaltyRule.getPenaltyMinAmount()) < 0) { | 93 | if (Objects.nonNull(penaltyRule.getPenaltyMinAmount()) && penaltyAmount.compareTo(penaltyRule.getPenaltyMinAmount()) < 0) { |
94 | penaltyAmount = penaltyRule.getPenaltyMinAmount(); | 94 | penaltyAmount = penaltyRule.getPenaltyMinAmount(); |
95 | } | 95 | } |
96 | + if (Objects.nonNull(penaltyRule.getPenaltyMaxAmount()) && penaltyAmount.compareTo(penaltyRule.getPenaltyMaxAmount()) > 0) { | ||
97 | + penaltyAmount = penaltyRule.getPenaltyMaxAmount(); | ||
98 | + } | ||
96 | BigDecimal leftAmount = orderActualAmount.subtract(penaltyAmount); | 99 | BigDecimal leftAmount = orderActualAmount.subtract(penaltyAmount); |
97 | - BuyerPenaltyCalResult bpcr = BuyerPenaltyCalResult.builder().uid(buyerUid).orderCode(orderCode) | 100 | + BuyerPenaltyCalResult bpcr = BuyerPenaltyCalResult.builder() |
101 | + .uid(buyerUid).orderCode(orderCode) | ||
98 | .orderActualAmount(orderActualAmount) | 102 | .orderActualAmount(orderActualAmount) |
99 | .goodsActualAmount(goodsActualAmount) | 103 | .goodsActualAmount(goodsActualAmount) |
100 | .penaltyRate(penaltyRate) | 104 | .penaltyRate(penaltyRate) |
101 | - .penaltyAmount(penaltyAmount).leftAmount(leftAmount).build(); | 105 | + .penaltyAmount(penaltyAmount) |
106 | + .leftAmount(leftAmount) | ||
107 | + .build(); | ||
102 | logger.info("calBuyerPenalty mfee {} BuyerPenaltyCalResult {}", penaltyRule, bpcr); | 108 | logger.info("calBuyerPenalty mfee {} BuyerPenaltyCalResult {}", penaltyRule, bpcr); |
103 | return bpcr; | 109 | return bpcr; |
104 | } | 110 | } |
-
Please register or login to post a comment