Commit f9a5bf3b by 刘鹏飞

coco将半价商品放到后边显示

parent 22780b18
......@@ -80,6 +80,8 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
if(products == null || products.isEmpty()){
return;
}
List<CartGoods> halfProduct = new ArrayList<>();
products.forEach(product -> {
Integer num = 0;
// 商品优惠的金额
......@@ -95,7 +97,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
discountAmount = discount.getDiscount();
Long newPrice = product.getOriginalPrice() - discountAmount;
CartGoods cartGoods = buildNewLine(product,ActivityTypeEnum.TYPE_53.getCode(),1,newPrice);
newProducts.add(cartGoods);
halfProduct.add(cartGoods);
}
}
Integer newQty = product.getQty() - num;
......@@ -106,6 +108,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
product.setQty(newQty);
newProducts.add(product);
}
newProducts.addAll(halfProduct);
});
......@@ -155,7 +158,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
newCartGoods.setSkuName(cgs.getSkuName());
newCartGoods.setClassificationId(cgs.getClassificationId());
newCartGoods.setClassificationName(cgs.getClassificationName());
newCartGoods.setActivityType(activityType);
//newCartGoods.setActivityType(activityType);
newCartGoods.setQty(qty);
return newCartGoods;
......
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