diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java index ac830fe5..7aee3aee 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java @@ -1764,7 +1764,7 @@ public class ProcessPublishWeb extends ActionWeb { jb.put("upfileId", upfileId); jb.put("upFileName", upFileName); String openUrl = ""; - ResponseObject ros = getUrl(jb, id, upFileName); + ResponseObject ros = getUrl("f",jb,upfileModel); JSONObject parseObject = JSON.parseObject(JSON.toJSONString(ros.getData())); String url = parseObject.get("url").toString(); if(url.contains(".xls")) @@ -1841,7 +1841,7 @@ public class ProcessPublishWeb extends ActionWeb { jb.put("upfileId", upfileId); jb.put("upFileName", upFileName); String openUrl = ""; - ResponseObject ros = getUrl(jb, model.getId(), upFileName); + ResponseObject ros = getUrl("f",jb,upfileModel); JSONObject parseObject = JSON.parseObject(JSON.toJSONString(ros.getData())); String url = parseObject.get("url").toString(); if(url.contains(".xls")) @@ -2649,11 +2649,22 @@ public class ProcessPublishWeb extends ActionWeb { } - public ResponseObject getUrl(JSONObject jb, String id ,String upFileName) { + public ResponseObject getUrl(String type, JSONObject jb, UpfileModel upfileModel) { + String id = upfileModel.getPl_uuid(); + String upFileName = upfileModel.getFileName(); + String shape_uuid = upfileModel.getShape_uuid(); String sourceAppId = "com.actionsoft.apps.coe.pal"; - DCContext sourceDc = new DCContext(_uc, - DCProfileManager.getDCProfile(sourceAppId, "COE_Upfile"), sourceAppId, - "file", id, upFileName); + DCContext sourceDc = null; + if("f".equals(type)) { + sourceDc = new DCContext(_uc, + DCProfileManager.getDCProfile(sourceAppId, "COE_Upfile"), sourceAppId, + "file", id, upFileName); + }else { + sourceDc = new DCContext(_uc, + DCProfileManager.getDCProfile(sourceAppId, "COE_Upfile"), sourceAppId, + id,shape_uuid, upFileName); + } + String downUrl = SDK.getConfAPI().getPortalUrl() + "/r/" + sourceDc.getDownloadURL().replace("./", ""); jb.put("downUrl", downUrl); @@ -2694,7 +2705,7 @@ public class ProcessPublishWeb extends ActionWeb { - /************ 批量流程发布 *****************/ + /************ 批量流程发布 *****************/ /** * 查询流程发布子表数据 @@ -2744,6 +2755,7 @@ public class ProcessPublishWeb extends ActionWeb { if (model != null) { String id = model.getId(); String methodCategory = model.getMethodCategory(); + String methodId = model.getMethodId(); obj.put("fileVersion", VersionUtil.getVersionStr(model.getVersion())); obj.put("methodId", model.getMethodId()); obj.put("category", methodCategory); @@ -2763,42 +2775,48 @@ public class ProcessPublishWeb extends ActionWeb { sqlWhere.append(" and PALREPOSITORYID ='").append(publishId).append("'"); List fileList = upFileDao.search(sqlWhere.toString()); if (fileList != null && fileList.size() > 0) - for (UpfileModel upfileModel : fileList) - if("data".equals(methodCategory)) { - if ("s".equals(upfileModel.getType())) { - JSONObject jb = new JSONObject(); - String upfileId = upfileModel.getUuid(); - String upFileName = upfileModel.getFileName(); - jb.put("upfileId", upfileId); - jb.put("upFileName", upFileName); - String openUrl = ""; - ResponseObject ros = getUrl(jb, id, upFileName); - JSONObject parseObject = JSON.parseObject(JSON.toJSONString(ros.getData())); - String url = parseObject.get("url").toString(); - if(url.contains(".xls")) - openUrl= url; - else - openUrl = SDK.getConfAPI().getPortalUrl() + "/r/" + url.replace("./", ""); - jb.put("openUrl",openUrl); - js.add(jb.toJSONString()); - } - } else if ("f".equals(upfileModel.getType())) { + for (UpfileModel upfileModel : fileList) + if (methodId.contains("data")) { + if ("s".equals(upfileModel.getType())) { + JSONObject jb = new JSONObject(); + String upfileId = upfileModel.getUuid(); + String shape_uuid = upfileModel.getShape_uuid(); + String upFileName = upfileModel.getFileName(); + jb.put("upfileId", upfileId); + System.err.println("文件名称:"+upFileName); + jb.put("upFileName", upFileName); + String openUrl = ""; + ResponseObject ros = getUrl("s",jb, upfileModel); + JSONObject parseObject = JSON.parseObject(JSON.toJSONString(ros.getData())); + String url = parseObject.get("url").toString(); + System.err.println("---下载地址--"+url); + if (url.contains(".xls")) + openUrl = url; + else + openUrl = SDK.getConfAPI().getPortalUrl() + "/r/" + url.replace("./", ""); + jb.put("openUrl", openUrl); + js.add(jb.toJSONString()); + } + } else { + if ("f".equals(upfileModel.getType())) { JSONObject jb = new JSONObject(); String upfileId = upfileModel.getUuid(); String upFileName = upfileModel.getFileName(); jb.put("upfileId", upfileId); jb.put("upFileName", upFileName); String openUrl = ""; - ResponseObject ros = getUrl(jb, id, upFileName); + ResponseObject ros = getUrl("f",jb,upfileModel); JSONObject parseObject = JSON.parseObject(JSON.toJSONString(ros.getData())); String url = parseObject.get("url").toString(); - if(url.contains(".xls")) - openUrl= url; + if (url.contains(".xls")) + openUrl = url; else openUrl = SDK.getConfAPI().getPortalUrl() + "/r/" + url.replace("./", ""); - jb.put("openUrl",openUrl); + jb.put("openUrl", openUrl); js.add(jb.toJSONString()); } + + } obj.put("upfileId", js); } else { obj.put("fileVersion", "1.0"); @@ -2848,10 +2866,11 @@ public class ProcessPublishWeb extends ActionWeb { } String changeId = changeBo.getString("CHANGEDFILEIDNEW"); PALRepositoryModel model3 = PALRepositoryCache.getCache().get(changeId); - if(null!= model3) { + if (null != model3) { String id = model3.getId(); List shapeIds = new ArrayList<>(); String methodCategory = model3.getMethodCategory(); + String methodId = model3.getMethodId(); List> shapeList = CoeDesignerUtil.getShapeMessageJson2(changeId);// 获取所有节点 if (shapeList != null && shapeList.size() > 0) for (Map map : shapeList) @@ -2865,7 +2884,7 @@ public class ProcessPublishWeb extends ActionWeb { List fileList = upFileDao.search(sqlWhere.toString()); if (fileList != null && fileList.size() > 0) for (UpfileModel upfileModel : fileList) - if("data".equals(methodCategory)) { + if (methodId.contains("data")) { if ("s".equals(upfileModel.getType())) { JSONObject jb = new JSONObject(); String upfileId = upfileModel.getUuid(); @@ -2873,35 +2892,43 @@ public class ProcessPublishWeb extends ActionWeb { jb.put("upfileId", upfileId); jb.put("upFileName", upFileName); String openUrl = ""; - ResponseObject ros = getUrl(jb, id, upFileName); - JSONObject parseObject = JSON.parseObject(JSON.toJSONString(ros.getData())); + ResponseObject ros = getUrl("s",jb,upfileModel); + JSONObject parseObject = JSON + .parseObject(JSON.toJSONString(ros.getData())); String url = parseObject.get("url").toString(); - if(url.contains(".xls")) - openUrl= url; + if (url.contains(".xls")) + openUrl = url; else - openUrl = SDK.getConfAPI().getPortalUrl() + "/r/" + url.replace("./", ""); - jb.put("openUrl",openUrl); + openUrl = SDK.getConfAPI().getPortalUrl() + "/r/" + + url.replace("./", ""); + jb.put("openUrl", openUrl); js.add(jb.toJSONString()); } - } else if ("f".equals(upfileModel.getType())) { - JSONObject jb = new JSONObject(); - String upfileId = upfileModel.getUuid(); - String upFileName = upfileModel.getFileName(); - jb.put("upfileId", upfileId); - jb.put("upFileName", upFileName); - String openUrl = ""; - ResponseObject ros = getUrl(jb, id, upFileName); - JSONObject parseObject = JSON.parseObject(JSON.toJSONString(ros.getData())); - String url = parseObject.get("url").toString(); - if(url.contains(".xls")) - openUrl= url; - else - openUrl = SDK.getConfAPI().getPortalUrl() + "/r/" + url.replace("./", ""); - jb.put("openUrl",openUrl); - js.add(jb.toJSONString()); + } else { + + if ("f".equals(upfileModel.getType())) { + JSONObject jb = new JSONObject(); + String upfileId = upfileModel.getUuid(); + String upFileName = upfileModel.getFileName(); + jb.put("upfileId", upfileId); + jb.put("upFileName", upFileName); + String openUrl = ""; + ResponseObject ros = getUrl("f",jb,upfileModel); + JSONObject parseObject = JSON + .parseObject(JSON.toJSONString(ros.getData())); + String url = parseObject.get("url").toString(); + if (url.contains(".xls")) + openUrl = url; + else + openUrl = SDK.getConfAPI().getPortalUrl() + "/r/" + + url.replace("./", ""); + jb.put("openUrl", openUrl); + js.add(jb.toJSONString()); + } + } obj.put("upfileId", js); - + } } else {