Commit 26e08277 by 周晓航

Merge branch 'KA-【华莱士】【半定制】一个订单多张优惠券使用场景-zxh' into qa

# Conflicts:
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
parents b2950c6d dc0d8eb2
...@@ -848,38 +848,7 @@ public class CouponServiceImpl implements CouponService { ...@@ -848,38 +848,7 @@ public class CouponServiceImpl implements CouponService {
@Override @Override
public GetProductsVo getSpqProductInfo(CheckSpqInfoRequestDto requestDto) { public GetProductsVo getSpqProductInfo(CheckSpqInfoRequestDto requestDto) {
String partnerId = requestDto.getPartnerId(); return this.getSpqProductInfo(requestDto,null);
String couponCode = requestDto.getCouponCode();
String storeId = requestDto.getStoreId();
//TODO 查询券详情券是否存在
GetMemberCouponRequestVo requestVo = new GetMemberCouponRequestVo();
requestVo.setPartnerId(partnerId);
requestVo.setCouponCode(couponCode);
requestVo.setStoreId(requestDto.getStoreId());
GetCouponDetailResponseDto couponDetailResponseDto = this.getMemberCoupon(requestVo);
if (couponDetailResponseDto == null || !couponDetailResponseDto.getResult().equals(ResponseCodeConstant.RESPONSE_SUCCESS_1) || CollectionUtils.isEmpty(couponDetailResponseDto.getDetails())) {
return null;
}
//券返回的商品id
List<String> skuIds = Lists.newArrayList();
String skuId = couponDetailResponseDto.getDetails().get(0).getActiveProduct().get(0).getProductIdPartner();
skuIds.add(String.valueOf(skuId));
//TODO 通过skuid查询spuid
Map<String, GetProductsVo> productsVoMap = itemService.getProducts(skuIds, partnerId, storeId , requestDto.getMenuType());
GetProductsVo productsVo = productsVoMap.get(skuId);
if (null == productsVo || !Objects.equals(productsVo.getStatus(), StoreItemStatus.PUT_ON_SALE.getCode())) {
return null;
}
// 校验商品可用时间
ValidateShopProductRequest request = getValidateShopProductRequest(productsVo, requestDto);
ProductBaseResponse<ValiadShopProductResponse> valiadProductResponse = storeItemClient.validateShopProduct(request);
if (null == valiadProductResponse || !Objects.equals(ResponseConstant.SUCCESS_RESPONSE_CODE, valiadProductResponse.getErrcode())
|| valiadProductResponse.getData() == null || CollectionUtils.isEmpty(valiadProductResponse.getData().getSuccessList())) {
return null;
}
return productsVo;
} }
...@@ -908,11 +877,16 @@ public class CouponServiceImpl implements CouponService { ...@@ -908,11 +877,16 @@ public class CouponServiceImpl implements CouponService {
if (CollectionUtils.isEmpty(couponDetailResponseDto.getDetails())) { if (CollectionUtils.isEmpty(couponDetailResponseDto.getDetails())) {
return null; return null;
} }
Integer couponType = 0;
//券返回的商品id //券返回的商品id
String skuId ;
List<String> skuIds = Lists.newArrayList(); List<String> skuIds = Lists.newArrayList();
String skuId = goodsId; if (StringUtils.isEmpty(goodsId)) {
//券返回的商品id
skuId = couponDetailResponseDto.getDetails().get(0).getActiveProduct().get(0).getProductIdPartner();
skuIds.add(String.valueOf(skuId));
}else {
skuId = goodsId;
}
skuIds.add(skuId); skuIds.add(skuId);
//TODO 通过skuid查询spuid //TODO 通过skuid查询spuid
Map<String, GetProductsVo> productsVoMap = itemService.getProducts(skuIds, partnerId, storeId, requestDto.getMenuType()); Map<String, GetProductsVo> productsVoMap = itemService.getProducts(skuIds, partnerId, storeId, requestDto.getMenuType());
......
...@@ -568,7 +568,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -568,7 +568,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
setAddAndUpdateResponse(shoppingCartGoodsResponseVo, calculationDiscountResult, cartGoodsList, shoppingCartGoodsResponseVo.getToastMsg(), partnerId, storeId, userId, ShoppingCartConstant.ADD_AND_UPDATE, null); setAddAndUpdateResponse(shoppingCartGoodsResponseVo, calculationDiscountResult, cartGoodsList, shoppingCartGoodsResponseVo.getToastMsg(), partnerId, storeId, userId, ShoppingCartConstant.ADD_AND_UPDATE, null);
} }
this.shoppingCartAddOrListCommonResponseHandle(shoppingCartGoodsResponseVo);
return ResponseUtil.success(shoppingCartGoodsResponseVo); return ResponseUtil.success(shoppingCartGoodsResponseVo);
} }
...@@ -700,8 +700,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -700,8 +700,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
for (int i = cartGoodsList.size() - 1; i >= 0; i--) { for (int i = cartGoodsList.size() - 1; i >= 0; i--) {
CartGoods cartGoods = cartGoodsList.get(i); CartGoods cartGoods = cartGoodsList.get(i);
if (GoodsTypeEnum.COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType()) || GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) { if (GoodsTypeEnum.COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType()) || GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) {
if (unChooseCouponCode.equals(cartGoods.getSpuId())) { if (Objects.equals(cartGoods.getCouponCode() ,unChooseCouponCode)) {
CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(partnerId, storeId, cartGoods.getSpuId(), 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())) { if (GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) {
productInfo = couponService.getSpqProductInfo(checkSpqInfoRequestDto, cartGoods.getSkuId()); productInfo = couponService.getSpqProductInfo(checkSpqInfoRequestDto, cartGoods.getSkuId());
......
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