From 8f3ca8c28d401ec0f2d0d1acad7048a27eb9aec5 Mon Sep 17 00:00:00 2001 From: paulGao Date: Tue, 7 Jun 2022 12:30:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E5=87=BA=E7=8E=B0=E7=9A=84=E8=8E=B7=E5=8F=96=E4=BF=83?= =?UTF-8?q?=E9=94=80=E4=BF=A1=E6=81=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/lili/modules/promotion/tools/PromotionTools.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/promotion/tools/PromotionTools.java b/framework/src/main/java/cn/lili/modules/promotion/tools/PromotionTools.java index 44aa15e9..b0aa1544 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/tools/PromotionTools.java +++ b/framework/src/main/java/cn/lili/modules/promotion/tools/PromotionTools.java @@ -1,5 +1,6 @@ package cn.lili.modules.promotion.tools; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.text.CharSequenceUtil; @@ -159,7 +160,7 @@ public class PromotionTools { } public static Map filterInvalidPromotionsMap(Map map) { - if (map == null) { + if (CollUtil.isEmpty(map)) { return new HashMap<>(); } //移除无效促销活动 @@ -173,7 +174,7 @@ public class PromotionTools { } return true; - }).collect(Collectors.toMap(stringObjectEntry -> stringObjectEntry != null ? stringObjectEntry.getKey() : null, stringObjectEntry1 -> stringObjectEntry1 != null ? stringObjectEntry1.getValue() : new BasePromotions())); + }).collect(Collectors.toMap(stringObjectEntry -> stringObjectEntry != null ? stringObjectEntry.getKey() : null, stringObjectEntry1 -> stringObjectEntry1 != null ? stringObjectEntry1.getValue() : new BasePromotions(), (oldValue, newValue) -> newValue)); } }