|
@@ -840,7 +840,8 @@ DISCOUNT("畅学卡")
|
|
|
}
|
|
|
// 判断满减
|
|
|
if (couponInfo.getUseLimit() != null && amount.compareTo(BigDecimal
|
|
|
- .valueOf(couponInfo.getUseLimit()).setScale(2, BigDecimal.ROUND_HALF_UP)) < 0) {
|
|
|
+ .valueOf(couponInfo.getUseLimit()).setScale(2, BigDecimal.ROUND_HALF_UP)) < 0
|
|
|
+ && !couponAmountMap.isEmpty()) {
|
|
|
throw new BizException("优惠券不可用");
|
|
|
}
|
|
|
|
|
@@ -870,7 +871,7 @@ DISCOUNT("畅学卡")
|
|
|
userOrderDetail.setActualPrice(actualPrice.subtract(couponAmount));
|
|
|
}
|
|
|
if (remainAmount.compareTo(BigDecimal.ZERO) > 0&& amount.compareTo(BigDecimal.ZERO) >0) {
|
|
|
- UserOrderDetail userOrderDetail = goodsInfos.get(0).getUserOrderDetail();
|
|
|
+ UserOrderDetail userOrderDetail = goodsInfos.get(couponAmountMap.keySet().stream().findFirst().get()).getUserOrderDetail();
|
|
|
userOrderDetail.setActualPrice(userOrderDetail.getActualPrice().subtract(remainAmount));
|
|
|
|
|
|
userOrderDetail.setDiscountJson(userOrderService.discountJson(EDiscountType.COUPON,
|