Commit f638ae41 by 周晓航

临时优化,卡配置互斥的情况导致购物车返回数据不对,

解决方案: 先自己重新请求一次购物车
parent fdb37cd6
...@@ -325,7 +325,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -325,7 +325,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} else { } else {
//校验券是否有效 这里是新的商品券支持多商品及换购券 //校验券是否有效 这里是新的商品券支持多商品及换购券
ValidCouponBo validCouponBo = assortmentSdkService.validCoupon(partnerId, storeId, couponCode, productIds, ValidCouponBo validCouponBo = assortmentSdkService.validCoupon(partnerId, storeId, couponCode, productIds,
BusinessTypeEnum.getByType(addShoppingCartGoodsRequestVo.getMenuType()).getCode(), skuId, couponProductDto,cartGoods); BusinessTypeEnum.getByType(addShoppingCartGoodsRequestVo.getMenuType()).getCode(), skuId, couponProductDto, cartGoods);
spuId2 = validCouponBo.getSkuId(); spuId2 = validCouponBo.getSkuId();
todayAvailableTimes = validCouponBo.getTodayAvailableTimes(); todayAvailableTimes = validCouponBo.getTodayAvailableTimes();
if (StringUtils.isNotBlank(skuId)) { if (StringUtils.isNotBlank(skuId)) {
...@@ -349,7 +349,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -349,7 +349,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
//缓存中获取购物车商品信息 //缓存中获取购物车商品信息
// 注意,围餐和点餐redis数据结构不一样 // 注意,围餐和点餐redis数据结构不一样
List<CartGoods> allCartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, addShoppingCartGoodsRequestVo.getSessionId(), null, shoppingCartBaseService,bizType); List<CartGoods> allCartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, addShoppingCartGoodsRequestVo.getSessionId(), null, shoppingCartBaseService, bizType);
if (CollectionUtils.isEmpty(allCartGoodsList)) { if (CollectionUtils.isEmpty(allCartGoodsList)) {
allCartGoodsList = new ArrayList<>(); allCartGoodsList = new ArrayList<>();
} }
...@@ -381,27 +381,27 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -381,27 +381,27 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, appId, orderType, assortmentCustomerInfoVo.isMemberPaid(), allCartGoodsList , appId, orderType, assortmentCustomerInfoVo.isMemberPaid(), allCartGoodsList
, new ArrayList<>() //结算页选中的代金券 , new ArrayList<>() //结算页选中的代金券
, null //加价购商品 , null //加价购商品
, deliveryAmount, null,bizType, accountFlag,new DiscountSharingDto(),this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList())); , deliveryAmount, null, bizType, accountFlag, new DiscountSharingDto(), this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
//更新购物车券状态 //更新购物车券状态
newCalculationUpdateCouponStatus(userId, partnerId, storeId, bizType, cartGoods, allCartGoodsList, discountResult); newCalculationUpdateCouponStatus(userId, partnerId, storeId, bizType, cartGoods, allCartGoodsList, discountResult);
sharingCartService.distribute(discountResult, allCartGoodsList, shoppingCartGoodsResponseVo, null sharingCartService.distribute(discountResult, allCartGoodsList, shoppingCartGoodsResponseVo, null
, userLoginInfoDto, null, activityQueryDto, menuType, deliveryAmount , userLoginInfoDto, null, activityQueryDto, menuType, deliveryAmount
, ShoppingCartConstant.ADD_AND_UPDATE, partnerId, null, userId, storeId,this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList())); , ShoppingCartConstant.ADD_AND_UPDATE, partnerId, null, userId, storeId, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo, discountResult, null, partnerId); buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo, discountResult, null, partnerId);
// //
} else { } else {
// 获取优惠信息 // 获取优惠信息
CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, userLoginInfoDto.getWxAppid(), orderType, assortmentCustomerInfoVo.isMemberPaid(), allCartGoodsList, new ArrayList(), new ArrayList<>(), null, deliveryAmount,bizType, accountFlag, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()), new DiscountSharingDto()); CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, userLoginInfoDto.getWxAppid(), orderType, assortmentCustomerInfoVo.isMemberPaid(), allCartGoodsList, new ArrayList(), new ArrayList<>(), null, deliveryAmount, bizType, accountFlag, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()), new DiscountSharingDto());
if (calculationDiscountResult != null && CollectionUtils.isNotEmpty(calculationDiscountResult.getSendGoods())){ if (calculationDiscountResult != null && CollectionUtils.isNotEmpty(calculationDiscountResult.getSendGoods())) {
sendGoodsQtyCheck(productsCount, appId, partnerId, userId, storeId, tableNumber, oldCartGoodsList, shoppingCartBaseService, calculationDiscountResult.getSendGoods(),bizType); sendGoodsQtyCheck(productsCount, appId, partnerId, userId, storeId, tableNumber, oldCartGoodsList, shoppingCartBaseService, calculationDiscountResult.getSendGoods(), bizType);
} }
//更新买M N券 券状态 //更新买M N券 券状态
calculationUpdateCouponStatus(userId, partnerId, storeId, bizType, allCartGoodsList, calculationDiscountResult); calculationUpdateCouponStatus(userId, partnerId, storeId, bizType, allCartGoodsList, calculationDiscountResult);
// 当商品数量被设为0时 // 当商品数量被设为0时
if (Objects.equals(cartGoods.getQty(), 0)) { if (Objects.equals(cartGoods.getQty(), 0)) {
assortmentSdkService.updateGoodsQtyBySdk(partnerId, userId, storeId, cartGoods.getCartGoodsUid(), 0, "", shoppingCartBaseService,bizType); assortmentSdkService.updateGoodsQtyBySdk(partnerId, userId, storeId, cartGoods.getCartGoodsUid(), 0, "", shoppingCartBaseService, bizType);
} }
// 促销活动的优惠金额计算 // 促销活动的优惠金额计算
updateShoppingCartGoodsDiscount(null, activityQueryDto, calculationDiscountResult, allCartGoodsList, shoppingCartGoodsResponseVo, null, userLoginInfoDto, addShoppingCartGoodsRequestVo.getMenuType(), deliveryAmount, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList())); updateShoppingCartGoodsDiscount(null, activityQueryDto, calculationDiscountResult, allCartGoodsList, shoppingCartGoodsResponseVo, null, userLoginInfoDto, addShoppingCartGoodsRequestVo.getMenuType(), deliveryAmount, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
...@@ -491,7 +491,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -491,7 +491,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 先验证商品是否存在 // 先验证商品是否存在
CartGoods cartGoods = assortmentSdkService.getCartGoodsBySdk(partnerId, userId, storeId, cartGoodsUid, "", shoppingCartBaseService,bizType); CartGoods cartGoods = assortmentSdkService.getCartGoodsBySdk(partnerId, userId, storeId, cartGoodsUid, "", shoppingCartBaseService, bizType);
if (cartGoods == null) { if (cartGoods == null) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_UPDATE_ERROR); return ResponseUtil.error(ResponseResult.SHOPPING_CART_UPDATE_ERROR);
// throw new ServiceException(ResponseResult.SHOPPING_CART_UPDATE_ERROR); // throw new ServiceException(ResponseResult.SHOPPING_CART_UPDATE_ERROR);
...@@ -500,7 +500,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -500,7 +500,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
checkUpdateStock(updateShoppingCartGoodsQtyRequestVo, cartGoods); checkUpdateStock(updateShoppingCartGoodsQtyRequestVo, cartGoods);
Integer oldQty = cartGoods.getQty(); Integer oldQty = cartGoods.getQty();
// 更新购物车中数量 // 更新购物车中数量
List<CartGoods> cartGoodsList = assortmentSdkService.updateGoodsQtyBySdk(partnerId, userId, storeId, cartGoodsUid, qty < 0 ? 0 : qty, "", shoppingCartBaseService,bizType); List<CartGoods> cartGoodsList = assortmentSdkService.updateGoodsQtyBySdk(partnerId, userId, storeId, cartGoodsUid, qty < 0 ? 0 : qty, "", shoppingCartBaseService, bizType);
// check购物车中所有商品 // check购物车中所有商品
CheckCartRequest checkCartRequest = assortmentSdkService.checkShoppingCartSdk(cartGoodsList, partnerId, storeId, shoppingCartGoodsResponseVo, updateShoppingCartGoodsQtyRequestVo.getOrderType(), "", updateShoppingCartGoodsQtyRequestVo.getMenuType(), shoppingCartBaseService); CheckCartRequest checkCartRequest = assortmentSdkService.checkShoppingCartSdk(cartGoodsList, partnerId, storeId, shoppingCartGoodsResponseVo, updateShoppingCartGoodsQtyRequestVo.getOrderType(), "", updateShoppingCartGoodsQtyRequestVo.getMenuType(), shoppingCartBaseService);
...@@ -511,7 +511,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -511,7 +511,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
cartGoodsList = JSONArray.parseArray(JSONObject.toJSONString(checkCartRequest.getCartGoodsList()), CartGoods.class); cartGoodsList = JSONArray.parseArray(JSONObject.toJSONString(checkCartRequest.getCartGoodsList()), CartGoods.class);
// 重新存储最新购物车 // 重新存储最新购物车
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, updateShoppingCartGoodsQtyRequestVo.getSessionId(), "", shoppingCartBaseService,bizType); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, updateShoppingCartGoodsQtyRequestVo.getSessionId(), "", shoppingCartBaseService, bizType);
Long deliveryAmount = calculateDeliveryAmount(receiveId, partnerId, storeId, userLoginInfoDto.getWxAppid(), shoppingCartGoodsResponseVo, updateShoppingCartGoodsQtyRequestVo.getOrderType()); Long deliveryAmount = calculateDeliveryAmount(receiveId, partnerId, storeId, userLoginInfoDto.getWxAppid(), shoppingCartGoodsResponseVo, updateShoppingCartGoodsQtyRequestVo.getOrderType());
ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, updateShoppingCartGoodsQtyRequestVo.getOrderType()); ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, updateShoppingCartGoodsQtyRequestVo.getOrderType());
...@@ -531,10 +531,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -531,10 +531,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, new ArrayList() //券 , new ArrayList() //券
, null //加价购商品 , null //加价购商品
, deliveryAmount , deliveryAmount
, null,bizType, accountFlag, discountSharingDto, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList())); , null, bizType, accountFlag, discountSharingDto, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
//校验加购数量 //校验加购数量
if (discountResult != null) { if (discountResult != null) {
sendGoodsQtyCheckForUpdate(cartGoodsList, oldQty, appId, partnerId, userId, storeId, cartGoodsUid, "", shoppingCartBaseService, discountResult.getSendGoods(),bizType); sendGoodsQtyCheckForUpdate(cartGoodsList, oldQty, appId, partnerId, userId, storeId, cartGoodsUid, "", shoppingCartBaseService, discountResult.getSendGoods(), bizType);
} }
newCalculationUpdateCouponStatus(userId, partnerId, storeId, bizType, cartGoods, cartGoodsList, discountResult); newCalculationUpdateCouponStatus(userId, partnerId, storeId, bizType, cartGoods, cartGoodsList, discountResult);
...@@ -552,17 +552,17 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -552,17 +552,17 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, null , null
, userId , userId
, storeId , storeId
,this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList())); , this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo, discountResult, null, partnerId); buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo, discountResult, null, partnerId);
} else { } else {
// 获取优惠信息 // 获取优惠信息
CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, userLoginInfoDto.getWxAppid(), orderType, assortmentCustomerInfoVo.isMemberPaid(), cartGoodsList, new ArrayList(), new ArrayList<>(), null, deliveryAmount,bizType, accountFlag, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()),discountSharingDto); CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, userLoginInfoDto.getWxAppid(), orderType, assortmentCustomerInfoVo.isMemberPaid(), cartGoodsList, new ArrayList(), new ArrayList<>(), null, deliveryAmount, bizType, accountFlag, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()), discountSharingDto);
if (calculationDiscountResult == null) { if (calculationDiscountResult == null) {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList); shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
} }
if (calculationDiscountResult != null) { if (calculationDiscountResult != null) {
sendGoodsQtyCheckForUpdate(cartGoodsList, oldQty, appId, partnerId, userId, storeId, cartGoodsUid, "", shoppingCartBaseService, calculationDiscountResult.getSendGoods(),bizType); sendGoodsQtyCheckForUpdate(cartGoodsList, oldQty, appId, partnerId, userId, storeId, cartGoodsUid, "", shoppingCartBaseService, calculationDiscountResult.getSendGoods(), bizType);
} }
//校验 //校验
calculationUpdateCouponStatus(userId, partnerId, storeId, bizType, cartGoodsList, calculationDiscountResult); calculationUpdateCouponStatus(userId, partnerId, storeId, bizType, cartGoodsList, calculationDiscountResult);
...@@ -598,7 +598,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -598,7 +598,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
String finalMnCouponCode = mnCouponCode; String finalMnCouponCode = mnCouponCode;
List<CartGoods> couponCartGoods = cartGoodsList.stream().filter(good -> finalMnCouponCode.equals(good.getCouponCode())).collect(toList()); List<CartGoods> couponCartGoods = cartGoodsList.stream().filter(good -> finalMnCouponCode.equals(good.getCouponCode())).collect(toList());
//更新购物车状态 //更新购物车状态
assortmentSdkService.updateGoodsCouponStatus(partnerId, userId, storeId,couponCartGoods, shoppingCartBaseService,bizType); assortmentSdkService.updateGoodsCouponStatus(partnerId, userId, storeId, couponCartGoods, shoppingCartBaseService, bizType);
} }
} }
...@@ -686,7 +686,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -686,7 +686,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
String unChooseCouponCode = shoppingCartInfoRequestVo.getUnChooseCouponCode(); String unChooseCouponCode = shoppingCartInfoRequestVo.getUnChooseCouponCode();
// 获取购物车商品 // 获取购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, "", shoppingCartBaseService,bizType); List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, "", shoppingCartBaseService, bizType);
// 如果购物车商品不为空, 则check购物车中所有商品 // 如果购物车商品不为空, 则check购物车中所有商品
if (CollectionUtils.isNotEmpty(cartGoodsList)) { if (CollectionUtils.isNotEmpty(cartGoodsList)) {
// check是否反选取消商品券 // check是否反选取消商品券
...@@ -696,8 +696,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -696,8 +696,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
CartGoods cartGoods = cartGoodsList.get(i); CartGoods cartGoods = cartGoodsList.get(i);
if (GoodsTypeEnum.couponTypeList.contains(cartGoods.getGoodsType())) { if (GoodsTypeEnum.couponTypeList.contains(cartGoods.getGoodsType())) {
if (Objects.equals(cartGoods.getCouponCode() ,unChooseCouponCode)) { if (Objects.equals(cartGoods.getCouponCode(), unChooseCouponCode)) {
CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(partnerId, storeId, cartGoods.getCouponCode(), menuType,null); CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(partnerId, storeId, cartGoods.getCouponCode(), menuType, null);
GetProductsVo productInfo = null; GetProductsVo productInfo = null;
if (GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType()) || GoodsTypeEnum.BUY_M_SEND_N_COUPON.getGoodsType().equals(cartGoods.getGoodsType())) { if (GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType()) || GoodsTypeEnum.BUY_M_SEND_N_COUPON.getGoodsType().equals(cartGoods.getGoodsType())) {
productInfo = couponService.getSpqProductInfo(checkSpqInfoRequestDto, cartGoods.getSkuId()); productInfo = couponService.getSpqProductInfo(checkSpqInfoRequestDto, cartGoods.getSkuId());
...@@ -723,7 +723,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -723,7 +723,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
cartGoodsList = JSONArray.parseArray(JSONObject.toJSONString(checkCartRequest.getCartGoodsList()), CartGoods.class); cartGoodsList = JSONArray.parseArray(JSONObject.toJSONString(checkCartRequest.getCartGoodsList()), CartGoods.class);
// 重新存储最新购物车 // 重新存储最新购物车
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, assortmentCustomerInfoVo.getSessionId(), "", this.shoppingCartBaseService,bizType); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, assortmentCustomerInfoVo.getSessionId(), "", this.shoppingCartBaseService, bizType);
} }
// 获取基础运费,并且 组装 deliveryAmountList字段: 额外配送费 如夜间配送费等 // 获取基础运费,并且 组装 deliveryAmountList字段: 额外配送费 如夜间配送费等
...@@ -771,7 +771,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -771,7 +771,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, sendGoods , sendGoods
, deliveryAmount , deliveryAmount
, null , null
,bizType, accountFlag,discountSharingDto, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList())); , bizType, accountFlag, discountSharingDto, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
sharingCartService.distribute(calculationSharingDiscountResult sharingCartService.distribute(calculationSharingDiscountResult
, cartGoodsList , cartGoodsList
, shoppingCartGoodsResponseVo , shoppingCartGoodsResponseVo
...@@ -785,7 +785,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -785,7 +785,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, partnerId , partnerId
, shoppingCartInfoRequestVo.getFlag() , shoppingCartInfoRequestVo.getFlag()
, userId , userId
, storeId,this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList())); , storeId, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo, calculationSharingDiscountResult, shoppingCartInfoRequestVo.getFlag(), partnerId); buildShoppingCartGoodsResponse(shoppingCartGoodsResponseVo, calculationSharingDiscountResult, shoppingCartInfoRequestVo.getFlag(), partnerId);
} else { } else {
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = new ArrayList<>(); List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = new ArrayList<>();
...@@ -813,7 +813,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -813,7 +813,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 获取优惠信息 调用促销 // 获取优惠信息 调用促销
CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId,
userLoginInfoDto.getWxAppid(), orderType, assortmentCustomerInfoVo.isMemberPaid(), userLoginInfoDto.getWxAppid(), orderType, assortmentCustomerInfoVo.isMemberPaid(),
cartGoodsList, coupons, null, shoppingCartInfoRequestVo.getReceiveId(), deliveryAmount,bizType, accountFlag, nightDistributionFee, discountSharingDto); cartGoodsList, coupons, null, shoppingCartInfoRequestVo.getReceiveId(), deliveryAmount, bizType, accountFlag, nightDistributionFee, discountSharingDto);
if (calculationDiscountResult == null) { if (calculationDiscountResult == null) {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList); shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
} }
...@@ -881,9 +881,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -881,9 +881,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
/** /**
* 加车 和list接口 公用处理方法 * 加车 和list接口 公用处理方法
*
* @param shoppingCartGoodsResponseVo * @param shoppingCartGoodsResponseVo
*/ */
private void shoppingCartAddOrListCommonResponseHandle(ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo){ private void shoppingCartAddOrListCommonResponseHandle(ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo) {
if (Objects.isNull(shoppingCartGoodsResponseVo)) { if (Objects.isNull(shoppingCartGoodsResponseVo)) {
return; return;
} }
...@@ -899,15 +900,16 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -899,15 +900,16 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
/** /**
* 如果有夜间配送费 需要维护划线价 deliveryAmount 字段, ___> 注意, 配送费的优惠是 促销在算(又特么各算一半,这产品真是恶心) * 如果有夜间配送费 需要维护划线价 deliveryAmount 字段, ___> 注意, 配送费的优惠是 促销在算(又特么各算一半,这产品真是恶心)
*
* @param deliveryAmount * @param deliveryAmount
* @param nightDistributionFee * @param nightDistributionFee
* @return * @return
*/ */
private Long responseDataMaintain2DeliverAmount(Long deliveryAmount,long nightDistributionFee){ private Long responseDataMaintain2DeliverAmount(Long deliveryAmount, long nightDistributionFee) {
if (Objects.isNull(deliveryAmount)) { if (Objects.isNull(deliveryAmount)) {
deliveryAmount = 0L; deliveryAmount = 0L;
} }
if (nightDistributionFee < 0){ if (nightDistributionFee < 0) {
return deliveryAmount; return deliveryAmount;
} }
return deliveryAmount + nightDistributionFee; return deliveryAmount + nightDistributionFee;
...@@ -915,6 +917,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -915,6 +917,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
/** /**
* 获取 券使用的门槛信息 * 获取 券使用的门槛信息
*
* @param products * @param products
* @return * @return
*/ */
...@@ -1016,9 +1019,9 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1016,9 +1019,9 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
@Override @Override
public BaseResponse getGoodsListCheck(ShoppingCartInfoRequestVo shoppingCartInfoRequestVo) { public BaseResponse getGoodsListCheck(ShoppingCartInfoRequestVo shoppingCartInfoRequestVo) {
Set<String> cardCodesSet = new HashSet<>(); Set<String> cardCodesSet = new HashSet<>();
if(CollectionUtils.isNotEmpty(shoppingCartInfoRequestVo.getCardCodes())){ if (CollectionUtils.isNotEmpty(shoppingCartInfoRequestVo.getCardCodes())) {
cardCodesSet.addAll(shoppingCartInfoRequestVo.getCardCodes()); cardCodesSet.addAll(shoppingCartInfoRequestVo.getCardCodes());
}else if(StringUtils.isNotBlank(shoppingCartInfoRequestVo.getCardCode())){ } else if (StringUtils.isNotBlank(shoppingCartInfoRequestVo.getCardCode())) {
cardCodesSet.add(shoppingCartInfoRequestVo.getCardCode()); cardCodesSet.add(shoppingCartInfoRequestVo.getCardCode());
} }
if (CollectionUtils.isEmpty(cardCodesSet)) { if (CollectionUtils.isEmpty(cardCodesSet)) {
...@@ -1055,6 +1058,14 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1055,6 +1058,14 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
return goodsList; return goodsList;
} }
ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo = goodsList.getResult(); ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo = goodsList.getResult();
// fisherman -> 储值卡互斥需求 发现bug 导致返回购物车数据不对 当前时间节点无法修复 重新请求一次
if (Objects.nonNull(shoppingCartInfoRequestVo.getEnableSharing()) && shoppingCartInfoRequestVo.getEnableSharing().compareTo(0) == 0) {
goodsList = getGoodsList(shoppingCartInfoRequestVo);
if (goodsList == null || !ResponseResult.SUCCESS.getCode().equals(goodsList.getCode())) {
return goodsList;
}
shoppingCartGoodsResponseVo = goodsList.getResult();
}
//SVC卡支付 //SVC卡支付
SVCCardPay(cardCodes, shoppingCartInfoRequestVo.getReceiveId(), partnerId, storeId, shoppingCartGoodsResponseVo); SVCCardPay(cardCodes, shoppingCartInfoRequestVo.getReceiveId(), partnerId, storeId, shoppingCartGoodsResponseVo);
return ResponseUtil.success(goodsList.getResult()); return ResponseUtil.success(goodsList.getResult());
...@@ -1084,7 +1095,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1084,7 +1095,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
String partnerId = shoppingCartClearRequestVo.getPartnerId(); String partnerId = shoppingCartClearRequestVo.getPartnerId();
String storeId = shoppingCartClearRequestVo.getShopId(); String storeId = shoppingCartClearRequestVo.getShopId();
shoppingCartNewBaseService.clear(partnerId, storeId, userId,bizType); shoppingCartNewBaseService.clear(partnerId, storeId, userId, bizType);
if (ObjectUtils.equals(shoppingCartClearRequestVo.getOperationType(), OperationTypeEnum.PAY_SUCCESS.getOperationType())) { if (ObjectUtils.equals(shoppingCartClearRequestVo.getOperationType(), OperationTypeEnum.PAY_SUCCESS.getOperationType())) {
return ResponseUtil.success(); return ResponseUtil.success();
} }
...@@ -1151,7 +1162,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1151,7 +1162,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList = shoppingCartInfoRequestVo.getSendGoods(); List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList = shoppingCartInfoRequestVo.getSendGoods();
// 获取购物车商品 // 获取购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, tableNumber, shoppingCartBaseService,bizType); List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, null, tableNumber, shoppingCartBaseService, bizType);
if (cartGoodsList == null) { if (cartGoodsList == null) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_GETINFO_INVAILD); return ResponseUtil.error(ResponseResult.SHOPPING_CART_GETINFO_INVAILD);
// throw new ServiceException(ResponseResult.SHOPPING_CART_GETINFO_INVAILD); // throw new ServiceException(ResponseResult.SHOPPING_CART_GETINFO_INVAILD);
...@@ -1190,7 +1201,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1190,7 +1201,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 多规格的sku商品计算包装费 // 多规格的sku商品计算包装费
//this.checkSkuOnVersion(cartGoodsList, partnerId, storeId, shoppingCartGoodsResponseVo); //this.checkSkuOnVersion(cartGoodsList, partnerId, storeId, shoppingCartGoodsResponseVo);
// 重新存储最新购物车 // 重新存储最新购物车
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, assortmentCustomerInfoVo.getSessionId(), tableNumber, this.shoppingCartBaseService,bizType); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, assortmentCustomerInfoVo.getSessionId(), tableNumber, this.shoppingCartBaseService, bizType);
if (CollectionUtils.isNotEmpty(sendGoodsList)) { if (CollectionUtils.isNotEmpty(sendGoodsList)) {
processSendGoods(sendGoodsList, partnerId, storeId, shoppingCartInfoRequestVo.getMenuType(), shoppingCartBaseService); processSendGoods(sendGoodsList, partnerId, storeId, shoppingCartInfoRequestVo.getMenuType(), shoppingCartBaseService);
...@@ -1237,7 +1248,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1237,7 +1248,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, coupons , coupons
, shoppingCartInfoRequestVo.getSendGoods() , shoppingCartInfoRequestVo.getSendGoods()
, deliveryAmount , deliveryAmount
, shoppingCartInfoRequestVo,bizType, accountFlag,discountSharingDto, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList())); , shoppingCartInfoRequestVo, bizType, accountFlag, discountSharingDto, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
// 活动校验 // 活动校验
calculationSharingValidatorService.validator(discountResult calculationSharingValidatorService.validator(discountResult
...@@ -1284,7 +1295,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1284,7 +1295,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
// 获取优惠信息 // 获取优惠信息
CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, userLoginInfoDto.getWxAppid(), orderType, assortmentCustomerInfoVo.isMemberPaid(), cartGoodsList, coupons, sendGoodsList, shoppingCartInfoRequestVo.getReceiveId(), deliveryAmount,bizType, accountFlag, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()),discountSharingDto); CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, userLoginInfoDto.getWxAppid(), orderType, assortmentCustomerInfoVo.isMemberPaid(), cartGoodsList, coupons, sendGoodsList, shoppingCartInfoRequestVo.getReceiveId(), deliveryAmount, bizType, accountFlag, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()), discountSharingDto);
//临时方案 //临时方案
packgeAdditional(shoppingCartInfoRequestVo, premiumExchangeActivity); packgeAdditional(shoppingCartInfoRequestVo, premiumExchangeActivity);
// 促销活动的优惠金额计算 // 促销活动的优惠金额计算
...@@ -1311,6 +1322,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1311,6 +1322,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
/** /**
* 设置购物车是否可以下单状态 * 设置购物车是否可以下单状态
*
* @param shoppingCartGoodsResponseVo * @param shoppingCartGoodsResponseVo
*/ */
private void setNonSingleOrder(ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo) { private void setNonSingleOrder(ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo) {
...@@ -1410,11 +1422,11 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1410,11 +1422,11 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
List<GetSvcInfoByMemberIdResponse> memberCardResponses = svcInfoByMemberId.getData(); List<GetSvcInfoByMemberIdResponse> memberCardResponses = svcInfoByMemberId.getData();
// 查询储值卡的余额 // 查询储值卡的余额
List<String> cardCodes = memberCardResponses.stream().map(GetSvcInfoByMemberIdResponse::getCardCode).collect(Collectors.toList()); List<String> cardCodes = memberCardResponses.stream().map(GetSvcInfoByMemberIdResponse::getCardCode).collect(Collectors.toList());
if (statusFlagList!=null&&statusFlagList.size()>0&&statusFlagList.contains(0)){ if (statusFlagList != null && statusFlagList.size() > 0 && statusFlagList.contains(0)) {
//从SVC查询出有效的储值卡,状态2 //从SVC查询出有效的储值卡,状态2
SvcCardDetailRequest req= new SvcCardDetailRequest(partnerId,cardCodes); SvcCardDetailRequest req = new SvcCardDetailRequest(partnerId, cardCodes);
BaseResponse<List<SvcCardDetailsResponse>> details = svcAppClient.details(req); BaseResponse<List<SvcCardDetailsResponse>> details = svcAppClient.details(req);
cardCodes=details.getResult().stream().filter(item->item.getCardState().equals(2)).map(SvcCardDetailsResponse::getCardCode).collect(toList()); cardCodes = details.getResult().stream().filter(item -> item.getCardState().equals(2)).map(SvcCardDetailsResponse::getCardCode).collect(toList());
} }
SVCCardAmountRequest svcCardAmountRequest = new SVCCardAmountRequest(); SVCCardAmountRequest svcCardAmountRequest = new SVCCardAmountRequest();
svcCardAmountRequest.setCardCodes(cardCodes); svcCardAmountRequest.setCardCodes(cardCodes);
...@@ -1588,7 +1600,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1588,7 +1600,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) { if (GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) {
if (CollectionUtils.isEmpty(cartGoods.getProductGroupList()) && CollectionUtils.isEmpty(cartGoods.getProductComboList())) { if (CollectionUtils.isEmpty(cartGoods.getProductGroupList()) && CollectionUtils.isEmpty(cartGoods.getProductComboList())) {
cartGoodsList.remove(i); cartGoodsList.remove(i);
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, null, null, this.shoppingCartBaseService,bizType); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, null, null, this.shoppingCartBaseService, bizType);
throw new ServiceException(ResponseResult.SHOPPING_CART_NO_MEAL); throw new ServiceException(ResponseResult.SHOPPING_CART_NO_MEAL);
} }
} }
...@@ -1605,7 +1617,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1605,7 +1617,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (StringUtils.isBlank(couponCode)) { if (StringUtils.isBlank(couponCode)) {
this.addCalculationDiscountGoods(calculationDiscountGoodsList, cartGoods); this.addCalculationDiscountGoods(calculationDiscountGoodsList, cartGoods);
} else { } else {
CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(partnerId, storeId, couponCode, menuType,cartGoods); CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(partnerId, storeId, couponCode, menuType, cartGoods);
CheckSpqInfoResponseDto checkSpqInfoResponseDto = null; CheckSpqInfoResponseDto checkSpqInfoResponseDto = null;
// fisherman 删除商品券导致 购物车显示商品名称 为换购券 券名称 // fisherman 删除商品券导致 购物车显示商品名称 为换购券 券名称
boolean viewProductName = false; boolean viewProductName = false;
...@@ -1614,17 +1626,18 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1614,17 +1626,18 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
viewProductName = true; viewProductName = true;
checkSpqInfoResponseDto = couponService.checkSpqInfo(checkSpqInfoRequestDto, cartGoods.getSkuId()); checkSpqInfoResponseDto = couponService.checkSpqInfo(checkSpqInfoRequestDto, cartGoods.getSkuId());
} else { } else {
checkSpqInfoResponseDto = couponService.checkSpqInfo(checkSpqInfoRequestDto,cartGoods.getSkuId()); checkSpqInfoResponseDto = couponService.checkSpqInfo(checkSpqInfoRequestDto, cartGoods.getSkuId());
} }
// 商品券不存在时,将商品券从购物车移除 // 商品券不存在时,将商品券从购物车移除
if (checkSpqInfoResponseDto == null) { if (checkSpqInfoResponseDto == null) {
cartGoodsList.remove(i); cartGoodsList.remove(i);
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, null, null, this.shoppingCartBaseService,bizType); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, null, null, this.shoppingCartBaseService, bizType);
continue; continue;
} }
if (cartGoodsUid.startsWith(CommonsConstant.COUPON_PREFIX)) { if (cartGoodsUid.startsWith(CommonsConstant.COUPON_PREFIX)) {
validCouponMap.put(couponCode, checkSpqInfoResponseDto); validCouponMap.put(couponCode, checkSpqInfoResponseDto);
}if (!GoodsTypeEnum.BUY_M_SEND_N_COUPON.getGoodsType().equals(cartGoods.getGoodsType())) { }
if (!GoodsTypeEnum.BUY_M_SEND_N_COUPON.getGoodsType().equals(cartGoods.getGoodsType())) {
validCouponMap.put(couponCode + checkSpqInfoResponseDto.getSkuId(), checkSpqInfoResponseDto); validCouponMap.put(couponCode + checkSpqInfoResponseDto.getSkuId(), checkSpqInfoResponseDto);
validCouponMap.put(couponCode, checkSpqInfoResponseDto); validCouponMap.put(couponCode, checkSpqInfoResponseDto);
} }
...@@ -1641,7 +1654,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1641,7 +1654,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
cartGoods.setName(checkSpqInfoResponseDto.getSkuName()); cartGoods.setName(checkSpqInfoResponseDto.getSkuName());
cartGoods.setSpuName(checkSpqInfoResponseDto.getSkuName()); cartGoods.setSpuName(checkSpqInfoResponseDto.getSkuName());
cartGoods.setSkuName(checkSpqInfoResponseDto.getSkuName()); cartGoods.setSkuName(checkSpqInfoResponseDto.getSkuName());
}else { } else {
cartGoods.setName(checkSpqInfoResponseDto.getCouponName()); cartGoods.setName(checkSpqInfoResponseDto.getCouponName());
cartGoods.setSpuName(checkSpqInfoResponseDto.getCouponName()); cartGoods.setSpuName(checkSpqInfoResponseDto.getCouponName());
} }
...@@ -1657,8 +1670,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1657,8 +1670,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// canUseCoupon 0 表示可用 // canUseCoupon 0 表示可用
accountFlag = accountFlag == null ? 0 : accountFlag; accountFlag = accountFlag == null ? 0 : accountFlag;
if (CollectionUtils.isEmpty(collect)) { if (CollectionUtils.isEmpty(collect)) {
if (GoodsTypeEnum.BUY_M_SEND_N_COUPON.getGoodsType().equals(cartGoods.getGoodsType()) && accountFlag == 1 ) if (GoodsTypeEnum.BUY_M_SEND_N_COUPON.getGoodsType().equals(cartGoods.getGoodsType()) && accountFlag == 1) {
{
if (cartGoods.getCanUseCoupon() == 0) { if (cartGoods.getCanUseCoupon() == 0) {
ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon coupon = new ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon(); ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon coupon = new ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon();
coupon.setCode(checkSpqInfoResponseDto.getCouponCode()); coupon.setCode(checkSpqInfoResponseDto.getCouponCode());
...@@ -1682,7 +1694,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1682,7 +1694,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 当加价购商品不为空时 // 当加价购商品不为空时
if (CollectionUtils.isNotEmpty(sendGoodsList)) { if (CollectionUtils.isNotEmpty(sendGoodsList)) {
for (ShoppingCartInfoRequestVo.SendGoods sendGoods : sendGoodsList) { for (ShoppingCartInfoRequestVo.SendGoods sendGoods : sendGoodsList) {
this.addCalculationDiscountGoods(calculationDiscountGoodsList, sendGoods.getGoodsId(), sendGoods.getQty(), sendGoods.getOriginalPrice(), 100, "",null); this.addCalculationDiscountGoods(calculationDiscountGoodsList, sendGoods.getGoodsId(), sendGoods.getQty(), sendGoods.getOriginalPrice(), 100, "", null);
} }
} }
calculationDiscountGoodsList.removeIf(calculationDiscountGoods -> (calculationDiscountGoods.getGoodsQuantity().equals(0))); calculationDiscountGoodsList.removeIf(calculationDiscountGoods -> (calculationDiscountGoods.getGoodsQuantity().equals(0)));
...@@ -1787,7 +1799,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1787,7 +1799,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// calculationDiscountGoods.setMemberDiscount(memberDiscount); // calculationDiscountGoods.setMemberDiscount(memberDiscount);
// this.addCalculationDiscountGoods(calculationDiscountGoodsList, calculationDiscountGoods); // this.addCalculationDiscountGoods(calculationDiscountGoodsList, calculationDiscountGoods);
// } // }
private void addCalculationDiscountGoods(List<ActivityCalculationDiscountRequestDto.CalculationDiscountGoods> calculationDiscountGoodsList private void addCalculationDiscountGoods(List<ActivityCalculationDiscountRequestDto.CalculationDiscountGoods> calculationDiscountGoodsList
, String goodsId , String goodsId
, Integer goodsQuantity , Integer goodsQuantity
...@@ -2246,7 +2257,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2246,7 +2257,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
shoppingCartGoodsResponseVo.setToastMsg(checkCartRequest.getShoppingCartGoodsResponseVo().getToastMsg()); shoppingCartGoodsResponseVo.setToastMsg(checkCartRequest.getShoppingCartGoodsResponseVo().getToastMsg());
shoppingCartGoodsResponseVo.setChanged(checkCartRequest.getShoppingCartGoodsResponseVo().getChanged()); shoppingCartGoodsResponseVo.setChanged(checkCartRequest.getShoppingCartGoodsResponseVo().getChanged());
} }
List<CartGoods> allCartGoodsList =checkCartRequest.getCartGoodsList(); List<CartGoods> allCartGoodsList = checkCartRequest.getCartGoodsList();
//判断当前商品在购物车是否已存在,存在则数量+1,不存在商品行 + 1 //判断当前商品在购物车是否已存在,存在则数量+1,不存在商品行 + 1
allCartGoodsList.forEach(oldCartGoods -> { allCartGoodsList.forEach(oldCartGoods -> {
...@@ -2260,7 +2271,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2260,7 +2271,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 重新set购物车信息到缓存中 // 重新set购物车信息到缓存中
assortmentSdkService.setShoppingCart(addShoppingCartGoodsRequestVo.getPartnerId(), addShoppingCartGoodsRequestVo.getShopId(), assortmentSdkService.setShoppingCart(addShoppingCartGoodsRequestVo.getPartnerId(), addShoppingCartGoodsRequestVo.getShopId(),
userId, nowCartGoodsList, addShoppingCartGoodsRequestVo.getSessionId(), addShoppingCartGoodsRequestVo.getTableNumber(), this.shoppingCartBaseService,addShoppingCartGoodsRequestVo.getBizType()); userId, nowCartGoodsList, addShoppingCartGoodsRequestVo.getSessionId(), addShoppingCartGoodsRequestVo.getTableNumber(), this.shoppingCartBaseService, addShoppingCartGoodsRequestVo.getBizType());
oldAllCartGoodsList.clear(); oldAllCartGoodsList.clear();
oldAllCartGoodsList.addAll(nowCartGoodsList); oldAllCartGoodsList.addAll(nowCartGoodsList);
return nowCartGoodsList; return nowCartGoodsList;
...@@ -2313,7 +2324,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2313,7 +2324,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (CollectionUtils.isNotEmpty(allCartGoodsList)) { if (CollectionUtils.isNotEmpty(allCartGoodsList)) {
if (Objects.equals(CouponTypeEnum.TYPE_0.getCode(), couponProductDto.getType()) if (Objects.equals(CouponTypeEnum.TYPE_0.getCode(), couponProductDto.getType())
|| Objects.equals(CouponTypeEnum.TYPE_4.getCode(), couponProductDto.getType())) { || Objects.equals(CouponTypeEnum.TYPE_4.getCode(), couponProductDto.getType())) {
int sum = allCartGoodsList.stream().filter(p -> Objects.equals(p.getCouponCode(),couponCode)).mapToInt(CartGoods::getQty).sum(); int sum = allCartGoodsList.stream().filter(p -> Objects.equals(p.getCouponCode(), couponCode)).mapToInt(CartGoods::getQty).sum();
//今日可用次数判断 //今日可用次数判断
if (sum + cartGoods.getQty() > todayAvailableTimes) { if (sum + cartGoods.getQty() > todayAvailableTimes) {
throw new ServiceException(ResponseResult.SHOPPING_CART_GOODS_COUPON_CAN_NOT_USE); throw new ServiceException(ResponseResult.SHOPPING_CART_GOODS_COUPON_CAN_NOT_USE);
...@@ -2380,7 +2391,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2380,7 +2391,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
private void commonItemVerfity(String channel, String partnerId, String storeId, List<Long> productIds, Integer qty){ private void commonItemVerfity(String channel, String partnerId, String storeId, List<Long> productIds, Integer qty) {
GetProductStockRequestDto requestDto = new GetProductStockRequestDto(); GetProductStockRequestDto requestDto = new GetProductStockRequestDto();
requestDto.setChannel(channel); requestDto.setChannel(channel);
requestDto.setPartnerId(partnerId); requestDto.setPartnerId(partnerId);
...@@ -2460,7 +2471,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2460,7 +2471,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} else if ((Objects.equals(shoppingCartInfoRequestVo.getOrderType(), CreateOrderType.TAKE_OUT.getCode()) } else if ((Objects.equals(shoppingCartInfoRequestVo.getOrderType(), CreateOrderType.TAKE_OUT.getCode())
|| Objects.equals(shoppingCartInfoRequestVo.getReachStoreType(), OrderType.COLLECT_GOODS.getCode()))) { || Objects.equals(shoppingCartInfoRequestVo.getReachStoreType(), OrderType.COLLECT_GOODS.getCode()))) {
//fisherman 【ID1033456】自提根据模板配置计算餐具包装费 //fisherman 【ID1033456】自提根据模板配置计算餐具包装费
PackAmountConfig packAmountByStoreConfig = commonFunctionHandle.getPackAmountByStoreConfig(shoppingCartInfoRequestVo, shoppingCartGoodsResponseVo.getNewPackAmount(),shoppingCartGoodsResponseVo.getTotalAmount()); PackAmountConfig packAmountByStoreConfig = commonFunctionHandle.getPackAmountByStoreConfig(shoppingCartInfoRequestVo, shoppingCartGoodsResponseVo.getNewPackAmount(), shoppingCartGoodsResponseVo.getTotalAmount());
Long packAmount = packAmountByStoreConfig.getNewPackAmount(); Long packAmount = packAmountByStoreConfig.getNewPackAmount();
shoppingCartGoodsResponseVo.setNewPackAmount(packAmount); shoppingCartGoodsResponseVo.setNewPackAmount(packAmount);
shoppingCartGoodsResponseVo.setPackageAmountCollectType(CollectionUtils.isEmpty(packAmountByStoreConfig.getCollectType()) ? 1 : 2); shoppingCartGoodsResponseVo.setPackageAmountCollectType(CollectionUtils.isEmpty(packAmountByStoreConfig.getCollectType()) ? 1 : 2);
...@@ -2726,15 +2737,15 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2726,15 +2737,15 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
private CalculationDiscountResult getCalculationDiscountResult(String menuType private CalculationDiscountResult getCalculationDiscountResult(String menuType
, String partnerId, String storeId, String userId, String appId, String wxappid, Integer orderType, boolean isMember , String partnerId, String storeId, String userId, String appId, String wxappid, Integer orderType, boolean isMember
, List<CartGoods> cartGoodsList, List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons , List<CartGoods> cartGoodsList, List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons
, List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList, String receiveId, Long deliveryAmount,Integer bizType, Integer accountFlag, long nightDistributionFee, DiscountSharingDto discountSharingDto ) { , List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList, String receiveId, Long deliveryAmount, Integer bizType, Integer accountFlag, long nightDistributionFee, DiscountSharingDto discountSharingDto) {
// 获取优惠信息 // 获取优惠信息
CalculationDiscountResult calculationDiscountResult = null; CalculationDiscountResult calculationDiscountResult = null;
//外卖场景下 查询门店配送信息 //外卖场景下 查询门店配送信息
if (BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)) { if (BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)) {
calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, isMember, cartGoodsList, coupons, sendGoodsList, BusinessTypeEnum.getByType(menuType).getCode(), deliveryAmount,bizType, accountFlag, nightDistributionFee, discountSharingDto); calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, isMember, cartGoodsList, coupons, sendGoodsList, BusinessTypeEnum.getByType(menuType).getCode(), deliveryAmount, bizType, accountFlag, nightDistributionFee, discountSharingDto);
} else { } else {
calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, isMember, cartGoodsList, coupons, sendGoodsList, BusinessTypeEnum.getByType(menuType).getCode(), null,bizType, accountFlag, 0L, discountSharingDto); calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, isMember, cartGoodsList, coupons, sendGoodsList, BusinessTypeEnum.getByType(menuType).getCode(), null, bizType, accountFlag, 0L, discountSharingDto);
} }
return calculationDiscountResult; return calculationDiscountResult;
...@@ -2820,7 +2831,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2820,7 +2831,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
break; break;
case 1: { case 1: {
//商户+门店级别(新算价) //商户+门店级别(新算价)
String partnerId_storeId= partnerId.concat(storeId); String partnerId_storeId = partnerId.concat(storeId);
if (Arrays.asList(center.getGrayList().split(",")).contains(partnerId_storeId)) { if (Arrays.asList(center.getGrayList().split(",")).contains(partnerId_storeId)) {
enable = true; enable = true;
} }
...@@ -2945,7 +2956,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2945,7 +2956,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
/** /**
* 购物车添加完成后促销返回赠送商品总数量校验 * 购物车添加完成后促销返回赠送商品总数量校验
*/ */
public void sendGoodsQtyCheck(Integer checkQty, String appid, String partnerId, String userId, String storeId, String tableNumber, List<CartGoods> oldCartGoodsList, ShoppingCartBaseService shoppingCartService, List<SendActivity> sendActivitys,Integer bizType) { public void sendGoodsQtyCheck(Integer checkQty, String appid, String partnerId, String userId, String storeId, String tableNumber, List<CartGoods> oldCartGoodsList, ShoppingCartBaseService shoppingCartService, List<SendActivity> sendActivitys, Integer bizType) {
if (CollectionUtils.isEmpty(sendActivitys)) { if (CollectionUtils.isEmpty(sendActivitys)) {
return; return;
} }
...@@ -2957,7 +2968,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2957,7 +2968,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
int cartLimitCount = queryLimitCount(partnerId, appid); int cartLimitCount = queryLimitCount(partnerId, appid);
if (cartLimitCount != 0 && checkQty + sendQty > cartLimitCount) { if (cartLimitCount != 0 && checkQty + sendQty > cartLimitCount) {
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, oldCartGoodsList, null, tableNumber, shoppingCartService,bizType); assortmentSdkService.setShoppingCart(partnerId, storeId, userId, oldCartGoodsList, null, tableNumber, shoppingCartService, bizType);
throw new ServiceException(ResponseResult.SHOPPING_CART_LIMIT_ADD); throw new ServiceException(ResponseResult.SHOPPING_CART_LIMIT_ADD);
} }
} }
...@@ -2965,7 +2976,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2965,7 +2976,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
/** /**
* 购物车添加完成后促销返回赠送商品总数量校验 * 购物车添加完成后促销返回赠送商品总数量校验
*/ */
public void sendGoodsQtyCheckForUpdate(List<CartGoods> cartGoodsList, Integer goodsQty, String appid, String partnerId, String userId, String storeId, String cartGoodsUid, String tableNumber, ShoppingCartBaseService shoppingCartService, List<SendActivity> sendActivitys,Integer bizType) { public void sendGoodsQtyCheckForUpdate(List<CartGoods> cartGoodsList, Integer goodsQty, String appid, String partnerId, String userId, String storeId, String cartGoodsUid, String tableNumber, ShoppingCartBaseService shoppingCartService, List<SendActivity> sendActivitys, Integer bizType) {
Integer updateQty = 0; Integer updateQty = 0;
if (CollectionUtils.isNotEmpty(cartGoodsList)) { if (CollectionUtils.isNotEmpty(cartGoodsList)) {
for (CartGoods goods : cartGoodsList) { for (CartGoods goods : cartGoodsList) {
...@@ -2983,7 +2994,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2983,7 +2994,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
} }
if (cartLimitCount != 0 && updateQty + sendQty > cartLimitCount) { if (cartLimitCount != 0 && updateQty + sendQty > cartLimitCount) {
assortmentSdkService.updateGoodsQtyBySdk(partnerId, userId, storeId, cartGoodsUid, goodsQty, "", shoppingCartBaseService,bizType); assortmentSdkService.updateGoodsQtyBySdk(partnerId, userId, storeId, cartGoodsUid, goodsQty, "", shoppingCartBaseService, bizType);
throw new ServiceException(ResponseResult.SHOPPING_CART_LIMIT_ADD); throw new ServiceException(ResponseResult.SHOPPING_CART_LIMIT_ADD);
} }
} }
...@@ -3141,7 +3152,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -3141,7 +3152,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 返回构造对象 // 返回构造对象
PremiumExchangeResponseVo premiumExchangeResponseVo = new PremiumExchangeResponseVo(); PremiumExchangeResponseVo premiumExchangeResponseVo = new PremiumExchangeResponseVo();
premiumExchangeResponseVo.setResultCode(ActivityResultCodeEnum.NON_PARTICIPATE.getCode()); premiumExchangeResponseVo.setResultCode(ActivityResultCodeEnum.NON_PARTICIPATE.getCode());
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, request.getSessionId(), null, shoppingCartBaseService,bizType); List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCart(partnerId, storeId, userId, request.getSessionId(), null, shoppingCartBaseService, bizType);
DiscountSharingDto discountSharingDto = new DiscountSharingDto(); DiscountSharingDto discountSharingDto = new DiscountSharingDto();
discountSharingDto.setEnableSharing(request.getEnableSharing()); discountSharingDto.setEnableSharing(request.getEnableSharing());
if (grayPush(partnerId, storeId, "2")) { if (grayPush(partnerId, storeId, "2")) {
...@@ -3176,7 +3187,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -3176,7 +3187,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, coupons //券 , coupons //券
, null //加价购商品 , null //加价购商品
, 0L , 0L
, null,bizType, accountFlag,discountSharingDto, 0L); , null, bizType, accountFlag, discountSharingDto, 0L);
premiumExchangeResponseVo = activityAdapter.convert2PremiumExchangeSharing(discountResult); premiumExchangeResponseVo = activityAdapter.convert2PremiumExchangeSharing(discountResult);
} else { } else {
...@@ -3200,8 +3211,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -3200,8 +3211,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}); });
} }
// 获取优惠信息 // 获取优惠信息
CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, assortmentCustomerInfoVo.getWxAppId(), orderType, assortmentCustomerInfoVo.isMemberPaid(), cartGoodsList, coupons, null, null, 0L,bizType CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, assortmentCustomerInfoVo.getWxAppId(), orderType, assortmentCustomerInfoVo.isMemberPaid(), cartGoodsList, coupons, null, null, 0L, bizType
, accountFlag, 0L,discountSharingDto); , accountFlag, 0L, discountSharingDto);
premiumExchangeResponseVo = activityAdapter.convert2PremiumExchange(calculationDiscountResult); premiumExchangeResponseVo = activityAdapter.convert2PremiumExchange(calculationDiscountResult);
} }
...@@ -3283,7 +3294,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -3283,7 +3294,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
PromotionResultVO vo = new PromotionResultVO(); PromotionResultVO vo = new PromotionResultVO();
if (grayPush) { if (grayPush) {
ActivityBaseResponseDto<PromotionResultVO> responseDto = activityClient.getV3Promotion(request); ActivityBaseResponseDto<PromotionResultVO> responseDto = activityClient.getV3Promotion(request);
if (responseDto != null && StringUtils.equals(responseDto.getStatusCode(),ResponseCodeConstant.RESPONSE_SUCCESS_STR)) { if (responseDto != null && StringUtils.equals(responseDto.getStatusCode(), ResponseCodeConstant.RESPONSE_SUCCESS_STR)) {
vo.setV3Promotion(responseDto.getResult().isV3Promotion()); vo.setV3Promotion(responseDto.getResult().isV3Promotion());
} }
} }
...@@ -3349,7 +3360,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -3349,7 +3360,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo = new ShoppingCartGoodsResponseVo(); ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo = new ShoppingCartGoodsResponseVo();
Long deliveryAmount = calculateDeliveryAmount(requestVo.getReceiveId(), partnerId, storeId, assortmentCustomerInfoVo.getWxAppId(), shoppingCartGoodsResponseVo, requestVo.getOrderType()); Long deliveryAmount = calculateDeliveryAmount(requestVo.getReceiveId(), partnerId, storeId, assortmentCustomerInfoVo.getWxAppId(), shoppingCartGoodsResponseVo, requestVo.getOrderType());
// 获取购物车商品 // 获取购物车商品
List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCartForCoupon(partnerId, requestVo.getStoreId(), userId, "", shoppingCartBaseService,bizType); List<CartGoods> cartGoodsList = assortmentSdkService.getShoppingCartForCoupon(partnerId, requestVo.getStoreId(), userId, "", shoppingCartBaseService, bizType);
if (grayPush(partnerId, storeId, "2")) { if (grayPush(partnerId, storeId, "2")) {
//此对象用于传递参数,省的一直增加方法参数个数 //此对象用于传递参数,省的一直增加方法参数个数
DiscountSharingDto sharingDto = new DiscountSharingDto(); DiscountSharingDto sharingDto = new DiscountSharingDto();
...@@ -3365,16 +3376,16 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -3365,16 +3376,16 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, new ArrayList<>() //券 , new ArrayList<>() //券
, null //加价购商品 , null //加价购商品
, deliveryAmount , deliveryAmount
, null,bizType, accountFlag,sharingDto, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList())); , null, bizType, accountFlag, sharingDto, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()));
if(discountResult!= null && Objects.equals(discountResult.getV3Promotion(),true)){//v3 if (discountResult != null && Objects.equals(discountResult.getV3Promotion(), true)) {//v3
couponAvailableCartInfo = activityAdapter.convert2CouponAvailableCartInfoSharingV3(partnerId, storeId, discountResult, orgCodes); couponAvailableCartInfo = activityAdapter.convert2CouponAvailableCartInfoSharingV3(partnerId, storeId, discountResult, orgCodes);
}else{//v2 } else {//v2
couponAvailableCartInfo = activityAdapter.convert2CouponAvailableCartInfoSharing(partnerId, storeId, discountResult, orgCodes); couponAvailableCartInfo = activityAdapter.convert2CouponAvailableCartInfoSharing(partnerId, storeId, discountResult, orgCodes);
} }
} else { } else {
// 获取优惠信息 // 获取优惠信息
CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, assortmentCustomerInfoVo.getWxAppId(), orderType, assortmentCustomerInfoVo.isMemberPaid(), cartGoodsList, new ArrayList<>(), null, null, deliveryAmount,bizType, accountFlag, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()),new DiscountSharingDto()); CalculationDiscountResult calculationDiscountResult = getCalculationDiscountResult(menuType, partnerId, storeId, userId, appId, assortmentCustomerInfoVo.getWxAppId(), orderType, assortmentCustomerInfoVo.isMemberPaid(), cartGoodsList, new ArrayList<>(), null, null, deliveryAmount, bizType, accountFlag, this.getNightDistributionFee(shoppingCartGoodsResponseVo.getDeliveryAmountList()), new DiscountSharingDto());
couponAvailableCartInfo = activityAdapter.convert2CouponAvailableCartInfo(partnerId, storeId, calculationDiscountResult, orgCodes); couponAvailableCartInfo = activityAdapter.convert2CouponAvailableCartInfo(partnerId, storeId, calculationDiscountResult, orgCodes);
} }
return ResponseUtil.success(couponAvailableCartInfo); return ResponseUtil.success(couponAvailableCartInfo);
...@@ -3408,7 +3419,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -3408,7 +3419,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
userId, userId,
replaceGoodsRequestVo.getSessionId(), replaceGoodsRequestVo.getSessionId(),
null, null,
shoppingCartBaseService,null); shoppingCartBaseService, null);
if (CollectionUtils.isEmpty(allCartGoodsList)) { if (CollectionUtils.isEmpty(allCartGoodsList)) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_REPLACE_GOODS); return ResponseUtil.error(ResponseResult.SHOPPING_CART_REPLACE_GOODS);
} }
...@@ -3561,10 +3572,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -3561,10 +3572,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
allCartGoodsList = notCheckStock; allCartGoodsList = notCheckStock;
shoppingCartNewBaseService.clear(replaceGoodsRequestVo.getPartnerId(), replaceGoodsRequestVo.getShopId(), userId,replaceGoodsRequestVo.getBizType()); shoppingCartNewBaseService.clear(replaceGoodsRequestVo.getPartnerId(), replaceGoodsRequestVo.getShopId(), userId, replaceGoodsRequestVo.getBizType());
// 重新set购物车信息到缓存中 // 重新set购物车信息到缓存中
assortmentSdkService.setShoppingCart(replaceGoodsRequestVo.getPartnerId(), replaceGoodsRequestVo.getShopId(), assortmentSdkService.setShoppingCart(replaceGoodsRequestVo.getPartnerId(), replaceGoodsRequestVo.getShopId(),
userId, allCartGoodsList, replaceGoodsRequestVo.getSessionId(), null, this.shoppingCartBaseService,replaceGoodsRequestVo.getBizType()); userId, allCartGoodsList, replaceGoodsRequestVo.getSessionId(), null, this.shoppingCartBaseService, replaceGoodsRequestVo.getBizType());
excludeGoods.clear(); excludeGoods.clear();
excludeGoods.addAll(allCartGoodsList); excludeGoods.addAll(allCartGoodsList);
return fullReplace; return fullReplace;
......
...@@ -86,11 +86,6 @@ public class CalculationSharingCartService { ...@@ -86,11 +86,6 @@ public class CalculationSharingCartService {
if (BusinessTypeEnum.SAAS_MALL.getCode().equals(menuType) && null != shoppingCartInfoRequestVo && OrderChannelType.SAASMALL.getCode().equalsIgnoreCase(shoppingCartInfoRequestVo.getChannelType())) { if (BusinessTypeEnum.SAAS_MALL.getCode().equals(menuType) && null != shoppingCartInfoRequestVo && OrderChannelType.SAASMALL.getCode().equalsIgnoreCase(shoppingCartInfoRequestVo.getChannelType())) {
deliverySharingService.mallDeliveryResponse(shoppingCartGoodsResponseVo, deliveryAmount,discountResult); deliverySharingService.mallDeliveryResponse(shoppingCartGoodsResponseVo, deliveryAmount,discountResult);
} }
logUtil.info("fisherman 1 ", JSON.toJSONString(discountResult));
logUtil.info("fisherman 2 ", JSON.toJSONString(cartGoodsList));
logUtil.info("fisherman 3 ", JSON.toJSONString(shoppingCartGoodsResponseVo));
logUtil.info("fisherman 4 ", JSON.toJSONString(couponPromotionVO));
logUtil.info("fisherman 5 ", JSON.toJSONString(shoppingCartInfoRequestVo));
/** /**
* 可用券及券折扣 * 可用券及券折扣
*/ */
......
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