fix[litemall-wx-api]: 下单时存在传递不合适的优惠券的情况,此时后端自动选择合适的优惠券。

This commit is contained in:
Junling Bu
2019-04-16 17:40:43 +08:00
parent 74396eb763
commit b252cf2b5b

View File

@@ -466,11 +466,14 @@ public class WxCartController {
}
else {
LitemallCoupon coupon = couponVerifyService.checkCoupon(userId, couponId, checkedGoodsPrice);
// 用户选择的优惠券有问题
// 用户选择的优惠券有问题,则选择合适优惠券,否则使用用户选择的优惠券
if(coupon == null){
return ResponseUtil.badArgumentValue();
couponPrice = tmpCouponPrice;
couponId = tmpCouponId;
}
else {
couponPrice = coupon.getDiscount();
}
couponPrice = coupon.getDiscount();
}
// 根据订单商品总价计算运费满88则免运费否则8元