Browse Source

商家端秒杀活动设置商品选择新增商品所属店铺显示、商品名称搜索

multiwx
dy-hu 10 months ago
parent
commit
96f4c73f27
  1. 4
      cereshop-business/src/main/java/com/shop/cereshop/business/controller/ShopSeckillController.java
  2. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopSeckillDAO.java
  3. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/CereShopSeckillService.java
  4. 4
      cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopSeckillServiceImpl.java
  5. 13
      cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopSeckillDAO.xml

4
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<Page<ToolProduct>> getProducts(@RequestBody ToolProductParam param, HttpServletRequest request) throws CoBusinessException{
public Result<Page<ToolProduct>> 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);
}

2
cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopSeckillDAO.java

@ -35,7 +35,7 @@ public interface CereShopSeckillDAO extends BaseMapper<CereShopSeckill> {
List<ShopSeckill> getAll(ShopSeckillGetAllParam param);
List<ToolProduct> getProducts(@Param("shopId") Long shopId, @Param("shopSeckillId") Long shopSeckillId);
List<ToolProduct> getProducts(@Param("shopId") Long shopId, @Param("shopSeckillId") Long shopSeckillId, @Param("searchContent") String searchContent);
List<CouponProduct> findDataProducts(@Param("shopSeckillId") Long shopSeckillId,@Param("shopId") Long shopId);

2
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;

4
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<ToolProduct> list=cereShopSeckillDAO.getProducts(param.getShopId(), param.getActivityId());
List<ToolProduct> list=cereShopSeckillDAO.getProducts(param.getBusinessId(), param.getActivityId(), param.getSearchContent());
PageInfo<ToolProduct> pageInfo=new PageInfo<>(list);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;

13
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)
<if test="searchContent != null">
and b.product_name like concat('%',#{searchContent},'%')
</if>
</select>
<select id="findDataProducts" parameterType="java.lang.Object"

Loading…
Cancel
Save