From 50c1f73901935edb0a7ce6fdead8dadf2e981004 Mon Sep 17 00:00:00 2001 From: sj <1304317391@qq.com> Date: Thu, 10 Nov 2022 15:43:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=9B=BE=E7=89=87=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/YxStoreCouponIssueServiceImpl.java | 19 +++++++++++++++++++ .../mapper/YxStoreCouponIssueMapper.java | 2 +- .../vo/YxStoreCouponIssueQueryVo.java | 7 +++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueServiceImpl.java index e21fb77b..013ef6de 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponIssueServiceImpl.java @@ -27,7 +27,10 @@ import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueDto; import co.yixiang.modules.activity.service.dto.YxStoreCouponIssueQueryCriteria; import co.yixiang.modules.activity.service.mapper.YxStoreCouponIssueMapper; import co.yixiang.modules.activity.vo.YxStoreCouponIssueQueryVo; +import co.yixiang.modules.product.domain.YxStoreProduct; +import co.yixiang.modules.product.service.YxStoreProductService; import co.yixiang.utils.FileUtil; +import co.yixiang.utils.StringUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.pagehelper.PageInfo; import lombok.AllArgsConstructor; @@ -59,6 +62,7 @@ public class YxStoreCouponIssueServiceImpl 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()); + } + }); + couponIssue.setImage(imageList); if(count > 0){ couponIssue.setIsUse(true); }else{ diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueMapper.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueMapper.java index cfc69148..3fc4f064 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueMapper.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/mapper/YxStoreCouponIssueMapper.java @@ -28,7 +28,7 @@ public interface YxStoreCouponIssueMapper extends CoreMapper @Select("