fix: 促销状态更新和满减活动范围商品判定
This commit is contained in:
parent
8181f2602a
commit
c286d05ad8
@ -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.DiscountPriceItem;
|
||||||
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
||||||
import cn.lili.modules.promotion.entity.dos.FullDiscount;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -70,6 +71,9 @@ public class FullDiscountRender implements CartRenderStep {
|
|||||||
cart.setFullDiscount(fullDiscountVO);
|
cart.setFullDiscount(fullDiscountVO);
|
||||||
Map<String, Double> skuPriceDetail = new HashMap<>(16);
|
Map<String, Double> skuPriceDetail = new HashMap<>(16);
|
||||||
for (CartSkuVO cartSkuVO : cart.getSkuList()) {
|
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());
|
skuPriceDetail.put(cartSkuVO.getGoodsSku().getId(), cartSkuVO.getPriceDetailDTO().getGoodsPrice());
|
||||||
}
|
}
|
||||||
if (!skuPriceDetail.isEmpty()) {
|
if (!skuPriceDetail.isEmpty()) {
|
||||||
|
@ -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));
|
List<T> promotionsList = this.list(new QueryWrapper<T>().in("id", ids));
|
||||||
for (T t : promotionsList) {
|
for (T t : promotionsList) {
|
||||||
if (startTime != null && endTime != null) {
|
if (startTime != null && endTime != null) {
|
||||||
this.checkPromotions(t);
|
|
||||||
t.setStartTime(new Date(startTime));
|
t.setStartTime(new Date(startTime));
|
||||||
t.setEndTime(new Date(endTime));
|
t.setEndTime(new Date(endTime));
|
||||||
|
this.checkPromotions(t);
|
||||||
} else {
|
} else {
|
||||||
t.setStartTime(null);
|
t.setStartTime(null);
|
||||||
t.setEndTime(null);
|
t.setEndTime(null);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user