|
@@ -27,6 +27,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+import java.net.URLDecoder;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -185,20 +188,26 @@ public class ReportDingServiceImpl {
|
|
|
//消息标题
|
|
|
body.setTitle(commentUserNickName + "评论了你「" + dateRange + "」的" + reportType);
|
|
|
|
|
|
- //消息内容
|
|
|
- List<Form> formList = new ArrayList<>();
|
|
|
- Form formContent = new Form();
|
|
|
- formContent.setKey("评论内容:\n");
|
|
|
- formContent.setValue(reportCommentCreateReqVO.getCommentContent());
|
|
|
- formList.add(formContent);
|
|
|
- body.setForm(formList);
|
|
|
|
|
|
- oa.setBody(body);
|
|
|
+ try {
|
|
|
+ //消息内容
|
|
|
+ List<Form> formList = new ArrayList<>();
|
|
|
+ Form formContent = new Form();
|
|
|
+ formContent.setKey("评论内容:\n");
|
|
|
+ formContent.setValue(URLDecoder.decode(reportCommentCreateReqVO.getCommentContent(),"UTF-8"));
|
|
|
+ formList.add(formContent);
|
|
|
+ body.setForm(formList);
|
|
|
+
|
|
|
+ oa.setBody(body);
|
|
|
+
|
|
|
+ DingMessageDto message = new DingMessageDto(messageUserId);
|
|
|
+ message.setMsgType(DingMsg.OA);
|
|
|
+ message.setOa(oa);
|
|
|
+ dingApi.sendMessage(message);
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
- DingMessageDto message = new DingMessageDto(messageUserId);
|
|
|
- message.setMsgType(DingMsg.OA);
|
|
|
- message.setOa(oa);
|
|
|
- dingApi.sendMessage(message);
|
|
|
}
|
|
|
|
|
|
//回复评论
|
|
@@ -207,22 +216,28 @@ public class ReportDingServiceImpl {
|
|
|
//消息标题
|
|
|
body.setTitle(commentUserNickName + "回复了你在" + reportAuthor + "「" + dateRange + "」" + reportType + "下的评论");
|
|
|
|
|
|
- //消息内容
|
|
|
- List<Form> formList = new ArrayList<>();
|
|
|
- Form formContent = new Form();
|
|
|
- formContent.setKey("回复内容:\n");
|
|
|
|
|
|
- int index = reportCommentCreateReqVO.getCommentContent().indexOf(":");
|
|
|
- String replyCommentContent = reportCommentCreateReqVO.getCommentContent().substring(index + 1);
|
|
|
- formContent.setValue(replyCommentContent);
|
|
|
- formList.add(formContent);
|
|
|
- body.setForm(formList);
|
|
|
- oa.setBody(body);
|
|
|
+ try {
|
|
|
+ //消息内容
|
|
|
+ List<Form> formList = new ArrayList<>();
|
|
|
+ Form formContent = new Form();
|
|
|
+ formContent.setKey("回复内容:\n");
|
|
|
+
|
|
|
+ int index = reportCommentCreateReqVO.getCommentContent().indexOf(":");
|
|
|
+ String replyCommentContent = reportCommentCreateReqVO.getCommentContent().substring(index + 1);
|
|
|
+ formContent.setValue(URLDecoder.decode(replyCommentContent,"UTF-8"));
|
|
|
+ formList.add(formContent);
|
|
|
+ body.setForm(formList);
|
|
|
+ oa.setBody(body);
|
|
|
+
|
|
|
+ DingMessageDto message = new DingMessageDto(messageUserId);
|
|
|
+ message.setMsgType(DingMsg.OA);
|
|
|
+ message.setOa(oa);
|
|
|
+ dingApi.sendMessage(message);
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
- DingMessageDto message = new DingMessageDto(messageUserId);
|
|
|
- message.setMsgType(DingMsg.OA);
|
|
|
- message.setOa(oa);
|
|
|
- dingApi.sendMessage(message);
|
|
|
}
|
|
|
|
|
|
|