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

测试bug修改

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