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},'%') +