From 3c568a7d42b99dffa0c10e55af62e30ebb02834e Mon Sep 17 00:00:00 2001 From: paulGao Date: Wed, 11 Jan 2023 11:32:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=BA=97=E9=93=BA=E5=85=A8=E5=93=81=E7=B1=BB=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E5=92=8C=E5=B9=B3=E5=8F=B0=E5=85=A8=E5=93=81=E7=B1=BB?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E6=B2=A1=E6=9C=89=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../promotion/serviceimpl/PromotionGoodsServiceImpl.java | 3 +-- .../modules/search/serviceimpl/EsGoodsIndexServiceImpl.java | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java index e3e460fa..28aedbdc 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/PromotionGoodsServiceImpl.java @@ -6,7 +6,6 @@ import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import cn.lili.cache.Cache; import cn.lili.common.enums.PromotionTypeEnum; -import cn.lili.common.utils.StringUtils; import cn.lili.common.vo.PageVO; import cn.lili.modules.goods.entity.dos.GoodsSku; import cn.lili.modules.goods.entity.dto.GoodsSkuDTO; @@ -100,7 +99,7 @@ public class PromotionGoodsServiceImpl extends ServiceImpl skuIds = skus.stream().map(GoodsSku::getId).collect(Collectors.toList()); List categoriesPath = new ArrayList<>(); categories.forEach(i -> { - if (StringUtils.isNotEmpty(i)) { + if (CharSequenceUtil.isNotEmpty(i)) { categoriesPath.addAll(Arrays.asList(i.split(","))); } } diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java index de20462d..bda58afb 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java @@ -239,7 +239,8 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements List promotionGoods = skuValidPromotions.stream() .filter(j -> (CharSequenceUtil.isNotEmpty(j.getSkuId()) && j.getSkuId().equals(goodsSku.getId())) || - j.getScopeType().equals(PromotionsScopeTypeEnum.ALL.name()) || + (j.getScopeType().equals(PromotionsScopeTypeEnum.ALL.name()) && j.getStoreId().equals("0")) || + (j.getScopeType().equals(PromotionsScopeTypeEnum.ALL.name()) && j.getStoreId().equals(esGoodsIndex.getStoreId())) || (j.getScopeType().equals(PromotionsScopeTypeEnum.PORTION_GOODS_CATEGORY.name()) && j.getScopeId().contains(goodsSku.getCategoryPath()))) .collect(Collectors.toList()); if (CollUtil.isNotEmpty(promotionGoods)) {