发布流程结束后,同步GPT文件加载附件链接
This commit is contained in:
parent
2e1e35d2d8
commit
c9bbdcff22
@ -90,7 +90,7 @@ public class SendGPTAlsp implements ASLP {
|
|||||||
String finalFilePath = filepath.replace("bin\\..\\", "");
|
String finalFilePath = filepath.replace("bin\\..\\", "");
|
||||||
|
|
||||||
JSONObject result = null;
|
JSONObject result = null;
|
||||||
result = JSONObject.parseObject(UploadGptFileUtils.uploadGptFile(uploadGptUrl, appkey, requestCode, dcContext.getFilePath()));
|
result = JSONObject.parseObject(UploadGptFileUtils.uploadGptFile(uploadGptUrl, appkey, requestCode, dcContext.getFilePath(),dcContext.getFileName(),fileId));
|
||||||
if (result.getString("msg").equals("success")) {
|
if (result.getString("msg").equals("success")) {
|
||||||
String data = result.getString("data");
|
String data = result.getString("data");
|
||||||
//插入模型ID与DOCID对应表中
|
//插入模型ID与DOCID对应表中
|
||||||
@ -153,7 +153,7 @@ public class SendGPTAlsp implements ASLP {
|
|||||||
String filepath = dcContext.getFilePath();
|
String filepath = dcContext.getFilePath();
|
||||||
String finalFilePath = filepath.replace("bin\\..\\", "");
|
String finalFilePath = filepath.replace("bin\\..\\", "");
|
||||||
|
|
||||||
JSONObject result = JSONObject.parseObject(UploadGptFileUtils.uploadGptFile(uploadGptUrl, appkey, requestCode, dcContext.getFilePath()));
|
JSONObject result = JSONObject.parseObject(UploadGptFileUtils.uploadGptFile(uploadGptUrl, appkey, requestCode, dcContext.getFilePath(),dcContext.getFileName(),changefileIdNew));
|
||||||
|
|
||||||
if (result.getString("msg").equals("success")) {
|
if (result.getString("msg").equals("success")) {
|
||||||
String data = result.getString("data");
|
String data = result.getString("data");
|
||||||
|
|||||||
@ -581,7 +581,7 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute
|
|||||||
String finalFilePath = filepath.replace("bin\\..\\", "");
|
String finalFilePath = filepath.replace("bin\\..\\", "");
|
||||||
|
|
||||||
|
|
||||||
JSONObject result=JSONObject.parseObject(UploadGptFileUtils.uploadGptFile(uploadGptUrl,appkey,requestCode,dcContext.getFilePath()));
|
JSONObject result=JSONObject.parseObject(UploadGptFileUtils.uploadGptFile(uploadGptUrl,appkey,requestCode,dcContext.getFilePath(),dcContext.getFileName(),fileId));
|
||||||
|
|
||||||
if(result.getString("msg").equals("success")){
|
if(result.getString("msg").equals("success")){
|
||||||
String data=result.getString("data");
|
String data=result.getString("data");
|
||||||
@ -708,7 +708,7 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute
|
|||||||
String filepath = dcContext.getFilePath();
|
String filepath = dcContext.getFilePath();
|
||||||
String finalFilePath = filepath.replace("bin\\..\\", "");
|
String finalFilePath = filepath.replace("bin\\..\\", "");
|
||||||
|
|
||||||
JSONObject result=JSONObject.parseObject(UploadGptFileUtils.uploadGptFile(uploadGptUrl,appkey,requestCode,dcContext.getFilePath()));
|
JSONObject result=JSONObject.parseObject(UploadGptFileUtils.uploadGptFile(uploadGptUrl,appkey,requestCode,dcContext.getFilePath(),dcContext.getFileName(),changefileIdNew));
|
||||||
|
|
||||||
if(result.getString("msg").equals("success")){
|
if(result.getString("msg").equals("success")){
|
||||||
String data=result.getString("data");
|
String data=result.getString("data");
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.actionsoft.apps.coe.pal.publisher.utils;
|
package com.actionsoft.apps.coe.pal.publisher.utils;
|
||||||
|
|
||||||
|
import com.actionsoft.bpms.server.conf.portal.AWSPortalConf;
|
||||||
import com.actionsoft.sdk.local.SDK;
|
import com.actionsoft.sdk.local.SDK;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -13,7 +14,7 @@ public class UploadGptFileUtils {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String uploadGptFile(String targetUrl,String appkey,String requestCode,String filePath) throws Exception {
|
public static String uploadGptFile(String targetUrl,String appkey,String requestCode,String filePath,String fileLinkName,String fileId) throws Exception {
|
||||||
String result = null;
|
String result = null;
|
||||||
HttpURLConnection connection=null;
|
HttpURLConnection connection=null;
|
||||||
OutputStream output=null;
|
OutputStream output=null;
|
||||||
@ -57,6 +58,20 @@ public class UploadGptFileUtils {
|
|||||||
writer.append("\r\n");
|
writer.append("\r\n");
|
||||||
writer.append(requestCode).append("\r\n");
|
writer.append(requestCode).append("\r\n");
|
||||||
|
|
||||||
|
// Send requestCode part
|
||||||
|
writer.append("--").append(boundary).append("\r\n");
|
||||||
|
writer.append("Content-Disposition: form-data; name=\"extensionName\"\r\n");
|
||||||
|
writer.append("Content-Type: text/plain; charset=UTF-8\r\n");
|
||||||
|
writer.append("\r\n");
|
||||||
|
writer.append(fileLinkName).append("\r\n");
|
||||||
|
|
||||||
|
// Send requestCode part
|
||||||
|
writer.append("--").append(boundary).append("\r\n");
|
||||||
|
writer.append("Content-Disposition: form-data; name=\"extensionValue\"\r\n");
|
||||||
|
writer.append("Content-Type: text/plain; charset=UTF-8\r\n");
|
||||||
|
writer.append("\r\n");
|
||||||
|
writer.append(getFileLinkUrl(fileId)).append("\r\n");
|
||||||
|
|
||||||
// End of multipart/form-data
|
// End of multipart/form-data
|
||||||
writer.append("--").append(boundary).append("--\r\n");
|
writer.append("--").append(boundary).append("--\r\n");
|
||||||
writer.flush();
|
writer.flush();
|
||||||
@ -81,4 +96,15 @@ public class UploadGptFileUtils {
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件链接地址
|
||||||
|
* @param fileId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getFileLinkUrl(String fileId){
|
||||||
|
String fileLinkUrl = AWSPortalConf.getUrl() + "/r/w?cmd=com.awspaas.user.apps.gpt_interface.openRepositoryHome&repositoryId=";
|
||||||
|
fileLinkUrl+=fileId;
|
||||||
|
return fileLinkUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user