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 8 import com.cnlive.shenhe.mapper.ShySitesMapper;
9 9 import com.cnlive.shenhe.mapper.ShyUsersMapper;
10 10 import com.cnlive.shenhe.utils.AuditPass;
  11 +import com.cnlive.shenhe.utils.CommonConst;
11 12 import com.cnlive.shenhe.utils.CommonUtils;
12 13 import com.github.pagehelper.PageHelper;
13 14 import com.github.pagehelper.PageInfo;
... ... @@ -99,15 +100,17 @@ public class CommentsServiceImpl {
99 100  
100 101 public ShyComments getDetailsComment(Integer id) {
101 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 114 return comment;
112 115 }
113 116  
... ... @@ -123,17 +126,17 @@ public class CommentsServiceImpl {
123 126 json.put("msg", "");
124 127 JSONObject result = new JSONObject();
125 128 try {
126   - result = Pass.commentPass(json,comment.getCallback());
  129 + result = Pass.commentPass(json, comment.getCallback());
127 130 } catch (Exception e) {
128 131 logger.error("评论回调失败,activity_id:{}", comment.getActivity_id());
129 132 success = false;
130 133 break;
131 134 }
132   - if(result==null){
  135 + if (result == null) {
133 136 logger.error("评论回调错误,且无返回信息。activity_id:{}", comment.getActivity_id());
134 137 success = false;
135 138 break;
136   - }else{
  139 + } else {
137 140 Integer code = result.getInteger("errorCode");
138 141 if (code != 0) {
139 142 logger.error("评论回调错误,activity_id:{},errorCode:{},errorMessage:{}", comment.getActivity_id(), code, result.getString("errorMessage"));
... ...