From 9b276fecad68c5d5483bfb29a2eaf203f4bb371b Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期二, 14 十月 2025 18:12:13 +0800
Subject: [PATCH] 定时自动叫号 与 WMS获取车辆是否在园接口开发
---
server/visits/dmvisit_service/src/main/java/com/doumee/core/dingTalk/DingTalk.java | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/core/dingTalk/DingTalk.java b/server/visits/dmvisit_service/src/main/java/com/doumee/core/dingTalk/DingTalk.java
index 2291752..7b2356e 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/core/dingTalk/DingTalk.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/core/dingTalk/DingTalk.java
@@ -373,8 +373,11 @@
* api 鍦板潃 https://open.dingtalk.com/document/orgapp/asynchronous-sending-of-enterprise-session-messages
* @throws ApiException
*/
- public void workInfoOANotice(Long agentId,String userIds,OapiMessageCorpconversationAsyncsendV2Request.Msg msg){
+ public Boolean workInfoOANotice(Long agentId,String userIds,OapiMessageCorpconversationAsyncsendV2Request.Msg msg){
try{
+ if(CollectionUtils.isEmpty(msg)){
+ return null;
+ }
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request();
request.setAgentId(agentId);
@@ -382,15 +385,16 @@
request.setToAllUser(false);
request.setMsg(msg);
- OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(request, "60c2df248ca93d4eafb4a04a2330d3d3");//getToken());
+ OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(request, getToken());
if(rsp.getErrcode().equals(Constants.DD_ERR_CODE)){
-
+ return true;
}else{
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),rsp.getMessage());
}
}catch (ApiException apiException){
}
+ return false;
}
@@ -539,6 +543,9 @@
*/
public String toDoNotice(String title,List<String> unionIdList,List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> fieldList,String url) {
try{
+ if(CollectionUtils.isEmpty(fieldList)){
+ return null;
+ }
com.aliyun.dingtalktodo_1_0.Client client = DingTalk.createV1Client();
CreateTodoTaskHeaders createTodoTaskHeaders = new CreateTodoTaskHeaders();
createTodoTaskHeaders.xAcsDingtalkAccessToken = getToken();
@@ -558,7 +565,7 @@
.setTitle("鍘诲鐞�")
.setActionType(2)
.setParam(actionList0Param)
- .setUrl("https://www.baidu.com") //TODO 璇︽儏鍦板潃
+ .setUrl(url) //TODO 璇︽儏鍦板潃
.setActionKey("ak-1-1");
//璇︽儏椤祏rl璺宠浆鍦板潃
CreateTodoTaskRequest.CreateTodoTaskRequestDetailUrl detailUrl = new CreateTodoTaskRequest.CreateTodoTaskRequestDetailUrl()
@@ -669,6 +676,11 @@
}
+ /**
+ * 璁垮鎶ュ涓庤瀹㈢敵璇� 閽夐拤寰呭姙
+ * @param visits
+ * @return
+ */
public List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> getToDoVisitFiledInfo(Visits visits){
List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> list = new ArrayList<>();
CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList contentFieldList0 = new CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList()
@@ -697,7 +709,11 @@
}
-
+ /**
+ * 鐢ㄨ溅鐢宠鐨� 閽夐拤寰呭姙
+ * @param carUseBook
+ * @return
+ */
public List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> getToDoCarUseBookFiledInfo(CarUseBook carUseBook){
List<CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList> list = new ArrayList<>();
CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList contentFieldList1 = new CreateTodoTaskRequest.CreateTodoTaskRequestContentFieldList()
--
Gitblit v1.9.3