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 += '流程制度模型'; stopHtml += '文件预览'; stopHtml += '文件编号'; - stopHtml += '相关/支持文件'; stopHtml += ''; stopHtml += ''; stopHtml += ''; @@ -552,46 +553,46 @@ function initPublishData(data, type, pageNumber, start){ // 初始化数据 function selectPublishData(data, type, pageNumber, start) { - //渲染到前台的流程架构L1,L2,L3,L4 - var param = { - cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs', - processInstId: processInstId, - wsId : wsId, - sid: sid, - type:type, - datas:JSON.stringify(data) - }; - $.ajax({ - url : "./jd", - type : "POST", - dataType : "JSON", - async : true, - data : param, - success : function(r) { - var info = r.data.info; - var L1 = r.data.data.Process_Architecture_L1; - var L2 = r.data.data.Process_Architecture_L2; - var L3 = r.data.data.Process_Architecture_L3; - var L4 = r.data.data.Process_Architecture_L4; - var L1old = ui("LEVEL_1_PROCESS_NAME"); - var L2old = ui("LEVEL_2_PROCESS_NAME"); - var L3old = ui("LEVEL_3_PROCESS_NAME"); - var L4old = ui("LEVEL_4_PROCESS_NAME"); - ui("LEVEL_1_PROCESS_NAME",L1); - ui("LEVEL_2_PROCESS_NAME",L2); - ui("LEVEL_3_PROCESS_NAME",L3); - ui("LEVEL_4_PROCESS_NAME",L4); - showlist(data, type, pageNumber, start); - //发起请求把审批人查询出来~ - queryapprove(); - ui("ADAPT_NAME_THE_COMPANY",""), - ui("ADAPT_REGION_NAME",""), - ui("APPLICABLE_PRODUCT",""), - $("#publisher_dialog").dialog("close"); - //展示未发布过的流程 - //data = r.data.is_not_publish_data; - } - }); + //渲染到前台的流程架构L1,L2,L3,L4 + var param = { + cmd: 'com.actionsoft.apps.coe.pal.publisher_getPublishNameByJs', + processInstId: processInstId, + wsId : wsId, + sid: sid, + type:type, + datas:JSON.stringify(data) + }; + $.ajax({ + url : "./jd", + type : "POST", + dataType : "JSON", + async : true, + data : param, + success : function(r) { + var info = r.data.info; + var L1 = r.data.data.Process_Architecture_L1; + var L2 = r.data.data.Process_Architecture_L2; + var L3 = r.data.data.Process_Architecture_L3; + var L4 = r.data.data.Process_Architecture_L4; + var L1old = ui("LEVEL_1_PROCESS_NAME"); + var L2old = ui("LEVEL_2_PROCESS_NAME"); + var L3old = ui("LEVEL_3_PROCESS_NAME"); + var L4old = ui("LEVEL_4_PROCESS_NAME"); + ui("LEVEL_1_PROCESS_NAME",L1); + ui("LEVEL_2_PROCESS_NAME",L2); + ui("LEVEL_3_PROCESS_NAME",L3); + ui("LEVEL_4_PROCESS_NAME",L4); + showlist(data, type, pageNumber, start); + //发起请求把审批人查询出来~ + queryapprove(); + ui("ADAPT_NAME_THE_COMPANY",""), + ui("ADAPT_REGION_NAME",""), + ui("APPLICABLE_PRODUCT",""), + $("#publisher_dialog").dialog("close"); + //展示未发布过的流程 + //data = r.data.is_not_publish_data; + } + }); } @@ -644,7 +645,7 @@ function queryapprove(){ } - + } }); } @@ -720,6 +721,7 @@ function showlist(data, type, pageNumber, start){ var relatedName = json.relatedName; var relatedUrl = json.relatedUrl; relatedStr += '

' + relatedName + ' 

'; + } if(relatedStr!=''){ html += ''+ relatedStr+''; @@ -807,22 +809,7 @@ function showlist(data, type, pageNumber, start){ //html += '' + reportName + ''; //html += '' + fName + ''; //html += ''; - html += '' + changNumer +''; - - - var relatedStr=''; - var relatedData = curr.relatedData; - for(var i = 0; i < relatedData.length; i++){ - var json=JSON.parse(relatedData[i]); - var relatedName = json.relatedName; - var relatedUrl = json.relatedUrl; - relatedStr += '

' + relatedName + ' 

'; - } - if(relatedStr!=''){ - html += ''+ relatedStr+''; - } - - + html += '' + changNumer +''; html += ''; // select2下拉框处理 var opt1 = { @@ -935,19 +922,6 @@ function showlist(data, type, pageNumber, start){ } html += ''; - - var relatedStr=''; - var relatedData = curr.relatedData; - for(var i = 0; i < relatedData.length; i++){ - var json=JSON.parse(relatedData[i]); - var relatedName = json.relatedName; - var relatedUrl = json.relatedUrl; - relatedStr += '

' + relatedName + ' 

'; - } - if(relatedStr!=''){ - html += ''+ relatedStr+''; - } - html += ''; } } @@ -1291,7 +1265,7 @@ function refreshManuals(processInstId,type) { success : function(r) { $.simpleAlert('close'); if (r.result == 'ok') { - AWSFormUtil.refreshPage(); + AWSFormUtil.refreshPage(); } else { $.simpleAlert(r.msg); } @@ -1307,7 +1281,7 @@ function openQueryDataDialog(type) { $(document).on('click', function(e) { //if (!e.target.closest('#autoSearchProcessDiv')) { if ($(e.target).closest('#autoSearchProcessDiv').length===0 && $(e.target).closest('.awsui-iconfont-buttonedit-search').length===0) { - // 如果点击的目标不是.input-container或其子元素,则隐藏tooltip + // 如果点击的目标不是.input-container或其子元素,则隐藏tooltip $("#autoSearchProcessDiv").hide(); } }); @@ -1860,15 +1834,15 @@ function getOutputName(category, method) { if (method.indexOf('process.') > -1 && method != 'process.scheme' ) { return '流程手册'; } - if (method == 'engineering.standard') { + if (method == 'engineering.standard') { return '工程技术标准手册' } - if (method == 'process.scheme') { + if (method == 'process.scheme') { return '方案手册' } - - + + return '手册'; }