Commit 79eafc43 by xiaoer.li@freemud.com

fix

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