Commit ad4356c415b9ab374dfde2e4f2cb479c5ebdb43f

Authored by liwei2917
1 parent f5bc9a70

评论审核查询增加分类别查询

src/main/java/com/cnlive/shenhe/controller/CommentsController.java
... ... @@ -64,7 +64,7 @@ public class CommentsController extends BaseController {
64 64 @GetMapping("/page")
65 65 public String getPage(Model model, String activity_id, String content, Integer is_hot,
66 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 68 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
69 69 if(CommonUtils.isNull(sessionUser)){
70 70 return "redirect:/users/login";
... ... @@ -89,7 +89,7 @@ public class CommentsController extends BaseController {
89 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 93 List<ShyComments> list = commentPage.getList();
94 94 if (!list.isEmpty()) {
95 95 for (ShyComments comment : list) {
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
... ... @@ -78,7 +78,7 @@ public class CommentsServiceImpl {
78 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 82 Example example = new Example(ShyComments.class);
83 83 Example.Criteria criteria = example.createCriteria();
84 84 if (CommonUtils.isNotEmpty(orderByClause)) {
... ... @@ -102,6 +102,11 @@ public class CommentsServiceImpl {
102 102 if (CommonUtils.isNotNull(is_hot)) {
103 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 110 if (CommonUtils.isNotEmpty(activity_id)) {
106 111 criteria.andLike("activity_id", "%" + activity_id + "%");
107 112 }
... ...
src/main/resources/templates/page/comment.html
... ... @@ -89,23 +89,23 @@
89 89 <form id="commentForm">
90 90 <!-- <input th:value="${param.state}"/> -->
91 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 93 <label for="activity_id" class="control-label cb-toolbar">活动id:</label>
94 94 <div class="col-sm-8" style="padding: 0;">
95 95 <input class="form-control" name="activity_id" type="text"
96 96 id="activity_id" >
97 97 </div>
98 98 </div>
99   - <div class="col-md-4" style="padding: 0">
  99 + <div class="col-md-5" style="padding: 0">
100 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 102 <input class="form-control" name="content" type="text" id="content"
103 103 >
104 104 </div>
105 105 </div>
106 106 <div class="col-md-3" style="padding: 0">
107 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 109 <select class="form-control col-sm-2" id="state" name="state">
110 110 <option value="">全部</option>
111 111 <option value="0" >未审核</option>
... ... @@ -114,18 +114,21 @@
114 114 </select>
115 115 </div>
116 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 118 </div>
125 119  
126 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 132 <label for="start_date" class="control-label cb-toolbar">时间:</label>
130 133 <div class="input-group col-md-9 date">
131 134 <input class="form-control date" name="start_date" type="text"
... ... @@ -135,7 +138,7 @@
135 138 </span>
136 139 </div>
137 140 </div>
138   - <div class="col-md-6" style="padding: 0;width: 45%;">
  141 + <div class="col-md-4" style="padding: 0;">
139 142 <label for="start_date" class="control-label cb-toolbar">至</label>
140 143 <div class="input-group col-md-9 date">
141 144 <input class="form-control date" name="end_date" type="text"
... ... @@ -150,7 +153,6 @@
150 153 <!-- onclick="javascript:$('#commentForm').submit();">查 询 -->
151 154 <!-- </button> -->
152 155 <!-- </div> -->
153   - </div>
154 156 </div>
155 157 </form>
156 158  
... ... @@ -539,6 +541,7 @@
539 541 var end_date = "";//结束时间
540 542 var count = "";//每页显示数量
541 543 var receive ="";//领取状态
  544 + var type="";//类型,topic:话题
542 545  
543 546 function query(){
544 547 activity_id = $("#activity_id").val();
... ... @@ -546,7 +549,8 @@
546 549 start_date = $("#start_date").val();
547 550 end_date = $("#end_date").val();
548 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 //全部
... ...