Commit ffe7f0e9 by xiaoer.li

fix:多选

parent e4943e27
...@@ -236,13 +236,13 @@ public class AdditionSharingService { ...@@ -236,13 +236,13 @@ public class AdditionSharingService {
if (discountResult == null || CollectionUtils.isEmpty(discountResult.getGoods()) || premiumExchangeActivity == null || CollectionUtils.isEmpty(premiumExchangeActivity.getProducts())) { if (discountResult == null || CollectionUtils.isEmpty(discountResult.getGoods()) || premiumExchangeActivity == null || CollectionUtils.isEmpty(premiumExchangeActivity.getProducts())) {
return; return;
} }
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods hgGood = discountResult.getGoods() List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> manyHgs = discountResult.getGoods()
.stream() .stream()
.filter(d -> CalculationGoodsType.TYPE_2.getType().equals(d.getCartGoodType())) .filter(d -> CalculationGoodsType.TYPE_2.getType().equals(d.getCartGoodType()))
.findFirst() .collect(Collectors.toList());
.orElse(null);
if (hgGood == null) { if (CollectionUtils.isEmpty(manyHgs)) {
throw new ServiceException(ResponseResult.PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST); throw new ServiceException(ResponseResult.PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST);
} }
...@@ -265,6 +265,10 @@ public class AdditionSharingService { ...@@ -265,6 +265,10 @@ public class AdditionSharingService {
if (null == getProductsVo) { if (null == getProductsVo) {
continue; continue;
} }
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods hgGood = manyHgs.stream().filter(d -> goodsId.equals(d.getGoodsId())).findFirst().orElse(null);
if (hgGood==null) {
continue;
}
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = this.getCartGoodsDetailDto(product, getProductsVo, goodsId, hgGood); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = this.getCartGoodsDetailDto(product, getProductsVo, goodsId, hgGood);
shoppingCartGoodsDto.getProducts().add(cartGoodsDetailDto); shoppingCartGoodsDto.getProducts().add(cartGoodsDetailDto);
//2.计算优惠价格 //2.计算优惠价格
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment