Commit df4fe111 by 周晓航

删除无效代码

parent 5fe42420
......@@ -2974,66 +2974,18 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
// 拿出 spu sku 校验 当前店铺是否有 商品
ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo = new ShoppingCartGoodsResponseVo();
String storeId = replaceGoodsRequestVo.getShopId();
String menuType = replaceGoodsRequestVo.getMenuType();
String appId = replaceGoodsRequestVo.getAppId();
List<String> spuIds = excludeGoods.stream().map(CartGoods::getSpuId).collect(toList());
String receiveId = replaceGoodsRequestVo.getReceiveId();
Integer orderType = replaceGoodsRequestVo.getOrderType();
List<ProductBean> productBeanListSpuClass = assortmentSdkService.getProductsInfo(partnerId, storeId, spuIds, menuType, this.shoppingCartBaseService);
LogUtil.info("productBeanListSpuClass", spuIds,JSON.toJSONString(productBeanListSpuClass));
// 没有查到商品 fisherman -> 给前端提示就行
if(productBeanListSpuClass == null || productBeanListSpuClass.isEmpty()){
return ResponseUtil.error(ResponseResult.SHOPPING_CART_REPLACE_GOODS_AND_CLEAR);
}
// 校验 获取到的商品数量 规格是否和 上家门店规格一直 sku spu
List<String> productIds = productBeanListSpuClass.stream().map(ProductBean::getPid).collect(toList());
// if (productIds.containsAll(spuIds)) {
// // 全部包含的情况 再次校验 sku是否包含
// List<ProductBean.SkuProductBean> skuListAll = new ArrayList<>();
// productBeanListSpuClass.forEach(productBean -> skuListAll.addAll(productBean.getSkuList()));
//
// List<String> productSkuIds = skuListAll.stream().map(ProductBean.SkuProductBean::getSkuId).collect(toList());
// List<String> excludeSkuList = excludeGoods.stream().map(CartGoods::getSkuId).collect(toList());
// // 删除 不对等的sku存在
// if (!productSkuIds.containsAll(excludeSkuList)) {
// List<String> skuList = new ArrayList<>();
// excludeSkuList.forEach(sku ->{
// if (!productSkuIds.contains(sku)) {
// skuList.add(sku);
// }
// });
// excludeGoods = excludeGoods.stream().filter(cartGoods -> !skuList.contains(cartGoods.getSpuId())).collect(Collectors.toList());
// fullReplace = false;
// }
// // 全部包含,直接使用
// }else {
// // 不全部包含
// List<String> spuList = new ArrayList<>();
// productIds.forEach(s -> {
// if (!spuIds.contains(s)) {
// spuList.add(s);
// }
// });
// excludeGoods = excludeGoods.stream().filter(cartGoods -> !spuList.contains(cartGoods.getSpuId())).collect(Collectors.toList());
// fullReplace = false;
// String storeId = replaceGoodsRequestVo.getShopId();
// String menuType = replaceGoodsRequestVo.getMenuType();
// List<String> spuIds = excludeGoods.stream().map(CartGoods::getSpuId).collect(toList());
// List<ProductBean> productBeanListSpuClass = assortmentSdkService.getProductsInfo(partnerId, storeId, spuIds, menuType, this.shoppingCartBaseService);
// LogUtil.info("productBeanListSpuClass", spuIds,JSON.toJSONString(productBeanListSpuClass));
// // 没有查到商品 fisherman -> 给前端提示就行
// if(productBeanListSpuClass == null || productBeanListSpuClass.isEmpty()){
// return ResponseUtil.error(ResponseResult.SHOPPING_CART_REPLACE_GOODS_AND_CLEAR);
// }
// 商品小料数量 没校验
// 购物车添加数量限制
// Integer productsCount = limitGoodsQty(excludeGoods, null, appId);
//查询多个商品库存信息
//更新redis
LogUtil.info("old shopcat msg ", null,JSON.toJSONString(excludeGoods));
fullReplace = updateCartGoodsLegal(excludeGoods, userId , replaceGoodsRequestVo, shoppingCartGoodsResponseVo ,fullReplace);
LogUtil.info("new shopcat msg ", null,JSON.toJSONString(excludeGoods));
// Long deliveryAmount = calculateDeliveryAmount(receiveId, partnerId, storeId, userLoginInfoDto.getWxAppid(), shoppingCartGoodsResponseVo,replaceGoodsRequestVo.getOrderType());
// ActivityQueryDto activityQueryDto = activityAdapter.getActivityQueryDto(partnerId, storeId, userId, appId, orderType);
// 丢弃 新门店的购物车数据
//String cartGoodsUid = replaceGoodsRequestVo.getCartGoodsUid();
if (!fullReplace) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_REPLACE_GOODS_AND_CLEAR);
}
......
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