Commit a502a24f by 周晓航

新算价 优惠总金额需要加上配送券的 优惠金额

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent f43fbba8
...@@ -98,7 +98,21 @@ public class CalculationCommonService { ...@@ -98,7 +98,21 @@ public class CalculationCommonService {
shoppingCartGoodsResponseVo.setOriginalTotalAmount(discountResult == null ? totalOriginalAmount : discountResult.getOriginalTotalAmount()); shoppingCartGoodsResponseVo.setOriginalTotalAmount(discountResult == null ? totalOriginalAmount : discountResult.getOriginalTotalAmount());
shoppingCartGoodsResponseVo.setTotalAmount(discountResult == null ? totalAmount : discountResult.getTotalAmount()); shoppingCartGoodsResponseVo.setTotalAmount(discountResult == null ? totalAmount : discountResult.getTotalAmount());
shoppingCartGoodsResponseVo.setNewPackAmount(totalPackageAmount); shoppingCartGoodsResponseVo.setNewPackAmount(totalPackageAmount);
shoppingCartGoodsResponseVo.setTotalDiscountAmount(discountResult == null ? 0L : discountResult.getTotalDiscountAmount()); // fisehrman 总优惠金额 需要+配送券的优惠金额
if (discountResult == null) {
shoppingCartGoodsResponseVo.setTotalDiscountAmount(0L);
}else {
// 需要算上配送券的优惠金额
Integer discountAmount = 0;
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);
if (discount != null) {
discountAmount = discount.getDiscount();
}
}
shoppingCartGoodsResponseVo.setTotalDiscountAmount(discountResult.getTotalDiscountAmount() + discountAmount);
}
} }
private void rowRealAmount(List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> goods, CartGoods cartGoods, String couponCode) { private void rowRealAmount(List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> goods, CartGoods cartGoods, String couponCode) {
......
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