|
@@ -49,32 +49,20 @@ public class DepositServiceImpl implements DepositService { |
|
@@ -49,32 +49,20 @@ public class DepositServiceImpl implements DepositService { |
49
|
}
|
49
|
}
|
50
|
List<Integer> productIdList = storageDepositMapper.queryUserDepositProductId(uid, (page - 1) * limit, limit);
|
50
|
List<Integer> productIdList = storageDepositMapper.queryUserDepositProductId(uid, (page - 1) * limit, limit);
|
51
|
List<StorageDepositCount> countInfoList = storageDepositMapper.queryUserDepositProduct(uid, productIdList);
|
51
|
List<StorageDepositCount> countInfoList = storageDepositMapper.queryUserDepositProduct(uid, productIdList);
|
52
|
- /*// 商品名称
|
|
|
53
|
- List<Product> productList = productMapper.selectByIds(productIdList);
|
|
|
54
|
- // 颜色
|
|
|
55
|
- List<Goods> goodsList = goodsMapper.selectByProductIds(productIdList);
|
|
|
56
|
- // 图片
|
|
|
57
|
- List<GoodsImages> goodsImagesList = goodsImagesMapper.selectByGoodsIdList(goodsList.stream().map(Goods::getId).collect(Collectors.toList()));
|
52
|
+ List<Integer> skupList = countInfoList.stream().map(StorageDepositCount::getSkup).collect(Collectors.toList());
|
|
|
53
|
+ List<SellerOrderGoods> goodsList = sellerOrderGoodsMapper.selectBySkups(skupList);
|
58
|
Map<Integer, StorageDepositCount> countInfoMap = countInfoList.stream().map(Function.identity()).collect(Collectors.toMap(StorageDepositCount::getProductId, Function.identity()));
|
54
|
Map<Integer, StorageDepositCount> countInfoMap = countInfoList.stream().map(Function.identity()).collect(Collectors.toMap(StorageDepositCount::getProductId, Function.identity()));
|
59
|
- Map<Integer, Product> productMap = productList.stream().map(Function.identity()).collect(Collectors.toMap(Product::getId, Function.identity()));
|
|
|
60
|
- Map<Integer, Goods> goodsMap = goodsList.stream().map(Function.identity()).collect(Collectors.toMap(Goods::getProductId, Function.identity()));
|
|
|
61
|
- Map<Integer, GoodsImages> goodsImagesMap = goodsImagesList.stream().map(Function.identity()).collect(Collectors.toMap(GoodsImages::getProductId, Function.identity()));
|
55
|
+ Map<Integer, SellerOrderGoods> goodsMap = goodsList.stream().map(Function.identity()).collect(Collectors.toMap(SellerOrderGoods::getProductId, Function.identity()));
|
62
|
|
56
|
|
63
|
List<DepositProductBo> result = new ArrayList<>();
|
57
|
List<DepositProductBo> result = new ArrayList<>();
|
64
|
for (Integer productId : productIdList) {
|
58
|
for (Integer productId : productIdList) {
|
65
|
DepositProductBo bo = new DepositProductBo();
|
59
|
DepositProductBo bo = new DepositProductBo();
|
66
|
bo.setProductId(productId);
|
60
|
bo.setProductId(productId);
|
67
|
- Product p = productMap.get(productId);
|
|
|
68
|
- if (p != null) {
|
|
|
69
|
- bo.setProductName(p.getProductName());
|
|
|
70
|
- }
|
|
|
71
|
- Goods g = goodsMap.get(productId);
|
|
|
72
|
- if (g != null) {
|
|
|
73
|
- bo.setColorName(StringUtils.isBlank(g.getGoodsName()) ? g.getColorName() : g.getGoodsName());
|
|
|
74
|
- }
|
|
|
75
|
- GoodsImages gi = goodsImagesMap.get(productId);
|
|
|
76
|
- if (gi != null) {
|
|
|
77
|
- bo.setPic(ImageUrlAssist.getAllProductPicUrl(gi.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
|
61
|
+ SellerOrderGoods goods = goodsMap.get(productId);
|
|
|
62
|
+ if (goods != null) {
|
|
|
63
|
+ bo.setProductName(goods.getProductName());
|
|
|
64
|
+ bo.setColorName(goods.getColorName());
|
|
|
65
|
+ bo.setPic(goods.getImageUrl());
|
78
|
}
|
66
|
}
|
79
|
StorageDepositCount countInfo = countInfoMap.get(productId);
|
67
|
StorageDepositCount countInfo = countInfoMap.get(productId);
|
80
|
if (countInfo != null) {
|
68
|
if (countInfo != null) {
|
|
@@ -83,7 +71,7 @@ public class DepositServiceImpl implements DepositService { |
|
@@ -83,7 +71,7 @@ public class DepositServiceImpl implements DepositService { |
83
|
bo.setShelfStatus(countInfo.getStorageIdCount() == 0 ? "全部已上架" : ("有" + countInfo.getStorageIdCount() + "件未上架"));
|
71
|
bo.setShelfStatus(countInfo.getStorageIdCount() == 0 ? "全部已上架" : ("有" + countInfo.getStorageIdCount() + "件未上架"));
|
84
|
}
|
72
|
}
|
85
|
result.add(bo);
|
73
|
result.add(bo);
|
86
|
- }*/
|
74
|
+ }
|
87
|
return null;
|
75
|
return null;
|
88
|
}
|
76
|
}
|
89
|
|
77
|
|