商品图库匹配问题修改

This commit is contained in:
liyj 2025-07-26 15:51:36 +08:00
parent 3a300fa979
commit 1996e69462

View File

@ -203,12 +203,8 @@ public class SyncShopImageServiceImpl implements SyncShopImageService {
List<ShopProductIndex> shopProductIndexList=new ArrayList<>();
for (ImageMappingDto imageMappingDto:imageMappingDtos){
String mergedImageUrl=imageMappingDto.getMergedImageUrl();
if(StringUtils.isEmpty(mergedImageUrl)){
continue;
}
ShopProductImage shopProductImage=new ShopProductImage();
ShopProductBase shopProductBase=new ShopProductBase();
ShopProductItem shopProductItem=new ShopProductItem();
if(StringUtils.isNotEmpty(mergedImageUrl)){
if(mergedImageUrl.contains(",")){
String [] imageUrls= mergedImageUrl.split(",");
for (String imageUrl:imageUrls){
@ -217,6 +213,9 @@ public class SyncShopImageServiceImpl implements SyncShopImageService {
}else {
shopProductImage.setItem_image_other(imageMappingDto.addDomainPrefix(staticDomain,mergedImageUrl));
}
}
ShopProductBase shopProductBase=new ShopProductBase();
ShopProductItem shopProductItem=new ShopProductItem();
String thumb=imageMappingDto.addDomainPrefix(staticDomain,imageMappingDto.getThumb());
shopProductImage.setProduct_id(imageMappingDto.getProductId());
shopProductImage.setProduct_image_id(imageMappingDto.getProductImageId());
@ -291,8 +290,10 @@ public class SyncShopImageServiceImpl implements SyncShopImageService {
productImageSearchDTOS.add(productImageSearchDTO);
}
}
log.info("查询es列表{}",productImageSearchDTOS);
Map<String,List<ProductImageSearchDTO>> productImageList=new HashMap<>();
productImageList= searchService.searchProductImageList(productImageSearchDTOS, DicEnum.ES_SEARCH_TYPE_2.getCode());
log.info("匹配es返回列表{}",productImageList);
productImageList.forEach((k,v)->{
if(!v.isEmpty()){
ImageMappingDto imageMappingDto=new ImageMappingDto();
@ -306,6 +307,7 @@ public class SyncShopImageServiceImpl implements SyncShopImageService {
imageMappingDtos.add(imageMappingDto);
}
});
log.info("匹配图库列表:{}",imageMappingDtos);
return imageMappingDtos;
}