Merge branch 'dev_grass_20190108' of http://git.yoho.cn/platform/platform-cms in…
…to dev_grass_20190108
Showing
5 changed files
with
51 additions
and
20 deletions
@@ -3,13 +3,14 @@ package com.yohobuy.platform.grass.restapi; | @@ -3,13 +3,14 @@ package com.yohobuy.platform.grass.restapi; | ||
3 | import com.yohobuy.platform.grass.service.IGrassGoodsCommentService; | 3 | import com.yohobuy.platform.grass.service.IGrassGoodsCommentService; |
4 | import com.yohobuy.platform.model.common.ApiResponse; | 4 | import com.yohobuy.platform.model.common.ApiResponse; |
5 | import com.yohobuy.platform.model.common.PageResponseVO; | 5 | import com.yohobuy.platform.model.common.PageResponseVO; |
6 | +import com.yohobuy.platform.model.grass.request.GoodsCommentModifyStatusReq; | ||
6 | import com.yohobuy.platform.model.grass.request.GoodsCommentQueryReq; | 7 | import com.yohobuy.platform.model.grass.request.GoodsCommentQueryReq; |
7 | import com.yohobuy.platform.model.grass.response.GoodsCommentQueryRsp; | 8 | import com.yohobuy.platform.model.grass.response.GoodsCommentQueryRsp; |
8 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
9 | import org.slf4j.LoggerFactory; | 10 | import org.slf4j.LoggerFactory; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
12 | +import org.springframework.web.bind.annotation.RequestBody; | ||
11 | import org.springframework.web.bind.annotation.RequestMapping; | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
12 | -import org.springframework.web.bind.annotation.RequestParam; | ||
13 | import org.springframework.web.bind.annotation.ResponseBody; | 14 | import org.springframework.web.bind.annotation.ResponseBody; |
14 | import org.springframework.web.bind.annotation.RestController; | 15 | import org.springframework.web.bind.annotation.RestController; |
15 | 16 | ||
@@ -33,9 +34,9 @@ public class GrassGoodsCommentController { | @@ -33,9 +34,9 @@ public class GrassGoodsCommentController { | ||
33 | 34 | ||
34 | @RequestMapping("/modifyStatus") | 35 | @RequestMapping("/modifyStatus") |
35 | @ResponseBody | 36 | @ResponseBody |
36 | - public ApiResponse modifyStatus(@RequestParam("id") Integer id,@RequestParam("status") Integer status){ | ||
37 | - logger.info("enter modifyStatus.id is {},status is {}",id,status); | ||
38 | - grassGoodsCommentService.modifyStatus(id,status); | 37 | + public ApiResponse modifyStatus(@RequestBody GoodsCommentModifyStatusReq req){ |
38 | + logger.info("enter modifyStatus.param is {}",req); | ||
39 | + grassGoodsCommentService.modifyStatus(req); | ||
39 | return new ApiResponse.ApiResponseBuilder().message("审核完成").build(); | 40 | return new ApiResponse.ApiResponseBuilder().message("审核完成").build(); |
40 | } | 41 | } |
41 | } | 42 | } |
1 | package com.yohobuy.platform.grass.service; | 1 | package com.yohobuy.platform.grass.service; |
2 | 2 | ||
3 | import com.yohobuy.platform.model.common.PageResponseVO; | 3 | import com.yohobuy.platform.model.common.PageResponseVO; |
4 | +import com.yohobuy.platform.model.grass.request.GoodsCommentModifyStatusReq; | ||
4 | import com.yohobuy.platform.model.grass.request.GoodsCommentQueryReq; | 5 | import com.yohobuy.platform.model.grass.request.GoodsCommentQueryReq; |
5 | import com.yohobuy.platform.model.grass.response.GoodsCommentQueryRsp; | 6 | import com.yohobuy.platform.model.grass.response.GoodsCommentQueryRsp; |
6 | 7 | ||
@@ -10,5 +11,5 @@ import com.yohobuy.platform.model.grass.response.GoodsCommentQueryRsp; | @@ -10,5 +11,5 @@ import com.yohobuy.platform.model.grass.response.GoodsCommentQueryRsp; | ||
10 | public interface IGrassGoodsCommentService { | 11 | public interface IGrassGoodsCommentService { |
11 | PageResponseVO<GoodsCommentQueryRsp> queryComment(GoodsCommentQueryReq req); | 12 | PageResponseVO<GoodsCommentQueryRsp> queryComment(GoodsCommentQueryReq req); |
12 | 13 | ||
13 | - void modifyStatus(Integer id,Integer status); | 14 | + void modifyStatus(GoodsCommentModifyStatusReq req); |
14 | } | 15 | } |
@@ -6,6 +6,7 @@ import com.yohobuy.platform.dal.grass.IGrassGoodsCommentDao; | @@ -6,6 +6,7 @@ import com.yohobuy.platform.dal.grass.IGrassGoodsCommentDao; | ||
6 | import com.yohobuy.platform.grass.service.IGrassGoodsCommentService; | 6 | import com.yohobuy.platform.grass.service.IGrassGoodsCommentService; |
7 | import com.yohobuy.platform.model.common.PageResponseVO; | 7 | import com.yohobuy.platform.model.common.PageResponseVO; |
8 | import com.yohobuy.platform.model.grass.GoodsChildCommentTotalBo; | 8 | import com.yohobuy.platform.model.grass.GoodsChildCommentTotalBo; |
9 | +import com.yohobuy.platform.model.grass.request.GoodsCommentModifyStatusReq; | ||
9 | import com.yohobuy.platform.model.grass.request.GoodsCommentQueryReq; | 10 | import com.yohobuy.platform.model.grass.request.GoodsCommentQueryReq; |
10 | import com.yohobuy.platform.model.grass.response.GoodsCommentQueryRsp; | 11 | import com.yohobuy.platform.model.grass.response.GoodsCommentQueryRsp; |
11 | import org.apache.commons.collections.CollectionUtils; | 12 | import org.apache.commons.collections.CollectionUtils; |
@@ -54,8 +55,8 @@ public class GrassGoodsCommentServiceImpl implements IGrassGoodsCommentService { | @@ -54,8 +55,8 @@ public class GrassGoodsCommentServiceImpl implements IGrassGoodsCommentService { | ||
54 | } | 55 | } |
55 | 56 | ||
56 | @Override | 57 | @Override |
57 | - public void modifyStatus(Integer id,Integer status) { | 58 | + public void modifyStatus(GoodsCommentModifyStatusReq req) { |
58 | Integer reviewerId = new UserHelper().getUserId(); | 59 | Integer reviewerId = new UserHelper().getUserId(); |
59 | - grassGoodsCommentDao.updateStatus(id,status,reviewerId, DateUtil.currentTimeSeconds()); | 60 | + grassGoodsCommentDao.updateStatus(req.getIds(),req.getStatus(),reviewerId, DateUtil.currentTimeSeconds()); |
60 | } | 61 | } |
61 | } | 62 | } |
@@ -46,7 +46,10 @@ | @@ -46,7 +46,10 @@ | ||
46 | <a id="allBtn" class="btn-info">全部</a> | 46 | <a id="allBtn" class="btn-info">全部</a> |
47 | 47 | ||
48 | </div> | 48 | </div> |
49 | - | 49 | + <div style="margin-left: 20px;margin-top: 10px"> |
50 | + <a id="btnBatchAllow" class="btn-long" style="background-color: #5CB85C;">批量通过</a> | ||
51 | + <a id="btnBatchBan" class="btn-long" style="background-color: #ffa951;">批量拒绝</a> | ||
52 | + </div> | ||
50 | </div> | 53 | </div> |
51 | 54 | ||
52 | <div region="center" id="labelGroupList" style="margin-left: 20px"> | 55 | <div region="center" id="labelGroupList" style="margin-left: 20px"> |
@@ -87,7 +90,24 @@ | @@ -87,7 +90,24 @@ | ||
87 | $("#labelGroupListTable").datagrid("load", {}); | 90 | $("#labelGroupListTable").datagrid("load", {}); |
88 | } | 91 | } |
89 | }); | 92 | }); |
90 | - | 93 | + $("#btnBatchAllow").click(function(){ |
94 | + batchUpdateStatus(1); | ||
95 | + }); | ||
96 | + $("#btnBatchBan").click(function(){ | ||
97 | + batchUpdateStatus(2); | ||
98 | + }); | ||
99 | + function batchUpdateStatus(status){ | ||
100 | + var rows = $('#labelGroupListTable').datagrid('getSelections'); | ||
101 | + if(!rows||rows.length == 0){ | ||
102 | + $.messager.alert("提示", "请先选择数据!", "warn"); | ||
103 | + return; | ||
104 | + } | ||
105 | + var ids = []; | ||
106 | + rows.forEach(function(value,i){ | ||
107 | + ids.push(value.id); | ||
108 | + }) | ||
109 | + updateStatus(ids,status) | ||
110 | + } | ||
91 | $("#searchBtn").linkbutton({ | 111 | $("#searchBtn").linkbutton({ |
92 | iconCls : "icon-search", | 112 | iconCls : "icon-search", |
93 | onClick : function() { | 113 | onClick : function() { |
@@ -128,6 +148,11 @@ | @@ -128,6 +148,11 @@ | ||
128 | }, | 148 | }, |
129 | columns: [[ | 149 | columns: [[ |
130 | { | 150 | { |
151 | + field: "ck", | ||
152 | + checkbox:true, | ||
153 | + align: "left" | ||
154 | + }, | ||
155 | + { | ||
131 | title: "评论ID", | 156 | title: "评论ID", |
132 | field: "id", | 157 | field: "id", |
133 | width: 15, | 158 | width: 15, |
@@ -223,7 +248,7 @@ | @@ -223,7 +248,7 @@ | ||
223 | pageSize: 10, | 248 | pageSize: 10, |
224 | pageList: [10], | 249 | pageList: [10], |
225 | idField: "id", | 250 | idField: "id", |
226 | - singleSelect: true, | 251 | + singleSelect: false, |
227 | onLoadSuccess: function (data) { | 252 | onLoadSuccess: function (data) { |
228 | if(index != ""){ | 253 | if(index != ""){ |
229 | $(this).datagrid("scrollTo",index); | 254 | $(this).datagrid("scrollTo",index); |
@@ -235,7 +260,7 @@ | @@ -235,7 +260,7 @@ | ||
235 | onClick : function() { | 260 | onClick : function() { |
236 | index = $(this).attr("index"); | 261 | index = $(this).attr("index"); |
237 | var row = $("#labelGroupListTable").datagrid('getData').rows[index]; | 262 | var row = $("#labelGroupListTable").datagrid('getData').rows[index]; |
238 | - updateStatus(row.id,1); | 263 | + updateStatus([row.id],1); |
239 | } | 264 | } |
240 | }); | 265 | }); |
241 | $(this).datagrid("getPanel").find("a[role='banStatus']").linkbutton({ | 266 | $(this).datagrid("getPanel").find("a[role='banStatus']").linkbutton({ |
@@ -243,20 +268,25 @@ | @@ -243,20 +268,25 @@ | ||
243 | onClick : function() { | 268 | onClick : function() { |
244 | index = $(this).attr("index"); | 269 | index = $(this).attr("index"); |
245 | var row = $("#labelGroupListTable").datagrid('getData').rows[index]; | 270 | var row = $("#labelGroupListTable").datagrid('getData').rows[index]; |
246 | - updateStatus(row.id,2); | 271 | + updateStatus([row.id],2); |
272 | + } | ||
273 | + }); | ||
247 | } | 274 | } |
248 | }); | 275 | }); |
249 | 276 | ||
250 | - function updateStatus(id,status){ | 277 | + function updateStatus(ids,status){ |
278 | + var param={ | ||
279 | + ids:ids, | ||
280 | + status:status | ||
281 | + }; | ||
251 | $.ajax( | 282 | $.ajax( |
252 | { | 283 | { |
253 | type : 'post', | 284 | type : 'post', |
254 | url : serverContextPath + "/grassGoodsComment/modifyStatus", | 285 | url : serverContextPath + "/grassGoodsComment/modifyStatus", |
255 | dataType : 'json', | 286 | dataType : 'json', |
256 | - data : { | ||
257 | - id:id, | ||
258 | - status:status | ||
259 | - }, | 287 | + data : JSON.stringify(param), |
288 | + contentType : 'application/json', | ||
289 | + dataType : 'json', | ||
260 | success : function(result){ | 290 | success : function(result){ |
261 | if(result.code==200){ | 291 | if(result.code==200){ |
262 | $("#labelGroupListTable").datagrid("reload"); | 292 | $("#labelGroupListTable").datagrid("reload"); |
@@ -272,8 +302,6 @@ | @@ -272,8 +302,6 @@ | ||
272 | } | 302 | } |
273 | ); | 303 | ); |
274 | } | 304 | } |
275 | - } | ||
276 | - }); | ||
277 | }); | 305 | }); |
278 | 306 | ||
279 | </script> | 307 | </script> |
@@ -305,7 +305,7 @@ | @@ -305,7 +305,7 @@ | ||
305 | iconCls : "icon-save", | 305 | iconCls : "icon-save", |
306 | handler:function(){ | 306 | handler:function(){ |
307 | var rows = $('#productListTable').datagrid('getSelections'); | 307 | var rows = $('#productListTable').datagrid('getSelections'); |
308 | - if(!rows){ | 308 | + if(!rows||rows.length == 0){ |
309 | $.messager.alert("提示", "请先选择数据!", "warn"); | 309 | $.messager.alert("提示", "请先选择数据!", "warn"); |
310 | return; | 310 | return; |
311 | } | 311 | } |
-
Please register or login to post a comment