PAL树形结构构建相关支持文件链接地址

This commit is contained in:
zhaol 2025-03-03 10:40:23 +08:00
parent fe8900e52b
commit 9b3e75e44c
2 changed files with 49 additions and 2 deletions

View File

@ -10,6 +10,8 @@ import java.util.Map;
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel;
import com.actionsoft.apps.coe.pal.pal.repository.web.CoeProcessLevelWeb;
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
import com.actionsoft.apps.coe.pal.util.BpmOrgUtil;
@ -123,7 +125,7 @@ public class RepositoryTreeUtil {
//相关/支持文件
JSONArray jsonArray1=new JSONArray();
List<RowMap> relatedRowMap=DBSql.getMaps("SELECT RELATIONFILEID FROM APP_ACT_COE_PAL_SHAPE_RLAT where FILEID='"+palModel.getId()+"' and ATTRID='related_support_files'");
/*List<RowMap> relatedRowMap=DBSql.getMaps("SELECT RELATIONFILEID FROM APP_ACT_COE_PAL_SHAPE_RLAT where FILEID='"+palModel.getId()+"' and ATTRID='related_support_files'");
if(relatedRowMap.size()>0){
for(int i=0;i<relatedRowMap.size();i++){
JSONObject jb = new JSONObject();
@ -138,6 +140,29 @@ public class RepositoryTreeUtil {
}
}*/
//获取使用中版本的相关支持文件
List<DesignerShapeRelationModel> relationList = DesignerShapeRelationCache.getListByAttrId(palModel.getId(), "", "related_support_files");
if (relationList.size() > 0) {
for (DesignerShapeRelationModel relation : relationList) {
JSONObject jb = new JSONObject();
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
List<PALRepositoryModel> models = PALRepositoryCache.getByVersionId(relationFileId);
if (models != null && models.size() > 0) {
for(PALRepositoryModel oneModel:models){
if(oneModel.isUse()==true){
String sessionId = new SSOUtil().registerClientSessionNoPassword("admin", LoginConst.DEFAULT_LANG, "localhost", LoginConst.DEVICE_PC);
String url=SDK.getConfAPI().getPortalUrl() + "/r/w?uuid="+ oneModel.getId()+"&teamId=&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&sid="+sessionId + "&browserId=" + UUIDGener.getObjectId();
jb.put("relatedName",oneModel.getName());
jb.put("relatedUrl",url);
jsonArray1.add(jb.toJSONString());
}
}
}
}
}
palObject.put("relatedData", jsonArray1);
@ -288,7 +313,7 @@ public class RepositoryTreeUtil {
//相关/支持文件
JSONArray jsonArray1=new JSONArray();
List<RowMap> relatedRowMap=DBSql.getMaps("SELECT RELATIONFILEID FROM APP_ACT_COE_PAL_SHAPE_RLAT where FILEID='"+palModel.getId()+"' and ATTRID='related_support_files'");
/*List<RowMap> relatedRowMap=DBSql.getMaps("SELECT RELATIONFILEID FROM APP_ACT_COE_PAL_SHAPE_RLAT where FILEID='"+palModel.getId()+"' and ATTRID='related_support_files'");
Map map=new HashMap();
if(relatedRowMap.size()>0){
for(int i=0;i<relatedRowMap.size();i++){
@ -304,6 +329,28 @@ public class RepositoryTreeUtil {
}
}*/
//获取使用中版本的相关支持文件
List<DesignerShapeRelationModel> relationList = DesignerShapeRelationCache.getListByAttrId(palModel.getId(), "", "related_support_files");
if (relationList.size() > 0) {
for (DesignerShapeRelationModel relation : relationList) {
JSONObject jb = new JSONObject();
String relationFileId = relation.getRelationFileId();// 支持或相关文件的ID
List<PALRepositoryModel> models = PALRepositoryCache.getByVersionId(relationFileId);
if (models != null && models.size() > 0) {
for(PALRepositoryModel oneModel:models){
if(oneModel.isUse()==true){
String sessionId = new SSOUtil().registerClientSessionNoPassword("admin", LoginConst.DEFAULT_LANG, "localhost", LoginConst.DEVICE_PC);
String url=SDK.getConfAPI().getPortalUrl() + "/r/w?uuid="+ oneModel.getId()+"&teamId=&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&sid="+sessionId + "&browserId=" + UUIDGener.getObjectId();
jb.put("relatedName",oneModel.getName());
jb.put("relatedUrl",url);
jsonArray1.add(jb.toJSONString());
}
}
}
}
}
palObject.put("relatedData", jsonArray1);