流程发布-表单添加显示附件

This commit is contained in:
lihongyu 2022-09-25 17:59:28 +08:00
parent b60210c7ef
commit ff8e2f11e0

View File

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