Commit 6adfdd2d by 查志伟

fix 属性均摊价格显示问题

parent f6e2bd05
......@@ -2065,7 +2065,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
XyDiscountServiceImpl xyDiscountService = (XyDiscountServiceImpl) PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.XY_DISCOUNT);
xyDiscountService.updateShoppingCartGoodsApportion(shoppingCartGoodsResponseVo, calculationDiscountResult, shoppingCartGoodsDto, premiumExchangeActivity, shoppingCartInfoRequestVo);
//xy折
//满赠
BuyAndGiftsPromotionService buyAndGiftsPromotionService = (BuyAndGiftsPromotionService) PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.BUY_GIFTS);
buyAndGiftsPromotionService.updateShoppingCartGoodsApportion(shoppingCartGoodsResponseVo, calculationDiscountResult, shoppingCartGoodsDto, premiumExchangeActivity, shoppingCartInfoRequestVo);
......
......@@ -446,8 +446,14 @@ public class CalculationCommonService {
cartGoodsDetailDto.setOriginalPrice(cartGoods.getOriginalPrice());
}
if (calculationGoods!=null) {
cartGoodsDetailDto.setTotalDiscountAmount(calculationGoods.getDiscountAmount().intValue());
//cartGoodsDetailDto.setOriginalPrice(calculationGoods.getOriginalPrice());
if (cartGoodsDetailDto.getIsSendGoods()) {
// 由于买赠活动中,赠品有属性的时候会裂为多行,所有优惠金额不能直接用促销返回的, 需要根据实际购物车行中的数量来计算
int discountAmt = calculationGoods.getDiscountAmount().intValue();
int discountCount = calculationGoods.getGoodsQuantity();
cartGoodsDetailDto.setTotalDiscountAmount(discountAmt / discountCount * cartGoods.getQty());
} else {
cartGoodsDetailDto.setTotalDiscountAmount(calculationGoods.getDiscountAmount().intValue());
}
}
else {
cartGoodsDetailDto.setTotalDiscountAmount(cartGoods.getOriginalAmount().intValue() - cartGoods.getAmount().intValue());
......
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