Merge branch 'apps_dev' of https://e.coding.net/yilidev/yilipalkaifa/apps into apps_dev
This commit is contained in:
commit
0534397440
@ -638,7 +638,7 @@ function showMessageReplyList(replyList,messageid){
|
||||
if(backgroundcanuseflag=="1"){
|
||||
replystr+=' <div class="replye-data-top awsui-user-profile" userid='+replyuser+'>'+replyusername+'</div>';
|
||||
}else{
|
||||
replystr+=' <div class="replye-data-top">'+replyusername+'</div>';
|
||||
replystr+=' <div class="replye-data-top">匿名用户</div>';
|
||||
}
|
||||
replystr+=' <span class="reply-time-cls">'+replytime+'</span>';
|
||||
if(deletePermit=="1"){
|
||||
|
||||
@ -4622,7 +4622,7 @@ function addShapeFile() {
|
||||
filesToFilter: [["Images (*.jpg; *.jpeg; *.gif; *.png; *.bmp)", "*.jpg; *.jpeg; *.gif; *.png; *.bmp; *.pdf; *.doc; *.docx; *.xls; *.xlsx; *.ppt; *.pptx; *.txt"]],
|
||||
repositoryName: "tmp",
|
||||
numLimit: 0,
|
||||
sizeLimit: 10 * 1024 * 1024,
|
||||
sizeLimit: 200 * 1024 * 1024,
|
||||
complete: function () {
|
||||
//事件回调函数
|
||||
$.simpleAlert('close');
|
||||
@ -4631,7 +4631,7 @@ function addShapeFile() {
|
||||
add: function (e, data) { //附件被添加到上传列表时触发,当返回false时,可阻止上传
|
||||
if (data.files.length == 0) {
|
||||
return false;
|
||||
} else if (data.files[0].size > 10 * 1024 * 1024) {
|
||||
} else if (data.files[0].size > 200 * 1024 * 1024) {
|
||||
$.simpleAlert("文件过大");
|
||||
return false;
|
||||
}
|
||||
@ -4808,7 +4808,7 @@ function addPolicyFile() {
|
||||
filesToFilter: [["Document(*.xml;*.doc;*.docx;)", "*.xml;*.doc;*.docx;"]],
|
||||
repositoryName: "migration",
|
||||
numLimit: 1,
|
||||
sizeLimit: 50 * 1024 * 1024,
|
||||
sizeLimit: 200 * 1024 * 1024,
|
||||
complete: function () {
|
||||
//事件回调函数
|
||||
$.simpleAlert('close');
|
||||
@ -4817,7 +4817,7 @@ function addPolicyFile() {
|
||||
add: function (e, data) { //附件被添加到上传列表时触发,当返回false时,可阻止上传
|
||||
if (data.files.length == 0) {
|
||||
return false;
|
||||
} else if (data.files[0].size > 50 * 1024 * 1024) {
|
||||
} else if (data.files[0].size > 200 * 1024 * 1024) {
|
||||
$.simpleAlert("文件过大");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -648,13 +648,9 @@
|
||||
this.selectdept = JSON.stringify(this.treelist)
|
||||
},
|
||||
openGptHome() {
|
||||
//let url = "https://chatgpt-uat.dcin-test.digitalyili.com/welcome?from=libchat&lib=ef2b50fd79c52577d51222bc58b231d7&priv=1&sid=" + sid ;
|
||||
//this.fullscreen = window.innerWidth <= 768; // 小屏幕时全屏显示
|
||||
//https://yiligpt.x.digitalyili.com/libchat?lib=b8e082947190f2aa4fca0d96a5a95ea5&priv=1&sid=
|
||||
//this.newPageUrl = "https://iam.digitalyili.com/proxy/sso?target=https://yiligpt.x.digitalyili.com/libchat?lib=b8e082947190f2aa4fca0d96a5a95ea5&priv=1&sid=" + sid;
|
||||
var sids = encodeURIComponent(sid);
|
||||
//this.newPageUrl = "https://iam.digitalyili.com/proxy/sso?target=https%3A%2F%2Fyiligpt.x.digitalyili.com%2Flibchat%3Flib%3Db8e082947190f2aa4fca0d96a5a95ea5%26priv%3D1%26sid%3D"+ sids;
|
||||
this.newPageUrl = "https://iam.digitalyili.com/proxy/sso?target=https://yiligpt.x.digitalyili.com/libchat%25253Flib=b8e082947190f2aa4fca0d96a5a95ea5%252526priv=1%252526sid=" + sids;
|
||||
this.newPageUrl = "https://iam.digitalyili.com/proxy/sso?target=https://yiligpt.x.digitalyili.com/auth-center%25253Fplatform=oa%252526lib=b8e082947190f2aa4fca0d96a5a95ea5%252526priv=1%252526sid=" + sids;
|
||||
document.cookie = "AWSSESSIONID=" + sid;
|
||||
this.param1 = sid;
|
||||
this.dialogVisible = true;
|
||||
@ -664,8 +660,9 @@
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
openInFullScreen() {
|
||||
var sids = encodeURIComponent(sid);
|
||||
this.dialogVisible = false;
|
||||
window.open("https://iam.digitalyili.com/proxy/sso?target=https%3A%2F%2Fyiligpt.x.digitalyili.com%2Fauth-center%253Fplatform%253Doa%2526lib%253Db8e082947190f2aa4fca0d96a5a95ea5%2526priv%253D1", "_blank");
|
||||
window.open("https://iam.digitalyili.com/proxy/sso?target=https://yiligpt.x.digitalyili.com/auth-center%25253Fplatform=oa%252526lib=b8e082947190f2aa4fca0d96a5a95ea5%252526priv=1%252526sid="+ sids, "_blank");
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@ -57,3 +57,25 @@
|
||||
display: grid;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
.loading-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 18px;
|
||||
color: #409EFF;
|
||||
padding: 20px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.awspaas.user.apps.yiliwps;
|
||||
|
||||
import com.actionsoft.apps.listener.PluginListener;
|
||||
import com.actionsoft.apps.resource.AppContext;
|
||||
import com.actionsoft.apps.resource.plugin.profile.ASLPPluginProfile;
|
||||
import com.actionsoft.apps.resource.plugin.profile.AWSPluginProfile;
|
||||
import com.awspaas.user.apps.yiliwps.aslp.WPSOnlineReadOnlyASLP;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:yujh
|
||||
* @Date: 2025/1/21 15:47
|
||||
*/
|
||||
public class Plugins implements PluginListener {
|
||||
public Plugins() {
|
||||
}
|
||||
public List<AWSPluginProfile> register(AppContext context) {
|
||||
List<AWSPluginProfile> list = new ArrayList<AWSPluginProfile>();
|
||||
list.add(new ASLPPluginProfile("wpsOnlineReadOnly", WPSOnlineReadOnlyASLP.class.getName(), "调用转换服务.在预览之前提前进行转换,预览时直接打开转换后的文件", null));
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.awspaas.user.apps.yiliwps.aslp;
|
||||
|
||||
import com.actionsoft.apps.resource.interop.aslp.ASLP;
|
||||
import com.actionsoft.apps.resource.interop.aslp.Meta;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.server.fs.DCContext;
|
||||
import com.awspaas.user.apps.yiliwps.constant.YiliWpsConst;
|
||||
import com.awspaas.user.apps.yiliwps.utils.HttpPostUtil;
|
||||
import com.awspaas.user.apps.yiliwps.utils.WPS4Util;
|
||||
import javax.ws.rs.HttpMethod;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:yujh
|
||||
* @Date: 2025/1/21 15:39
|
||||
*/
|
||||
public class WPSOnlineReadOnlyASLP implements ASLP {
|
||||
public WPSOnlineReadOnlyASLP() {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Meta(parameter = { "name: 'sid', required: true, desc:'sessionid'",
|
||||
"name: 'sourceDc', required: true, desc:'原文件DC'"})
|
||||
public ResponseObject call(Map<String, Object> params) {
|
||||
ResponseObject result = ResponseObject.newOkResponse();
|
||||
if (params == null) {
|
||||
result.err("不接受参数为空的调用!");
|
||||
return result;
|
||||
}
|
||||
String sid = params.get("sid").toString();
|
||||
DCContext sourceDc = (DCContext) params.get("sourceDc");
|
||||
String fileName = sourceDc.getFileName();
|
||||
String fileType = getFileType(fileName);
|
||||
WPS4Util.initAppInfo(YiliWpsConst.AK, YiliWpsConst.SK);
|
||||
|
||||
String url = String.format("/api/preview/v1/files/%s/link?type=%s&preview_mode=%s&_w_third_sid=%s&_w_third_palId=%s&_w_third_queryFileId=%s&_w_third_fname=%s&_w_third_appId=%s&_w_third_repositoryName=%s&_w_third_groupValue=%s&_w_third_fileValue=%s&_w_third_filePreview=%s"
|
||||
,sourceDc.getFileValue(),fileType,"ordinary",sid,sourceDc.getGroupValue(),sourceDc.getFileValue(), URLEncoder.encode(sourceDc.getFileName()),sourceDc.getAppId(),sourceDc.getRepositoryName(),sourceDc.getGroupValue(),sourceDc.getFileValue(),"filePreview");
|
||||
System.out.println(">>>>>>>>预览的url = " + url);
|
||||
Map<String,String> headers = null;
|
||||
try {
|
||||
headers = WPS4Util.getSignatureHeaders(url, HttpMethod.GET,null, YiliWpsConst.CONTENT_TYPE);
|
||||
result.setData(HttpPostUtil.sendGetRequest(YiliWpsConst.HOST+"/open"+url,headers));
|
||||
System.out.println(">>>>>>>>>>result.toString() = " + result.toString());
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件名获取文件类型
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public String getFileType(String fileName){
|
||||
//根据文件名获取文件类型
|
||||
if (fileName.endsWith(".doc") || fileName.endsWith(".docx")) {
|
||||
return "w";
|
||||
} else if (fileName.endsWith(".xls") || fileName.endsWith(".xlsx")) {
|
||||
return "s";
|
||||
} else if (fileName.endsWith(".pdf") || fileName.endsWith(".pdfx")) {
|
||||
return "p";
|
||||
}
|
||||
return "w";
|
||||
}
|
||||
}
|
||||
@ -25,13 +25,18 @@ public class YiliWpsApi {
|
||||
@QueryParam("_w_third_palId") String palId,
|
||||
@QueryParam("_w_third_queryFileId") String queryFileId,
|
||||
@QueryParam("_w_third_sid") String sid,
|
||||
@QueryParam("_w_third_fname") String fileName
|
||||
@QueryParam("_w_third_fname") String fileName,
|
||||
@QueryParam("_w_third_appId") String appId,
|
||||
@QueryParam("_w_third_repositoryName") String repositoryName,
|
||||
@QueryParam("_w_third_groupValue") String groupValue,
|
||||
@QueryParam("_w_third_fileValue") String fileValue,
|
||||
@QueryParam("_w_third_filePreview") String filePreview
|
||||
) {
|
||||
JSONObject params = new JSONObject();
|
||||
UserContext _uc = UserContext.fromSessionId(sid);
|
||||
logApi.consoleInfo(">>>>>文件信息请求成功/v1/3rd/file/info"+palId+","+headFileId+queryFileId+sid+fileName);
|
||||
logApi.consoleInfo(">>>>>文件信息请求成功/v1/3rd/file/info"+palId+","+headFileId+queryFileId+sid+fileName+appId+repositoryName+groupValue+fileValue);
|
||||
WpsWeb web =new WpsWeb(_uc);
|
||||
return web.getFileInfo(sid,palId,queryFileId,fileName);
|
||||
return web.getFileInfo(sid,palId,queryFileId,fileName,appId,repositoryName,groupValue,fileValue,filePreview);
|
||||
}
|
||||
|
||||
@Path("/v1/3rd/user/info")
|
||||
|
||||
@ -23,6 +23,7 @@ import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.bpms.util.UUIDGener;
|
||||
import com.actionsoft.bpms.util.UtilNumber;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.LogAPI;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@ -33,6 +34,7 @@ import com.awspaas.user.apps.yiliwps.utils.CallASLPUtil;
|
||||
import com.awspaas.user.apps.yiliwps.utils.HttpPostUtil;
|
||||
import com.awspaas.user.apps.yiliwps.utils.WPS4Util;
|
||||
import javax.ws.rs.HttpMethod;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import java.io.*;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
@ -81,14 +83,19 @@ public class WpsWeb extends ActionWeb {
|
||||
return HttpPostUtil.sendGetRequest(YiliWpsConst.HOST+"/open"+url,headers);
|
||||
}
|
||||
|
||||
public String getFileInfo(String sid,String palId,String fileId,String fileName){
|
||||
public String getFileInfo(String sid,String palId,String fileId,String fileName,String appId,String repositoryName,String groupValue,String fileValue,String filePreview){
|
||||
String sourceFileName = null;
|
||||
try {
|
||||
sourceFileName = URLDecoder.decode(fileName,"UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
DCContext sourceDc = getFileDCContext(fileId);
|
||||
DCContext sourceDc;
|
||||
if(UtilString.isEmpty(filePreview)){
|
||||
sourceDc = getFileDCContext(fileId);
|
||||
}else{
|
||||
sourceDc = getFileDCContext(palId,appId,repositoryName,groupValue,fileValue,sourceFileName);
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
JSONObject file = new JSONObject();
|
||||
JSONObject user = new JSONObject();
|
||||
@ -279,6 +286,38 @@ public class WpsWeb extends ActionWeb {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取附件的附件ID
|
||||
* @return
|
||||
*/
|
||||
public DCContext getFileDCContext(String palId,String appId,String repositoryName,String groupValue,String fileValue,String fileName) {
|
||||
//先校验DC是否存在
|
||||
DCContext sourceDc = null;
|
||||
System.out.println(">>>>>>>appId = " + appId);
|
||||
System.out.println(">>>>>>>repositoryName = " + repositoryName);
|
||||
DCPluginProfile dcProfile = DCProfileManager.getDCProfile(appId, repositoryName);
|
||||
if (dcProfile != null) {
|
||||
System.out.println(" >>>>进入普通文件");
|
||||
sourceDc = new DCContext(this.getContext(), dcProfile, appId, groupValue,
|
||||
fileValue, fileName);
|
||||
if(null != sourceDc){
|
||||
System.out.println(">>>>>>>>>>>>>>>>sourceDc.getDownloadURL() = " + sourceDc.getDownloadURL());
|
||||
return sourceDc;
|
||||
}
|
||||
//获取的附件为空
|
||||
}
|
||||
//先获取附件模版
|
||||
System.out.println(" >>>>默认附件");
|
||||
repositoryName = "!form-ui-file-";
|
||||
BO bo = SDK.getBOAPI().query(YiliWpsConst.BO_EU_SYSTEM_DEMO_FILE).addQuery("FILESTATE=", true).detail();
|
||||
List<FormFile> files = SDK.getBOAPI().getFiles(bo.getId(), "SYSTEMFILE");
|
||||
FormFile formFile = files.get(0);
|
||||
sourceDc = SDK.getBOAPI().getFileDCContext(formFile, repositoryName);
|
||||
sourceDc.setSession(this.getContext());
|
||||
//往附件表中写入一个附件
|
||||
return sourceDc;
|
||||
}
|
||||
|
||||
public String getCoeDefinition(String palId){
|
||||
// coe所需参数
|
||||
PALRepositoryModel plModel = PALRepositoryCache.getCache().get(palId);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user