Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
bc132aba
Commit
bc132aba
authored
Sep 06, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):打印时添加list类型的转义处理
parent
5131349e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
WordTemplateUtils.java
...join/amos/boot/module/jg/biz/utils/WordTemplateUtils.java
+19
-3
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/utils/WordTemplateUtils.java
View file @
bc132aba
...
...
@@ -20,9 +20,7 @@ import java.io.*;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.*
;
@Slf4j
public
class
WordTemplateUtils
{
...
...
@@ -239,6 +237,8 @@ public class WordTemplateUtils {
escapedMap
.
put
(
key
,
escapeValue
((
String
)
value
));
}
else
if
(
value
instanceof
Map
)
{
escapedMap
.
put
(
key
,
escapeSpecialCharacters
((
Map
<
String
,
Object
>)
value
));
}
else
if
(
value
instanceof
List
)
{
escapedMap
.
put
(
key
,
escapeList
((
List
<?>)
value
));
}
else
{
escapedMap
.
put
(
key
,
value
);
}
...
...
@@ -246,6 +246,22 @@ public class WordTemplateUtils {
return
escapedMap
;
}
private
static
List
<
Object
>
escapeList
(
List
<?>
inputList
)
{
List
<
Object
>
escapedList
=
new
ArrayList
<>();
for
(
Object
value
:
inputList
)
{
if
(
value
instanceof
String
)
{
escapedList
.
add
(
escapeValue
((
String
)
value
));
}
else
if
(
value
instanceof
Map
)
{
escapedList
.
add
(
escapeSpecialCharacters
((
Map
<
String
,
Object
>)
value
));
}
else
if
(
value
instanceof
List
)
{
escapedList
.
add
(
escapeList
((
List
<?>)
value
));
}
else
{
escapedList
.
add
(
value
);
}
}
return
escapedList
;
}
private
static
String
escapeValue
(
String
value
)
{
if
(
value
==
null
)
{
return
null
;
...
...
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