人员简历相关接口开发

This commit is contained in:
dxfeng 2022-12-30 09:39:16 +08:00
parent 207081aca2
commit 702092c5a2
1 changed files with 10 additions and 0 deletions

View File

@ -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));