Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3e03e6cb
authored
Jan 11, 2021
by
ws
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
海报修改
1 parent
66850b3c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WePosterSubassembly.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WePosterFontServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WePosterServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WePosterSubassembly.java
View file @
3e03e6c
...
...
@@ -129,7 +129,7 @@ public class WePosterSubassembly extends BaseEntity {
private
Integer
rotate
;
@TableField
@ApiModelProperty
(
"字体类型 0 通常 1 粗体 2 斜体"
)
@ApiModelProperty
(
"字体类型 0 通常 1 粗体 2 斜体
3 粗体+斜体
"
)
private
Integer
fontStyle
=
0
;
@TableField
(
value
=
"`order`"
)
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WePosterFontServiceImpl.java
View file @
3e03e6c
...
...
@@ -55,13 +55,16 @@ public class WePosterFontServiceImpl extends ServiceImpl<WePosterFontMapper,WePo
@Override
public
Font
getFont
(
Long
id
,
Integer
size
,
Integer
fontStyle
)
{
int
fontType
=
Font
.
PLAIN
;
if
(
fontStyle
.
equals
(
1
)){
fontType
=
Font
.
BOLD
;
}
else
if
(
fontStyle
.
equals
(
2
)){
fontType
=
Font
.
ITALIC
;
}
else
if
(
fontStyle
.
equals
(
3
)){
fontType
=
Font
.
BOLD
+
Font
.
ITALIC
;
}
if
(
id
==
null
||
id
.
equals
(
0L
)){
if
(
fontStyle
>
0
){
return
DEFAULT_FONT
.
deriveFont
(
fontStyle
.
equals
(
1
)?
Font
.
BOLD
:
Font
.
ITALIC
,(
float
)
size
);
}
else
{
return
DEFAULT_FONT
.
deriveFont
((
float
)
size
);
}
return
DEFAULT_FONT
.
deriveFont
(
fontType
,(
float
)
size
);
}
WePosterFont
posterFont
=
this
.
getById
(
id
);
if
(
posterFont
==
null
){
...
...
@@ -75,7 +78,7 @@ public class WePosterFontServiceImpl extends ServiceImpl<WePosterFontMapper,WePo
try
{
font
=
Font
.
createFont
(
Font
.
TRUETYPE_FONT
,
byteArrayInputStream
);
FONT_MAP
.
put
(
posterFont
.
getId
(),
font
);
font
=
font
.
deriveFont
((
float
)
size
);
font
=
font
.
deriveFont
(
fontType
,
(
float
)
size
);
return
font
;
}
catch
(
FontFormatException
e
)
{
e
.
printStackTrace
();
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WePosterServiceImpl.java
View file @
3e03e6c
...
...
@@ -120,6 +120,7 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
@Override
public
String
generateSimpleImg
(
WePoster
poster
)
{
if
(
CollectionUtils
.
isEmpty
(
poster
.
getPosterSubassemblyList
())){
poster
.
setSampleImgPath
(
poster
.
getBackgroundImgPath
());
return
poster
.
getBackgroundImgPath
();
}
Map
<
Long
,
Font
>
fontMap
=
poster
.
getPosterSubassemblyList
().
stream
().
filter
(
wePosterSubassembly
->
wePosterSubassembly
.
getType
().
equals
(
1
))
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment