Browse Source

解决商家商城无法显示发布的商家券问题

multiwx
dy-hu 7 months ago
parent
commit
df3d5f1590
  1. 3
      cereshop-app/src/main/java/com/shop/cereshop/app/service/cart/impl/CereShopCartServiceImpl.java
  2. 11
      cereshop-app/src/main/java/com/shop/cereshop/app/service/coupon/impl/CereShopCouponServiceImpl.java
  3. 3
      cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java

3
cereshop-app/src/main/java/com/shop/cereshop/app/service/cart/impl/CereShopCartServiceImpl.java

@ -605,7 +605,8 @@ public class CereShopCartServiceImpl implements CereShopCartService {
List<ProductCoupon> 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());
}

11
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<ProductCoupon> findByProductId(Long shopId, Long productId) {
return cereShopCouponDAO.findProductCanUseCoupon(shopId, productId);
CerePlatformShop platformShop = cerePlatformShopDAO.selectByPrimaryKey(shopId);
return cereShopCouponDAO.findProductCanUseCoupon(platformShop.getBusinessId(), productId);
}
@Override

3
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());
}

Loading…
Cancel
Save