解决流程阅览相关文件因数据问题导致报错问题
This commit is contained in:
parent
ffe331dd2c
commit
82638881c9
@ -4730,7 +4730,7 @@ public class PALRepositoryQueryAPIManager {
|
||||
* @param uuid
|
||||
* @return
|
||||
*/
|
||||
public Map<String, JSONObject> queryRepositoryAttributeById(String uuid) {
|
||||
public static Map<String, JSONObject> queryRepositoryAttributeById(String uuid) {
|
||||
Map<String, JSONObject> result = new HashMap<>();
|
||||
PALRepositoryModel plModel = PALRepositoryCache.getCache().get(uuid);
|
||||
// 获取所有文件属性
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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<String, JSONObject> 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="<a href='"+url+"' style='color:blue' target='_blank'>"+inputValue+"</a>";
|
||||
attribute.put("value", appUrl);
|
||||
|
||||
}else{
|
||||
appUrl="<a href='"+'#'+"' style='color:blue' target='_blank'>"+inputValue+"</a>";
|
||||
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="<a href='"+url+"' style='color:blue' target='_blank'>"+inputValue+"</a>";
|
||||
attribute.put("value", appUrl);
|
||||
}
|
||||
}*/
|
||||
}else{
|
||||
appUrl="<a href='"+'#'+"' style='color:blue' target='_blank'>"+inputValue+"</a>";
|
||||
attribute.put("value", appUrl);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user