From 55b5710769caa0ee2219727dbbc43d8af0a0ac30 Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 25 Aug 2021 21:32:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=AF=BC=E8=87=B4=E7=9A=84=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E8=BF=90=E7=AE=97=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cart/render/impl/CartPriceRender.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CartPriceRender.java b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CartPriceRender.java index e3b3f59f..d704192d 100644 --- a/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CartPriceRender.java +++ b/framework/src/main/java/cn/lili/modules/order/cart/render/impl/CartPriceRender.java @@ -1,14 +1,11 @@ package cn.lili.modules.order.cart.render.impl; -import cn.lili.modules.goods.service.CategoryService; import cn.lili.modules.order.cart.entity.dto.TradeDTO; import cn.lili.modules.order.cart.entity.enums.RenderStepEnums; import cn.lili.modules.order.cart.entity.vo.CartSkuVO; import cn.lili.modules.order.cart.entity.vo.CartVO; import cn.lili.modules.order.cart.render.CartRenderStep; -import cn.lili.modules.promotion.service.KanjiaActivityGoodsService; -import cn.lili.modules.promotion.service.PointsGoodsService; -import org.springframework.beans.factory.annotation.Autowired; +import cn.lili.modules.order.order.entity.dto.PriceDetailDTO; import org.springframework.stereotype.Service; import java.util.List; @@ -30,9 +27,25 @@ public class CartPriceRender implements CartRenderStep { @Override public void render(TradeDTO tradeDTO) { + //价格过滤 在购物车商品失效时,需要对价格进行初始化操作 + initPriceDTO(tradeDTO); + + //构造cartVO - this.buildCartPrice(tradeDTO); - this.buildTradePrice(tradeDTO); + buildCartPrice(tradeDTO); + buildTradePrice(tradeDTO); + + + } + + /** + * 特殊情况下对购物车金额进行护理 + * + * @param tradeDTO + */ + private void initPriceDTO(TradeDTO tradeDTO) { + tradeDTO.getCartList().forEach(cartVO -> cartVO.setPriceDetailDTO(new PriceDetailDTO())); + tradeDTO.setPriceDetailDTO(new PriceDetailDTO()); } /**