Commit 79eafc43 by xiaoer.li@freemud.com

fix

parent b4d22ae8
...@@ -121,7 +121,7 @@ public class CalculationSharingEquallyService { ...@@ -121,7 +121,7 @@ public class CalculationSharingEquallyService {
/** /**
* 加价购商品 * 加价购商品
*/ */
additionSharingService.equally(shoppingCartInfoRequestVo, shoppingCartGoodsDto, discountResult, premiumExchangeActivity); additionSharingService.equally(shoppingCartInfoRequestVo, shoppingCartGoodsDto, discountResult, premiumExchangeActivity, shoppingCartGoodsResponseVo);
/** /**
* 积分抵扣 * 积分抵扣
*/ */
......
...@@ -231,7 +231,8 @@ public class AdditionSharingService { ...@@ -231,7 +231,8 @@ public class AdditionSharingService {
public void equally(ShoppingCartInfoRequestVo shoppingCartInfoRequestVo public void equally(ShoppingCartInfoRequestVo shoppingCartInfoRequestVo
, ShoppingCartGoodsDto shoppingCartGoodsDto , ShoppingCartGoodsDto shoppingCartGoodsDto
, CalculationSharingDiscountResponseDto.CalculationDiscountResult discountResult , CalculationSharingDiscountResponseDto.CalculationDiscountResult discountResult
, CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity) { , CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity
, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo) {
if (discountResult == null || CollectionUtils.isEmpty(discountResult.getGoods()) || premiumExchangeActivity == null || CollectionUtils.isEmpty(premiumExchangeActivity.getProducts())) { if (discountResult == null || CollectionUtils.isEmpty(discountResult.getGoods()) || premiumExchangeActivity == null || CollectionUtils.isEmpty(premiumExchangeActivity.getProducts())) {
return; return;
...@@ -254,11 +255,10 @@ public class AdditionSharingService { ...@@ -254,11 +255,10 @@ public class AdditionSharingService {
} }
log.info("getProductsVoMap:{}", JSON.toJSONString(getProductsVoMap)); log.info("getProductsVoMap:{}", JSON.toJSONString(getProductsVoMap));
// 获取计算返回的价格 // 获取计算返回的价格
Long originalTotalAmount = shoppingCartGoodsDto.getOriginalTotalAmount(); Long originalTotalAmount = shoppingCartGoodsResponseVo.getOriginalTotalAmount();
Long totalAmount = shoppingCartGoodsDto.getTotalAmount(); //Long totalAmount = shoppingCartGoodsDto.getTotalAmount();
Long totalDiscountAmount = shoppingCartGoodsDto.getTotalDiscountAmount(); //Long totalDiscountAmount = shoppingCartGoodsDto.getTotalDiscountAmount();
//加价换购活动总优惠 //加价换购活动总优惠
Long currenttotalDiscountAmount = 0L;
for (CreateOrderVo.PremiumExchangeActivity.Product product : premiumExchangeActivity.getProducts()) { for (CreateOrderVo.PremiumExchangeActivity.Product product : premiumExchangeActivity.getProducts()) {
String goodsId = StringUtils.isEmpty(product.getSkuId()) ? product.getSpuId() : product.getSkuId(); String goodsId = StringUtils.isEmpty(product.getSkuId()) ? product.getSpuId() : product.getSkuId();
...@@ -267,15 +267,15 @@ public class AdditionSharingService { ...@@ -267,15 +267,15 @@ public class AdditionSharingService {
continue; continue;
} }
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods hgGood = manyHgs.stream().filter(d -> goodsId.equals(d.getGoodsId())).findFirst().orElse(null); CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods hgGood = manyHgs.stream().filter(d -> goodsId.equals(d.getGoodsId())).findFirst().orElse(null);
if (hgGood==null) { if (hgGood == null) {
continue; continue;
} }
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = this.getCartGoodsDetailDto(product, getProductsVo, goodsId, hgGood); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = this.getCartGoodsDetailDto(product, getProductsVo, goodsId, hgGood);
shoppingCartGoodsDto.getProducts().add(cartGoodsDetailDto); shoppingCartGoodsDto.getProducts().add(cartGoodsDetailDto);
//2.计算优惠价格 //2.计算优惠价格
originalTotalAmount += getProductsVo.getFinalPrice(); originalTotalAmount += getProductsVo.getFinalPrice();
totalDiscountAmount += cartGoodsDetailDto.getTotalDiscountAmount(); //totalDiscountAmount += cartGoodsDetailDto.getTotalDiscountAmount();
currenttotalDiscountAmount += cartGoodsDetailDto.getTotalDiscountAmount(); //currenttotalDiscountAmount += cartGoodsDetailDto.getTotalDiscountAmount();
// 3.设置商品行优惠明细 // 3.设置商品行优惠明细
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount sendActivity = hgGood.getDiscounts().get(0); CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount sendActivity = hgGood.getDiscounts().get(0);
ActivityDiscountsDto activityDiscountsDto = new ActivityDiscountsDto(); ActivityDiscountsDto activityDiscountsDto = new ActivityDiscountsDto();
...@@ -319,6 +319,4 @@ public class AdditionSharingService { ...@@ -319,6 +319,4 @@ public class AdditionSharingService {
cartGoodsDetailDto.setExtraList(cartGoodsExtraList); cartGoodsDetailDto.setExtraList(cartGoodsExtraList);
return cartGoodsDetailDto; return cartGoodsDetailDto;
} }
} }
\ No newline at end of file
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