From 82638881c95bb35c2c5c3f632234353968bc997c Mon Sep 17 00:00:00 2001 From: zhal <15900249928@163.com> Date: Sun, 31 Jul 2022 16:38:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=B5=81=E7=A8=8B=E9=98=85?= =?UTF-8?q?=E8=A7=88=E7=9B=B8=E5=85=B3=E6=96=87=E4=BB=B6=E5=9B=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=97=AE=E9=A2=98=E5=AF=BC=E8=87=B4=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PALRepositoryQueryAPIManager.java | 2 +- .../web/DesignerRelationShapeWeb.java | 5 +-- .../repository/util/CoeProcessLevelUtil.java | 43 +++++++++++++++++-- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java index 54e239be..600aaa64 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java @@ -4730,7 +4730,7 @@ public class PALRepositoryQueryAPIManager { * @param uuid * @return */ - public Map queryRepositoryAttributeById(String uuid) { + public static Map queryRepositoryAttributeById(String uuid) { Map result = new HashMap<>(); PALRepositoryModel plModel = PALRepositoryCache.getCache().get(uuid); // 获取所有文件属性 diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java index c1ccd0e0..7894cf7b 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java @@ -855,7 +855,7 @@ public class DesignerRelationShapeWeb extends ActionWeb { } } macroLibraries.put("treeData", jsonArr_new.toString()); - }else if(attrId.equals("R_relevant_flies")){ + }else if(attrId.equals("R_relevant_flies")){//相关文件 for (int i = 0; i < objects.size(); i++) { JSONObject jsonObject = objects.getJSONObject(i); String isParent=jsonObject.getString("isParent"); @@ -882,8 +882,7 @@ public class DesignerRelationShapeWeb extends ActionWeb { } macroLibraries.put("treeData", jsonArr_new.toString()); - } else if(attrId.equals("support_files")) { - + } else if(attrId.equals("support_files")) { //支持文件 for (int i = 0; i < objects.size(); i++) { JSONObject jsonObject = objects.getJSONObject(i); String isParent=jsonObject.getString("isParent"); diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java index d581ecc6..a977f9df 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java @@ -2266,9 +2266,46 @@ public class CoeProcessLevelUtil { boolean isclosed=userModel.isClosed(); if(isclosed==false){ - String sessionId = new SSOUtil().registerClientSessionNoPassword(plModel.getCreateUser(), LoginConst.DEFAULT_LANG, "localhost", LoginConst.DEVICE_PC); + Map jsonObjectMap=PALRepositoryQueryAPIManager.queryRepositoryAttributeById(uuid); - String relationFileId; + if(attributeModel.getKey().equals(jsonObjectMap.get(attributeModel.getKey()).get("attrId"))){ + String relationFileId; + + JSONArray jsonValue = jsonObjectMap.get(attributeModel.getKey()).getJSONArray("value"); + if(jsonValue.size()>0){ + + String sessionId = new SSOUtil().registerClientSessionNoPassword(plModel.getCreateUser(), LoginConst.DEFAULT_LANG, "localhost", LoginConst.DEVICE_PC); + + relationFileId = jsonValue.getJSONObject(0).get("fileId").toString(); + + PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid); + String taskId=""; + if (model != null) { + if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 + taskId=getLastPublishTaskIdByModelId(model.getId()); + } + } + String url=SDK.getPortalAPI().getPortalUrl()+"/r/w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid="+relationFileId+""+"&sid="+sessionId+"&taskId="+taskId; + + //判断如果关联属性是岗位,多个岗位显示为... + if(attributeModel.getKey().equals("post")){ + int lenth=inputValue.split(",").length-1; + if(lenth>=2){ + int index1=inputValue.indexOf(","); + int index2=inputValue.indexOf(",",index1+1); + inputValue=inputValue.substring(0,index2)+"..."; + } + } + appUrl=""+inputValue+""; + attribute.put("value", appUrl); + + }else{ + appUrl=""+inputValue+""; + attribute.put("value", appUrl); + } + } + + /*String relationFileId; if(JSONObject.parseObject(property.getPropertyValue())!=null){ relationFileId = JSONObject.parseObject(property.getPropertyValue()).get("relationFileId").toString(); if(relationFileId.contains(",")){ @@ -2298,7 +2335,7 @@ public class CoeProcessLevelUtil { } appUrl=""+inputValue+""; attribute.put("value", appUrl); - } + }*/ }else{ appUrl=""+inputValue+""; attribute.put("value", appUrl);