Commit ffe7f0e9 by xiaoer.li

fix:多选

parent e4943e27
......@@ -236,13 +236,13 @@ public class AdditionSharingService {
if (discountResult == null || CollectionUtils.isEmpty(discountResult.getGoods()) || premiumExchangeActivity == null || CollectionUtils.isEmpty(premiumExchangeActivity.getProducts())) {
return;
}
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods hgGood = discountResult.getGoods()
List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> manyHgs = discountResult.getGoods()
.stream()
.filter(d -> CalculationGoodsType.TYPE_2.getType().equals(d.getCartGoodType()))
.findFirst()
.orElse(null);
.collect(Collectors.toList());
if (hgGood == null) {
if (CollectionUtils.isEmpty(manyHgs)) {
throw new ServiceException(ResponseResult.PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST);
}
......@@ -265,6 +265,10 @@ public class AdditionSharingService {
if (null == getProductsVo) {
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.getProducts().add(cartGoodsDetailDto);
//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