Commit 0ec08f17 by 徐康

Merge branch 'feature/xukang_20210609_麦咖啡p7v2' into qa

parents c623942a dda7fa30
...@@ -242,25 +242,25 @@ public class CouponDiscountCalculation { ...@@ -242,25 +242,25 @@ public class CouponDiscountCalculation {
} }
if(haveB3S1Fav) { if(haveB3S1Fav) {
List<CartGoods> nowCartGoodsList = new ArrayList<>(); // List<CartGoods> nowCartGoodsList = new ArrayList<>();
AtomicBoolean changed = new AtomicBoolean(); // AtomicBoolean changed = new AtomicBoolean();
changed.set(false); // changed.set(false);
if(CollectionUtils.isNotEmpty(cartGoodsList)){ // if(CollectionUtils.isNotEmpty(cartGoodsList)){
ApiLog.debug("合并买3赠1商品券 【merge-before】 : {} ", JSONObject.toJSONString(cartGoodsList)); // ApiLog.debug("合并买3赠1商品券 【merge-before】 : {} ", JSONObject.toJSONString(cartGoodsList));
cartGoodsList.forEach(newCartGood -> { // cartGoodsList.forEach(newCartGood -> {
int index; // int index;
if ((index = nowCartGoodsList.indexOf(newCartGood)) >= 0) { // if ((index = nowCartGoodsList.indexOf(newCartGood)) >= 0) {
changed.set(true); // changed.set(true);
nowCartGoodsList.get(index).setQty(nowCartGoodsList.get(index).getQty() + newCartGood.getQty()); // nowCartGoodsList.get(index).setQty(nowCartGoodsList.get(index).getQty() + newCartGood.getQty());
} else { // } else {
nowCartGoodsList.add(newCartGood); // nowCartGoodsList.add(newCartGood);
} // }
}); // });
} // }
if(changed.get()) { // if(changed.get()) {
cartGoodsList.clear(); // cartGoodsList.clear();
cartGoodsList.addAll(nowCartGoodsList); // cartGoodsList.addAll(nowCartGoodsList);
} // }
int index = 0; int index = 0;
for (int i = 0; i < cartGoodsList.size(); i++) { for (int i = 0; i < cartGoodsList.size(); i++) {
......
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