Commit a046c2ff by 周晓航

总优惠金额 新增 活动满减配送费 优惠金额

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent 41d984ff
...@@ -105,11 +105,12 @@ public class CalculationCommonService { ...@@ -105,11 +105,12 @@ public class CalculationCommonService {
// 需要算上配送券的优惠金额 // 需要算上配送券的优惠金额
Integer discountAmount = 0; Integer discountAmount = 0;
if (CollectionUtils.isNotEmpty(discountResult.getDiscounts())) { if (CollectionUtils.isNotEmpty(discountResult.getDiscounts())) {
// 过滤出配送券金额 // 过滤出配送券金额 和 满减配送费活动金额
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount discount = discountResult.getDiscounts().stream().filter(c -> c.getType() != null && c.getType().compareTo(ActivityTypeEnum.TYPE_34.getCode()) == 0).findFirst().orElse(null); double sum = discountResult.getDiscounts().stream()
if (discount != null) { .filter(c -> c.getType() != null && (c.getType().compareTo(ActivityTypeEnum.TYPE_34.getCode()) == 0 || c.getType().compareTo(ActivityTypeEnum.TYPE_14.getCode()) == 0))
discountAmount = discount.getDiscount(); .mapToDouble(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount::getDiscount)
} .sum();
discountAmount = Double.valueOf(sum).intValue();
} }
shoppingCartGoodsResponseVo.setTotalDiscountAmount(discountResult.getTotalDiscountAmount() + discountAmount); shoppingCartGoodsResponseVo.setTotalDiscountAmount(discountResult.getTotalDiscountAmount() + discountAmount);
} }
......
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