Commit 09ce4e33 by 吕明尚

实际支付金额增加判断

parent a5778d82
......@@ -1057,7 +1057,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
throw new BaseException("总金额小于优惠券最小使用金额");
}
priceResponse.setCouponFee(consumerCoupon.getSubPrice());
priceResponse.setPayFee(priceResponse.getTotalFee().subtract(consumerCoupon.getSubPrice()));
BigDecimal subtract = priceResponse.getTotalFee().subtract(consumerCoupon.getSubPrice());
//判断是否为负数
if (subtract.compareTo(BigDecimal.ZERO) < 0) {
priceResponse.setPayFee(BigDecimal.ZERO);
} else {
priceResponse.setPayFee(subtract);
}
break;
case DURATION://TODO 时长券
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment