Commit e2719efc31bbabaa6a8ace9d0130f423a26e86c7

Authored by 周伟鹏
1 parent d9bb345e

update

src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
@@ -8,6 +8,7 @@ import com.cnlive.shenhe.mapper.ShyCommentsMapper; @@ -8,6 +8,7 @@ import com.cnlive.shenhe.mapper.ShyCommentsMapper;
8 import com.cnlive.shenhe.mapper.ShySitesMapper; 8 import com.cnlive.shenhe.mapper.ShySitesMapper;
9 import com.cnlive.shenhe.mapper.ShyUsersMapper; 9 import com.cnlive.shenhe.mapper.ShyUsersMapper;
10 import com.cnlive.shenhe.utils.AuditPass; 10 import com.cnlive.shenhe.utils.AuditPass;
  11 +import com.cnlive.shenhe.utils.CommonConst;
11 import com.cnlive.shenhe.utils.CommonUtils; 12 import com.cnlive.shenhe.utils.CommonUtils;
12 import com.github.pagehelper.PageHelper; 13 import com.github.pagehelper.PageHelper;
13 import com.github.pagehelper.PageInfo; 14 import com.github.pagehelper.PageInfo;
@@ -99,15 +100,17 @@ public class CommentsServiceImpl { @@ -99,15 +100,17 @@ public class CommentsServiceImpl {
99 100
100 public ShyComments getDetailsComment(Integer id) { 101 public ShyComments getDetailsComment(Integer id) {
101 ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id); 102 ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id);
102 - String auditorName = "白名单";  
103 - String auditor_id = comment.getAuditor_id();  
104 - if (CommonUtils.isNotEmpty(auditor_id)) {  
105 - ShyUsers user = new ShyUsers();  
106 - user.setUser_id(auditor_id);  
107 - user = shyUsersMapper.selectOne(user);  
108 - auditorName = user.getUsername() + user.getEmail(); 103 + if (comment.getState() != CommonConst.AUDIT_INTT) {
  104 + String auditorName = "白名单";
  105 + String auditor_id = comment.getAuditor_id();
  106 + if (CommonUtils.isNotEmpty(auditor_id)) {
  107 + ShyUsers user = new ShyUsers();
  108 + user.setUser_id(auditor_id);
  109 + user = shyUsersMapper.selectOne(user);
  110 + auditorName = user.getUsername() + user.getEmail();
  111 + }
  112 + comment.setAuditor(auditorName);
109 } 113 }
110 - comment.setAuditor(auditorName);  
111 return comment; 114 return comment;
112 } 115 }
113 116
@@ -123,17 +126,17 @@ public class CommentsServiceImpl { @@ -123,17 +126,17 @@ public class CommentsServiceImpl {
123 json.put("msg", ""); 126 json.put("msg", "");
124 JSONObject result = new JSONObject(); 127 JSONObject result = new JSONObject();
125 try { 128 try {
126 - result = Pass.commentPass(json,comment.getCallback()); 129 + result = Pass.commentPass(json, comment.getCallback());
127 } catch (Exception e) { 130 } catch (Exception e) {
128 logger.error("评论回调失败,activity_id:{}", comment.getActivity_id()); 131 logger.error("评论回调失败,activity_id:{}", comment.getActivity_id());
129 success = false; 132 success = false;
130 break; 133 break;
131 } 134 }
132 - if(result==null){ 135 + if (result == null) {
133 logger.error("评论回调错误,且无返回信息。activity_id:{}", comment.getActivity_id()); 136 logger.error("评论回调错误,且无返回信息。activity_id:{}", comment.getActivity_id());
134 success = false; 137 success = false;
135 break; 138 break;
136 - }else{ 139 + } else {
137 Integer code = result.getInteger("errorCode"); 140 Integer code = result.getInteger("errorCode");
138 if (code != 0) { 141 if (code != 0) {
139 logger.error("评论回调错误,activity_id:{},errorCode:{},errorMessage:{}", comment.getActivity_id(), code, result.getString("errorMessage")); 142 logger.error("评论回调错误,activity_id:{},errorCode:{},errorMessage:{}", comment.getActivity_id(), code, result.getString("errorMessage"));