修改钉钉推送消息部分参数为String

This commit is contained in:
wulin 2020-11-19 09:23:25 +08:00
parent 0df32f1153
commit 3c4e5e9218
2 changed files with 13 additions and 13 deletions

View File

@ -275,7 +275,7 @@ public class DingTalkUtil {
thirdMsgSendRecord.setMsgType("action_card");
thirdMsgSendRecord.setStaffId(staff.getId());
thirdMsgSendRecord.setMsgTitle(singleTitle);
thirdMsgSendRecord.setAppId(Long.parseLong(appid));
thirdMsgSendRecord.setAppId(appid);
thirdMsgSendRecord.setHeadText(title);
thirdMsgSendRecord.setMsgContent(marDown);
thirdMsgSendRecord.setMsgUrl(singleUrl);
@ -283,7 +283,7 @@ public class DingTalkUtil {
try{
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request();
req.setAgentId(thirdMsgSendRecord.getAppId());
req.setAgentId(Long.parseLong(thirdMsgSendRecord.getAppId()));
req.setUseridList(staff.getEmployeeId());
OapiMessageCorpconversationAsyncsendV2Request.Msg obj1 = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
obj1.setMsgtype(thirdMsgSendRecord.getMsgType());
@ -299,10 +299,10 @@ public class DingTalkUtil {
//插入数据库
JSONObject json = JSONObject.parseObject(rsp.getBody());
if(json.getIntValue("errcode") == 0){
thirdMsgSendRecord.setTaskId(json.getLong("task_id"));
thirdMsgSendRecord.setTaskId(json.getString("task_id"));
thirdMsgSendRecord.setStatus(1);
}else{
thirdMsgSendRecord.setTaskId(0L);
thirdMsgSendRecord.setTaskId("0");
thirdMsgSendRecord.setStatus(6);
thirdMsgSendRecord.setRemark(json.getString("errmsg"));
msg = thirdMsgSendRecord.getRemark();
@ -327,7 +327,7 @@ public class DingTalkUtil {
thirdMsgSendRecord.setMsgType("work_msg");
thirdMsgSendRecord.setStaffId(staff.getId());
thirdMsgSendRecord.setMsgTitle(singleTitle);
thirdMsgSendRecord.setAppId(Long.parseLong(appid));
thirdMsgSendRecord.setAppId(appid);
thirdMsgSendRecord.setHeadText(title);
thirdMsgSendRecord.setMsgContent(marDown);
thirdMsgSendRecord.setMsgUrl(singleUrl);
@ -352,10 +352,10 @@ public class DingTalkUtil {
//插入数据库
JSONObject json = JSONObject.parseObject(rsp.getBody());
if(json.getIntValue("errcode") == 0){
thirdMsgSendRecord.setTaskId(json.getLong("record_id"));
thirdMsgSendRecord.setTaskId(json.getString("record_id"));
thirdMsgSendRecord.setStatus(1);
}else{
thirdMsgSendRecord.setTaskId(0L);
thirdMsgSendRecord.setTaskId("0");
thirdMsgSendRecord.setStatus(6);
thirdMsgSendRecord.setRemark(json.getString("errmsg"));
msg = thirdMsgSendRecord.getRemark();

View File

@ -63,9 +63,9 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
//发送状态0新建1已发送2处理中3已送达4未读5已读6发送失败7撤回
private Integer status;
//应用ID
private Long appId;
private String appId;
//钉钉返回的任务id
private Long taskId;
private String taskId;
//备注一些说明
private String remark;
/**
@ -417,14 +417,14 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
* 应用ID
* @return
*/
public Long getAppId() {
public String getAppId() {
return appId;
}
/**
* 应用ID
* @param appId
*/
public void setAppId(Long appId) {
public void setAppId(String appId) {
this.appId = appId;
}
@ -432,14 +432,14 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
* 钉钉返回的任务id
* @return
*/
public Long getTaskId() {
public String getTaskId() {
return taskId;
}
/**
* 钉钉返回的任务id
* @param taskId
*/
public void setTaskId(Long taskId) {
public void setTaskId(String taskId) {
this.taskId = taskId;
}