diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index d0a508fa..d2615321 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ 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 9b970058..1942487b 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 @@ -2607,19 +2607,18 @@ public class CoEPALController { /** - * 流程手册预览 - * + * 流程手册预览+excel下载 * @param me * @param taskId * @return */ - // @Mapping("COE_PAL_OUTPUTREPORT_OUTPUT_PROCESS_PREVIEW") - @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_ppt_preview") - public String COEPALOUTPUTREPORTOutputProcessPPTPreview(UserContext me, String taskId) { - return PALRepositoryQueryAPIManager.getInstance().outputReportPPTPreview(me, taskId); + @Mapping("com.actionsoft.apps.coe.pal_outputreport_output_process_previewByExceldown") + public String previewByExceldown(UserContext me, String taskId) { + return PALRepositoryQueryAPIManager.getInstance().previewByExceldown(me, taskId); } + /** * 流程阅览 流程手册下载 * @@ -3757,19 +3756,4 @@ public class CoEPALController { return web.createOutputPrReportsByEstimatePPTFile(me, fileId); } - - /** - * 判断附件 - * - * @param me - * @param uuids - * @param teamId - * @param wsId - * @return - */ - @Mapping("com.actionsoft.apps.coe.pal.publisher_output_pr_downloadExcelFile") - public String createOutputPrReportsByDownloadExcelFile(UserContext me, String taskIds) { - DesignerRelationShapeWeb web = new DesignerRelationShapeWeb(me); - return web.createOutputPrReportsByDownloadExcelFile(taskIds); - } } 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 dc91495b..e05ebd3e 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 @@ -3547,6 +3547,83 @@ public class PALRepositoryQueryAPIManager { } + + + + public String previewByExceldown(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))) || file2.isFile() && "pptx".equals((file2.getName().substring(file2.getName().lastIndexOf(".") + 1))) || "xlsx".equals((file2.getName().substring(file2.getName().lastIndexOf(".") + 1))) ||"xls".equals((file2.getName().substring(file2.getName().lastIndexOf(".") + 1)))) { + docFile = file2; + break; + } + } + if (docFile == null) { + return ResponseObject.newErrResponse("没有找到文件").toString(); + } + + if ("xls".equals((docFile.getName().substring(docFile.getName().lastIndexOf(".") + 1))) || "xlsx".equals((docFile.getName().substring(docFile.getName().lastIndexOf(".") + 1)))) { + OutputAppProfile appFile = OutputAppManager.getProfile(model.getProfileId()); + String sourceAppId = appFile.getAppContext().getId(); + 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{ + if (SDK.getAppAPI().isActive("com.actionsoft.apps.addons.onlinedoc")) { + OutputAppProfile appFile = OutputAppManager.getProfile(model.getProfileId()); + String sourceAppId = appFile.getAppContext().getId(); + String filename = docFile.getName(); + DCContext sourceDc = new DCContext(_uc, DCProfileManager.getDCProfile(sourceAppId, "output"), sourceAppId, model.getWsId(), taskId, filename); + Map aslpParams = new HashMap(); + aslpParams.put("sid", _uc.getSessionId()); + aslpParams.put("fileNameOriginal", filename); + aslpParams.put("sourceDc", sourceDc); + aslpParams.put("isShowDefaultToolbar", true); + aslpParams.put("isShowBackbtn", false); + aslpParams.put("isEncrypt", true); + aslpParams.put("isCopy", true); + aslpParams.put("isPrint", true); + aslpParams.put("isDownload", true); + AppAPI appAPI = SDK.getAppAPI(); + ResponseObject responseObject = appAPI.callASLP(appAPI.getAppContext(sourceAppId), "aslp://com.actionsoft.apps.addons.onlinedoc/filePreview", aslpParams); + if (responseObject != null) { + if (responseObject.isOk()) { + String url = responseObject.get("url").toString(); + result.put("url", url); + result.put("filename", filename); + } else { + result = ResponseObject.newErrResponse("文档转换服务不可用,请联系管理员"); + } + } + } else { + result = ResponseObject.newErrResponse("文档转换服务不可用,请联系管理员"); + } + } + + } + } else { + result = ResponseObject.newErrResponse("没有可预览文件"); + } + } catch (Exception e) { + e.printStackTrace(); + return ResponseObject.newErrResponse().toString(); + } + } + return result.toString(); + } + + + public String outputReportPPTPreview(UserContext _uc, String taskId) { OutputTaskModel model = new OutputTask().getTaskReportById(taskId); ResponseObject result = ResponseObject.newOkResponse(); diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/action.xml b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/action.xml index 4a01fdda..71a938ac 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/action.xml +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/action.xml @@ -1,1304 +1,1304 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1309,499 +1309,502 @@ - + - + - + - - - - - - + + + + + + - + - + - + - - - + + + - + + + + - - + + - - - - - + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js index d974839e..87bf6d0d 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js @@ -4220,153 +4220,31 @@ function outputReport() { fileId: ruuid }, success: function (r) { - debugger; if (r.result == "ok") { - if (methodId == "data.form") { + $.simpleAlert('正在打开', 'loading'); + setTimeout(function () { $.ajax({ type: "POST", url: "./jd?sid=" + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal.publisher_output_pr_estimateFile", + + "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_process_previewByExceldown", data: { - fileId: ruuid + taskId: r.data.taskId }, - success: function (rep) { - if (rep.data.result == "existExcel") { - $.ajax({ - type: "POST", - url: "./jd?sid=" - + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal.publisher_output_pr_downloadExcelFile", - data: { - taskIds: r.data.taskId - }, - success: function (msg) { - if (msg.result == "ok") { - window.open(msg.data.url); - $.simpleAlert("close"); - } else { - $.simpleAlert("close"); - } - } - }); - } else { - $.simpleAlert('正在打开', 'loading'); - setTimeout(function () { - $.ajax({ - type: "POST", - url: "./jd?sid=" - + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_process_preview", - data: { - taskId: r.data.taskId - }, - success: function (msg) { - if (msg.result == "ok") { - $.simpleAlert("close"); - if (msg['data']) { - var url = msg['data']['url']; - window.open(url); - } - } else { - $.simpleAlert("close"); - $.simpleAlert(msg['msg'], 'info'); - } - } - }); - }, 2000); - } - } - }); - } else if (methodId == 'control.policy') { - $.ajax({ - type: "POST", - url: "./jd?sid=" - + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal.publisher_output_pr_estimatePPTFile", - data: { - fileId: ruuid - }, - success: function (rep) { - debugger; - if (rep.data.result == "existPPT") { - setTimeout(function () { - $.ajax({ - type: "POST", - url: "./jd?sid=" - + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_process_ppt_preview", - data: { - taskId: r.data.taskId - }, - success: function (msg) { - if (msg.result == "ok") { - $.simpleAlert("close"); - if (msg['data']) { - var url = msg['data']['url']; - window.open(url); - } - } else { - $.simpleAlert("close"); - $.simpleAlert(msg['msg'], 'info'); - } - } - }); - }, 2000); - } else { - $.simpleAlert('正在打开', 'loading'); - setTimeout(function () { - $.ajax({ - type: "POST", - url: "./jd?sid=" - + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_process_preview", - data: { - taskId: r.data.taskId - }, - success: function (msg) { - if (msg.result == "ok") { - $.simpleAlert("close"); - if (msg['data']) { - var url = msg['data']['url']; - window.open(url); - } - } else { - $.simpleAlert("close"); - $.simpleAlert(msg['msg'], 'info'); - } - } - }); - }, 2000); - } - } - }); - } else { - $.simpleAlert('正在打开', 'loading'); - setTimeout(function () { - $.ajax({ - type: "POST", - url: "./jd?sid=" - + CLB.sid - + "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_process_preview", - data: { - taskId: r.data.taskId - }, - success: function (msg) { - if (msg.result == "ok") { - $.simpleAlert("close"); - if (msg['data']) { - var url = msg['data']['url']; - window.open(url); - } - } else { - $.simpleAlert("close"); - $.simpleAlert(msg['msg'], 'info'); + success: function (msg) { + if (msg.result == "ok") { + $.simpleAlert("close"); + if (msg['data']) { + var url = msg['data']['url']; + window.open(url); } + } else { + $.simpleAlert("close"); + $.simpleAlert(msg['msg'], 'info'); } - }); - }, 2000); - } + } + }); + }, 2000); } else { if (methodId == 'data.form') { $.simpleAlert('表单手册创建失败', 'error');