Commit 30031ba5 by 周晓航

Merge branch 'KA-【华莱士】【半定制】一个订单多张优惠券使用场景-zxh' into qa

parents 897221be 669ad588
...@@ -905,9 +905,21 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -905,9 +905,21 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
Long useCouponThreshold = 0L; Long useCouponThreshold = 0L;
if (CollectionUtils.isNotEmpty(products)) { if (CollectionUtils.isNotEmpty(products)) {
// 过滤出 活动商品 以及 优惠券商品 求和 // 过滤出 活动商品 以及 优惠券商品 求和
return products.stream().filter(p -> !GoodsTypeEnum.couponTypeList.contains(p.getGoodsType()) && Objects.isNull(p.getActivityType())) // return products.stream().filter(p -> !GoodsTypeEnum.couponTypeList.contains(p.getGoodsType()) && Objects.isNull(p.getActivityType()))
.mapToLong(CartGoods::getOriginalAmount) // .mapToLong(CartGoods::getOriginalAmount)
.sum(); // .sum();
// activityType = 61 是赠送商品 已过滤
List<CartGoods> collect = products.stream().filter(p -> !GoodsTypeEnum.couponTypeList.contains(p.getGoodsType()) && Objects.isNull(p.getActivityType())).collect(toList());
for (CartGoods cartGoods : collect) {
useCouponThreshold += cartGoods.getOriginalAmount();
// 小料
Integer qty = cartGoods.getQty();
if (CollectionUtils.isNotEmpty(cartGoods.getProductMaterialList())) {
for (CartGoods.MaterialGoods materialGoods : cartGoods.getProductMaterialList()) {
useCouponThreshold += materialGoods.getOriginalAmount() * materialGoods.getQty() * qty;
}
}
}
} }
return useCouponThreshold; return useCouponThreshold;
} }
......
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