fix(CartServiceImpl.java): 添加商品至购物车先判断商品是否存在

This commit is contained in:
有来技术 2021-08-15 01:16:49 +08:00
parent 7416728e24
commit f5429c463a

View File

@ -87,7 +87,9 @@ public class CartServiceImpl implements ICartService {
} }
}); });
CompletableFuture.allOf(cartItemCompletableFuture).join(); CompletableFuture.allOf(cartItemCompletableFuture).join();
cartHashOperations.put(hKey,cartItem);
Assert.isTrue(cartItem.getSkuId() != null && cartItem.getSkuId() > 0,"商品不存在");
cartHashOperations.put(hKey, cartItem);
return true; return true;
} }