...
|
...
|
@@ -93,12 +93,18 @@ public class BuyerCancelCompensateComputeHandler { |
|
|
if (Objects.nonNull(penaltyRule.getPenaltyMinAmount()) && penaltyAmount.compareTo(penaltyRule.getPenaltyMinAmount()) < 0) {
|
|
|
penaltyAmount = penaltyRule.getPenaltyMinAmount();
|
|
|
}
|
|
|
if (Objects.nonNull(penaltyRule.getPenaltyMaxAmount()) && penaltyAmount.compareTo(penaltyRule.getPenaltyMaxAmount()) > 0) {
|
|
|
penaltyAmount = penaltyRule.getPenaltyMaxAmount();
|
|
|
}
|
|
|
BigDecimal leftAmount = orderActualAmount.subtract(penaltyAmount);
|
|
|
BuyerPenaltyCalResult bpcr = BuyerPenaltyCalResult.builder().uid(buyerUid).orderCode(orderCode)
|
|
|
BuyerPenaltyCalResult bpcr = BuyerPenaltyCalResult.builder()
|
|
|
.uid(buyerUid).orderCode(orderCode)
|
|
|
.orderActualAmount(orderActualAmount)
|
|
|
.goodsActualAmount(goodsActualAmount)
|
|
|
.penaltyRate(penaltyRate)
|
|
|
.penaltyAmount(penaltyAmount).leftAmount(leftAmount).build();
|
|
|
.penaltyAmount(penaltyAmount)
|
|
|
.leftAmount(leftAmount)
|
|
|
.build();
|
|
|
logger.info("calBuyerPenalty mfee {} BuyerPenaltyCalResult {}", penaltyRule, bpcr);
|
|
|
return bpcr;
|
|
|
}
|
...
|
...
|
|