|
@@ -337,10 +337,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
@@ -337,10 +337,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
337
|
logger.info("enter getArticleList, req is {}", req);
|
337
|
logger.info("enter getArticleList, req is {}", req);
|
338
|
Integer articleId = req.getArticleId();
|
338
|
Integer articleId = req.getArticleId();
|
339
|
Integer source = req.getSource()==null || req.getSource() == 0 ? null:req.getSource();//文章来源
|
339
|
Integer source = req.getSource()==null || req.getSource() == 0 ? null:req.getSource();//文章来源
|
340
|
- Integer uidSourceFlag = null;
|
|
|
341
|
- if(source != null && source == 1){
|
|
|
342
|
- uidSourceFlag = 1;//普通用户,查询时排除小编
|
|
|
343
|
- }
|
340
|
+ Integer userType = req.getUserType() == null || req.getUserType() == 0 ? null : req.getUserType();//用户身份
|
344
|
Integer authStatus = req.getAuthStatus()==null ||req.getAuthStatus()==8 ? null:req.getAuthStatus();
|
341
|
Integer authStatus = req.getAuthStatus()==null ||req.getAuthStatus()==8 ? null:req.getAuthStatus();
|
345
|
Integer isRecommend = req.getIsRecommend()==null ||req.getIsRecommend()==8 ? null:req.getIsRecommend();
|
342
|
Integer isRecommend = req.getIsRecommend()==null ||req.getIsRecommend()==8 ? null:req.getIsRecommend();
|
346
|
Integer isTop = req.getIsTop()==null ||req.getIsTop()==8 ? null:req.getIsTop();
|
343
|
Integer isTop = req.getIsTop()==null ||req.getIsTop()==8 ? null:req.getIsTop();
|
|
@@ -371,25 +368,31 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
@@ -371,25 +368,31 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
371
|
authorUids.clear();
|
368
|
authorUids.clear();
|
372
|
authorUids.add(authorUid);
|
369
|
authorUids.add(authorUid);
|
373
|
}
|
370
|
}
|
374
|
- //文章来源是小编,查询条件 source = 1,并且 uid在小编集合中in grassVirtualUser
|
|
|
375
|
- //文章来源是普通用户,需要排除小编 not in grassVirtualUser
|
|
|
376
|
- if(source != null && source == ArticleTypeEnum.VIRTUALUSER.getValue()){//小编
|
|
|
377
|
- source = 1;//文章类型也是1
|
|
|
378
|
- List<Integer> virtualUids = grassVirtualUserDao.getAllPlatUid();
|
|
|
379
|
- if(CollectionUtils.isEmpty(virtualUids)){
|
|
|
380
|
- return rsp;
|
|
|
381
|
- }
|
|
|
382
|
|
371
|
|
383
|
- if(StringUtils.isNotEmpty(authName) || authorUid != null){//来源于小编,并且查询条件有nickName
|
|
|
384
|
- authorUids.retainAll(virtualUids);
|
|
|
385
|
- if(CollectionUtils.isEmpty(authorUids)){
|
|
|
386
|
- logger.info("getArticleList ,result is empty, req={}", req);
|
|
|
387
|
- return rsp;
|
|
|
388
|
- }
|
|
|
389
|
- }else{
|
|
|
390
|
- authorUids = virtualUids;
|
|
|
391
|
- }
|
|
|
392
|
- }
|
372
|
+ List<Integer> excludedUids = null;
|
|
|
373
|
+ //排除掉 马甲用户
|
|
|
374
|
+ if(userType != null && userType == 10){//来自于用户的--排除掉马甲用户
|
|
|
375
|
+ excludedUids = grassVirtualUserDao.getAllPlatUid();
|
|
|
376
|
+ userType = null;
|
|
|
377
|
+ }
|
|
|
378
|
+ //其他的查询马甲用户表
|
|
|
379
|
+// if(source != null && source == ArticleTypeEnum.VIRTUALUSER.getValue()){//小编
|
|
|
380
|
+// source = 1;//文章类型也是1
|
|
|
381
|
+// List<Integer> virtualUids = grassVirtualUserDao.getAllPlatUid();
|
|
|
382
|
+// if(CollectionUtils.isEmpty(virtualUids)){
|
|
|
383
|
+// return rsp;
|
|
|
384
|
+// }
|
|
|
385
|
+//
|
|
|
386
|
+// if(StringUtils.isNotEmpty(authName) || authorUid != null){//来源于小编,并且查询条件有nickName
|
|
|
387
|
+// authorUids.retainAll(virtualUids);
|
|
|
388
|
+// if(CollectionUtils.isEmpty(authorUids)){
|
|
|
389
|
+// logger.info("getArticleList ,result is empty, req={}", req);
|
|
|
390
|
+// return rsp;
|
|
|
391
|
+// }
|
|
|
392
|
+// }else{
|
|
|
393
|
+// authorUids = virtualUids;
|
|
|
394
|
+// }
|
|
|
395
|
+// }
|
393
|
if(StringUtils.isNotEmpty(startTime)){
|
396
|
if(StringUtils.isNotEmpty(startTime)){
|
394
|
startTimeInt = Long.valueOf(startTime);
|
397
|
startTimeInt = Long.valueOf(startTime);
|
395
|
}
|
398
|
}
|
|
@@ -398,10 +401,10 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
@@ -398,10 +401,10 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
398
|
}
|
401
|
}
|
399
|
int page = req.getPage();
|
402
|
int page = req.getPage();
|
400
|
int size = req.getSize();
|
403
|
int size = req.getSize();
|
401
|
- int total = grassArticleDao.selectArticleCount(articleId, source, authStatus,authorUids,isRecommend, isTop,startTimeInt, endTimeInt, uidSourceFlag,recommendSort);
|
404
|
+ int total = grassArticleDao.selectArticleCount(articleId, source, authStatus,authorUids,isRecommend, isTop,startTimeInt, endTimeInt, recommendSort,excludedUids,userType);
|
402
|
logger.info("getArticleList: grassArticleDao.getArticleCount: articleId is {}, source is {}, total is {}", articleId, source, total);
|
405
|
logger.info("getArticleList: grassArticleDao.getArticleCount: articleId is {}, source is {}, total is {}", articleId, source, total);
|
403
|
int offset = (page - 1) * size;
|
406
|
int offset = (page - 1) * size;
|
404
|
- List<GrassArticle> articleList = grassArticleDao.selectArticleList(articleId, source, authStatus,authorUids,isRecommend, isTop,startTimeInt, endTimeInt,offset, size,uidSourceFlag,recommendSort);
|
407
|
+ List<GrassArticle> articleList = grassArticleDao.selectArticleList(articleId, source, authStatus,authorUids,isRecommend, isTop,startTimeInt, endTimeInt,offset, size,recommendSort,excludedUids,userType);
|
405
|
rsp.setList(buildArticleDetail(articleList));
|
408
|
rsp.setList(buildArticleDetail(articleList));
|
406
|
rsp.setTotal(total);
|
409
|
rsp.setTotal(total);
|
407
|
rsp.setSize(size);
|
410
|
rsp.setSize(size);
|
|
@@ -1216,7 +1219,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
@@ -1216,7 +1219,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
1216
|
Map<Integer,UserInfoRspBO> userInfoMap = getUsersInfo(uids);
|
1219
|
Map<Integer,UserInfoRspBO> userInfoMap = getUsersInfo(uids);
|
1217
|
Map<Integer,Author> authorInfoMap = getAuthorInfo(authoruids);
|
1220
|
Map<Integer,Author> authorInfoMap = getAuthorInfo(authoruids);
|
1218
|
List<ArticleDetailRspBo> rspBoList = Lists.newArrayList();
|
1221
|
List<ArticleDetailRspBo> rspBoList = Lists.newArrayList();
|
1219
|
- List<Integer> vitualUids = grassVirtualUserDao.getAllPlatUid();//所有的马甲用户
|
1222
|
+// List<Integer> vitualUids = grassVirtualUserDao.getAllPlatUid();//所有的马甲用户
|
1220
|
articleList.forEach(article -> {
|
1223
|
articleList.forEach(article -> {
|
1221
|
ArticleDetailRspBo rspBo = new ArticleDetailRspBo();
|
1224
|
ArticleDetailRspBo rspBo = new ArticleDetailRspBo();
|
1222
|
rspBo.setArticleId(article.getId());
|
1225
|
rspBo.setArticleId(article.getId());
|
|
@@ -1236,11 +1239,11 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
@@ -1236,11 +1239,11 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
1236
|
rspBo.setPublishTime(DateUtil.long2DateStr(article.getCreateTime(), DateUtil.DATE_TIME_FORMAT));
|
1239
|
rspBo.setPublishTime(DateUtil.long2DateStr(article.getCreateTime(), DateUtil.DATE_TIME_FORMAT));
|
1237
|
rspBo.setAuthStatus(article.getAuthStatus());
|
1240
|
rspBo.setAuthStatus(article.getAuthStatus());
|
1238
|
rspBo.setSource(article.getArticleType());
|
1241
|
rspBo.setSource(article.getArticleType());
|
1239
|
- if (article.getArticleType() == ArticleTypeEnum.NORMAL.getValue()) {//文章类型是1 的
|
1242
|
+ /* if (article.getArticleType() == ArticleTypeEnum.NORMAL.getValue()) {//文章类型是1 的
|
1240
|
if (vitualUids.contains(article.getAuthorUid())) {//属于马甲用户发布的
|
1243
|
if (vitualUids.contains(article.getAuthorUid())) {//属于马甲用户发布的
|
1241
|
rspBo.setSource(6);
|
1244
|
rspBo.setSource(6);
|
1242
|
}
|
1245
|
}
|
1243
|
- }
|
1246
|
+ }*/
|
1244
|
rspBo.setImgList(imgMap.get(article.getId()));
|
1247
|
rspBo.setImgList(imgMap.get(article.getId()));
|
1245
|
rspBo.setLabelList(labelMap.get(article.getId()));
|
1248
|
rspBo.setLabelList(labelMap.get(article.getId()));
|
1246
|
rspBo.setIsTop(article.getIsTop());
|
1249
|
rspBo.setIsTop(article.getIsTop());
|
|
@@ -1255,6 +1258,11 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
@@ -1255,6 +1258,11 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
1255
|
rspBo.setTopicId(topic == null ? null : topic.getId());
|
1258
|
rspBo.setTopicId(topic == null ? null : topic.getId());
|
1256
|
rspBo.setTopicName(topic == null ? null : topic.getTopicName());
|
1259
|
rspBo.setTopicName(topic == null ? null : topic.getTopicName());
|
1257
|
rspBo.setTopicGroupId(topic == null ? null : topic.getRelatedGroup());
|
1260
|
rspBo.setTopicGroupId(topic == null ? null : topic.getRelatedGroup());
|
|
|
1261
|
+ if(article.getArticleType() == 2){//资讯来的,前台展示 空
|
|
|
1262
|
+ rspBo.setUserType(0);
|
|
|
1263
|
+ }else{//10--前台展示用户
|
|
|
1264
|
+ rspBo.setUserType(article.getUserType() == null ? 10 : article.getUserType());
|
|
|
1265
|
+ }
|
1258
|
rspBoList.add(rspBo);
|
1266
|
rspBoList.add(rspBo);
|
1259
|
});
|
1267
|
});
|
1260
|
return rspBoList;
|
1268
|
return rspBoList;
|