修复结算时无促销报错问题

This commit is contained in:
paulGao 2021-12-22 15:34:20 +08:00
parent 7dfffd60b8
commit c5187a63b9

View File

@ -114,6 +114,7 @@ public class CheckDataRender implements CartRenderStep {
cartSkuVO.setErrorMessage("商品库存不足,现有库存数量[" + dataSku.getQuantity() + "]");
}
//移除无效促销活动
if (cartSkuVO.getPromotionMap() != null && !cartSkuVO.getPromotionMap().isEmpty()) {
cartSkuVO.setPromotionMap(cartSkuVO.getPromotionMap().entrySet().stream().filter(i -> {
BasePromotions basePromotions = (BasePromotions) i.getValue();
if (basePromotions.getStartTime() != null && basePromotions.getEndTime() != null) {
@ -123,6 +124,7 @@ public class CheckDataRender implements CartRenderStep {
}).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
}
}
}
/**
* 店铺分组