Authored by mlge

种草--文章管理 修改查询条件

@@ -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;
@@ -53,6 +53,9 @@ @@ -53,6 +53,9 @@
53 </input> 53 </input>
54 <input class="easyui-combobox" id="source"> 54 <input class="easyui-combobox" id="source">
55 </input> 55 </input>
  56 + <input class="easyui-combobox" id="userType">
  57 + </input>
  58 +
56 <input id="startTimeStr" name="startTimeStr" class="easyui-datetimebox" data-options="prompt:'发布时间(开始)'"/> 59 <input id="startTimeStr" name="startTimeStr" class="easyui-datetimebox" data-options="prompt:'发布时间(开始)'"/>
57 60
58 <input id="endTimeStr" name="endTimeStr" class="easyui-datetimebox" data-options="prompt:'发布时间(结束)'"/> 61 <input id="endTimeStr" name="endTimeStr" class="easyui-datetimebox" data-options="prompt:'发布时间(结束)'"/>
@@ -87,6 +90,7 @@ @@ -87,6 +90,7 @@
87 $("#publisher").textbox("setValue",""); 90 $("#publisher").textbox("setValue","");
88 $("#articleId").textbox("setValue",""); 91 $("#articleId").textbox("setValue","");
89 $("#source").combobox("setValue",""); 92 $("#source").combobox("setValue","");
  93 + $("#userType").combobox("setValue","");
90 $("#isRecommend").combobox("setValue",""); 94 $("#isRecommend").combobox("setValue","");
91 $("#isTop").combobox("setValue",""); 95 $("#isTop").combobox("setValue","");
92 $("#startTimeStr").datetimebox('setValue',""); 96 $("#startTimeStr").datetimebox('setValue',"");
@@ -132,9 +136,21 @@ @@ -132,9 +136,21 @@
132 textField : "text", 136 textField : "text",
133 required:false, 137 required:false,
134 prompt: "请选择来源", 138 prompt: "请选择来源",
135 - data:[{text:"全部",value:"0"},{text:"用户",value:"1"},{text:"编辑",value:"6"},{text:"资讯",value:"2"},{text:"now",value:"5"},{text:"mars",value:"3"},{text:"晒单",value:"4"}] 139 + data:[{text:"全部",value:"0"},{text:"社区",value:"1"},{text:"资讯",value:"2"},{text:"晒单",value:"4"},{text:"now",value:"5"},{text:"mars",value:"3"}]
  140 + });
  141 +
  142 + $("#userType").combobox({
  143 + valueField : "value",
  144 + textField : "text",
  145 + required:false,
  146 + prompt: "请选择用户身份",
  147 + data:[{text:"全部",value:"0"},{text:"用户",value:"10"},{text: "普通马甲", value: "1"},
  148 + {text: "编辑", value: "2"}, {text: "官方号", value: "3"},
  149 + {text: "社区大号", value: "4"}, {text: "品牌号", value: "5"},
  150 + {text: "外部刷评论马甲", value: "6"}]
136 }); 151 });
137 152
  153 +
138 //推荐顺序 154 //推荐顺序
139 $("#recommendSort").combobox({ 155 $("#recommendSort").combobox({
140 valueField : "value", 156 valueField : "value",
@@ -173,6 +189,7 @@ @@ -173,6 +189,7 @@
173 authorUid: $("#publisherUid").textbox("getValue"), 189 authorUid: $("#publisherUid").textbox("getValue"),
174 articleId: $("#articleId").textbox("getValue"), 190 articleId: $("#articleId").textbox("getValue"),
175 source: $("#source").combobox("getValue"), 191 source: $("#source").combobox("getValue"),
  192 + userType: $("#userType").combobox("getValue"),
176 recommendSort:$("#recommendSort").combobox("getValue"), 193 recommendSort:$("#recommendSort").combobox("getValue"),
177 isRecommend: $("#isRecommend").combobox("getValue"), 194 isRecommend: $("#isRecommend").combobox("getValue"),
178 isTop: $("#isTop").combobox("getValue"), 195 isTop: $("#isTop").combobox("getValue"),
@@ -192,6 +209,7 @@ @@ -192,6 +209,7 @@
192 publisher: $("#publisher").textbox("getValue"), 209 publisher: $("#publisher").textbox("getValue"),
193 articleId: $("#articleId").textbox("getValue"), 210 articleId: $("#articleId").textbox("getValue"),
194 source: $("#source").textbox("getValue"), 211 source: $("#source").textbox("getValue"),
  212 + userType: $("#userType").textbox("getValue"),
195 recommendSort:$("#recommendSort").combobox("getValue"), 213 recommendSort:$("#recommendSort").combobox("getValue"),
196 authStatus: $("#authStatus").combobox("getValue") 214 authStatus: $("#authStatus").combobox("getValue")
197 }, 215 },
@@ -293,9 +311,40 @@ @@ -293,9 +311,40 @@
293 if(rowData.source == '5'){ 311 if(rowData.source == '5'){
294 str = "now"; 312 str = "now";
295 } 313 }
296 - if(rowData.source == '6'){ 314 +
  315 + return str;
  316 + }
  317 +
  318 + },{
  319 + title: "用户身份",
  320 + field: "userType",
  321 + width: 20,
  322 + align: "left",
  323 + formatter: function (value, rowData, rowIndex) {
  324 + debugger
  325 + var str = '';//不明身份者
  326 +
  327 + if(rowData.userType == '10'){
  328 + str = "用户";
  329 + }
  330 + if(rowData.userType == '1'){
  331 + str = "普通马甲";
  332 + }
  333 + if(rowData.userType == '2'){
297 str = "编辑"; 334 str = "编辑";
298 } 335 }
  336 + if(rowData.userType == '3'){
  337 + str = "官方号";
  338 + }
  339 + if(rowData.userType == '4'){
  340 + str = "社区大号";
  341 + }
  342 + if(rowData.userType == '5'){
  343 + str = "品牌号";
  344 + }
  345 + if(rowData.userType == '6'){
  346 + str = "外部刷评论马甲";
  347 + }
299 return str; 348 return str;
300 } 349 }
301 350