Commit 085a5b2e authored by 廖旭伟's avatar 廖旭伟

测试bug修改

parent dd030c75
...@@ -126,6 +126,10 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao, ...@@ -126,6 +126,10 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
if(StringUtils.isNotEmpty(item.getProductDetail())) { if(StringUtils.isNotEmpty(item.getProductDetail())) {
item.setProductDetail(item.getProductDetail().replaceAll(regex, replacement)); item.setProductDetail(item.getProductDetail().replaceAll(regex, replacement));
} }
String categoryIds = productCategoryService.find(new ProductCategoryQuery().productId(item.getId())).stream().map(i -> i.getCategoryId().toString()).distinct().collect(Collectors.joining(","));
String companyIds = companyProductService.find(new CompanyProductQuery().productId(item.getId())).stream().map(i -> i.getCompanyId().toString()).distinct().collect(Collectors.joining(","));
item.setCompanyId(companyIds);
item.setCategoryId(categoryIds);
}); });
} }
return productEntityResult; return productEntityResult;
...@@ -163,7 +167,17 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao, ...@@ -163,7 +167,17 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
@Override @Override
protected void findAfter(ProductEntity params, PageInfo pageInfo, Context context, List<ProductEntity> list) throws AppException { protected void findAfter(ProductEntity params, PageInfo pageInfo, Context context, List<ProductEntity> list) throws AppException {
String regex = "src=\"file";
String replacement;
if(domain.endsWith("/")){
replacement = "src=\"" + domain + "file";
}else {
replacement = "src=\"" + domain + "/file";
}
list.forEach(item -> { list.forEach(item -> {
if(StringUtils.isNotEmpty(item.getProductDetail())) {
item.setProductDetail(item.getProductDetail().replaceAll(regex, replacement));
}
String categoryIds = productCategoryService.find(new ProductCategoryQuery().productId(item.getId())).stream().map(i -> i.getCategoryId().toString()).distinct().collect(Collectors.joining(",")); String categoryIds = productCategoryService.find(new ProductCategoryQuery().productId(item.getId())).stream().map(i -> i.getCategoryId().toString()).distinct().collect(Collectors.joining(","));
String companyIds = companyProductService.find(new CompanyProductQuery().productId(item.getId())).stream().map(i -> i.getCompanyId().toString()).distinct().collect(Collectors.joining(",")); String companyIds = companyProductService.find(new CompanyProductQuery().productId(item.getId())).stream().map(i -> i.getCompanyId().toString()).distinct().collect(Collectors.joining(","));
item.setCompanyId(companyIds); item.setCompanyId(companyIds);
......
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