From bcdd99eb4adab78e62bb2ad315768ffa9ad5b361 Mon Sep 17 00:00:00 2001 From: sj <1304317391@qq.com> Date: Thu, 10 Nov 2022 17:19:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=95=86=E5=93=81id=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=A7=84=E6=A0=BC=E5=A4=AA?= =?UTF-8?q?=E9=95=BF=E6=97=B6=EF=BC=8C=E6=95=B0=E6=8D=AE=E5=BA=93=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/YxStoreCouponUserServiceImpl.java | 22 +++++++++++++++++++ .../activity/vo/YxStoreCouponUserQueryVo.java | 6 ++++- .../dto/YxStoreProductQueryCriteria.java | 3 +++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java index 0cbdca79..037a7f66 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java @@ -11,6 +11,7 @@ package co.yixiang.modules.activity.service.impl; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.exception.YshopException; import co.yixiang.common.service.impl.BaseServiceImpl; import co.yixiang.common.utils.QueryHelpPlus; @@ -30,9 +31,12 @@ import co.yixiang.modules.activity.vo.YxStoreCouponUserQueryVo; import co.yixiang.modules.cart.domain.YxStoreBrandCart; import co.yixiang.modules.cart.service.YxStoreCartService; import co.yixiang.modules.cart.vo.YxStoreCartQueryVo; +import co.yixiang.modules.product.domain.YxStoreProduct; +import co.yixiang.modules.product.service.YxStoreProductService; import co.yixiang.modules.user.domain.YxUser; import co.yixiang.modules.user.service.YxUserService; import co.yixiang.utils.FileUtil; +import co.yixiang.utils.StringUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -74,6 +78,8 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl needIdlist; + if (idList.length>3){ + needIdlist= Arrays.asList(Arrays.copyOf(idList, 3)); + }else { + needIdlist= Arrays.asList(idList); + } + List imageList=new ArrayList<>(); + needIdlist.forEach(id->{ + YxStoreProduct yxStoreProduct=yxStoreProductService.getById(id); + if (ObjectUtil.isNotEmpty(yxStoreProduct)&& StringUtils.isNotBlank(yxStoreProduct.getImage())){ + imageList.add(yxStoreProductService.getById(id).getImage()); + } + }); + queryVo.setImage(imageList); if(couponUser.getIsFail() == 1){ queryVo.set_type(CouponEnum.USE_0.getValue()); queryVo.set_msg("已失效"); diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreCouponUserQueryVo.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreCouponUserQueryVo.java index 258d6bb5..800c2680 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreCouponUserQueryVo.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/YxStoreCouponUserQueryVo.java @@ -8,6 +8,7 @@ import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; +import java.util.List; /** *

@@ -28,11 +29,14 @@ public class YxStoreCouponUserQueryVo implements Serializable { @ApiModelProperty(value = "兑换的项目id") private Integer cid; + @ApiModelProperty(value = "优惠券图片") + private List image; + @ApiModelProperty(value = "优惠券所属用户") private Long uid; @ApiModelProperty(value = "优惠券名称") - private String couponTitle; + private String cname; @ApiModelProperty(value = "优惠券的面值") private BigDecimal couponPrice; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/YxStoreProductQueryCriteria.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/YxStoreProductQueryCriteria.java index e65473cb..c9e48541 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/YxStoreProductQueryCriteria.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/YxStoreProductQueryCriteria.java @@ -26,6 +26,9 @@ public class YxStoreProductQueryCriteria{ @Query private Integer isShow; + @Query + private Integer id; + @Query private Integer cateId;