Commit 492d3737 by chongfu.liang

fix空指针

parent a003fdeb
......@@ -132,6 +132,12 @@ public class CouponPromotionService implements IPromotionService {
List<String> validCouponCodeLis = new ArrayList<>();
if (couponPromotionVO != null && ObjectUtils.equals(CouponFlag.YES.getCode(), couponPromotionVO.getFlg())){
validCouponCodeLis = shoppingCartGoodsResponseVo.getAvailableCoupon().getUsableCoupons().stream().map(ActivityCouponBean::getCouponCode).collect(Collectors.toList());
} else {
couponPromotionVO = new CouponPromotionVO();
couponPromotionVO.setUserId(userLoginInfoDto.getMemberId());
couponPromotionVO.setStoreId(shoppingCartInfoRequestVo.getShopId());
couponPromotionVO.setPartnerId(shoppingCartInfoRequestVo.getPartnerId());
couponPromotionVO.setOrderType(shoppingCartInfoRequestVo.getOrderType());
}
couponService.checkValidCoupon(couponPromotionVO, validCouponCodeLis, spqIdToCartUuid, couponCode, cartGoodsList);
......
......@@ -135,6 +135,12 @@ public class CouponSharingService {
List<String> validCouponCodeLis = new ArrayList<>();
if (couponPromotionVO != null && ObjectUtils.equals(CouponFlag.YES.getCode(), couponPromotionVO.getFlg())){
validCouponCodeLis = shoppingCartGoodsResponseVo.getAvailableCoupon().getUsableCoupons().stream().map(ActivityCouponBean::getCouponCode).collect(Collectors.toList());
} else {
couponPromotionVO = new CouponPromotionVO();
couponPromotionVO.setUserId(userId);
couponPromotionVO.setStoreId(shoppingCartInfoRequestVo.getShopId());
couponPromotionVO.setPartnerId(shoppingCartInfoRequestVo.getPartnerId());
couponPromotionVO.setOrderType(shoppingCartInfoRequestVo.getOrderType());
}
couponService.checkValidCoupon(couponPromotionVO, validCouponCodeLis, spqIdToCartUuid, couponCode, cartGoodsList);
......
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