Authored by 周少峰

'ti'

... ... @@ -2124,19 +2124,20 @@ public class ProductServiceImpl implements ProductService {
// 5.标记查询结果
result.stream().map(item -> {
// 获取productCode 库存信息
List<Storage> storages = storagesMap.get(productCodeIdMap.get(item.getProductCode()));
if (null == storages) {
return item;
}
// 尺码不存在
if (!sizeNamesSet.contains(item.getSizeName())) {
setStorageCheckRespStatusInfo(item, StorageCheckEnum.SIZE_NOT_FOUND.getType());
return item;
}
// 获取productCode 库存信息
List<Storage> storages = storagesMap.get(productCodeIdMap.get(item.getProductCode()));
if (null == storages) {
return item;
}
// sizeName 匹配
if(storages.stream().anyMatch(storage -> sizeIdNameMap.get(storage.getSizeId()).equals(item.getSizeName()))) {
if(storages.stream().anyMatch(storage -> null != sizeIdNameMap.get(storage.getSizeId()) && sizeIdNameMap.get(storage.getSizeId()).equals(item.getSizeName()))) {
setStorageCheckRespStatusInfo(item, StorageCheckEnum.PRODUCT_SIZE_MATCH.getType());
return item;
}
... ...