| | |
| | | throw new ServiceException(AppErrorConstant.COUPON_EXPIRED); |
| | | } else if (couponStatus == 2) { |
| | | throw new ServiceException(AppErrorConstant.COUPON_USED); |
| | | } else if (couponStatus != 0) { |
| | | } else if (couponStatus != 1) { |
| | | throw new ServiceException(AppErrorConstant.COUPON_NO_FIND); |
| | | } |
| | | // 检查优惠券类型 |
| | |
| | | throw new ServiceException(AppErrorConstant.COUPON_EXPIRED); |
| | | }else if(memberCoupon.getCouponStatus()==2){ |
| | | throw new ServiceException(AppErrorConstant.COUPON_USED); |
| | | }else if(memberCoupon.getCouponStatus()==-1){ |
| | | }else if(memberCoupon.getCouponStatus()!=1){ |
| | | throw new ServiceException(AppErrorConstant.COUPON_NO_FIND); |
| | | } |
| | | if(memberCoupon.getCouponType()!=4){ |
| | |
| | | List<String> goodsLimitList = null; |
| | | HashSet<Long> shopIdSet = new HashSet<>(); |
| | | for(AppMemberCouponPageVo appGetAbleCouponPageVo : memberCouponPageVoList){ |
| | | shopIdSet.add(appGetAbleCouponPageVo.getShopId()); |
| | | if(appGetAbleCouponPageVo.getShopId()!=null){ |
| | | shopIdSet.add(appGetAbleCouponPageVo.getShopId()); |
| | | } |
| | | if(appGetAbleCouponPageVo.getCouponType()==4){ |
| | | appGetAbleCouponPageVo.setVerifyCode("2-"+appGetAbleCouponPageVo.getMemberCouponId()); |
| | | } |
| | | } |
| | | String shopJoinedString = String.join(",", shopIdSet.stream().map(Object::toString).collect(Collectors.toList())); |
| | | MgtBaseBathDto mgtBaseBathDto = new MgtBaseBathDto(); |
| | |
| | | relGoodsIds = appGetAbleCouponPageVo.getRelGoodsIds(); |
| | | if(StringUtils.isNotBlank(relGoodsIds)){ |
| | | goodsList = remoteGoodsService.listGoodsByGoodsId(relGoodsIds).getData(); |
| | | if(!goodsList.isEmpty()){ |
| | | if(goodsList!=null&&!goodsList.isEmpty()){ |
| | | goodsLimitList = goodsList.stream().map(goods -> { |
| | | String goodsName = goods.getGoodsName(); |
| | | goodsName = "限制" + goodsName + "适用"; |
| | |
| | | } |
| | | } |
| | | appGetAbleCouponPageVo.setGoodsLimitList(goodsLimitList); |
| | | appGetAbleCouponPageVo.setVerifyShopName(shopMap.get(appGetAbleCouponPageVo.getShopId()).getShopName()); |
| | | if(appGetAbleCouponPageVo.getShopId()!=null){ |
| | | appGetAbleCouponPageVo.setVerifyShopName(shopMap.get(appGetAbleCouponPageVo.getShopId()).getShopName()); |
| | | } |
| | | } |
| | | } |
| | | return memberCouponPageVoList; |