Commit 95b3dff8 by 缪晖

platform orderCheck coupon NPE repaired

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