From d80f7d2571b88dae10ffdd204bc32d466d996b04 Mon Sep 17 00:00:00 2001 From: yujh Date: Mon, 14 Oct 2024 13:58:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=B6=E5=BA=A6?= =?UTF-8?q?=E5=9B=BE=E4=B9=9F=E8=B5=B0=E6=98=AF=E5=90=A6=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E7=82=B9=E6=8E=A7=E5=88=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/designer/extend/js/designer.extend.link.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js index 4cc8bbdf..b20d0370 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js @@ -2273,7 +2273,7 @@ function updateAttributeById(objId, va, shapeId) { "cmd": "com.actionsoft.apps.coe.pal_pl_repository_designer_message" }]; } - var isCriticalControlPoint="否"; + var isCriticalControlPoint=""; attributesJsonArray.forEach(obj => { // 检查id是否匹配 if (obj.id === 'isCriticalControlPoint') { @@ -2292,7 +2292,7 @@ function updateAttributeById(objId, va, shapeId) { ]; shape.dataAttributes[13]["dataShowConfig"].config = dataArray; - }else{ + }else if(isCriticalControlPoint === "否"){ var dataArray = [ { "horizontal": "right", From 222af80abcf9d245568633cfb2be3f9a2b2698d7 Mon Sep 17 00:00:00 2001 From: yujh Date: Wed, 16 Oct 2024 14:20:40 +0800 Subject: [PATCH 2/4] =?UTF-8?q?wps=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yiliwps/controller/YiliWpsController.java | 12 ++++++ .../user/apps/yiliwps/restful/YiliWpsApi.java | 2 +- .../awspaas/user/apps/yiliwps/web/WpsWeb.java | 43 ++++++++++++++++--- 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/controller/YiliWpsController.java b/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/controller/YiliWpsController.java index 1c8dbe84..bdba477e 100644 --- a/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/controller/YiliWpsController.java +++ b/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/controller/YiliWpsController.java @@ -53,4 +53,16 @@ public class YiliWpsController { WpsWeb web =new WpsWeb(me); return web.getCoeDefinition(palId); } + + /** + * 判断文件大小是否超过设定值 + * @param me + * @param palId + * @return + */ + @Mapping("com.awspaas.user.apps.yiliwps.checkFileSize") + public String checkFileSize(UserContext me,String palId){ + WpsWeb web =new WpsWeb(me); + return web.checkFileSize(palId); + } } diff --git a/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/restful/YiliWpsApi.java b/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/restful/YiliWpsApi.java index b6a21f12..c227c232 100644 --- a/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/restful/YiliWpsApi.java +++ b/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/restful/YiliWpsApi.java @@ -93,7 +93,7 @@ public class YiliWpsApi { @QueryParam("_w_third_fname") String fileName){ System.out.println(">>>>>>文件历史调用成功:"+System.currentTimeMillis()); WpsWeb web = new WpsWeb(); - return web.getHistoryFileInfo(queryFileId,fileName); + return web.getHistoryFileInfo(queryFileId); } @Path("/v1/3rd/file/version/{version}") diff --git a/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/web/WpsWeb.java b/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/web/WpsWeb.java index c97e308f..862ad7b7 100644 --- a/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/web/WpsWeb.java +++ b/com.awspaas.user.apps.yiliwps/src/com/awspaas/user/apps/yiliwps/web/WpsWeb.java @@ -1,5 +1,6 @@ package com.awspaas.user.apps.yiliwps.web; +import com.actionsoft.apps.coe.pal.constant.CoEConstant; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; import com.actionsoft.apps.coe.pal.pal.repository.designer.CoeDesignerShapeAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.designer.manage.CoeDesignerAPIManager; @@ -13,6 +14,7 @@ import com.actionsoft.bpms.commons.database.RowMap; import com.actionsoft.bpms.commons.formfile.dao.FormFileDao; import com.actionsoft.bpms.commons.formfile.model.delegate.FormFile; import com.actionsoft.bpms.commons.mvc.view.ActionWeb; +import com.actionsoft.bpms.commons.mvc.view.ResponseObject; import com.actionsoft.bpms.org.model.UserModel; import com.actionsoft.bpms.server.UserContext; import com.actionsoft.bpms.server.conf.portal.AWSPortalConf; @@ -20,6 +22,7 @@ import com.actionsoft.bpms.server.fs.DCContext; 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.sdk.local.SDK; import com.actionsoft.sdk.local.api.LogAPI; import com.alibaba.fastjson.JSONArray; @@ -54,7 +57,7 @@ public class WpsWeb extends ActionWeb { public String getWPSOnlineFilePreviewUrl(String palId,String fileName) throws Exception{ //先判断该fileId有无附件 String fileId = getFileIdByPalId(palId); - DCContext sourceDc = getFileDCContext(fileId,fileName); + DCContext sourceDc = getFileDCContext(fileId); WPS4Util.initAppInfo(YiliWpsConst.AK, YiliWpsConst.SK); String url = String.format("/api/edit/v1/files/%s/link?type=%s&_w_third_sid=%s&_w_third_palId=%s&_w_third_queryFileId=%s&_w_third_fname=%s",fileId,"w",this.getContext().getSessionId(),palId,fileId,URLEncoder.encode(sourceDc.getFileName())); Map headers = WPS4Util.getSignatureHeaders(url, HttpMethod.GET,null, YiliWpsConst.CONTENT_TYPE); @@ -70,7 +73,7 @@ public class WpsWeb extends ActionWeb { public String getWPSOnlineFileReadOnlyUrl(String palId,String fileName) throws Exception{ //先判断该fileId有无附件 String fileId = getFileIdByPalId(palId); - DCContext sourceDc = getFileDCContext(fileId,fileName); + DCContext sourceDc = getFileDCContext(fileId); 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",fileId,"w","ordinary",this.getContext().getSessionId(),palId,fileId,URLEncoder.encode(sourceDc.getFileName())); Map headers = WPS4Util.getSignatureHeaders(url, HttpMethod.GET,null, YiliWpsConst.CONTENT_TYPE); @@ -85,7 +88,7 @@ public class WpsWeb extends ActionWeb { } catch (UnsupportedEncodingException e) { e.printStackTrace(); } - DCContext sourceDc = getFileDCContext(fileId,sourceFileName); + DCContext sourceDc = getFileDCContext(fileId); JSONObject jsonObject = new JSONObject(); JSONObject file = new JSONObject(); JSONObject user = new JSONObject(); @@ -149,7 +152,7 @@ public class WpsWeb extends ActionWeb { //CallASLPUtil aslpUtil =new CallASLPUtil(); //aslpUtil.callTranslateDocASLP(me,palId,fileName,fileInputStream); //只写入新文件 - DCContext sourceDc = getFileDCContext(fileId,fileName); + DCContext sourceDc = getFileDCContext(fileId); sourceDc.setSession(me); SDK.getDCAPI().write(fileInputStream,sourceDc); //在重新获取下fileId @@ -178,11 +181,11 @@ public class WpsWeb extends ActionWeb { * 获取历史版本文件 * @return */ - public String getHistoryFileInfo(String queryFileId,String fileName){ + public String getHistoryFileInfo(String queryFileId){ JSONObject resultJson =new JSONObject(); JSONArray historyArray =new JSONArray(); JSONObject fileJson = new JSONObject(); - DCContext sourceDc = getFileDCContext(queryFileId,fileName); + DCContext sourceDc = getFileDCContext(queryFileId); //组装json JSONObject userJson =new JSONObject(); userJson.put("id","admin"); @@ -243,7 +246,7 @@ public class WpsWeb extends ActionWeb { * @param palId * @return */ - public DCContext getFileDCContext(String palId,String fileName){ + public DCContext getFileDCContext(String palId){ DCContext sourceDc = null; //先判断该fileId有无附件 String querySql = " SELECT PALREPOSITORYID,SHAPEID,FILETYPE,FILENAME FROM " + YiliWpsConst.APP_ACT_COE_PAL_UPFILE+" WHERE ID = ? ORDER BY CREATETIME DESC"; @@ -299,6 +302,32 @@ public class WpsWeb extends ActionWeb { return model.getDefinition(); } + /** + * 校验正文文件大小 + * @return + */ + public String checkFileSize(String palId){ + ResponseObject ro = ResponseObject.newOkResponse(); + //判断用户上传的文件的大小有多大 + String fileId = getFileIdByPalId(palId); + DCContext sourceDc = getFileDCContext(fileId); + if(null == sourceDc){ + ro.put("state",false); + } + String fileLength = String.valueOf(sourceDc.length()); + String maxFileLength = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, "wps_export_file_size"); + String maxFileLength_B = UtilNumber.mul(UtilNumber.mul(maxFileLength, "1024.0"),"1024.0"); + System.out.println(">>fileLength = " + fileLength); + System.out.println(">>maxFileLength_B = " + maxFileLength_B); + if(Double.parseDouble(UtilNumber.sub(fileLength,maxFileLength_B))>0){//大于设置的值,则走wps逻辑 + ro.put("maxFileLength",maxFileLength); + ro.put("state",true); + }else{ + ro.put("state",false); + } + return ro.toString(); + } + /** * 通过文件ID获取主要模型块的附件ID From 5e9727821a17f06797ce606af1a2c062ff9c7a4d Mon Sep 17 00:00:00 2001 From: yujh Date: Wed, 16 Oct 2024 14:21:42 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=8C=89=E9=92=AE=EF=BC=8C=E5=B8=A6=E5=87=BA?= =?UTF-8?q?=E5=80=BC=E5=A2=9E=E5=8A=A0=E5=8D=95=E4=B8=80=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E4=BA=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/coe/pal/publisher/client/web/FilePermWeb.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/FilePermWeb.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/FilePermWeb.java index 05e709fa..79d6b4bc 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/FilePermWeb.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/FilePermWeb.java @@ -6,8 +6,10 @@ import com.actionsoft.apps.coe.pal.publisher.constant.FilePermConstant; import com.actionsoft.bpms.bo.engine.BO; import com.actionsoft.bpms.bpmn.engine.model.run.delegate.ProcessInstance; import com.actionsoft.bpms.bpmn.engine.model.run.delegate.TaskInstance; +import com.actionsoft.bpms.commons.database.RowMap; import com.actionsoft.bpms.commons.mvc.view.ActionWeb; import com.actionsoft.bpms.server.UserContext; +import com.actionsoft.bpms.util.DBSql; import com.actionsoft.sdk.local.SDK; import com.actionsoft.sdk.local.api.ProcessExecuteQuery; @@ -27,6 +29,12 @@ public class FilePermWeb extends ActionWeb { bo.set("APPLYTYPE","单一权限申请"); bo.set("APPLYFILEIDS",palVersionId); bo.set("APPLYFILES",model.getName()); + String querySql = "SELECT PUBLISHDEPTID,CREATEUSER FROM BO_ACT_PUBLISH_PERM_SCOPE WHERE PALVERSIONID = ?"; + RowMap map = DBSql.getMap(querySql, new Object[]{palVersionId}); + if(null != map){ + bo.set("DYPUBLISHER",map.getString("CREATEUSER")); + bo.set("DYPUBLISHDEPT",map.getString("PUBLISHDEPTID")); + } SDK.getBOAPI().create(FilePermConstant.BO_ACT_FILE_PERM,bo,processInstance.getId(),uid); ProcessExecuteQuery start = SDK.getProcessAPI().start(processInstance); TaskInstance taskInstance = start.fetchActiveTasks().get(0); From 747bbb47b1451683157c606fb1443ff33f241bf6 Mon Sep 17 00:00:00 2001 From: yujh Date: Wed, 16 Oct 2024 14:36:09 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/output/template/web/TemplateWeb.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/com.awspaas.user.apps.output.template/src/com/awspaas/user/apps/output/template/web/TemplateWeb.java b/com.awspaas.user.apps.output.template/src/com/awspaas/user/apps/output/template/web/TemplateWeb.java index 43447857..4843e687 100644 --- a/com.awspaas.user.apps.output.template/src/com/awspaas/user/apps/output/template/web/TemplateWeb.java +++ b/com.awspaas.user.apps.output.template/src/com/awspaas/user/apps/output/template/web/TemplateWeb.java @@ -63,10 +63,17 @@ public class TemplateWeb extends ActionWeb { ResponseObject ro =ResponseObject.newOkResponse(); UserContext me = super.getContext(); ProcessInstance processInstance = SDK.getProcessAPI().createProcessInstance(TemplateConstant.mapping_dw_id,me.getUID(), "新增"); - BO bo =new BO(); - bo.set("TPLID",tplId); - bo.set("PALID",palId); - SDK.getBOAPI().create(TemplateConstant.BO_EU_TPL_PAL_MAPPING, bo, processInstance, me); + BO bo = SDK.getBOAPI().query(TemplateConstant.BO_EU_TPL_PAL_MAPPING).addQuery("CREATEUSER=", me.getUID()).addQuery("PALID=", palId).orderByCreated().desc().detail(); + if(null!=bo){//存在则走更新,不存在则走修改 + bo.set("TPLID",tplId); + bo.set("PALID",palId); + SDK.getBOAPI().update(TemplateConstant.BO_EU_TPL_PAL_MAPPING, bo); + }else{ + bo =new BO(); + bo.set("TPLID",tplId); + bo.set("PALID",palId); + SDK.getBOAPI().create(TemplateConstant.BO_EU_TPL_PAL_MAPPING, bo, processInstance, me); + } return ro.toString(); } }