From 41882bd8417dbe21bb98d4ac3b170a4cde3d3132 Mon Sep 17 00:00:00 2001 From: yujh Date: Mon, 12 May 2025 10:55:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E6=89=8B=E5=86=8C=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E7=94=9F=E6=88=90=E5=99=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../output/pr/dc/OutputDCFileProcessor.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/dc/OutputDCFileProcessor.java b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/dc/OutputDCFileProcessor.java index dfb77f18..2ba70abc 100644 --- a/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/dc/OutputDCFileProcessor.java +++ b/com.actionsoft.apps.coe.pal.output.pr/src/com/actionsoft/apps/coe/pal/output/pr/dc/OutputDCFileProcessor.java @@ -59,6 +59,40 @@ public class OutputDCFileProcessor extends AbstFileProcessor implements FileProc return ""; } + /** + * 得到报告文件 + * + * @param wsId 资产库id + * @param id 任务Id + * @param profileId 报告生成器扩展App的配置Id + * @throws Exception + */ + public static String getReportUtilDownloadURL(String wsId, String id, String profileId, UserContext _uc, String taskName) throws Exception { + UtilFile file = OutputAPIManager.getInstance().getFilePath(wsId, id, profileId); + OutputWordUtil.xml2Word(null, file.getPath()); + if (file.exists()) { + //String josnStr = OutputAPIManager.getInstance().getWizardJsonData(wsId, id, profileId); + // JSONObject jsonObj = JSONObject.fromObject(josnStr); + DCContext dcContext = null; + DCUtil.getInstance(); + dcContext = DCUtil.createTempFileContext("com.actionsoft.apps.coe.pal.output.pr", "output", id, "zip"); + dcContext.setFileName(taskName+ ".zip"); + File ff = new File(dcContext.getFilePath()); + // UtilFile.zipCompress(file.getPath(), ff, "doc"); +// UtilFile.zipCompressExcludeName(file.getPath(), ff, "txt,**/*.log"); + UtilFile.zipCompressExcludeName(file.getPath(), ff, "txt,**/*.log,**/*.xml,xmltodoc/"); + dcContext.setSession(_uc); + // 操作行为日志记录 + if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { + CoEOpLogAPI.auditOkOp(_uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_DOWNLOAD, CoEOpLogConst.INFO_OUTPUT_DOWNLOAD); + } + return dcContext.getDownloadURL(); + } + return ""; + } + + + /* * 预览报告文件 * @param wsId 资产库id