Commit a1c669d8f4d7edd124d7dd471b8fab4e453a1f73

Authored by boyang
1 parent 38ecb47a

fix: list接口去重2

shop/src/main/java/com/canrd/shop/service/impl/ProductServiceImpl.java
... ... @@ -299,7 +299,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductDO> im
299 299 }
300 300 }
301 301  
302   - List<Productcategoryrelation> productcategoryrelations = productCategoryRelationService.lambdaQuery()
  302 + /*List<Productcategoryrelation> productcategoryrelations = productCategoryRelationService.lambdaQuery()
303 303 .in(Productcategoryrelation::getProductId, productIds)
304 304 .list();
305 305 List<String> categoryIds = productcategoryrelations.stream().map(Productcategoryrelation::getCategoryId).collect(Collectors.toList());
... ... @@ -315,7 +315,7 @@ public class ProductServiceImpl extends ServiceImpl&lt;ProductMapper, ProductDO&gt; im
315 315 Map<String,List<EbCategorysRelation>> prodId2relCateIds = productId2cateIds.entrySet().stream()
316 316 .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().stream()
317 317 .flatMap(cateId -> Optional.ofNullable(cateId2relCates.get(cateId)).orElse(Collections.emptyList()).stream())
318   - .collect(Collectors.toList())));
  318 + .collect(Collectors.toList())));*/
319 319 records.forEach(product -> {
320 320 if (productPriceShow){
321 321 if (Objects.nonNull(pId2ttMinPriceMap.get(product.getId()))){
... ... @@ -328,7 +328,7 @@ public class ProductServiceImpl extends ServiceImpl&lt;ProductMapper, ProductDO&gt; im
328 328 product.setImageFileKey(map.get("fileKey").toString());
329 329  
330 330  
331   - List<EbCategorysRelation> ebCategorysRelations = prodId2relCateIds.get(product.getId());
  331 + /*List<EbCategorysRelation> ebCategorysRelations = prodId2relCateIds.get(product.getId());*/
332 332 /*if (CollUtil.isNotEmpty(ebCategorysRelations)){
333 333 Map<String,Integer> relatedCateId2Relevance = ebCategorysRelations.stream()
334 334 .collect(Collectors.toMap(EbCategorysRelation::getRelatedCategoryId, EbCategorysRelation::getRelevance,(a, b) -> a));
... ...