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;