Browse Source

拼团、秒杀、限时折扣商品获取处理平台上架状态过滤业务

multiwx
dy-hu 11 months ago
parent
commit
837b8581ad
  1. 1
      cereshop-app/src/main/java/com/shop/cereshop/app/controller/canvas/CanvasController.java
  2. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CerePlatformShopDAO.java
  3. 5
      cereshop-app/src/main/java/com/shop/cereshop/app/param/member/MemberProductPageParam.java
  4. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/service/index/impl/IndexServiceImpl.java
  5. 1
      cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereProductClassifyServiceImpl.java
  6. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/CerePlatformShopService.java
  7. 4
      cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/impl/CerePlatformShopServiceImpl.java
  8. 8
      cereshop-app/src/main/resources/mybatis/mapper/product/CereProductClassifyDAO.xml
  9. 8
      cereshop-app/src/main/resources/mybatis/mapper/product/CereProductMemberDAO.xml
  10. 24
      cereshop-app/src/main/resources/mybatis/mapper/product/CereShopProductDAO.xml
  11. 8
      cereshop-app/src/main/resources/mybatis/mapper/shop/CerePlatformShopDAO.xml

1
cereshop-app/src/main/java/com/shop/cereshop/app/controller/canvas/CanvasController.java

@ -264,6 +264,7 @@ public class CanvasController {
memberLevelId = user.getMemberLevelId();
}
param.setMemberLevelId(memberLevelId);
param.setProject(ContextUtil.getProject());
Page page=cereProductMemberService.getMemberProducts(param);
return new Result(page);
}

2
cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CerePlatformShopDAO.java

