Commit 44613cb9 by chongfu.liang

优惠券问题

parent b479a63e
......@@ -211,16 +211,16 @@ public class PlatformListCartGoodsService extends AbstractListCartGoodsService {
discountResult = calCostBO.getCalculationDiscountBO().getResult();
}
// 当couponCode不为空时,需计算优惠价格 3代金 31折扣 32商品 33换购券
// 当couponCode不为空时,需计算优惠价格
// 当couponCode不为空时,需计算优惠价格 3代金 31折扣 32商品 33换购券
long couponDiscount = 0;
if (couponPromotionVO != null && StringUtils.isNotEmpty(couponPromotionVO.getCouponCode())
&& calCostBO.getCalculationDiscountBO() != null && calCostBO.getCalculationDiscountBO().getResult() != null) {
List<CalculationDiscountBO.CalculationDiscountResult.CouponResults> couponDiscounts = calCostBO.getCalculationDiscountBO().getResult().getCouponDiscounts();
if (CollectionUtils.isNotEmpty(couponDiscounts)) {
for (CalculationDiscountBO.CalculationDiscountResult.CouponResults couponResults : couponDiscounts) {
couponDiscount = couponDiscount + (couponResults.getDiscountAmount() == null ? 0 : couponResults.getDiscountAmount());
}
}
&& calCostBO.getCalculationDiscountBO() != null && calCostBO.getCalculationDiscountBO().getResult() != null
&& calCostBO.getCalculationDiscountBO().getResult().getDiscounts() != null) {
List<Integer> asList = Arrays.asList(3, 31);
List<CalculationDiscountBO.CalculationDiscountResult.Discount> couponDiscounts = calCostBO.getCalculationDiscountBO().getResult().getDiscounts();
CalculationDiscountBO.CalculationDiscountResult.Discount first = couponDiscounts.stream().filter(d -> asList.contains(d.getType())).findFirst().orElse(null);
if (first!=null) couponDiscount = first.getDiscount().longValue();
}
shoppingCartGoodsBO.setCouponDiscount(couponDiscount);
//循环购物车商品券
......
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