fix: 促销状态更新和满减活动范围商品判定

This commit is contained in:
misworga831 2023-05-08 18:49:37 +08:00
parent 8181f2602a
commit c286d05ad8
2 changed files with 5 additions and 1 deletions

View File

@ -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<String, Double> 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()) {

View File

@ -112,9 +112,9 @@ public abstract class AbstractPromotionsServiceImpl<M extends BaseMapper<T>, T e
List<T> promotionsList = this.list(new QueryWrapper<T>().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);