diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java index ad8a0ac7..9bd883c6 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java @@ -2486,6 +2486,21 @@ public class CoEPALController { public String COEPALOUTPUTREPORTOutputProcessPreview(UserContext me, String taskId) { return PALRepositoryQueryAPIManager.getInstance().outputReportPreview(me, taskId); } + + + /** + * 流程阅览 流程手册下载 + * @param me + * @param taskId + * @return + * by zhaolei + */ + @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_download") + public String COEPALOUTPUTREPORTOutputProcessDownload(UserContext me, String taskId) { + return PALRepositoryQueryAPIManager.getInstance().outputReportDownload(me, taskId); + } + + /** * 查询导出组织模型等结构 diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java index 09483c8c..dee8d981 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java @@ -2588,6 +2588,50 @@ public class PALRepositoryQueryAPIManager { return result.toString(); } + + /** + * 流程手册下载 + * @param _uc + * @param taskId + * @return + */ + public String outputReportDownload(UserContext _uc, String taskId) { + OutputTaskModel model = new OutputTask().getTaskReportById(taskId); + ResponseObject result = ResponseObject.newOkResponse(); + if (model != null) { + try { + UtilFile file = OutputAPIManager.getInstance().getFilePath(model.getWsId(), taskId, model.getProfileId()); + if (file.exists()) { + File[] fileList = file.listFiles(); + if (fileList.length > 0) { + File docFile = null; + for (File file2 : fileList) { + if (file2.isFile() && "doc".equals((file2.getName().substring(file2.getName().lastIndexOf(".") + 1)))) { + docFile = file2; + break; + } + } + if (docFile == null) { + return ResponseObject.newErrResponse("没有找到文件").toString(); + } + String sourceAppId = "com.actionsoft.apps.coe.pal.output.pr"; + String filename = docFile.getName(); + DCContext sourceDc = new DCContext(_uc, DCProfileManager.getDCProfile(sourceAppId, "output"), sourceAppId, model.getWsId(), taskId, filename); + + String downUrl=SDK.getConfAPI().getPortalUrl() + "/r/" + sourceDc.getDownloadURL().replace("./", ""); + result.put("url",downUrl); + } + }else{ + result = ResponseObject.newErrResponse("没有可预览文件"); + } + } catch (Exception e) { + e.printStackTrace(); + return ResponseObject.newErrResponse().toString(); + } + } + return result.toString(); + } + /** * 发布流程访问量+1 */ diff --git a/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.view.portal.html b/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.view.portal.html index 5f375cea..ecf40954 100755 --- a/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.view.portal.html +++ b/com.actionsoft.apps.coe.pal/template/page/pal.pl.repository.designer.view.portal.html @@ -618,7 +618,7 @@ } } } - /* var output = initOutputFileLink(); + /*var output = initOutputFileLink(); if (output != 0) { output = 40; } else { @@ -643,16 +643,14 @@ }); + //渲染评论内容 function initPl() { - $(".message-detial-reply").empty(); $(".message-detial-reply").append("
"); var addreplystr=""; addreplystr+=""; $(".reply-box").append(addreplystr); //$('#showemotion').SinaEmotion($('.emotion')); @@ -664,146 +662,8 @@ } - function initOutputFileLink() { - if(taskId != "") { - var html = ''; - // 只包含手册的链接 - html += '| ';
t += ' 流程手册: ';
- t += '';
+ t += '';
t += ' |
| ';
- t += ' 流程手册: ';
- t += '';
- t += ' |