发布流程增加相关/支持文件显示

This commit is contained in:
zhal 2024-09-19 11:34:05 +08:00
parent b2c167afb7
commit 5162b7e469
3 changed files with 73 additions and 1 deletions

View File

@ -3825,6 +3825,57 @@ public class PALRepositoryQueryAPIManager {
return result;
}
/**
* 导出单个制度手册
* 仅限于应用流程手册com.awspaas.user.apps.coe.pal.output.bd下的手册导出
*
* @param wsId 资产库Id
* @param userId 用户Id
* @param teamId 小组Id
* @param fileId 流程文件Id
* @return 返回创建流程手册结果及taskId
*/
public String createOutputReportFA(String wsId, String userId, String teamId, String fileId) {
UserContext _uc = UserContext.fromUID(userId);
OutPutReportWeb web = new OutPutReportWeb(_uc);
String appId = "com.awspaas.user.apps.coe.pal.output.zd";
// 报告生成器参数配置
String config = "{'isItReport':true,'orderNuberFirst':true,'orderNametwo':false,'reportNameIsItName':'%fileName%_%fileVersion%'}";// 配置
String title = "方案-手册1";
// 获取流程手册下所有的流程模板
List<OutputAppProfile> list = web.getOutputAppByAppId(appId);
OutputAppProfile outputAppProfile = null;
for (OutputAppProfile profile : list) {
if (!"".equals(title) && title.equals(profile.getTitle())) {
outputAppProfile = profile;
break;
}
}
if (outputAppProfile == null) {
throw new AWSException("创建制度手册失败,未找到报告模版");
}
String profileId = outputAppProfile.getId();
String taskName = outputAppProfile.getTitle();
String language = "".equals(outputAppProfile.getLang()) ? "cn" : outputAppProfile.getLang();
String isExecute = "Y";
String targetShape = "";
String relationFileId = "";
String isModify = "false";
String taskId = "";
String result = web.reportSaveByCallable(language, taskName, userId, teamId, profileId, wsId, isExecute, config, fileId, targetShape, relationFileId, isModify, taskId);
ResponseObject ro = ResponseObject.parse(result);
if (ro.isOk()) {
JSONObject object = (JSONObject) ro.getData();
String id = object.getString("taskId");
// 更改状态为隐藏不在界面显示该方式创建的流程手册数据
new OutputTask().updateIsDisplayStatus(id);
}
return result;
}
/**
* 预览流程手册
*

View File

@ -119,6 +119,28 @@ public class RepositoryTreeUtil {
if (model != null) palObject.put("dutyUserName", model.getUserName());
}
//相关/支持文件
JSONArray jsonArray1=new JSONArray();
String relatedName="";
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++){
JSONObject jb = new JSONObject();
PALRepositoryModel pModel=PALRepositoryCache.getCache().get(relatedRowMap.get(i).getString("RELATIONFILEID"));
String sessionId = new SSOUtil().registerClientSessionNoPassword(pModel.getCreateUser(), LoginConst.DEFAULT_LANG, "localhost", LoginConst.DEVICE_PC);
String url=SDK.getConfAPI().getPortalUrl() + "/r/w?uuid="+ pModel.getId()+"&teamId=&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&sid="+sessionId;
jb.put("relatedName",pModel.getName());
jb.put("relatedUrl",url);
jsonArray1.add(jb.toJSONString());
}
}
palObject.put("relatedData", jsonArray1);
//String sqls = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PROPERTYNAME='文件编码' and PLID = '"+palModel.getId()+"'";
//palObject.put("stopNumber", DBSql.getString(sqls));
// if (professionalIcon) {
@ -264,7 +286,6 @@ public class RepositoryTreeUtil {
palObject.put("dutyUserName", "");
//相关/支持文件
JSONArray jsonArray1=new JSONArray();
String relatedName="";
List<RowMap> relatedRowMap=DBSql.getMaps("SELECT RELATIONFILEID FROM APP_ACT_COE_PAL_SHAPE_RLAT where FILEID='"+palModel.getId()+"' and ATTRID='related_support_files'");