From 702092c5a261dec174d7e29acecb7d91a82efda9 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Fri, 30 Dec 2022 09:39:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=AE=80=E5=8E=86=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/resume/po/PersonnelResumePO.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/engine/organization/entity/resume/po/PersonnelResumePO.java b/src/com/engine/organization/entity/resume/po/PersonnelResumePO.java index d5d603ff..1206bf87 100644 --- a/src/com/engine/organization/entity/resume/po/PersonnelResumePO.java +++ b/src/com/engine/organization/entity/resume/po/PersonnelResumePO.java @@ -61,6 +61,16 @@ public class PersonnelResumePO { String outPutPath = GCONST.getRootPath() + "hrm" + File.separator + "import" + File.separator + "template" + File.separator + manager.getImageFileName(); File f = new File(outPutPath); + if (!f.exists()) { + String substring = outPutPath.substring(0, outPutPath.lastIndexOf(File.separator)); + File file = new File(substring); + if (file.mkdirs()) { + boolean newFile = f.createNewFile(); + if (!newFile) { + throw new IOException(outPutPath + "文件创建失败"); + } + } + } Thumbnails.of(inputStream).forceSize(100, 120).toFile(f); InputStream fileInputStream = Files.newInputStream(f.toPath()); imageStr = "data:image/" + manager.getImageFileType() + ";base64," + Base64.getEncoder().encodeToString(IOUtils.toByteArray(fileInputStream));