Commit a4973d0e by yu.sun

Merge branch 'feature-yu.sun-checkCartInfoAboutCoupon-20201105' into qa

parents 4332e63b 289b24c2
...@@ -43,7 +43,6 @@ import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderItemR ...@@ -43,7 +43,6 @@ import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderItemR
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.QueryByCodeResponse; import com.freemud.application.sdk.api.ordercenter.response.orderInfo.QueryByCodeResponse;
import com.freemud.application.sdk.api.ordercenter.service.OrderSdkService; import com.freemud.application.sdk.api.ordercenter.service.OrderSdkService;
import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO; import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO;
import com.freemud.application.sdk.api.productcenter.service.ProductService;
import com.freemud.sdk.api.assortment.shoppingcart.constant.CartResponseConstant; import com.freemud.sdk.api.assortment.shoppingcart.constant.CartResponseConstant;
import com.freemud.application.sdk.api.storecenter.request.StoreInfoRequest; import com.freemud.application.sdk.api.storecenter.request.StoreInfoRequest;
import com.freemud.application.sdk.api.storecenter.response.StoreResponse; import com.freemud.application.sdk.api.storecenter.response.StoreResponse;
...@@ -56,7 +55,6 @@ import com.freemud.sdk.api.assortment.shoppingcart.request.CheckCartRequest; ...@@ -56,7 +55,6 @@ import com.freemud.sdk.api.assortment.shoppingcart.request.CheckCartRequest;
import com.freemud.sdk.api.assortment.shoppingcart.service.ShoppingCartBaseService; import com.freemud.sdk.api.assortment.shoppingcart.service.ShoppingCartBaseService;
import com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl; import com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl;
import com.freemud.sdk.api.assortment.shoppingcart.util.CartResponseUtil; import com.freemud.sdk.api.assortment.shoppingcart.util.CartResponseUtil;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.ObjectUtils;
...@@ -66,7 +64,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -66,7 +64,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -109,7 +106,6 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -109,7 +106,6 @@ public class ShoppingCartMCoffeeServiceImpl {
private OrderSdkService orderSdkService; private OrderSdkService orderSdkService;
@Autowired @Autowired
private StoreCenterService storeCenterService; private StoreCenterService storeCenterService;
@Autowired @Autowired
private ProductClient productClient; private ProductClient productClient;
@Autowired @Autowired
...@@ -161,6 +157,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -161,6 +157,7 @@ public class ShoppingCartMCoffeeServiceImpl {
spuId2 = vo.getSkuId(); spuId2 = vo.getSkuId();
goodsId = vo.getSkuId(); goodsId = vo.getSkuId();
} }
productIds.add(Long.parseLong(goodsId)); productIds.add(Long.parseLong(goodsId));
// 获取添加商品的详细信息 // 获取添加商品的详细信息
List<ProductBeanDTO> productBeanListSpuClass = assortmentSdkService.getProductsInfoSdk(partnerId, storeId, Collections.singletonList(spuId2), menuType, this.shoppingCartBaseService); List<ProductBeanDTO> productBeanListSpuClass = assortmentSdkService.getProductsInfoSdk(partnerId, storeId, Collections.singletonList(spuId2), menuType, this.shoppingCartBaseService);
...@@ -180,6 +177,13 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -180,6 +177,13 @@ public class ShoppingCartMCoffeeServiceImpl {
addCartGoods.setSpuName(addShoppingCartGoodsRequestVo.getGroupName()); addCartGoods.setSpuName(addShoppingCartGoodsRequestVo.getGroupName());
addCartGoods.setName(addShoppingCartGoodsRequestVo.getGroupName()); addCartGoods.setName(addShoppingCartGoodsRequestVo.getGroupName());
} }
//根据券号获取券名称
String couponName = "";
if (StringUtils.isNotEmpty(couponCode)){
CustomerInfoVo userLoginInfoDto = getCustomerInfoVo(sessionId);
couponName = getCouponNameByCode(couponCode,userLoginInfoDto,BusinessTypeEnum.getByType(addShoppingCartGoodsRequestVo.getMenuType()).getCode());
addCartGoods.setCouponName(couponName);
}
// 如果购物车中有商品券,则当前添加的商品是特价商品时,需要提示“已选商品券,与其他优惠商品不同享,商品将恢复原价” // 如果购物车中有商品券,则当前添加的商品是特价商品时,需要提示“已选商品券,与其他优惠商品不同享,商品将恢复原价”
boolean haveCouponProduct = oldCartGoodsList.parallelStream().anyMatch(k -> k.getCartGoodsUid().startsWith(CommonsConstant.COUPON_PREFIX)); boolean haveCouponProduct = oldCartGoodsList.parallelStream().anyMatch(k -> k.getCartGoodsUid().startsWith(CommonsConstant.COUPON_PREFIX));
...@@ -1710,4 +1714,17 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1710,4 +1714,17 @@ public class ShoppingCartMCoffeeServiceImpl {
} }
return requestVo; return requestVo;
} }
private String getCouponNameByCode(String couponCode,CustomerInfoVo userInfo,String menuType){
String couponName = "";
//加购的时候根据券号查询券名称,存入cartGood
CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(userInfo.getPartnerId(),
userInfo.getStoreId(),couponCode , menuType);
CouponService couponService = SDKCommonBaseContextWare.getBean(CouponService.class);
CheckSpqInfoResponseDto checkSpqInfoResponseDto = couponService.checkSpqInfo(checkSpqInfoRequestDto);
if (null != checkSpqInfoRequestDto && StringUtils.isNotEmpty(checkSpqInfoResponseDto.getActivityName())){
couponName = checkSpqInfoResponseDto.getActivityName();
}
return couponName;
}
} }
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