From 724db1936b17219939042613a6e9b869ec6fa6f5 Mon Sep 17 00:00:00 2001 From: gaoxiongzaq Date: Tue, 24 Oct 2023 11:37:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20cad=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E4=BB=A5=E4=B8=8A=E5=8E=8B=E7=BC=A9=E5=8C=85?= =?UTF-8?q?=20=E4=B8=8D=E8=87=AA=E5=8A=A8=E5=88=9B=E5=BB=BA=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/keking/service/FileHandlerService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/src/main/java/cn/keking/service/FileHandlerService.java b/server/src/main/java/cn/keking/service/FileHandlerService.java index 15afc64d..0298d888 100644 --- a/server/src/main/java/cn/keking/service/FileHandlerService.java +++ b/server/src/main/java/cn/keking/service/FileHandlerService.java @@ -327,6 +327,13 @@ public class FileHandlerService implements InitializingBean { */ public String cadToPdf(String inputFilePath, String outputFilePath ,String cadPreviewType) throws Exception { final InterruptionTokenSource source = new InterruptionTokenSource();//CAD延时 + int index = outputFilePath.lastIndexOf("."); + String folder = outputFilePath.substring(0, index); + File path = new File(folder); + //目录不存在 创建新的目录 + if (!path.exists()) { + path.mkdirs(); + } Callable call = () -> { File outputFile = new File(outputFilePath); LoadOptions opts = new LoadOptions();