Commit 9f276c97 by 缪晖

Merge branch 'hotfix/20210610_codev4_coupon_npe_miaohui' into 'master'

platform orderCheck coupon NPE repaired

See merge request !117
parents d34c208d 26c91b69
...@@ -560,14 +560,14 @@ public class CheckOrder { ...@@ -560,14 +560,14 @@ public class CheckOrder {
if (Objects.equals(getCouponDetailResponseDto, null) || CollectionUtils.isEmpty(getCouponDetailResponseDto.getDetails()) if (Objects.equals(getCouponDetailResponseDto, null) || CollectionUtils.isEmpty(getCouponDetailResponseDto.getDetails())
|| getCouponDetailResponseDto.getDetails().get(0).getActive() == null || getCouponDetailResponseDto.getDetails().get(0).getActive() == null
|| getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode() == null) { || getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode() == null) {
if ((CollectionUtils.isNotEmpty(getCouponDetailResponseDto.getDetails().get(0).getActiveRestrictionVOS()) // 返回信息为空
throw new ServiceException(ResponseResult.COUPON_GETINFO_INVAILD);
} else if (CollectionUtils.isNotEmpty(getCouponDetailResponseDto.getDetails().get(0).getActiveRestrictionVOS())
&& CollectionUtils.isEmpty(getCouponDetailResponseDto.getDetails().get(0).getActiveRestrictionVOS().stream() && CollectionUtils.isEmpty(getCouponDetailResponseDto.getDetails().get(0).getActiveRestrictionVOS().stream()
.filter(a -> Objects.equals(a.getStoreIdPartner(), createOrderVo.getShopId())).collect(Collectors.toList())) .filter(a -> Objects.equals(a.getStoreIdPartner(), createOrderVo.getShopId())).collect(Collectors.toList()))
)) { ) {
// 当前门店不可用
throw new ServiceException(ResponseResult.COUPON_SHOP_NOTSUPPORT); throw new ServiceException(ResponseResult.COUPON_SHOP_NOTSUPPORT);
} else {
throw new ServiceException(ResponseResult.COUPON_GETINFO_INVAILD);
}
} }
List<GetCouponDetailResponseDto.ActiveRedeemTimeInterval> activeRedeemTimeIntervalList = getCouponDetailResponseDto.getDetails().get(0).getActiveRedeemTimeIntervalList(); List<GetCouponDetailResponseDto.ActiveRedeemTimeInterval> activeRedeemTimeIntervalList = getCouponDetailResponseDto.getDetails().get(0).getActiveRedeemTimeIntervalList();
checkCouonRedeemTime(activeRedeemTimeIntervalList); checkCouonRedeemTime(activeRedeemTimeIntervalList);
...@@ -590,14 +590,14 @@ public class CheckOrder { ...@@ -590,14 +590,14 @@ public class CheckOrder {
if (Objects.equals(getCouponDetailResponseDto, null) || CollectionUtils.isEmpty(getCouponDetailResponseDto.getDetails()) if (Objects.equals(getCouponDetailResponseDto, null) || CollectionUtils.isEmpty(getCouponDetailResponseDto.getDetails())
|| getCouponDetailResponseDto.getDetails().get(0).getActive() == null || getCouponDetailResponseDto.getDetails().get(0).getActive() == null
|| getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode() == null) { || getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode() == null) {
if ((CollectionUtils.isNotEmpty(getCouponDetailResponseDto.getDetails().get(0).getActiveRestrictionVOS()) // 返回信息为空
throw new ServiceException(ResponseResult.COUPON_GETINFO_INVAILD);
} else if (CollectionUtils.isNotEmpty(getCouponDetailResponseDto.getDetails().get(0).getActiveRestrictionVOS())
&& CollectionUtils.isEmpty(getCouponDetailResponseDto.getDetails().get(0).getActiveRestrictionVOS().stream() && CollectionUtils.isEmpty(getCouponDetailResponseDto.getDetails().get(0).getActiveRestrictionVOS().stream()
.filter(a -> Objects.equals(a.getStoreIdPartner(), createOrderVo.getShopId())).collect(Collectors.toList())) .filter(a -> Objects.equals(a.getStoreIdPartner(), createOrderVo.getShopId())).collect(Collectors.toList()))
)) { ) {
// 当前门店不可用
throw new ServiceException(ResponseResult.COUPON_SHOP_NOTSUPPORT); throw new ServiceException(ResponseResult.COUPON_SHOP_NOTSUPPORT);
} else {
throw new ServiceException(ResponseResult.COUPON_GETINFO_INVAILD);
}
} }
String activeCode = getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode(); String activeCode = getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode();
ShoppingCartInfoRequestVo.couponCode coupon = new ShoppingCartInfoRequestVo.couponCode(); ShoppingCartInfoRequestVo.couponCode coupon = new ShoppingCartInfoRequestVo.couponCode();
......
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