Commit 95b3dff8 by 缪晖

platform orderCheck coupon NPE repaired

parent 26c91b69
...@@ -562,12 +562,6 @@ public class CheckOrder { ...@@ -562,12 +562,6 @@ public class CheckOrder {
|| getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode() == null) { || getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode() == null) {
// 返回信息为空 // 返回信息为空
throw new ServiceException(ResponseResult.COUPON_GETINFO_INVAILD); 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(); List<GetCouponDetailResponseDto.ActiveRedeemTimeInterval> activeRedeemTimeIntervalList = getCouponDetailResponseDto.getDetails().get(0).getActiveRedeemTimeIntervalList();
checkCouonRedeemTime(activeRedeemTimeIntervalList); checkCouonRedeemTime(activeRedeemTimeIntervalList);
...@@ -592,12 +586,6 @@ public class CheckOrder { ...@@ -592,12 +586,6 @@ public class CheckOrder {
|| getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode() == null) { || getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode() == null) {
// 返回信息为空 // 返回信息为空
throw new ServiceException(ResponseResult.COUPON_GETINFO_INVAILD); 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(); String activeCode = getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode();
ShoppingCartInfoRequestVo.couponCode coupon = new ShoppingCartInfoRequestVo.couponCode(); ShoppingCartInfoRequestVo.couponCode coupon = new ShoppingCartInfoRequestVo.couponCode();
......
...@@ -109,15 +109,8 @@ public class CommonCheckOrderHandle { ...@@ -109,15 +109,8 @@ public class CommonCheckOrderHandle {
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())
&& 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(); List<GetCouponDetailResponseDto.ActiveRedeemTimeInterval> activeRedeemTimeIntervalList = getCouponDetailResponseDto.getDetails().get(0).getActiveRedeemTimeIntervalList();
checkCouonRedeemTime(activeRedeemTimeIntervalList); checkCouonRedeemTime(activeRedeemTimeIntervalList);
String activeCode = getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode(); String activeCode = getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode();
...@@ -146,15 +139,8 @@ public class CommonCheckOrderHandle { ...@@ -146,15 +139,8 @@ public class CommonCheckOrderHandle {
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())
&& 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(); String activeCode = getCouponDetailResponseDto.getDetails().get(0).getActive().getActiveCode();
ShoppingCartInfoRequestVo.couponCode coupon = new ShoppingCartInfoRequestVo.couponCode(); ShoppingCartInfoRequestVo.couponCode coupon = new ShoppingCartInfoRequestVo.couponCode();
coupon.setCouponCode(couponCode.getCouponCode()); coupon.setCouponCode(couponCode.getCouponCode());
......
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