From 1996e69462713756237dec044a45a23c7e8357e9 Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Sat, 26 Jul 2025 15:51:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=9B=BE=E5=BA=93=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SyncShopImageServiceImpl.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) 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; }