diff --git a/cereshop-app/src/main/java/com/shop/cereshop/app/service/cart/impl/CereShopCartServiceImpl.java b/cereshop-app/src/main/java/com/shop/cereshop/app/service/cart/impl/CereShopCartServiceImpl.java index 96421fa..6a6dbea 100644 --- a/cereshop-app/src/main/java/com/shop/cereshop/app/service/cart/impl/CereShopCartServiceImpl.java +++ b/cereshop-app/src/main/java/com/shop/cereshop/app/service/cart/impl/CereShopCartServiceImpl.java @@ -605,7 +605,8 @@ public class CereShopCartServiceImpl implements CereShopCartService { List couponList = couponMap.get(sku.getProductId()); if (couponList == null) { if(user!=null){ - couponList=cereShopCouponService.findByProductIdAndUserId(user.getBuyerUserId(), sku.getShopId(), sku.getProductId()); + //couponList=cereShopCouponService.findByProductIdAndUserId(user.getBuyerUserId(), sku.getShopId(), sku.getProductId()); + couponList=cereShopCouponService.findByProductIdAndUserId(user.getBuyerUserId(), Long.valueOf(user.getProject()), sku.getProductId()); }else { couponList=cereShopCouponService.findByProductId(sku.getShopId(), sku.getProductId()); } diff --git a/cereshop-app/src/main/java/com/shop/cereshop/app/service/coupon/impl/CereShopCouponServiceImpl.java b/cereshop-app/src/main/java/com/shop/cereshop/app/service/coupon/impl/CereShopCouponServiceImpl.java index b41476a..19afc42 100644 --- a/cereshop-app/src/main/java/com/shop/cereshop/app/service/coupon/impl/CereShopCouponServiceImpl.java +++ b/cereshop-app/src/main/java/com/shop/cereshop/app/service/coupon/impl/CereShopCouponServiceImpl.java @@ -5,19 +5,24 @@ */ package com.shop.cereshop.app.service.coupon.impl; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.shop.cereshop.app.dao.coupon.CereShopCouponDAO; +import com.shop.cereshop.app.dao.shop.CerePlatformShopDAO; import com.shop.cereshop.app.page.coupon.CommonCoupon; import com.shop.cereshop.app.page.product.ProductCoupon; +import com.shop.cereshop.app.page.shop.PlatformShop; import com.shop.cereshop.app.param.canvas.CanvasCouponParam; import com.shop.cereshop.app.param.coupon.ShopCouponParam; import com.shop.cereshop.app.service.buyer.CereBuyerShopCouponService; import com.shop.cereshop.app.service.coupon.CereShopCouponService; +import com.shop.cereshop.app.service.shop.CerePlatformShopService; import com.shop.cereshop.commons.constant.IntegerEnum; import com.shop.cereshop.commons.domain.buyer.CereBuyerShopCoupon; import com.shop.cereshop.commons.domain.buyer.CereBuyerUser; import com.shop.cereshop.commons.domain.common.Page; +import com.shop.cereshop.commons.domain.shop.CerePlatformShop; import com.shop.cereshop.commons.domain.tool.CereShopCoupon; import com.shop.cereshop.commons.exception.CoBusinessException; import com.shop.cereshop.commons.utils.EmptyUtils; @@ -42,9 +47,13 @@ public class CereShopCouponServiceImpl implements CereShopCouponService { @Autowired private CereBuyerShopCouponService cereBuyerShopCouponService; + @Autowired + private CerePlatformShopDAO cerePlatformShopDAO; + @Override public List findByProductId(Long shopId, Long productId) { - return cereShopCouponDAO.findProductCanUseCoupon(shopId, productId); + CerePlatformShop platformShop = cerePlatformShopDAO.selectByPrimaryKey(shopId); + return cereShopCouponDAO.findProductCanUseCoupon(platformShop.getBusinessId(), productId); } @Override diff --git a/cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java b/cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java index 4e581b4..8c12f8c 100644 --- a/cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java +++ b/cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java @@ -785,7 +785,8 @@ public class CereShopProductServiceImpl implements CereShopProductService { return shopCoupons; } if(user!=null){ - shopCoupons=cereShopCouponService.findByProductIdAndUserId(user.getBuyerUserId(), detail.getShopId(), detail.getProductId()); + //shopCoupons=cereShopCouponService.findByProductIdAndUserId(user.getBuyerUserId(), detail.getShopId(), detail.getProductId()); + shopCoupons=cereShopCouponService.findByProductIdAndUserId(user.getBuyerUserId(), Long.valueOf(user.getProject()), detail.getProductId()); }else { shopCoupons=cereShopCouponService.findByProductId(detail.getShopId(), detail.getProductId()); }