Commit ec01d873 by 周晓航

添加日志

parent 25fe22e9
......@@ -3205,6 +3205,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
//校验库存
List<CartGoods> stockLimitGoods = allCartGoodsList.stream().filter(CartGoods::isStockLimit).collect(toList());
List<CartGoods> notCheckStock = allCartGoodsList.stream().filter(cartGoods -> !cartGoods.isStockLimit()).collect(toList());
LogUtil.info("request check stock limit 001 ",stockLimitGoods,notCheckStock);
if (!CollectionUtils.isEmpty(stockLimitGoods)) {
List<Long> goodsId = stockLimitGoods.stream().map(v -> Long.parseLong(v.getGoodsId())).collect(toList());
GetProductStockRequestDto requestDto = new GetProductStockRequestDto();
......@@ -3230,7 +3231,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
stockLimitGoods.forEach(cartGoods -> {
// 数量修改
availableStocksResult.forEach(dataBean -> {
if (cartGoods.getSpuId().equals(dataBean.getPid())) {
if (cartGoods.getGoodsId().equals(dataBean.getPid()+"")) {
Integer qty = dataBean.getQty();
if (qty !=null && qty.compareTo(cartGoods.getQty()) < 0) {
cartGoods.setQty(qty);
......@@ -3239,6 +3240,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
});
});
// 获取到最新的 库存 stockLimitGoods 数据 放入 nowCartGoodsList 中
LogUtil.info("request check stock limit 002 ",stockLimitGoods,notCheckStock);
notCheckStock.addAll(stockLimitGoods);
}else {
LogUtil.info("request check stock limit fail",requestDto,null);
......
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