Authored by hugufei

添加GoodsRelated*LogicService

... ... @@ -14,7 +14,7 @@ import java.util.Map;
import java.util.stream.Collectors;
@Component
public class ProductImageRelatedLogicService {
public class GoodsRelatedImageLogicService {
@Autowired
private GoodsImagesMapper goodsImagesMapper;
... ...
... ... @@ -11,7 +11,7 @@ import java.util.Map;
import java.util.stream.Collectors;
@Component
public class ProductStorageLogicService {
public class GoodsRelatedStorageLogicService {
private static final Integer VALID_STATUS = Integer.valueOf(1);
... ...
... ... @@ -30,13 +30,13 @@ public class ProductGoodsLogicService {
@Autowired
private GoodsMapper goodsMapper;
@Autowired
private ProductImageRelatedLogicService productImageRelatedLogicService;
private GoodsRelatedImageLogicService goodsRelatedImageLogicService;
@Autowired
private StorageService storageService;
@Autowired
private BasicDataCacheService basicDataCacheService;
@Autowired
private ProductStorageLogicService productStorageLogicService;
private GoodsRelatedStorageLogicService goodsRelatedStorageLogicService;
/**
* 全量增量都有调用
... ... @@ -54,10 +54,10 @@ public class ProductGoodsLogicService {
storageList = storageService.getStoragesByGoodsIds(goodsIds);
}
// 构建goodStorageMap
Map<Integer, Integer> goodStorageMap =productStorageLogicService.queryGoodStorageMap(storageList);
Map<Integer, Integer> goodStorageMap = goodsRelatedStorageLogicService.queryGoodStorageMap(storageList);
// 构建goodsCoverImagesMap
Map<Integer, GoodsCoverImage> goodsCoverImagesMap = productImageRelatedLogicService.selectGoodsCoverImagesByProductIds(productIds);
Map<Integer, GoodsCoverImage> goodsCoverImagesMap = goodsRelatedImageLogicService.selectGoodsCoverImagesByProductIds(productIds);
// 根据productId分组
List<ProductGoodBO> productGoodBOs = new ArrayList<>();
... ...
... ... @@ -2,7 +2,7 @@ package com.yoho.search.consumer.service.logicService.productIndex;
import com.yoho.search.consumer.service.bo.ProductIndexBO;
import com.yoho.search.consumer.service.daoService.GoodsImagesService;
import com.yoho.search.consumer.service.logicService.ProductImageRelatedLogicService;
import com.yoho.search.consumer.service.logicService.GoodsRelatedImageLogicService;
import com.yoho.search.dal.model.GoodsImages;
import com.yoho.search.dal.model.ProductDefaultImage;
import org.apache.commons.collections.CollectionUtils;
... ... @@ -23,12 +23,12 @@ public class ProductDefaultImageBuilder implements IndexFieldBuilder {
@Autowired
private GoodsImagesService goodsImagesService;
@Autowired
private ProductImageRelatedLogicService productImageRelatedLogicService;
private GoodsRelatedImageLogicService goodsRelatedImageLogicService;
@Override
public void build(List<ProductIndexBO> productIndexBOs, List<Integer> ids, List<Integer> sknList) {
List<GoodsImages> goodsImages = goodsImagesService.selectListByProductIds(ids);
List<ProductDefaultImage> productDefaultImages = productImageRelatedLogicService.buildProductDefaultImage(goodsImages);
List<ProductDefaultImage> productDefaultImages = goodsRelatedImageLogicService.buildProductDefaultImage(goodsImages);
if (CollectionUtils.isEmpty(productDefaultImages)) {
return;
}
... ...