|
|
@ -18,6 +18,7 @@ |
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
@ -1477,4 +1478,43 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
|
|
|
|
return new PageData<>(list, pageInfo.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public PublishedListResultDTO detailV2(ArticleListFormDTO formDTO) { |
|
|
|
PublishedListResultDTO resultDTO = new PublishedListResultDTO(); |
|
|
|
//1.查询文章主表信息
|
|
|
|
List<PublishedListResultDTO> list = baseDao.selectAllArticle(formDTO); |
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(list)) { |
|
|
|
resultDTO = list.get(NumConstant.ZERO); |
|
|
|
//查询文章涉及的发布范围网络Id列表
|
|
|
|
LambdaQueryWrapper<ArticlePublishRangeEntity> tWrapper = new LambdaQueryWrapper<>(); |
|
|
|
tWrapper.eq(ArticlePublishRangeEntity::getArticleId, formDTO.getArticleId()); |
|
|
|
tWrapper.eq(ArticlePublishRangeEntity::getDelFlag, NumConstant.ZERO_STR); |
|
|
|
//【文章下线的查所有发布范围,文章没下线的只查还没下线的发布范围】
|
|
|
|
if("offline".equals(resultDTO.getStatusFlag())){ |
|
|
|
tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "offline"); |
|
|
|
}else { |
|
|
|
tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "published"); |
|
|
|
} |
|
|
|
List<ArticlePublishRangeEntity> entityList = articlePublishRangeDao.selectList(tWrapper); |
|
|
|
if (!CollectionUtils.isEmpty(entityList)) { |
|
|
|
List<String> contentList = entityList.stream().map(ArticlePublishRangeEntity::getGridId).collect(Collectors.toList()); |
|
|
|
resultDTO.setGridIdList(contentList); |
|
|
|
} |
|
|
|
|
|
|
|
//查询文章内容
|
|
|
|
LambdaQueryWrapper<ArticleContentEntity> tWrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
tWrapper1.eq(ArticleContentEntity::getArticleId, formDTO.getArticleId()); |
|
|
|
tWrapper1.eq(ArticleContentEntity::getDelFlag, NumConstant.ZERO_STR); |
|
|
|
tWrapper1.orderByDesc(ArticleContentEntity::getOrderNum); |
|
|
|
List<ArticleContentEntity> contentEntityList = articleContentDao.selectList(tWrapper1); |
|
|
|
if (!CollectionUtils.isEmpty(entityList)) { |
|
|
|
LinkedList<String> contentList = (LinkedList)contentEntityList.stream().map(ArticleContentEntity::getContent).collect(Collectors.toList()); |
|
|
|
resultDTO.setContentList(contentList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
} |
|
|
|