...
|
...
|
@@ -1934,38 +1934,40 @@ public class ProductServiceImpl implements ProductService { |
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/*List<Integer> sizeIdList = storageList.stream().map(Storage::getSizeId).collect(Collectors.toList());
|
|
|
List<Integer> sizeIdList = storageList.stream().map(Storage::getSizeId).collect(Collectors.toList());
|
|
|
List<Size> sizes = sizeMapper.selectByIds(sizeIdList);
|
|
|
|
|
|
Map<Integer, String> sizeMap = sizes.stream().collect(Collectors.toMap(Size::getId, Size::getSizeName));
|
|
|
|
|
|
List<Integer> goodsIdList = storageList.stream().map(Storage::getGoodsId).collect(Collectors.toList());
|
|
|
List<Goods> goodsList = goodsMapper.selectByIds(goodsIdList);
|
|
|
Map<Integer, Goods> goodsMap = goodsList.stream().collect(Collectors.toMap(Goods::getId, a -> a));
|
|
|
|
|
|
List<Integer> productIdList = storageList.stream().map(Storage::getProductId).collect(Collectors.toList());
|
|
|
List<Product> products = productMapper.selectByIds(productIdList);
|
|
|
Map<Integer, Product> productMap = products.stream().collect(Collectors.toMap(Product::getId, a -> a));
|
|
|
|
|
|
StorageDataResp resp = new StorageDataResp();
|
|
|
storageList.forEach(item -> {
|
|
|
|
|
|
GoodsSize goodsSize = new GoodsSize();
|
|
|
goodsSize.setSizeId(storage.getSizeId());
|
|
|
if (size != null) {
|
|
|
goodsSize.setSizeName(size.getSizeName());
|
|
|
}
|
|
|
goodsSize.setSizeId(item.getSizeId());
|
|
|
goodsSize.setSizeName(sizeMap.get(item.getSizeId()));
|
|
|
resp.setSize(goodsSize);
|
|
|
|
|
|
Goods goods = goodsMap.get(item.getGoodsId());
|
|
|
if (null != goods) {
|
|
|
resp.setColorId(goods.getColorId().toString());
|
|
|
resp.setColorName(StringUtils.isEmpty(goods.getGoodsName()) ? goods.getColorName() : goods.getGoodsName());
|
|
|
resp.setImageUrl(goods.getColorImage());
|
|
|
}
|
|
|
|
|
|
|
|
|
resp.setColorId(goods.getColorId().toString());
|
|
|
resp.setColorName(StringUtils.isEmpty(goods.getGoodsName()) ? goods.getColorName() : goods.getGoodsName());
|
|
|
resp.setImageUrl(goods.getColorImage());
|
|
|
|
|
|
|
|
|
Product product = productMap.get(item.getProductId());
|
|
|
if (product != null) {
|
|
|
resp.setProductId(product.getId());
|
|
|
resp.setProductName(product.getProductName());
|
|
|
resp.setStatus(product.getShelveStatus());
|
|
|
}
|
|
|
});*/
|
|
|
});
|
|
|
|
|
|
return respList;
|
|
|
}
|
...
|
...
|
|