Commit 9f76e6ea authored by 廖旭伟's avatar 廖旭伟

测试bug修改

parent 37703ec1
......@@ -133,15 +133,18 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
@Override
public List<ProductEntity> getProductEntitiesByCompanyId(ProductEntity entity, List<CompanyProductEntity> companyProducList) {
List<ProductEntity> productList = companyProducList.stream().map(item -> {
ProductEntity productEntity = this.getCache(item.getProductId().toString());
if (!ObjectUtils.isEmpty(productEntity)) {
productEntity.setCompanyId(entity.getCompanyId());
String categoryIds = productCategoryService.find(new ProductCategoryQuery().productId(item.getId())).stream().map(i -> i.getCategoryId().toString()).collect(Collectors.joining(","));
productEntity.setCategoryId(categoryIds);
}
return productEntity;
}).collect(Collectors.toList());
List<ProductEntity> productList = new ArrayList<>();
if(CollectionUtils.isNotEmpty(companyProducList)){
companyProducList.forEach(item->{
ProductEntity productEntity = this.getCache(item.getProductId().toString());
if (!ObjectUtils.isEmpty(productEntity)) {
productEntity.setCompanyId(entity.getCompanyId());
String categoryIds = productCategoryService.find(new ProductCategoryQuery().productId(item.getId())).stream().map(i -> i.getCategoryId().toString()).collect(Collectors.joining(","));
productEntity.setCategoryId(categoryIds);
productList.add(productEntity);
}
});
}
return productList;
}
......
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