From 6c4cb1c89b5d3774d10366cd880a1be1dbf6e438 Mon Sep 17 00:00:00 2001 From: loy Date: Wed, 18 Aug 2021 17:16:33 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-57251=20=E4=BF=AE=E5=A4=8D=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B9=8B=E5=A4=96cptx=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/nx/app/designer/CptxApp.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/nx/app/designer/CptxApp.java b/designer-realize/src/main/java/com/fr/nx/app/designer/CptxApp.java index f76be4d89..4597d0234 100644 --- a/designer-realize/src/main/java/com/fr/nx/app/designer/CptxApp.java +++ b/designer-realize/src/main/java/com/fr/nx/app/designer/CptxApp.java @@ -4,6 +4,7 @@ import com.fr.base.extension.FileExtension; import com.fr.design.mainframe.AbstractAppProvider; import com.fr.design.mainframe.JTemplate; import com.fr.file.FILE; +import com.fr.log.FineLoggerFactory; import com.fr.main.impl.WorkBook; import com.fr.nx.cptx.utils.CptxFileUtils; @@ -35,16 +36,17 @@ public class CptxApp extends AbstractAppProvider { */ @Override public JTemplate openTemplate(FILE tplFile) { - WorkBook workBook = CptxFileUtils.getWorkBook(CptxFileUtils.getFormatPath(tplFile.getPath())); - if (workBook == null) { - workBook = new WorkBook(); - } - return new JStreamBook(workBook, tplFile); + return new JStreamBook(asIOFile(tplFile), tplFile); } @Override public WorkBook asIOFile(FILE file) { - WorkBook workBook = CptxFileUtils.getWorkBook(CptxFileUtils.getFormatPath(file.getPath())); + WorkBook workBook = null; + try { + workBook = CptxFileUtils.getWorkBook(file.asInputStream()); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } if (workBook == null) { workBook = new WorkBook(); }