...
|
...
|
@@ -337,10 +337,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
logger.info("enter getArticleList, req is {}", req);
|
|
|
Integer articleId = req.getArticleId();
|
|
|
Integer source = req.getSource()==null || req.getSource() == 0 ? null:req.getSource();//文章来源
|
|
|
Integer uidSourceFlag = null;
|
|
|
if(source != null && source == 1){
|
|
|
uidSourceFlag = 1;//普通用户,查询时排除小编
|
|
|
}
|
|
|
Integer userType = req.getUserType() == null || req.getUserType() == 0 ? null : req.getUserType();//用户身份
|
|
|
Integer authStatus = req.getAuthStatus()==null ||req.getAuthStatus()==8 ? null:req.getAuthStatus();
|
|
|
Integer isRecommend = req.getIsRecommend()==null ||req.getIsRecommend()==8 ? null:req.getIsRecommend();
|
|
|
Integer isTop = req.getIsTop()==null ||req.getIsTop()==8 ? null:req.getIsTop();
|
...
|
...
|
@@ -371,25 +368,31 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
authorUids.clear();
|
|
|
authorUids.add(authorUid);
|
|
|
}
|
|
|
//文章来源是小编,查询条件 source = 1,并且 uid在小编集合中in grassVirtualUser
|
|
|
//文章来源是普通用户,需要排除小编 not in grassVirtualUser
|
|
|
if(source != null && source == ArticleTypeEnum.VIRTUALUSER.getValue()){//小编
|
|
|
source = 1;//文章类型也是1
|
|
|
List<Integer> virtualUids = grassVirtualUserDao.getAllPlatUid();
|
|
|
if(CollectionUtils.isEmpty(virtualUids)){
|
|
|
return rsp;
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotEmpty(authName) || authorUid != null){//来源于小编,并且查询条件有nickName
|
|
|
authorUids.retainAll(virtualUids);
|
|
|
if(CollectionUtils.isEmpty(authorUids)){
|
|
|
logger.info("getArticleList ,result is empty, req={}", req);
|
|
|
return rsp;
|
|
|
}
|
|
|
}else{
|
|
|
authorUids = virtualUids;
|
|
|
}
|
|
|
}
|
|
|
List<Integer> excludedUids = null;
|
|
|
//排除掉 马甲用户
|
|
|
if(userType != null && userType == 10){//来自于用户的--排除掉马甲用户
|
|
|
excludedUids = grassVirtualUserDao.getAllPlatUid();
|
|
|
userType = null;
|
|
|
}
|
|
|
//其他的查询马甲用户表
|
|
|
// if(source != null && source == ArticleTypeEnum.VIRTUALUSER.getValue()){//小编
|
|
|
// source = 1;//文章类型也是1
|
|
|
// List<Integer> virtualUids = grassVirtualUserDao.getAllPlatUid();
|
|
|
// if(CollectionUtils.isEmpty(virtualUids)){
|
|
|
// return rsp;
|
|
|
// }
|
|
|
//
|
|
|
// if(StringUtils.isNotEmpty(authName) || authorUid != null){//来源于小编,并且查询条件有nickName
|
|
|
// authorUids.retainAll(virtualUids);
|
|
|
// if(CollectionUtils.isEmpty(authorUids)){
|
|
|
// logger.info("getArticleList ,result is empty, req={}", req);
|
|
|
// return rsp;
|
|
|
// }
|
|
|
// }else{
|
|
|
// authorUids = virtualUids;
|
|
|
// }
|
|
|
// }
|
|
|
if(StringUtils.isNotEmpty(startTime)){
|
|
|
startTimeInt = Long.valueOf(startTime);
|
|
|
}
|
...
|
...
|
@@ -398,10 +401,10 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
}
|
|
|
int page = req.getPage();
|
|
|
int size = req.getSize();
|
|
|
int total = grassArticleDao.selectArticleCount(articleId, source, authStatus,authorUids,isRecommend, isTop,startTimeInt, endTimeInt, uidSourceFlag,recommendSort);
|
|
|
int total = grassArticleDao.selectArticleCount(articleId, source, authStatus,authorUids,isRecommend, isTop,startTimeInt, endTimeInt, recommendSort,excludedUids,userType);
|
|
|
logger.info("getArticleList: grassArticleDao.getArticleCount: articleId is {}, source is {}, total is {}", articleId, source, total);
|
|
|
int offset = (page - 1) * size;
|
|
|
List<GrassArticle> articleList = grassArticleDao.selectArticleList(articleId, source, authStatus,authorUids,isRecommend, isTop,startTimeInt, endTimeInt,offset, size,uidSourceFlag,recommendSort);
|
|
|
List<GrassArticle> articleList = grassArticleDao.selectArticleList(articleId, source, authStatus,authorUids,isRecommend, isTop,startTimeInt, endTimeInt,offset, size,recommendSort,excludedUids,userType);
|
|
|
rsp.setList(buildArticleDetail(articleList));
|
|
|
rsp.setTotal(total);
|
|
|
rsp.setSize(size);
|
...
|
...
|
@@ -1216,7 +1219,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
Map<Integer,UserInfoRspBO> userInfoMap = getUsersInfo(uids);
|
|
|
Map<Integer,Author> authorInfoMap = getAuthorInfo(authoruids);
|
|
|
List<ArticleDetailRspBo> rspBoList = Lists.newArrayList();
|
|
|
List<Integer> vitualUids = grassVirtualUserDao.getAllPlatUid();//所有的马甲用户
|
|
|
// List<Integer> vitualUids = grassVirtualUserDao.getAllPlatUid();//所有的马甲用户
|
|
|
articleList.forEach(article -> {
|
|
|
ArticleDetailRspBo rspBo = new ArticleDetailRspBo();
|
|
|
rspBo.setArticleId(article.getId());
|
...
|
...
|
@@ -1236,11 +1239,11 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
rspBo.setPublishTime(DateUtil.long2DateStr(article.getCreateTime(), DateUtil.DATE_TIME_FORMAT));
|
|
|
rspBo.setAuthStatus(article.getAuthStatus());
|
|
|
rspBo.setSource(article.getArticleType());
|
|
|
if (article.getArticleType() == ArticleTypeEnum.NORMAL.getValue()) {//文章类型是1 的
|
|
|
/* if (article.getArticleType() == ArticleTypeEnum.NORMAL.getValue()) {//文章类型是1 的
|
|
|
if (vitualUids.contains(article.getAuthorUid())) {//属于马甲用户发布的
|
|
|
rspBo.setSource(6);
|
|
|
}
|
|
|
}
|
|
|
}*/
|
|
|
rspBo.setImgList(imgMap.get(article.getId()));
|
|
|
rspBo.setLabelList(labelMap.get(article.getId()));
|
|
|
rspBo.setIsTop(article.getIsTop());
|
...
|
...
|
@@ -1255,6 +1258,11 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
rspBo.setTopicId(topic == null ? null : topic.getId());
|
|
|
rspBo.setTopicName(topic == null ? null : topic.getTopicName());
|
|
|
rspBo.setTopicGroupId(topic == null ? null : topic.getRelatedGroup());
|
|
|
if(article.getArticleType() == 2){//资讯来的,前台展示 空
|
|
|
rspBo.setUserType(0);
|
|
|
}else{//10--前台展示用户
|
|
|
rspBo.setUserType(article.getUserType() == null ? 10 : article.getUserType());
|
|
|
}
|
|
|
rspBoList.add(rspBo);
|
|
|
});
|
|
|
return rspBoList;
|
...
|
...
|
|