From df3d5f1590d38c2467435d7dc1a3d6ff08047018 Mon Sep 17 00:00:00 2001 From: dy-hu Date: Thu, 20 Jun 2024 17:33:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=95=86=E5=AE=B6=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E7=9A=84=E5=95=86=E5=AE=B6=E5=88=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/cart/impl/CereShopCartServiceImpl.java | 3 ++- .../app/service/coupon/impl/CereShopCouponServiceImpl.java | 11 ++++++++++- .../app/service/product/impl/CereShopProductServiceImpl.java | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) 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()); }