Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
df4fe111
Commit
df4fe111
authored
May 27, 2021
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除无效代码
parent
5fe42420
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
56 deletions
+8
-56
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+8
-56
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
df4fe111
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment