Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
张文彪
/
employmentBusinessPc
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ae935183
authored
Dec 17, 2025
by
zwb
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改简历生成html文件添加字体参数
parent
f2f1daef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
employmentBusiness-pc-modules/employmentBusiness-pc-system/src/main/java/com/bkty/system/service/resume/impl/NewEditionResumeServiceImpl.java
employmentBusiness-pc-modules/employmentBusiness-pc-system/src/main/java/com/bkty/system/utils/FileProcessor.java
employmentBusiness-pc-modules/employmentBusiness-pc-system/src/main/java/com/bkty/system/service/resume/impl/NewEditionResumeServiceImpl.java
View file @
ae935183
...
@@ -756,7 +756,7 @@ public class NewEditionResumeServiceImpl implements NewEditionResumeService {
...
@@ -756,7 +756,7 @@ public class NewEditionResumeServiceImpl implements NewEditionResumeService {
String
htmlName
=
resumeId
+
".html"
;
String
htmlName
=
resumeId
+
".html"
;
FileProcessor
.
processFileWithSize
(
properties
.
getPath
()
+
"template/"
+
templateName
,
properties
.
getPath
()
+
"output/"
+
htmlName
,
"<%- data %>"
,
jsonString
,
"<%- FontSize %>"
,
fontSize
,
"<%- LineHeight %>"
,
lineHeight
);
FileProcessor
.
processFileWithSize
(
properties
.
getPath
()
+
"template/"
+
templateName
,
properties
.
getPath
()
+
"output/"
+
htmlName
,
jsonString
,
fontSize
,
lineHeight
);
redisTemplate
.
opsForValue
().
set
(
CacheConstants
.
CREATE_RESUME_HTML_DATA
.
formatted
(
resumeId
),
jsonString
);
redisTemplate
.
opsForValue
().
set
(
CacheConstants
.
CREATE_RESUME_HTML_DATA
.
formatted
(
resumeId
),
jsonString
);
redisTemplate
.
opsForValue
().
set
(
CacheConstants
.
CREATE_RESUME_HTML
.
formatted
(
resumeId
),
properties
.
getHtmlDown
()
+
htmlName
);
redisTemplate
.
opsForValue
().
set
(
CacheConstants
.
CREATE_RESUME_HTML
.
formatted
(
resumeId
),
properties
.
getHtmlDown
()
+
htmlName
);
...
...
employmentBusiness-pc-modules/employmentBusiness-pc-system/src/main/java/com/bkty/system/utils/FileProcessor.java
View file @
ae935183
...
@@ -7,6 +7,9 @@ import java.nio.charset.StandardCharsets;
...
@@ -7,6 +7,9 @@ import java.nio.charset.StandardCharsets;
public
class
FileProcessor
{
public
class
FileProcessor
{
private
static
String
OLD_DATA
=
"<%- data %>"
;
private
static
String
OLD_DONTSIZE
=
"<%- FontSize %>"
;
private
static
String
OLD_LINEHEIGHT
=
"<%- LineHeight %>"
;
/**
/**
* 读取服务器路径上的文件,替换字符串并生成HTML文件
* 读取服务器路径上的文件,替换字符串并生成HTML文件
* @param sourceFilePath 原文件路径
* @param sourceFilePath 原文件路径
...
@@ -34,7 +37,7 @@ public class FileProcessor {
...
@@ -34,7 +37,7 @@ public class FileProcessor {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
public
static
void
processFileWithSize
(
String
sourceFilePath
,
String
targetFilePath
,
String
oldData
,
String
newData
,
String
oldFontSize
,
String
newFontSize
,
String
oldLineHeight
,
String
newLineHeight
)
{
public
static
void
processFileWithSize
(
String
sourceFilePath
,
String
targetFilePath
,
String
newData
,
String
newFontSize
,
String
newLineHeight
)
{
File
sourceFile
=
new
File
(
sourceFilePath
);
File
sourceFile
=
new
File
(
sourceFilePath
);
File
targetFile
=
new
File
(
targetFilePath
);
File
targetFile
=
new
File
(
targetFilePath
);
...
@@ -46,15 +49,9 @@ public class FileProcessor {
...
@@ -46,15 +49,9 @@ public class FileProcessor {
while
((
line
=
reader
.
readLine
())
!=
null
)
{
while
((
line
=
reader
.
readLine
())
!=
null
)
{
// 替换字符串
// 替换字符串
String
processedLine
=
line
;
String
processedLine
=
line
;
if
(!
oldData
.
isEmpty
()
&&
!
newData
.
isEmpty
())
{
processedLine
=
processedLine
.
replace
(
OLD_DATA
,
newData
);
processedLine
=
processedLine
.
replace
(
oldData
,
newData
);
processedLine
=
processedLine
.
replace
(
OLD_DONTSIZE
,
newFontSize
);
}
processedLine
=
processedLine
.
replace
(
OLD_LINEHEIGHT
,
newLineHeight
);
if
(!
oldFontSize
.
isEmpty
()
&&
!
newFontSize
.
isEmpty
())
{
processedLine
=
processedLine
.
replace
(
oldFontSize
,
newFontSize
);
}
if
(!
oldLineHeight
.
isEmpty
()
&&
!
newLineHeight
.
isEmpty
())
{
processedLine
=
processedLine
.
replace
(
oldLineHeight
,
newLineHeight
);
}
writer
.
write
(
processedLine
);
writer
.
write
(
processedLine
);
writer
.
newLine
();
// 写入换行符
writer
.
newLine
();
// 写入换行符
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment