|
|
@@ -270,7 +270,8 @@ public class ProductOrderService {
|
|
|
// 优惠券抵扣:校验并计入优惠金额(orderType=PRODUCT)
|
|
|
Long appliedCouponId = null;
|
|
|
if (dto.getCouponId() != null) {
|
|
|
- Integer couponDiscount = couponService.apply(buyerId, dto.getCouponId(), "PRODUCT", order.getTotalAmount());
|
|
|
+ Integer couponDiscount = couponService.apply(buyerId, dto.getCouponId(), "PRODUCT", order.getTotalAmount(),
|
|
|
+ java.util.Collections.singleton(order.getProductId()));
|
|
|
if (couponDiscount != null && couponDiscount > 0) {
|
|
|
discountAmount += couponDiscount;
|
|
|
appliedCouponId = dto.getCouponId();
|
|
|
@@ -429,7 +430,8 @@ public class ProductOrderService {
|
|
|
int discountAmount = dto.getDiscountAmount() != null ? dto.getDiscountAmount() : 0;
|
|
|
Long appliedCouponId = null;
|
|
|
if (dto.getCouponId() != null) {
|
|
|
- Integer couponDiscount = couponService.apply(buyerId, dto.getCouponId(), "PRODUCT", order.getTotalAmount());
|
|
|
+ Integer couponDiscount = couponService.apply(buyerId, dto.getCouponId(), "PRODUCT", order.getTotalAmount(),
|
|
|
+ java.util.Collections.singleton(order.getProductId()));
|
|
|
if (couponDiscount != null && couponDiscount > 0) {
|
|
|
discountAmount += couponDiscount;
|
|
|
appliedCouponId = dto.getCouponId();
|
|
|
@@ -817,7 +819,8 @@ public class ProductOrderService {
|
|
|
// 优惠券抵扣:校验并计入优惠金额(orderType=PRODUCT)
|
|
|
Long appliedCouponId = null;
|
|
|
if (dto.getCouponId() != null) {
|
|
|
- Integer couponDiscount = couponService.apply(buyerId, dto.getCouponId(), "PRODUCT", totalAmount);
|
|
|
+ Integer couponDiscount = couponService.apply(buyerId, dto.getCouponId(), "PRODUCT", totalAmount,
|
|
|
+ dto.getItems().stream().map(OrderItemVO::getProductId).collect(java.util.stream.Collectors.toSet()));
|
|
|
if (couponDiscount != null && couponDiscount > 0) {
|
|
|
multiDiscountAmount += couponDiscount;
|
|
|
appliedCouponId = dto.getCouponId();
|