修复因原商品库存为0,但选中规格库存不为0时,导致商品下架
This commit is contained in:
@ -100,6 +100,7 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
|
||||
|
||||
/**
|
||||
* 删除购物车
|
||||
*
|
||||
* @param uid uid
|
||||
* @param ids 购物车id集合
|
||||
*/
|
||||
@ -113,6 +114,7 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
|
||||
|
||||
/**
|
||||
* 改购物车数量
|
||||
*
|
||||
* @param cartId 购物车id
|
||||
* @param cartNum 数量
|
||||
* @param uid uid
|
||||
@ -153,6 +155,7 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
|
||||
|
||||
/**
|
||||
* 购物车列表
|
||||
*
|
||||
* @param uid 用户id
|
||||
* @param cartIds 购物车id,多个逗号隔开
|
||||
* @param status 0-购购物车列表
|
||||
@ -193,7 +196,7 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
|
||||
|
||||
if (ObjectUtil.isNull(storeProduct)) {
|
||||
this.removeById(storeCart.getId());
|
||||
}else if(ShopCommonEnum.SHOW_0.getValue().equals(storeProduct.getIsShow()) || storeProduct.getStock() == 0){
|
||||
} else if ((ShopCommonEnum.SHOW_0.getValue().equals(storeProduct.getIsShow()) || storeProduct.getStock() == 0) && StrUtil.isEmpty(storeCart.getProductAttrUnique())) {
|
||||
storeCartQueryVo.setProductInfo(storeProduct);
|
||||
invalid.add(storeCartQueryVo);
|
||||
} else {
|
||||
@ -258,6 +261,7 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
|
||||
|
||||
/**
|
||||
* 添加购物车
|
||||
*
|
||||
* @param uid 用户id
|
||||
* @param productId 普通产品编号
|
||||
* @param cartNum 购物车数量
|
||||
@ -312,6 +316,7 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
|
||||
|
||||
/**
|
||||
* 返回当前用户购物车总数量
|
||||
*
|
||||
* @param uid 用户id
|
||||
* @return int
|
||||
*/
|
||||
@ -327,6 +332,7 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
|
||||
|
||||
/**
|
||||
* 检测商品/秒杀/砍价/拼团库存
|
||||
*
|
||||
* @param uid 用户ID
|
||||
* @param productId 产品ID
|
||||
* @param cartNum 购买数量
|
||||
@ -400,8 +406,6 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//====================================================================//
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user