Commit ad4356c415b9ab374dfde2e4f2cb479c5ebdb43f
1 parent
f5bc9a70
评论审核查询增加分类别查询
Showing
3 changed files
with
28 additions
and
19 deletions
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
| @@ -64,7 +64,7 @@ public class CommentsController extends BaseController { | @@ -64,7 +64,7 @@ public class CommentsController extends BaseController { | ||
| 64 | @GetMapping("/page") | 64 | @GetMapping("/page") |
| 65 | public String getPage(Model model, String activity_id, String content, Integer is_hot, | 65 | public String getPage(Model model, String activity_id, String content, Integer is_hot, |
| 66 | String start_date, String end_date, Integer state, Integer receive, | 66 | String start_date, String end_date, Integer state, Integer receive, |
| 67 | - Integer page, Integer pageSize, String orderByClause, HttpSession session) { | 67 | + Integer page, Integer pageSize, String orderByClause, HttpSession session,Integer type) { |
| 68 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 68 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 69 | if(CommonUtils.isNull(sessionUser)){ | 69 | if(CommonUtils.isNull(sessionUser)){ |
| 70 | return "redirect:/users/login"; | 70 | return "redirect:/users/login"; |
| @@ -89,7 +89,7 @@ public class CommentsController extends BaseController { | @@ -89,7 +89,7 @@ public class CommentsController extends BaseController { | ||
| 89 | } catch (Exception e) { | 89 | } catch (Exception e) { |
| 90 | } | 90 | } |
| 91 | } | 91 | } |
| 92 | - PageInfo<ShyComments> commentPage = commentsService.getPage(activity_id, content, is_hot, sDate, eDate, state, receive, null, page, pageSize, orderByClause, spid, userId); | 92 | + PageInfo<ShyComments> commentPage = commentsService.getPage(activity_id, content, is_hot, sDate, eDate, state, receive, null, page, pageSize, orderByClause, spid, userId,type); |
| 93 | List<ShyComments> list = commentPage.getList(); | 93 | List<ShyComments> list = commentPage.getList(); |
| 94 | if (!list.isEmpty()) { | 94 | if (!list.isEmpty()) { |
| 95 | for (ShyComments comment : list) { | 95 | for (ShyComments comment : list) { |
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
| @@ -78,7 +78,7 @@ public class CommentsServiceImpl { | @@ -78,7 +78,7 @@ public class CommentsServiceImpl { | ||
| 78 | return shyCommentsMapper.updateByPrimaryKeySelective(shyComments); | 78 | return shyCommentsMapper.updateByPrimaryKeySelective(shyComments); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | - public PageInfo<ShyComments> getPage(String activity_id, String content, Integer is_hot, Date start_date, Date end_date, Integer states, Integer receive, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId) { | 81 | + public PageInfo<ShyComments> getPage(String activity_id, String content, Integer is_hot, Date start_date, Date end_date, Integer states, Integer receive, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId,Integer type) { |
| 82 | Example example = new Example(ShyComments.class); | 82 | Example example = new Example(ShyComments.class); |
| 83 | Example.Criteria criteria = example.createCriteria(); | 83 | Example.Criteria criteria = example.createCriteria(); |
| 84 | if (CommonUtils.isNotEmpty(orderByClause)) { | 84 | if (CommonUtils.isNotEmpty(orderByClause)) { |
| @@ -102,6 +102,11 @@ public class CommentsServiceImpl { | @@ -102,6 +102,11 @@ public class CommentsServiceImpl { | ||
| 102 | if (CommonUtils.isNotNull(is_hot)) { | 102 | if (CommonUtils.isNotNull(is_hot)) { |
| 103 | criteria.andEqualTo("is_hot", is_hot); | 103 | criteria.andEqualTo("is_hot", is_hot); |
| 104 | } | 104 | } |
| 105 | + if (CommonUtils.isNotNull(type)&&type==0) { | ||
| 106 | + criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC); | ||
| 107 | + }else if(CommonUtils.isNotNull(type)&&type==1){ | ||
| 108 | + criteria.andIsNull("type"); | ||
| 109 | + } | ||
| 105 | if (CommonUtils.isNotEmpty(activity_id)) { | 110 | if (CommonUtils.isNotEmpty(activity_id)) { |
| 106 | criteria.andLike("activity_id", "%" + activity_id + "%"); | 111 | criteria.andLike("activity_id", "%" + activity_id + "%"); |
| 107 | } | 112 | } |
src/main/resources/templates/page/comment.html
| @@ -89,23 +89,23 @@ | @@ -89,23 +89,23 @@ | ||
| 89 | <form id="commentForm"> | 89 | <form id="commentForm"> |
| 90 | <!-- <input th:value="${param.state}"/> --> | 90 | <!-- <input th:value="${param.state}"/> --> |
| 91 | <div class="btn-group margin-bottom col-md-6" style="padding: 0;"> | 91 | <div class="btn-group margin-bottom col-md-6" style="padding: 0;"> |
| 92 | - <div class="col-md-5" style="padding: 0"> | 92 | + <div class="col-md-4" style="padding: 0"> |
| 93 | <label for="activity_id" class="control-label cb-toolbar">活动id:</label> | 93 | <label for="activity_id" class="control-label cb-toolbar">活动id:</label> |
| 94 | <div class="col-sm-8" style="padding: 0;"> | 94 | <div class="col-sm-8" style="padding: 0;"> |
| 95 | <input class="form-control" name="activity_id" type="text" | 95 | <input class="form-control" name="activity_id" type="text" |
| 96 | id="activity_id" > | 96 | id="activity_id" > |
| 97 | </div> | 97 | </div> |
| 98 | </div> | 98 | </div> |
| 99 | - <div class="col-md-4" style="padding: 0"> | 99 | + <div class="col-md-5" style="padding: 0"> |
| 100 | <label for="content" class="control-label cb-toolbar">内容:</label> | 100 | <label for="content" class="control-label cb-toolbar">内容:</label> |
| 101 | - <div class="col-sm-8" style="padding: 0;"> | 101 | + <div class="col-sm-9" style="padding: 0;"> |
| 102 | <input class="form-control" name="content" type="text" id="content" | 102 | <input class="form-control" name="content" type="text" id="content" |
| 103 | > | 103 | > |
| 104 | </div> | 104 | </div> |
| 105 | </div> | 105 | </div> |
| 106 | <div class="col-md-3" style="padding: 0"> | 106 | <div class="col-md-3" style="padding: 0"> |
| 107 | <label for="state" class="control-label cb-toolbar">状态:</label> | 107 | <label for="state" class="control-label cb-toolbar">状态:</label> |
| 108 | - <div class="col-sm-6" style="padding: 0;"> | 108 | + <div class="col-sm-8" style="padding: 0;"> |
| 109 | <select class="form-control col-sm-2" id="state" name="state"> | 109 | <select class="form-control col-sm-2" id="state" name="state"> |
| 110 | <option value="">全部</option> | 110 | <option value="">全部</option> |
| 111 | <option value="0" >未审核</option> | 111 | <option value="0" >未审核</option> |
| @@ -114,18 +114,21 @@ | @@ -114,18 +114,21 @@ | ||
| 114 | </select> | 114 | </select> |
| 115 | </div> | 115 | </div> |
| 116 | </div> | 116 | </div> |
| 117 | - <script th:inline="javascript"> | ||
| 118 | -// var isHot = [[${param.is_hot}]]; | ||
| 119 | -// if (isHot != null && isHot[0] != "") { | ||
| 120 | -// $("#is_hot").val(isHot[0]); | ||
| 121 | -// } | ||
| 122 | - </script> | ||
| 123 | - | 117 | + |
| 124 | </div> | 118 | </div> |
| 125 | 119 | ||
| 126 | <div class="btn-group margin-bottom col-md-6 pull-right" style="padding: 0"> | 120 | <div class="btn-group margin-bottom col-md-6 pull-right" style="padding: 0"> |
| 127 | - <div class="col-md-11" style="width: 88%;padding: 0;"> | ||
| 128 | - <div class="col-md-6" style="padding: 0;width: 45%;"> | 121 | + <div class="col-md-3" style="padding: 0"> |
| 122 | + <label for="state" class="control-label cb-toolbar">类型:</label> | ||
| 123 | + <div class="col-sm-8" style="padding: 0;"> | ||
| 124 | + <select class="form-control col-sm-2" id="topic" name="topic"> | ||
| 125 | + <option value="">全部</option> | ||
| 126 | + <option value="0" >话题</option> | ||
| 127 | + <option value="1" >其他</option> | ||
| 128 | + </select> | ||
| 129 | + </div> | ||
| 130 | + </div> | ||
| 131 | + <div class="col-md-5" style="padding: 0;"> | ||
| 129 | <label for="start_date" class="control-label cb-toolbar">时间:</label> | 132 | <label for="start_date" class="control-label cb-toolbar">时间:</label> |
| 130 | <div class="input-group col-md-9 date"> | 133 | <div class="input-group col-md-9 date"> |
| 131 | <input class="form-control date" name="start_date" type="text" | 134 | <input class="form-control date" name="start_date" type="text" |
| @@ -135,7 +138,7 @@ | @@ -135,7 +138,7 @@ | ||
| 135 | </span> | 138 | </span> |
| 136 | </div> | 139 | </div> |
| 137 | </div> | 140 | </div> |
| 138 | - <div class="col-md-6" style="padding: 0;width: 45%;"> | 141 | + <div class="col-md-4" style="padding: 0;"> |
| 139 | <label for="start_date" class="control-label cb-toolbar">至</label> | 142 | <label for="start_date" class="control-label cb-toolbar">至</label> |
| 140 | <div class="input-group col-md-9 date"> | 143 | <div class="input-group col-md-9 date"> |
| 141 | <input class="form-control date" name="end_date" type="text" | 144 | <input class="form-control date" name="end_date" type="text" |
| @@ -150,7 +153,6 @@ | @@ -150,7 +153,6 @@ | ||
| 150 | <!-- onclick="javascript:$('#commentForm').submit();">查 询 --> | 153 | <!-- onclick="javascript:$('#commentForm').submit();">查 询 --> |
| 151 | <!-- </button> --> | 154 | <!-- </button> --> |
| 152 | <!-- </div> --> | 155 | <!-- </div> --> |
| 153 | - </div> | ||
| 154 | </div> | 156 | </div> |
| 155 | </form> | 157 | </form> |
| 156 | 158 | ||
| @@ -539,6 +541,7 @@ | @@ -539,6 +541,7 @@ | ||
| 539 | var end_date = "";//结束时间 | 541 | var end_date = "";//结束时间 |
| 540 | var count = "";//每页显示数量 | 542 | var count = "";//每页显示数量 |
| 541 | var receive ="";//领取状态 | 543 | var receive ="";//领取状态 |
| 544 | + var type="";//类型,topic:话题 | ||
| 542 | 545 | ||
| 543 | function query(){ | 546 | function query(){ |
| 544 | activity_id = $("#activity_id").val(); | 547 | activity_id = $("#activity_id").val(); |
| @@ -546,7 +549,8 @@ | @@ -546,7 +549,8 @@ | ||
| 546 | start_date = $("#start_date").val(); | 549 | start_date = $("#start_date").val(); |
| 547 | end_date = $("#end_date").val(); | 550 | end_date = $("#end_date").val(); |
| 548 | count = $("#pageSize").val(); | 551 | count = $("#pageSize").val(); |
| 549 | - window.location.href = "/comments/page?activity_id=" + activity_id + "&start_date=" + start_date + "&end_date=" + end_date + "&content=" + content + "&pageSize="+count+"&state="+state+"&receive="+receive; | 552 | + type = $("#topic").val(); |
| 553 | + window.location.href = "/comments/page?activity_id=" + activity_id + "&start_date=" + start_date + "&end_date=" + end_date + "&content=" + content + "&pageSize="+count+"&state="+state+"&receive="+receive+"&type="+type; | ||
| 550 | } | 554 | } |
| 551 | 555 | ||
| 552 | //全部 | 556 | //全部 |