From 3c4e5e9218d534731aea062234af9bf95a61d973 Mon Sep 17 00:00:00 2001 From: wulin Date: Thu, 19 Nov 2020 09:23:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=92=89=E9=92=89=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=B6=88=E6=81=AF=E9=83=A8=E5=88=86=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=B8=BAString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lz/common/utils/DingTalkUtil.java | 14 +++++++------- .../modules/third/entity/ThirdMsgSendRecord.java | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/lz/common/utils/DingTalkUtil.java b/src/main/java/com/lz/common/utils/DingTalkUtil.java index 7a86ac71..b243c43d 100644 --- a/src/main/java/com/lz/common/utils/DingTalkUtil.java +++ b/src/main/java/com/lz/common/utils/DingTalkUtil.java @@ -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(); diff --git a/src/main/java/com/lz/modules/third/entity/ThirdMsgSendRecord.java b/src/main/java/com/lz/modules/third/entity/ThirdMsgSendRecord.java index 249aca2f..7570413d 100644 --- a/src/main/java/com/lz/modules/third/entity/ThirdMsgSendRecord.java +++ b/src/main/java/com/lz/modules/third/entity/ThirdMsgSendRecord.java @@ -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; }