Commit 79625d9c by 缪晖

Merge branch 'feature/20201208_collageOrder_miaohui' into 'qa'

Update ShoppingCartCollageServiceImpl.java

See merge request !70
parents 137bf983 28ba4084
...@@ -708,7 +708,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp ...@@ -708,7 +708,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
updatePackPrice(shoppingCartGoodsResponseVo, shoppingCartGoodsDto); updatePackPrice(shoppingCartGoodsResponseVo, shoppingCartGoodsDto);
// 重新计算购物车行折扣总金额 // 重新计算购物车行折扣总金额
updateTotalDiscountAmount(shoppingCartGoodsDto); //updateTotalDiscountAmount(shoppingCartGoodsDto);
return ResponseUtil.success(shoppingCartGoodsDto); return ResponseUtil.success(shoppingCartGoodsDto);
} }
...@@ -801,6 +801,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp ...@@ -801,6 +801,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
return (int) (o1.getAddCartTime() - o2.getAddCartTime()); return (int) (o1.getAddCartTime() - o2.getAddCartTime());
} }
}); });
List<String> cartGoodsUidList = calculationDiscountGoodsList.stream().map(ActivityCalculationDiscountRequestDto.CalculationDiscountGoods::getCartGoodsUid).collect(toList());
activityCalculationDiscountRequestDto.setGoods(calculationDiscountGoodsList); activityCalculationDiscountRequestDto.setGoods(calculationDiscountGoodsList);
activityCalculationDiscountRequestDto.setCoupons(coupons); activityCalculationDiscountRequestDto.setCoupons(coupons);
activityCalculationDiscountRequestDto.setOrgIds(commonService.getOrgIds(partnerId, storeId)); activityCalculationDiscountRequestDto.setOrgIds(commonService.getOrgIds(partnerId, storeId));
...@@ -820,6 +821,17 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp ...@@ -820,6 +821,17 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
result.setValidCouponMap(validCouponMap); result.setValidCouponMap(validCouponMap);
result.setDeliveryAmount(distributionFee); result.setDeliveryAmount(distributionFee);
result.setDistributionFee(result.getDistributionFee()); result.setDistributionFee(result.getDistributionFee());
// 返回之前根据购物车行进行排序
List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods> apportionGoodsList = new ArrayList<>();
List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Goods> goodList = new ArrayList<>();
cartGoodsUidList.stream().forEach(cartGoodsUid -> {
apportionGoodsList.add(result.getApportionGoods().stream().filter(apportionGoods -> cartGoodsUid.equals(apportionGoods.getCartGoodsUid())).findFirst().get());
goodList.add(result.getGoods().stream().filter(goods -> cartGoodsUid.equals(goods.getCartGoodsUid())).findFirst().get());
});
result.setApportionGoods(apportionGoodsList);
result.setGoods(goodList);
return result; return result;
} }
// 支付宝华莱士紧急修改代码,当促销返回103错误码时,需要报券不适用于该门店,且清空购物车 // 支付宝华莱士紧急修改代码,当促销返回103错误码时,需要报券不适用于该门店,且清空购物车
......
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