From 3d9cc5b50c880f60f69e0164508a90427673a1e2 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期五, 06 三月 2026 10:02:27 +0800
Subject: [PATCH] 功能优化

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java |   71 +++++++++++++++--------------------
 1 files changed, 31 insertions(+), 40 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 939f95e..fd954d2 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,9 +7,6 @@
 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.*;
@@ -718,7 +715,9 @@
                             if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ddUserIdList)){
                                 for (String ddUserId:ddUserIdList) {
                                     this.getJDYData(warningEvent,ddUserId,
-                                            systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.JDY_ENTRY_ID).getCode()
+                                            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()
                                     );
                                 }
                             }
@@ -759,44 +758,34 @@
      * 绠�閬撲簯娑堟伅鎺ㄩ�� 瀹氬埗
      * @param warningEvent
      * @param ddUserId 鎺ユ敹浜� 閽夐拤涓婚敭
+     * @param jdyApiKey  绠�鍗曚簯APIKEY
+     * @param appid  搴旂敤ID
      * @param entryId 琛ㄥ崟ID
      * @throws IOException
      */
-    public void getJDYData(WarningEvent warningEvent,String ddUserId , String entryId)  {
-        try {
-            log.error("绠�閬撲簯鍙戦�侀�氱煡杩斿洖淇℃伅寮�濮�"  );
-            FormDataApiClient apiClient = new FormDataApiClient(systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.JDY_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.JDY_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());
-        }
+    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));
+
     }
 
 
@@ -1116,7 +1105,9 @@
                         if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ddUserIdList)){
                             for (String ddUserId:ddUserIdList) {
                                 this.getJDYData(warningEvent,ddUserId,
-                                        systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.JDY_ENTRY_ID).getCode()
+                                        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