|
@@ -131,6 +131,7 @@ public class CommunityArticleServiceImpl extends ServiceImpl<CommunityArticleMap
|
|
|
Long id = communityArticle.getId();
|
|
|
List<Long> articleIds = communityArticle.getArticleIds();
|
|
|
Integer pageTagType = communityArticle.getPageTagType();
|
|
|
+ Integer noCollection = communityArticle.getNoCollection();
|
|
|
if (pageTagType != null && pageTagType == 1) {
|
|
|
List<CommunityUserLikeVo> communityUserLikeVos = selectCommunityUserLikeList(SecurityUtils.getUserId(), null, 1, 999999, 1);
|
|
|
if (communityUserLikeVos.isEmpty()) {
|
|
@@ -160,6 +161,25 @@ public class CommunityArticleServiceImpl extends ServiceImpl<CommunityArticleMap
|
|
|
int offset = (pageNum - 1) * pageSize;
|
|
|
communityArticleVos = communityArticleMapper.selectCommunityArticleList(communityArticle, classIds, offset, pageSize, searchType);
|
|
|
|
|
|
+ //剔除是否有合集文章
|
|
|
+ List<Long> ids = communityArticleVos.stream().map(item -> item.getId()).collect(Collectors.toList());
|
|
|
+ List<CommunityCollectionArticle> collections = communityCollectionArticleMapper.selectList(new QueryWrapper<CommunityCollectionArticle>()
|
|
|
+ .in("article_id", ids)
|
|
|
+ .and((wrapper) -> {
|
|
|
+ wrapper.ne("is_delete", true).or().isNull("is_delete");
|
|
|
+ }));
|
|
|
+ List<CommunityArticleVo> articleVos_copy = new ArrayList<>(communityArticleVos);
|
|
|
+ if (noCollection != null){
|
|
|
+ if (noCollection == 1) {
|
|
|
+ for (CommunityArticleVo communityArticleVo : articleVos_copy) {
|
|
|
+ for (CommunityCollectionArticle collection : collections) {
|
|
|
+ if(collection.getArticleId().equals(communityArticleVo.getId())){
|
|
|
+ communityArticleVos.remove(communityArticleVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
rspData.setTotal(communityArticleVos.size());
|
|
|
List<CommunityArticleVo> communityArticleVos_copy = new ArrayList<>(communityArticleVos);
|