From 96f4c73f27a1b5a99ba146944efb897cfe3114bc Mon Sep 17 00:00:00 2001 From: dy-hu Date: Fri, 28 Jun 2024 16:11:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=AE=B6=E7=AB=AF=E7=A7=92=E6=9D=80?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E8=AE=BE=E7=BD=AE=E5=95=86=E5=93=81=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81=E6=89=80=E5=B1=9E?= =?UTF-8?q?=E5=BA=97=E9=93=BA=E6=98=BE=E7=A4=BA=E3=80=81=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cereshop/business/controller/ShopSeckillController.java | 4 ++-- .../shop/cereshop/business/dao/tool/CereShopSeckillDAO.java | 2 +- .../business/service/tool/CereShopSeckillService.java | 2 +- .../service/tool/impl/CereShopSeckillServiceImpl.java | 4 ++-- .../resources/mybatis/mapper/tool/CereShopSeckillDAO.xml | 13 ++++++++----- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/controller/ShopSeckillController.java b/cereshop-business/src/main/java/com/shop/cereshop/business/controller/ShopSeckillController.java index 9827871..b10e3b9 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/controller/ShopSeckillController.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/controller/ShopSeckillController.java @@ -160,10 +160,10 @@ public class ShopSeckillController { */ @PostMapping(value = "getProducts") @ApiOperation(value = "选择商品查询") - public Result> getProducts(@RequestBody ToolProductParam param, HttpServletRequest request) throws CoBusinessException{ + public Result> getProducts(@RequestBody ToolProductNewParam param, HttpServletRequest request) throws CoBusinessException{ //获取当前登录账户 CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); - param.setShopId(user.getBusinessId()); + param.setBusinessId(user.getBusinessId()); Page page=cereShopSeckillService.getProducts(param); return new Result(page); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopSeckillDAO.java b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopSeckillDAO.java index c88b7f0..1a319bf 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopSeckillDAO.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopSeckillDAO.java @@ -35,7 +35,7 @@ public interface CereShopSeckillDAO extends BaseMapper { List getAll(ShopSeckillGetAllParam param); - List getProducts(@Param("shopId") Long shopId, @Param("shopSeckillId") Long shopSeckillId); + List getProducts(@Param("shopId") Long shopId, @Param("shopSeckillId") Long shopSeckillId, @Param("searchContent") String searchContent); List findDataProducts(@Param("shopSeckillId") Long shopSeckillId,@Param("shopId") Long shopId); diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/CereShopSeckillService.java b/cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/CereShopSeckillService.java index 424590c..ed64878 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/CereShopSeckillService.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/CereShopSeckillService.java @@ -29,7 +29,7 @@ public interface CereShopSeckillService { Page getAll(ShopSeckillGetAllParam param) throws CoBusinessException; - Page getProducts(ToolProductParam param) throws CoBusinessException; + Page getProducts(ToolProductNewParam param) throws CoBusinessException; ShopSeckillData getData(ShopSeckillGetByIdParam param, Long shopId) throws CoBusinessException; diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopSeckillServiceImpl.java b/cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopSeckillServiceImpl.java index 691bbc6..1d61110 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopSeckillServiceImpl.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopSeckillServiceImpl.java @@ -394,9 +394,9 @@ public class CereShopSeckillServiceImpl implements CereShopSeckillService { } @Override - public Page getProducts(ToolProductParam param) throws CoBusinessException { + public Page getProducts(ToolProductNewParam param) throws CoBusinessException { PageHelper.startPage(param.getPage(),param.getPageSize()); - List list=cereShopSeckillDAO.getProducts(param.getShopId(), param.getActivityId()); + List list=cereShopSeckillDAO.getProducts(param.getBusinessId(), param.getActivityId(), param.getSearchContent()); PageInfo pageInfo=new PageInfo<>(list); Page page=new Page(pageInfo.getList(),pageInfo.getTotal()); return page; diff --git a/cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopSeckillDAO.xml b/cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopSeckillDAO.xml index aa4ea22..3975e1c 100644 --- a/cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopSeckillDAO.xml +++ b/cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopSeckillDAO.xml @@ -289,32 +289,35 @@ LEFT JOIN cere_product_classify d ON b.classify_id = d.classify_id LEFT JOIN (SELECT GROUP_CONCAT(sku_value) `value`, sku_id FROM cere_sku_name GROUP BY sku_id) e ON a.sku_id = e.sku_id - where b.shop_id = #{shopId} + where b.shop_id in (select shop_id from cere_platform_shop where business_id = #{shopId}) and b.shelve_state = 1 and a.product_id NOT in (SELECT a.product_id FROM cere_shop_group_work_detail a LEFT JOIN cere_shop_group_work b ON a.shop_group_work_id = b.shop_group_work_id - where b.shop_id = #{shopId} + where b.shop_id in (select shop_id from cere_platform_shop where business_id = #{shopId}) and b.state=1) and a.product_id NOT in (SELECT a.product_id FROM cere_shop_discount_detail a LEFT JOIN cere_shop_discount b ON a.shop_discount_id = b.shop_discount_id - where b.shop_id = #{shopId} + where b.shop_id in (select shop_id from cere_platform_shop where business_id = #{shopId}) and b.state=1) and a.product_id NOT in (SELECT a.product_id FROM cere_sign_product a LEFT JOIN cere_activity_sign b ON a.sign_id = b.sign_id LEFT JOIN cere_platform_seckill c ON b.activity_id = c.seckill_id and b.sign_type = 2 - where b.shop_id = #{shopId} + where b.shop_id in (select shop_id from cere_platform_shop where business_id = #{shopId}) and c.state=3) and a.product_id NOT in (SELECT a.product_id FROM cere_sign_product a LEFT JOIN cere_activity_sign b ON a.sign_id = b.sign_id LEFT JOIN cere_platform_discount c ON b.activity_id = c.discount_id and b.sign_type = 3 - where b.shop_id = #{shopId} + where b.shop_id in (select shop_id from cere_platform_shop where business_id = #{shopId}) and c.state=3) + + and b.product_name like concat('%',#{searchContent},'%') +