diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncShopImageServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncShopImageServiceImpl.java index 0c361283..582ccf0f 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncShopImageServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/sync/service/impl/SyncShopImageServiceImpl.java @@ -203,20 +203,19 @@ public class SyncShopImageServiceImpl implements SyncShopImageService { List shopProductIndexList=new ArrayList<>(); for (ImageMappingDto imageMappingDto:imageMappingDtos){ String mergedImageUrl=imageMappingDto.getMergedImageUrl(); - if(StringUtils.isEmpty(mergedImageUrl)){ - continue; - } ShopProductImage shopProductImage=new ShopProductImage(); + if(StringUtils.isNotEmpty(mergedImageUrl)){ + if(mergedImageUrl.contains(",")){ + String [] imageUrls= mergedImageUrl.split(","); + for (String imageUrl:imageUrls){ + shopProductImage.setItem_image_other(imageMappingDto.addDomainPrefix(staticDomain,imageUrl)); + } + }else { + shopProductImage.setItem_image_other(imageMappingDto.addDomainPrefix(staticDomain,mergedImageUrl)); + } + } ShopProductBase shopProductBase=new ShopProductBase(); ShopProductItem shopProductItem=new ShopProductItem(); - if(mergedImageUrl.contains(",")){ - String [] imageUrls= mergedImageUrl.split(","); - for (String imageUrl:imageUrls){ - shopProductImage.setItem_image_other(imageMappingDto.addDomainPrefix(staticDomain,imageUrl)); - } - }else { - shopProductImage.setItem_image_other(imageMappingDto.addDomainPrefix(staticDomain,mergedImageUrl)); - } 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> 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; }