bug
jiangqs
2023-08-10 a8e56f03a22c722ccf3f67a408919e6c8f256de3
ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/service/impl/member/MemberCouponServiceImpl.java
@@ -81,7 +81,7 @@
            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);
        }
        // 检查优惠券类型
@@ -123,7 +123,7 @@
            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){
@@ -184,7 +184,12 @@
            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();
@@ -196,7 +201,7 @@
                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 + "适用";
@@ -212,7 +217,9 @@
                    }
                }
                appGetAbleCouponPageVo.setGoodsLimitList(goodsLimitList);
                appGetAbleCouponPageVo.setVerifyShopName(shopMap.get(appGetAbleCouponPageVo.getShopId()).getShopName());
                if(appGetAbleCouponPageVo.getShopId()!=null){
                    appGetAbleCouponPageVo.setVerifyShopName(shopMap.get(appGetAbleCouponPageVo.getShopId()).getShopName());
                }
            }
        }
        return memberCouponPageVoList;