GPT代码提交
This commit is contained in:
parent
8871a88c53
commit
06c890e894
Binary file not shown.
@ -0,0 +1,7 @@
|
||||
package com.actionsoft.apps.coe.pal.publisher.constant;
|
||||
|
||||
public class GPTConstant {
|
||||
|
||||
public static final String GPT_DOC_BONAME = "GPTDOCFILE"; //发布流程流程组Id
|
||||
|
||||
}
|
||||
@ -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 "";
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
@ -423,6 +423,8 @@ function initHtml() {
|
||||
stopHtml += '<button name="refreshManual" type="button" class="awsui-btn awsui-btn" onclick="refreshManuals(\''+$("#processInstId").val()+'\',\''+"1"+'\');">重新生成手册</button>';
|
||||
stopHtml += '<button name="showFiles" type="button" class="awsui-btn awsui-btn" onclick="getFiles();">生成附件</button>';
|
||||
|
||||
|
||||
|
||||
}
|
||||
//stopHtml += '<button name="add" type="button" class="awsui-btn awsui-btn-blue" onclick="addProcess(\'stop\');">新增</button>';
|
||||
// stopHtml += '<button name="save" type="button" class="awsui-btn" onclick="saveFormData(\'stop\');">保存</button>';
|
||||
@ -437,7 +439,6 @@ function initHtml() {
|
||||
stopHtml += '<th style="background-color:#fff;" class="width_30">流程制度模型</th>';
|
||||
stopHtml += '<th style="background-color:#fff;" class="width_25">文件预览</th>';
|
||||
stopHtml += '<th style="background-color:#fff;" class="width_35">文件编号</th>';
|
||||
stopHtml += '<th style="background-color:#fff;" class="width_35">相关/支持文件</th>';
|
||||
stopHtml += '</tr>';
|
||||
stopHtml += '</thead>';
|
||||
stopHtml += '<tbody id="publish_stop_tbody"></tbody>';
|
||||
@ -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 += '</p><a href="javascript:void(0);" onclick="openUrl(\'' + relatedUrl + '\')">' + relatedName + ' </a></p>';
|
||||
|
||||
}
|
||||
if(relatedStr!=''){
|
||||
html += '<td style="padding:1px;"><span>'+ relatedStr+'</span></td>';
|
||||
@ -807,22 +809,7 @@ function showlist(data, type, pageNumber, start){
|
||||
//html += '<td ' + tableTdCss + ' id="report_' + curr.changeFileId + '">' + reportName + '</td>';
|
||||
//html += '<td ' + tableTdCss + '>' + fName + '</td>';
|
||||
//html += '<td style="padding:1px;"><textarea onblur="changeDesc(\'change\',\'' + curr.changeFileId + '\', this)" style="width:100%;height:30px;" ' + textareaPerm + ' class="awsui-input">' + curr.changedDesc + '</textarea></td>';
|
||||
html += '<td ' + tableTdCss + '>' + changNumer +'</td>';
|
||||
|
||||
|
||||
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 += '</p><a href="javascript:void(0);" onclick="openUrl(\'' + relatedUrl + '\')">' + relatedName + ' </a></p>';
|
||||
}
|
||||
if(relatedStr!=''){
|
||||
html += '<td style="padding:1px;"><span>'+ relatedStr+'</span></td>';
|
||||
}
|
||||
|
||||
|
||||
html += '<td ' + tableTdCss + '>' + changNumer +'</td>';
|
||||
html += '</tr>';
|
||||
// select2下拉框处理
|
||||
var opt1 = {
|
||||
@ -935,19 +922,6 @@ function showlist(data, type, pageNumber, start){
|
||||
}
|
||||
|
||||
html += '<td style="padding:1px;"><textarea onblur="changeDesc(\'stop\',\'' + curr.stopFileId + '\', this)" style="width:100%;height:30px;" ' + textareaPerm + ' class="awsui-input">' + curr.stopDesc + '</textarea></td>';
|
||||
|
||||
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 += '</p><a href="javascript:void(0);" onclick="openUrl(\'' + relatedUrl + '\')">' + relatedName + ' </a></p>';
|
||||
}
|
||||
if(relatedStr!=''){
|
||||
html += '<td style="padding:1px;"><span>'+ relatedStr+'</span></td>';
|
||||
}
|
||||
|
||||
html += '</tr>';
|
||||
}
|
||||
}
|
||||
@ -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 '手册';
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user