Commit d13c7f16 by 王世昌

修复验证

parent d8979e66
......@@ -44,14 +44,14 @@ public class CheckAdapter {
getMemberCouponListRequestDto.setPageSize(Integer.MAX_VALUE);
List<GetMemberCouponListResponseDto.Result.MemberCoupon> validMemberCouponList = couponService.getValidMemberCouponList(getMemberCouponListRequestDto, bo.getOrderType());
if (CollectionUtils.isEmpty(validMemberCouponList)) {
throw new ServiceException(ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON, ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON.getMessage());
}
for (int i = 0; i < cartGoodsList.size(); i++) {
CartGoods cartGoods = cartGoodsList.get(i);
if (!CommonUtils.isProductCoupon(cartGoods.getCouponCode(), cartGoods.getCartGoodsUid())) {
continue;
}
if (CollectionUtils.isEmpty(validMemberCouponList)) {
throw new ServiceException(ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON, ResponseResult.SHOPPING_CART_USER_HAVE_NO_COUPON.getMessage());
}
String couponCode = CommonUtils.getCouponCode(cartGoods.getCouponCode(), cartGoods.getCartGoodsUid());
GetMemberCouponListResponseDto.Result.MemberCoupon memberCoupon = validMemberCouponList.stream().filter(p -> couponCode.equals(p.getCouponCode())).findFirst().orElse(null);
if (memberCoupon == null) {
......
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