From d352184d3364e379da38e56d6aa53c1f53f517ca Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期日, 04 一月 2026 15:06:59 +0800
Subject: [PATCH] 最新版本541200007最新版本541200007
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java | 67 +++++++++++++++++++--------------
1 files changed, 38 insertions(+), 29 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java
index fd954d2..859b669 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java
@@ -7,6 +7,9 @@
import com.doumee.core.dingTalk.DingTalkStream;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.haikang.model.HKConstants;
+import com.doumee.core.jiandaoyun.api.arch.DeptApiClient;
+import com.doumee.core.jiandaoyun.api.jdy.FormDataApiClient;
+import com.doumee.core.jiandaoyun.model.form.FormDataCreateParam;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.dao.business.*;
@@ -715,8 +718,6 @@
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ddUserIdList)){
for (String ddUserId:ddUserIdList) {
this.getJDYData(warningEvent,ddUserId,
- systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.API_KEY).getCode(),
- systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.APPID).getCode(),
systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.ENTRY_ID).getCode()
);
}
@@ -758,34 +759,44 @@
* 绠�閬撲簯娑堟伅鎺ㄩ�� 瀹氬埗
* @param warningEvent
* @param ddUserId 鎺ユ敹浜� 閽夐拤涓婚敭
- * @param jdyApiKey 绠�鍗曚簯APIKEY
- * @param appid 搴旂敤ID
* @param entryId 琛ㄥ崟ID
* @throws IOException
*/
- public void getJDYData(WarningEvent warningEvent,String ddUserId,String jdyApiKey,String appid,String entryId) throws IOException {
- Map<String,Object> map = new HashMap<>();
- map.put("app_id",appid);
- map.put("entry_id",entryId);
- map.put("is_start_workflow","false");
- map.put("is_start_trigger","true");
- map.put("data",this.getJdyChildData(warningEvent,ddUserId));
-
-// OkHttpClient client = new OkHttpClient().newBuilder()
-// .build();
-// MediaType mediaType = MediaType.parse("application/json");
-// RequestBody body = RequestBody.create(mediaType, JSONObject.toJSONString(map));//"{\"data\":{\"notice_time\":{\"value\":\"2025-12-23 04:56:29\"},\"title\":{\"value\":\"璺ㄨ秺鐢熶骇绾縗"},\"user\":{\"value\":\"1568490244651036\"},\"content\":{\"value\":\"璺ㄨ秺鐢熶骇绾�-鑺滄箹鐗╂祦涓績鍖楀洿澧欒繃閬撲笢\"},\"notice_type\":{\"value\":\"璺ㄨ秺鐢熶骇绾縗"}},\"is_start_trigger\":\"true\",\"app_id\":\"6909d0fbdb93b068192dc4a9\",\"entry_id\":\"694a19ecf57e071788efc20b\",\"is_start_workflow\":\"false\"}");
-// log.error("绠�閬撲簯鍙戦�侀�氱煡璇锋眰淇℃伅" + JSONObject.toJSONString(map));
-// Request request = new Request.Builder()
-// .url("https://api.jiandaoyun.com/api/v5/app/entry/data/create")
-// .method("POST", body)
-// .addHeader("Authorization", "Bearer "+jdyApiKey)
-// .addHeader("Content-Type", "application/json")
-// .build();
-// Response response = client.newCall(request).execute();
-//
-// log.error("绠�閬撲簯鍙戦�侀�氱煡杩斿洖淇℃伅" + JSONObject.toJSONString(response));
-
+ public void getJDYData(WarningEvent warningEvent,String ddUserId , String entryId) {
+ try {
+ log.error("绠�閬撲簯鍙戦�侀�氱煡杩斿洖淇℃伅寮�濮�" );
+ FormDataApiClient apiClient = new FormDataApiClient(systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.API_KEY).getCode()
+ ,systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.JDY_API_HOST).getCode());
+ FormDataCreateParam param =new FormDataCreateParam();
+ param.setData(this.getJdyChildData(warningEvent,ddUserId));
+ param.setApp_id(systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.APPID).getCode());
+ param.setEntry_id(entryId);
+ param.setIs_start_trigger(false);
+ param.setIs_start_trigger(true);
+ Map<String, Object> response = apiClient.singleDataCreate(param,apiClient.getDefaultVersion());
+ /*
+ Map<String,Object> map = new HashMap<>();
+ map.put("app_id",appid);
+ map.put("entry_id",entryId);
+ map.put("is_start_workflow","false");
+ map.put("is_start_trigger","true");
+ map.put("data",this.getJdyChildData(warningEvent,ddUserId));
+ OkHttpClient client = new OkHttpClient().newBuilder()
+ .build();
+ MediaType mediaType = MediaType.parse("application/json");
+ RequestBody body = RequestBody.create(mediaType, JSONObject.toJSONString(map));//"{\"data\":{\"notice_time\":{\"value\":\"2025-12-23 04:56:29\"},\"title\":{\"value\":\"璺ㄨ秺鐢熶骇绾縗"},\"user\":{\"value\":\"1568490244651036\"},\"content\":{\"value\":\"璺ㄨ秺鐢熶骇绾�-鑺滄箹鐗╂祦涓績鍖楀洿澧欒繃閬撲笢\"},\"notice_type\":{\"value\":\"璺ㄨ秺鐢熶骇绾縗"}},\"is_start_trigger\":\"true\",\"app_id\":\"6909d0fbdb93b068192dc4a9\",\"entry_id\":\"694a19ecf57e071788efc20b\",\"is_start_workflow\":\"false\"}");
+ log.error("绠�閬撲簯鍙戦�侀�氱煡璇锋眰淇℃伅" + JSONObject.toJSONString(map));
+ Request request = new Request.Builder()
+ .url(systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.JDY_API_HOST).getCode()+"v5/app/entry/data/create")
+ .method("POST", body)
+ .addHeader("Authorization", "Bearer "+jdyApiKey)
+ .addHeader("Content-Type", "application/json")
+ .build();
+ Response response = client.newCall(request).execute();*/
+ log.error("绠�閬撲簯鍙戦�侀�氱煡杩斿洖淇℃伅" + JSONObject.toJSONString(response));
+ }catch (Exception e){
+ log.error("绠�閬撲簯鍙戦�侀�氱煡杩斿洖淇℃伅寮傚父锛�" + e.getMessage());
+ }
}
@@ -1105,8 +1116,6 @@
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ddUserIdList)){
for (String ddUserId:ddUserIdList) {
this.getJDYData(warningEvent,ddUserId,
- systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.API_KEY).getCode(),
- systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.APPID).getCode(),
systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.ENTRY_ID).getCode()
);
--
Gitblit v1.9.3