diff --git a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar index d18785ae..ea5049db 100644 Binary files a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar and b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar differ diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/constant/GPTConstant.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/constant/GPTConstant.java new file mode 100644 index 00000000..3a7211f8 --- /dev/null +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/constant/GPTConstant.java @@ -0,0 +1,7 @@ +package com.actionsoft.apps.coe.pal.publisher.constant; + +public class GPTConstant { + + public static final String GPT_DOC_BONAME = "GPTDOCFILE"; //发布流程流程组Id + +} diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/utils/DeleteGptFilesUtils.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/utils/DeleteGptFilesUtils.java new file mode 100644 index 00000000..0a0d9ad6 --- /dev/null +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/utils/DeleteGptFilesUtils.java @@ -0,0 +1,53 @@ +package com.actionsoft.apps.coe.pal.publisher.utils; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.StandardCharsets; + +public class DeleteGptFilesUtils { + + public static String deleteGptFiles(String deleteGptUrl,String jsonRequest,String appkey){ + + try { + // 设置请求URL和参数 + //String url = "https://ai-dcin-test.digitalyili.com/chatylserver/requestAIForDocQuest/delLibDoc"; + /*String jsonRequest = "{\n" + + " \"requestCode\": \"YOUR_REQUEST_CODE\",\n" + + " \"docId\": 1\n" + + "}";*/ + // 创建连接 + URL connectionUrl = new URL(deleteGptUrl); + HttpURLConnection connection = (HttpURLConnection) connectionUrl.openConnection(); + connection.setRequestMethod("POST"); + connection.setRequestProperty("Content-Type", "application/json"); + connection.setRequestProperty("appkey", appkey); + connection.setDoOutput(true); + + // 发送请求 + OutputStream outputStream = connection.getOutputStream(); + byte[] input = jsonRequest.getBytes(StandardCharsets.UTF_8); + outputStream.write(input, 0, input.length); + outputStream.flush(); + outputStream.close(); + + // 获取响应 + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + StringBuilder response = new StringBuilder(); + String line; + while ((line = reader.readLine()) != null) { + response.append(line); + } + reader.close(); + + // 处理响应 + String jsonResponse = response.toString(); + System.out.println(jsonResponse); + } catch (Exception e) { + e.printStackTrace(); + } + return ""; + } +} diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/utils/UploadGptFileUtils.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/utils/UploadGptFileUtils.java new file mode 100644 index 00000000..d3e4d078 --- /dev/null +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/utils/UploadGptFileUtils.java @@ -0,0 +1,72 @@ +package com.actionsoft.apps.coe.pal.publisher.utils; + +import com.actionsoft.sdk.local.SDK; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.ProtocolException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class UploadGptFileUtils { + + + + public static String uploadGptFile(String targetUrl,String appkey,String requestCode,String filePath) throws Exception { + /*String targetUrl = "https://ai-test.digitalyili.com/chatylserver/requestAIForDocQuest/uploadDoc"; + String appkey = "CTidBagRfEXF5OTDjQeqmqSA6EvZfYMj"; + + String requestCode = "bbc058b3f3132b742089998684a91767"; // Replace with your requestCode + String filePath = "C:\\Users\\admin\\Desktop\\伊利项目\\伊利集团数据管理办法 (2).docx"; // Replace with your file path*/ + String boundary = "----WebKitFormBoundary" + System.currentTimeMillis(); + HttpURLConnection connection = (HttpURLConnection) new URL(targetUrl).openConnection(); + connection.setRequestMethod("POST"); + connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); + connection.setRequestProperty("appkey", appkey); + connection.setDoOutput(true); + + OutputStream output = connection.getOutputStream(); + PrintWriter writer = new PrintWriter(new OutputStreamWriter(output, "UTF-8"), true); + // Send analysisType part + writer.append("--").append(boundary).append("\r\n"); + writer.append("Content-Disposition: form-data; name=\"analysisType\"\r\n"); + writer.append("Content-Type: text/plain; charset=UTF-8\r\n"); + writer.append("\r\n"); + writer.append("0\r\n"); + // Send file part + writer.append("--").append(boundary).append("\r\n"); + writer.append("Content-Disposition: form-data; name=\"file\"; filename=\"").append(new File(filePath).getName()).append("\"\r\n"); + writer.append("Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document\r\n"); + writer.append("Content-Transfer-Encoding: binary\r\n"); + writer.append("\r\n"); + writer.flush(); + Files.copy(Paths.get(filePath), output); + output.flush(); + writer.append("\r\n"); + + // Send requestCode part + writer.append("--").append(boundary).append("\r\n"); + writer.append("Content-Disposition: form-data; name=\"requestCode\"\r\n"); + writer.append("Content-Type: text/plain; charset=UTF-8\r\n"); + writer.append("\r\n"); + writer.append(requestCode).append("\r\n"); + + // End of multipart/form-data + writer.append("--").append(boundary).append("--\r\n"); + writer.flush(); + + // Read the response + int responseCode = connection.getResponseCode(); + System.out.println("Response Code: " + responseCode); + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + String line=null; + while ((line = reader.readLine()) != null) { + System.out.println(line); + + } + + return line; + + } +} diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js index 1fd17f33..535b63d1 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.multiple_L4.js @@ -423,6 +423,8 @@ function initHtml() { stopHtml += ''; stopHtml += ''; + + } //stopHtml += ''; // stopHtml += ''; @@ -437,7 +439,6 @@ function initHtml() { stopHtml += '