@ -37,7 +37,7 @@ public interface CerePlatformShopDAO extends BaseMapper<CerePlatformShop> {
RecommendShop findVolumeProductByShopId(@Param("project") String project, @Param("shopId") Long shopId);
List<RecommendShop> findRecommendProducts();
List<RecommendShop> findRecommendProducts(@Param("project") String project);
Integer findPayUsers(@Param("productId") Long productId);

5
cereshop-app/src/main/java/com/shop/cereshop/app/param/member/MemberProductPageParam.java

@ -52,4 +52,9 @@ public class MemberProductPageParam extends PageParam {
*/
private Long memberLevelId;
/**
* 商家id
*/
private String project;
}

2
cereshop-app/src/main/java/com/shop/cereshop/app/service/index/impl/IndexServiceImpl.java

@ -73,7 +73,7 @@ public class IndexServiceImpl implements IndexService {
.peek(shop -> shop=cerePlatformShopservice.findVolumeProductByShopId(ContextUtil.getProject(), shop.getShopId()));
}
//查询好物推荐数据(销量前10商品数据)
List<RecommendShop> products=cerePlatformShopservice.findRecommendProducts();
List<RecommendShop> products=cerePlatformShopservice.findRecommendProducts(ContextUtil.getProject());
if(!EmptyUtils.isEmpty(products)){
products.forEach(product -> {
//设置付款人数

1
cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereProductClassifyServiceImpl.java

@ -174,6 +174,7 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic
if (user != null) {
param.setBuyerUserId(user.getBuyerUserId());
}
param.setProject(ContextUtil.getProject());
//获取产品信息
List<Product> list = getProducts(param, user);

2
cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/CerePlatformShopService.java

@ -26,7 +26,7 @@ public interface CerePlatformShopService {
RecommendShop findVolumeProductByShopId(String project, Long shopId);
List<RecommendShop> findRecommendProducts();
List<RecommendShop> findRecommendProducts(String project);
Integer findPayUsers(Long productId);

4
cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/impl/CerePlatformShopServiceImpl.java

@ -110,8 +110,8 @@ public class CerePlatformShopServiceImpl implements CerePlatformShopService {
}
@Override
public List<RecommendShop> findRecommendProducts() {
return cerePlatformShopDAO.findRecommendProducts();
public List<RecommendShop> findRecommendProducts(String project) {
return cerePlatformShopDAO.findRecommendProducts(project);
}
@Override

8
cereshop-app/src/main/resources/mybatis/mapper/product/CereProductClassifyDAO.xml

@ -252,7 +252,13 @@
where a.product_id=b.product_id GROUP BY a.product_id) b ON a.product_id=b.product_id
LEFT JOIN cere_product_classify e ON a.classify_id=e.classify_id
LEFT JOIN (SELECT SUM(number) number,sku_id,order_id from cere_order_product GROUP BY sku_id) f ON b.sku_id=f.sku_id
where a.shelve_state=1
where 1=1
<if test="project == 0">
and a.plat_shelve_state=1
</if>
<if test="project!=0 and project != ''">
and a.shelve_state=1
</if>
<if test="classifyId!=null">
and (a.classify_id=#{classifyId} OR e.classify_level_hierarchy like concat('%/',#{classifyId},'%'))
</if>

8
cereshop-app/src/main/resources/mybatis/mapper/product/CereProductMemberDAO.xml

@ -107,7 +107,13 @@
LEFT JOIN (SELECT COUNT(a.buyer_user_id) users,a.product_id FROM (SELECT b.buyer_user_id,a.product_id FROM cere_order_product a,cere_shop_order b
where a.order_id=b.order_id and b.state in (2,3,4) GROUP BY a.product_id,b.buyer_user_id) a GROUP BY a.product_id) x ON a.product_id=x.product_id
LEFT JOIN cere_platform_member_level y ON a.member_level_id=y.member_level_id
where s.shelve_state=1
where 1=1
<if test="project == 0">
and s.plat_shelve_state=1
</if>
<if test="project!=0 and project != ''">
and s.shelve_state=1
</if>
<if test="memberLevelId != null">
and a.member_level_id = #{memberLevelId}
</if>

24
cereshop-app/src/main/resources/mybatis/mapper/product/CereShopProductDAO.xml

@ -670,7 +670,13 @@
LEFT JOIN cere_shop_group_work h ON a.shop_group_work_id=h.shop_group_work_id
LEFT JOIN (SELECT a.sku_id,a.image from cere_sku_name a,cere_product_sku b where a.sku_id=b.sku_id LIMIT 1) m ON a.sku_id=m.sku_id
LEFT JOIN cere_product_sku n ON a.sku_id=n.sku_id
where b.shelve_state=1 and h.state=1 and d.state=1
where h.state=1 and d.state=1
<if test="project == 0">
and b.plat_shelve_state=1
</if>
<if test="project!=0 and project != ''">
and b.shelve_state=1
</if>
<if test="shopId!=null">
and b.shop_id=#{shopId}
</if>
@ -720,7 +726,13 @@
LEFT JOIN cere_shop_seckill h ON a.shop_seckill_id=h.shop_seckill_id
LEFT JOIN (SELECT a.sku_id,a.image from cere_sku_name a,cere_product_sku b where a.sku_id=b.sku_id LIMIT 1) m ON a.sku_id=m.sku_id
LEFT JOIN cere_product_sku n ON a.sku_id=n.sku_id
where b.shelve_state=1 and h.state=1 and d.state=1
where h.state=1 and d.state=1
<if test="project == 0">
and b.plat_shelve_state=1
</if>
<if test="project!=0 and project != ''">
and b.shelve_state=1
</if>
<if test="shopId!=null">
and b.shop_id=#{shopId}
</if>
@ -764,7 +776,13 @@
LEFT JOIN cere_shop_discount h ON a.shop_discount_id=h.shop_discount_id
LEFT JOIN (SELECT a.sku_id,a.image from cere_sku_name a,cere_product_sku b where a.sku_id=b.sku_id LIMIT 1) m ON a.sku_id=m.sku_id
LEFT JOIN cere_product_sku n ON a.sku_id=n.sku_id
where b.shelve_state=1 and h.state=1 and d.state=1
where h.state=1 and d.state=1
<if test="project == 0">
and b.plat_shelve_state=1
</if>
<if test="project!=0 and project != ''">
and b.shelve_state=1
</if>
<if test="shopId!=null">
and b.shop_id=#{shopId}
</if>

8
cereshop-app/src/main/resources/mybatis/mapper/shop/CerePlatformShopDAO.xml

@ -265,7 +265,13 @@
GROUP BY a.product_id) e ON a.product_id=e.product_id
LEFT JOIN (SELECT a.sku_id,a.image from cere_sku_name a,cere_product_sku b where a.sku_id=b.sku_id
GROUP BY a.sku_id) f ON c.sku_id=f.sku_id
where a.shelve_state=1
where 1=1
<if test="project == 0">
and a.plat_shelve_state=1
</if>
<if test="project!=0 and project != ''">
and a.shelve_state=1
</if>
GROUP BY c.sku_id
ORDER BY SUM(c.number) DESC LIMIT 1
</select>

Loading…
Cancel
Save