Commit 5f37709b by 张洪旺

Merge remote-tracking branch 'origin/qa' into qa

parents 6828563e a61e7adb
......@@ -1185,15 +1185,8 @@ public class ShoppingCartMCoffeeServiceImpl {
//判断当前商品在购物车是否已存在,存在则数量+1,不存在商品行 + 1
allCartGoodsList.forEach(oldCartGoods -> {
int index;
if (nowCartGoodsList.size()>0) {
for (int i = 0; i < nowCartGoodsList.size(); i++) {
if (nowCartGoodsList.get(i).getSkuId().equals(oldCartGoods.getSkuId())
&& nowCartGoodsList.get(i).getSpuId().equals(oldCartGoods.getSpuId())){
nowCartGoodsList.get(i).setQty(nowCartGoodsList.get(i).getQty() + addCartGoods.getQty());
}else{
nowCartGoodsList.add(oldCartGoods);
}
}
if ((index = nowCartGoodsList.indexOf(oldCartGoods)) >= 0) {
nowCartGoodsList.get(index).setQty(nowCartGoodsList.get(index).getQty() + addCartGoods.getQty());
} else {
nowCartGoodsList.add(oldCartGoods);
}
......
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