Commit d9bb345e5929318694ab4c15284e02ba16366624

Authored by 周伟鹏
1 parent 6aa58594

update

src/main/java/com/cnlive/shenhe/controller/CommentsController.java
@@ -74,15 +74,17 @@ public class CommentsController { @@ -74,15 +74,17 @@ public class CommentsController {
74 List<ShyComments> list = commentPage.getList(); 74 List<ShyComments> list = commentPage.getList();
75 if (!list.isEmpty()) { 75 if (!list.isEmpty()) {
76 for (ShyComments comment : list) { 76 for (ShyComments comment : list) {
77 - String auditor = "白名单";  
78 - String auditor_id = comment.getAuditor_id();  
79 - if (CommonUtils.isNotEmpty(auditor_id)) {  
80 - ShyUsers user = new ShyUsers();  
81 - user.setUser_id(auditor_id);  
82 - user = usersService.select(user);  
83 - if (CommonUtils.isNotNull(user)) auditor = user.getUsername() + user.getEmail(); 77 + if(comment.getState()!=CommonConst.AUDIT_INTT){
  78 + String auditor = "白名单";
  79 + String auditor_id = comment.getAuditor_id();
  80 + if (CommonUtils.isNotEmpty(auditor_id)) {
  81 + ShyUsers user = new ShyUsers();
  82 + user.setUser_id(auditor_id);
  83 + user = usersService.select(user);
  84 + if (CommonUtils.isNotNull(user)) auditor = user.getUsername() + user.getEmail();
  85 + }
  86 + comment.setAuditor(auditor);
84 } 87 }
85 - comment.setAuditor(auditor);  
86 } 88 }
87 } 89 }
88 model.addAttribute("commentPage", commentPage); 90 model.addAttribute("commentPage", commentPage);
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
@@ -129,18 +129,25 @@ public class CommentsServiceImpl { @@ -129,18 +129,25 @@ public class CommentsServiceImpl {
129 success = false; 129 success = false;
130 break; 130 break;
131 } 131 }
132 - Integer code = result.getInteger("errorCode");  
133 - if (code != 0) {  
134 - logger.error("评论回调错误,activity_id:{},errorCode:{},errorMessage:{}", comment.getActivity_id(), code, result.getString("errorMessage")); 132 + if(result==null){
  133 + logger.error("评论回调错误,且无返回信息。activity_id:{}", comment.getActivity_id());
135 success = false; 134 success = false;
136 break; 135 break;
  136 + }else{
  137 + Integer code = result.getInteger("errorCode");
  138 + if (code != 0) {
  139 + logger.error("评论回调错误,activity_id:{},errorCode:{},errorMessage:{}", comment.getActivity_id(), code, result.getString("errorMessage"));
  140 + success = false;
  141 + break;
  142 + }
  143 + comment.setState(state);
  144 + comment.setAuditor_id(userId);
  145 + int i = shyCommentsMapper.updateByPrimaryKeySelective(comment);
  146 + if (i != 1) {
  147 + success = false;
  148 + }
137 } 149 }
138 - comment.setState(state);  
139 - comment.setAuditor_id(userId);  
140 - int i = shyCommentsMapper.updateByPrimaryKeySelective(comment);  
141 - if (i != 1) {  
142 - success = false;  
143 - } 150 +
144 } 151 }
145 return success; 152 return success;
146 } 153 }
src/main/resources/templates/page/videoDetail.html
@@ -248,7 +248,7 @@ @@ -248,7 +248,7 @@
248 if (action_note_type == 'reject') { 248 if (action_note_type == 'reject') {
249 $.ajax({ 249 $.ajax({
250 type: 'post', 250 type: 'post',
251 - data: {'id':id,'activity_id': activity_id, 'state': state, 'attr_tags': msg,'msg':msg,'callback':callback[0]}, 251 + data: {'id':id,'activity_id': activity_id, 'state': state, 'attr_tags': msg,'msg':msg,'callback':callback},
252 url: '/videos/shenheVideo', 252 url: '/videos/shenheVideo',
253 success: function (data) { 253 success: function (data) {
254 window.location.href = '/videos/page?state=0' 254 window.location.href = '/videos/page?state=0'
@@ -276,7 +276,7 @@ @@ -276,7 +276,7 @@
276 } 276 }
277 $.ajax({ 277 $.ajax({
278 type: 'post', 278 type: 'post',
279 - data: {'id':id,'activity_id': activity_id, 'state': state, 'attr_tags': msg,'msg':msg,'callback':callback[0]}, 279 + data: {'id':id,'activity_id': activity_id, 'state': state, 'attr_tags': msg,'msg':msg,'callback':callback},
280 url: '/videos/shenheVideo', 280 url: '/videos/shenheVideo',
281 success: function (data) { 281 success: function (data) {
282 window.location.href = '/videos/page?state=0' 282 window.location.href = '/videos/page?state=0'