From c286d05ad8a1a1adece4654beab48e14c1e562c8 Mon Sep 17 00:00:00 2001 From: misworga831 Date: Mon, 8 May 2023 18:49:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=83=E9=94=80=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=92=8C=E6=BB=A1=E5=87=8F=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E5=95=86=E5=93=81=E5=88=A4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/order/cart/render/impl/FullDiscountRender.java | 4 ++++ .../promotion/serviceimpl/AbstractPromotionsServiceImpl.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/FullDiscountRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/FullDiscountRender.java index 24618c4b..270caba9 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/FullDiscountRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/FullDiscountRender.java @@ -16,6 +16,7 @@ import cn.lili.modules.order.cart.render.util.PromotionPriceUtil; import cn.lili.modules.order.order.entity.dto.DiscountPriceItem; import cn.lili.modules.order.order.entity.dto.PriceDetailDTO; import cn.lili.modules.promotion.entity.dos.FullDiscount; +import cn.lili.modules.promotion.entity.enums.PromotionsScopeTypeEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -70,6 +71,9 @@ public class FullDiscountRender implements CartRenderStep { cart.setFullDiscount(fullDiscountVO); Map skuPriceDetail = new HashMap<>(16); for (CartSkuVO cartSkuVO : cart.getSkuList()) { + if (PromotionsScopeTypeEnum.PORTION_GOODS.name().equals(fullDiscountVO.getScopeType()) && fullDiscountVO.getScopeId() != null && !fullDiscountVO.getScopeId().contains(cartSkuVO.getGoodsSku().getId())) { + continue; + } skuPriceDetail.put(cartSkuVO.getGoodsSku().getId(), cartSkuVO.getPriceDetailDTO().getGoodsPrice()); } if (!skuPriceDetail.isEmpty()) { diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/AbstractPromotionsServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/AbstractPromotionsServiceImpl.java index 3a16eb86..a92abfb5 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/AbstractPromotionsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/AbstractPromotionsServiceImpl.java @@ -112,9 +112,9 @@ public abstract class AbstractPromotionsServiceImpl, T e List promotionsList = this.list(new QueryWrapper().in("id", ids)); for (T t : promotionsList) { if (startTime != null && endTime != null) { - this.checkPromotions(t); t.setStartTime(new Date(startTime)); t.setEndTime(new Date(endTime)); + this.checkPromotions(t); } else { t.setStartTime(null); t.setEndTime(null);