Commit 38ecb47a66c63f3e54ed3c0ea915931aa002826a

Authored by boyang
1 parent 2fa199e4

fix: list接口去重

shop/src/main/java/com/canrd/shop/service/impl/ProductServiceImpl.java
... ... @@ -329,7 +329,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductDO> im
329 329  
330 330  
331 331 List<EbCategorysRelation> ebCategorysRelations = prodId2relCateIds.get(product.getId());
332   - if (CollUtil.isNotEmpty(ebCategorysRelations)){
  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));
335 335 TreeMap<String, Integer> cateId2Relevance = new TreeMap<>(relatedCateId2Relevance);
... ... @@ -347,7 +347,7 @@ public class ProductServiceImpl extends ServiceImpl&lt;ProductMapper, ProductDO&gt; im
347 347 .limit(10)
348 348 .collect(Collectors.toList());
349 349 product.setRelatedProductIds(relatedProductIds);
350   - }
  350 + }*/
351 351 });
352 352 }
353 353  
... ...
shop/src/main/resources/mapper/ProductMapper.xml
... ... @@ -7,7 +7,7 @@
7 7 </resultMap>
8 8  
9 9 <select id="queryAll" resultMap="BaseResultMap">
10   - select distinct p.id,p.name,p.productImageListStore,p.htmlFilePath,pc.id as pcid
  10 + select distinct p.id,p.name,p.productImageListStore,p.htmlFilePath
11 11 from product p
12 12 left join productcategoryrelation pcr on p.id=pcr.productId
13 13 left join productcategory pc on pc.id=pcr.categoryId
... ...