流程发布-表单添加显示附件
This commit is contained in:
parent
b60210c7ef
commit
ff8e2f11e0
@ -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<UpfileModel> 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<String> shapeIds = new ArrayList<>();
|
||||
String methodCategory = model3.getMethodCategory();
|
||||
String methodId = model3.getMethodId();
|
||||
List<Map<String, Object>> shapeList = CoeDesignerUtil.getShapeMessageJson2(changeId);// 获取所有节点
|
||||
if (shapeList != null && shapeList.size() > 0)
|
||||
for (Map<String, Object> map : shapeList)
|
||||
@ -2865,7 +2884,7 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
List<UpfileModel> 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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user