Commit 3f0df066 by shuhu.hou@freemud.cn

修复满赠空指针

parent 77388c8d
...@@ -52,7 +52,7 @@ public class BuyAndGiftsPromotionService implements IPromotionService { ...@@ -52,7 +52,7 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
} }
List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList = new ArrayList<>(); List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList = new ArrayList<>();
sendActivities.forEach(sendActivity -> sendGoodsList.addAll(sendActivity.getSendGoods())); sendActivities.forEach(sendActivity -> sendGoodsList.addAll(sendActivity.getSendGoods()));
List<ProductBeanDTO> productBeanDTOS = buildActivityProduct(shoppingCartInfoRequestVo, sendGoodsList); List<ProductBeanDTO> productBeanDTOS = buildActivityProduct(activityQueryDto, sendGoodsList);
if (CollectionUtils.isEmpty(productBeanDTOS)) { if (CollectionUtils.isEmpty(productBeanDTOS)) {
return; return;
} }
...@@ -141,14 +141,14 @@ public class BuyAndGiftsPromotionService implements IPromotionService { ...@@ -141,14 +141,14 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
} }
/** /**
* @param shoppingCartInfoRequestVo * @param activityQueryDto
* @param sendGoodsList * @param sendGoodsList
* @return * @return
*/ */
private List<ProductBeanDTO> buildActivityProduct(ShoppingCartInfoRequestVo shoppingCartInfoRequestVo, List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList) { private List<ProductBeanDTO> buildActivityProduct(ActivityQueryDto activityQueryDto, List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods> sendGoodsList) {
//获取 //获取
List<String> goodsIds = sendGoodsList.stream().map(ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods::getGoodsId).collect(Collectors.toList()); List<String> goodsIds = sendGoodsList.stream().map(ActivityCalculationDiscountResponseDto.CalculationDiscountResult.SendActivity.SendGoods::getGoodsId).collect(Collectors.toList());
List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(shoppingCartInfoRequestVo.getPartnerId(), shoppingCartInfoRequestVo.getShopId(), goodsIds, shoppingCartBaseService); List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(activityQueryDto.getPartnerId(), activityQueryDto.getStoreId(), goodsIds, shoppingCartBaseService);
if (CollectionUtils.isEmpty(productBeanList)) { if (CollectionUtils.isEmpty(productBeanList)) {
throw new ServiceException(ResponseResult.SHOPPING_CART_GIFTS_PRODUCT_NOT_EXIST); throw new ServiceException(ResponseResult.SHOPPING_CART_GIFTS_PRODUCT_NOT_EXIST);
} }
......
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