From 376b477284f9d68d34c847879942004e51f85faf Mon Sep 17 00:00:00 2001 From: dy-hu Date: Tue, 2 Jul 2024 17:15:22 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=95=86=E5=AE=B6=E7=AB=AF=E7=BB=84=E5=90=88?= =?UTF-8?q?=E6=8D=86=E7=BB=91=E6=A8=A1=E5=9D=97=E5=95=86=E5=93=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=8E=B7=E5=8F=96=E5=BC=82=E5=B8=B8=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=81=E5=94=AE=E4=BB=B7=E5=8C=BA=E9=97=B4=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=BF=AE=E5=A4=8D=E3=80=81=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=E4=BF=AE=E5=A4=8D=202.?= =?UTF-8?q?=E5=95=86=E5=AE=B6=E7=AB=AF=E7=BB=84=E5=90=88=E6=8D=86=E7=BB=91?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=95=86=E5=93=81=E6=96=B0=E5=A2=9E=E6=89=80?= =?UTF-8?q?=E5=B1=9E=E5=BA=97=E9=93=BA=E6=98=BE=E7=A4=BA=E4=B8=9A=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/compose/impl/CereShopComposeServiceImpl.java | 14 ++++++++++++++ .../mybatis/mapper/compose/CereShopComposeDAO.xml | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/service/compose/impl/CereShopComposeServiceImpl.java b/cereshop-business/src/main/java/com/shop/cereshop/business/service/compose/impl/CereShopComposeServiceImpl.java index 84360ec..c80389c 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/service/compose/impl/CereShopComposeServiceImpl.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/service/compose/impl/CereShopComposeServiceImpl.java @@ -5,6 +5,7 @@ */ package com.shop.cereshop.business.service.compose.impl; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.shop.cereshop.business.dao.compose.CereShopComposeDAO; @@ -22,6 +23,7 @@ import com.shop.cereshop.business.service.platformtool.CerePlatformSeckillServic import com.shop.cereshop.business.service.product.CereProductMemberService; import com.shop.cereshop.business.service.product.CereProductSkuService; import com.shop.cereshop.business.service.redis.CereRedisKeyServcice; +import com.shop.cereshop.business.service.shop.CerePlatformShopService; import com.shop.cereshop.business.service.tool.CereShopDiscountService; import com.shop.cereshop.business.service.tool.CereShopSeckillService; import com.shop.cereshop.commons.constant.CoReturnFormat; @@ -30,6 +32,7 @@ import com.shop.cereshop.commons.constant.StringEnum; import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser; import com.shop.cereshop.commons.domain.common.Page; import com.shop.cereshop.commons.domain.product.CereProductMember; +import com.shop.cereshop.commons.domain.shop.CerePlatformShop; import com.shop.cereshop.commons.domain.tool.CereComposeProduct; import com.shop.cereshop.commons.domain.tool.CereShopCompose; import com.shop.cereshop.commons.exception.CoBusinessException; @@ -83,6 +86,9 @@ public class CereShopComposeServiceImpl implements CereShopComposeService { @Autowired private CereProductSkuService cereProductSkuService; + @Autowired + private CerePlatformShopService platformShopService; + @Override @Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) public void save(ComposeSaveParam param, CerePlatformBusinessUser user) throws CoBusinessException, Exception { @@ -382,6 +388,14 @@ public class CereShopComposeServiceImpl implements CereShopComposeService { Map finalMinMap = minMap; Map finalMaxMap = maxMap; list.forEach((shopProduct -> { + try { + CerePlatformShop platformShop = platformShopService.getById(shopProduct.getShopId()); + if (ObjectUtils.isNotEmpty(platformShop)) { + shopProduct.setShopName(platformShop.getShopName()); + } + } catch (CoBusinessException e) { + e.printStackTrace(); + } if(!EmptyUtils.isEmpty(shopProduct.getSkuImage())){ //规格配图了,取规格图片展示 shopProduct.setProductImage(shopProduct.getSkuImage()); diff --git a/cereshop-business/src/main/resources/mybatis/mapper/compose/CereShopComposeDAO.xml b/cereshop-business/src/main/resources/mybatis/mapper/compose/CereShopComposeDAO.xml index 075837e..bf17cf3 100644 --- a/cereshop-business/src/main/resources/mybatis/mapper/compose/CereShopComposeDAO.xml +++ b/cereshop-business/src/main/resources/mybatis/mapper/compose/CereShopComposeDAO.xml @@ -197,20 +197,20 @@