Commit a602f9e9 by shuhu.hou@freemud.cn

校验商品库存,当库存为0是不可添加

parent 6bdbb7e6
...@@ -1241,7 +1241,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1241,7 +1241,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
if (availableStocks != null && ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(availableStocks.getCode()) && if (availableStocks != null && ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(availableStocks.getCode()) &&
(CollectionUtils.isEmpty(availableStocks.getResult()) || availableStocks.getResult().get(0).getQty() == null (CollectionUtils.isEmpty(availableStocks.getResult()) || availableStocks.getResult().get(0).getQty() == null
|| availableStocks.getResult().get(0).getQty() <= qty)) { || availableStocks.getResult().get(0).getQty() < qty)) {
throw new ServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE); throw new ServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment