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 32c10fec
authored
Jan 11, 2021
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/back_end_dev' into back_end_dev
2 parents
368a13b2
3e03e6cb
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 @
32c10fe
...
@@ -129,7 +129,7 @@ public class WePosterSubassembly extends BaseEntity {
...
@@ -129,7 +129,7 @@ public class WePosterSubassembly extends BaseEntity {
private
Integer
rotate
;
private
Integer
rotate
;
@TableField
@TableField
@ApiModelProperty
(
"字体类型 0 通常 1 粗体 2 斜体"
)
@ApiModelProperty
(
"字体类型 0 通常 1 粗体 2 斜体
3 粗体+斜体
"
)
private
Integer
fontStyle
=
0
;
private
Integer
fontStyle
=
0
;
@TableField
(
value
=
"`order`"
)
@TableField
(
value
=
"`order`"
)
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WePosterFontServiceImpl.java
View file @
32c10fe
...
@@ -55,13 +55,16 @@ public class WePosterFontServiceImpl extends ServiceImpl<WePosterFontMapper,WePo
...
@@ -55,13 +55,16 @@ public class WePosterFontServiceImpl extends ServiceImpl<WePosterFontMapper,WePo
@Override
@Override
public
Font
getFont
(
Long
id
,
Integer
size
,
Integer
fontStyle
)
{
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
(
id
==
null
||
id
.
equals
(
0L
)){
if
(
fontStyle
>
0
){
return
DEFAULT_FONT
.
deriveFont
(
fontType
,(
float
)
size
);
return
DEFAULT_FONT
.
deriveFont
(
fontStyle
.
equals
(
1
)?
Font
.
BOLD
:
Font
.
ITALIC
,(
float
)
size
);
}
else
{
return
DEFAULT_FONT
.
deriveFont
((
float
)
size
);
}
}
}
WePosterFont
posterFont
=
this
.
getById
(
id
);
WePosterFont
posterFont
=
this
.
getById
(
id
);
if
(
posterFont
==
null
){
if
(
posterFont
==
null
){
...
@@ -75,7 +78,7 @@ public class WePosterFontServiceImpl extends ServiceImpl<WePosterFontMapper,WePo
...
@@ -75,7 +78,7 @@ public class WePosterFontServiceImpl extends ServiceImpl<WePosterFontMapper,WePo
try
{
try
{
font
=
Font
.
createFont
(
Font
.
TRUETYPE_FONT
,
byteArrayInputStream
);
font
=
Font
.
createFont
(
Font
.
TRUETYPE_FONT
,
byteArrayInputStream
);
FONT_MAP
.
put
(
posterFont
.
getId
(),
font
);
FONT_MAP
.
put
(
posterFont
.
getId
(),
font
);
font
=
font
.
deriveFont
((
float
)
size
);
font
=
font
.
deriveFont
(
fontType
,
(
float
)
size
);
return
font
;
return
font
;
}
catch
(
FontFormatException
e
)
{
}
catch
(
FontFormatException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WePosterServiceImpl.java
View file @
32c10fe
...
@@ -120,6 +120,7 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
...
@@ -120,6 +120,7 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
@Override
@Override
public
String
generateSimpleImg
(
WePoster
poster
)
{
public
String
generateSimpleImg
(
WePoster
poster
)
{
if
(
CollectionUtils
.
isEmpty
(
poster
.
getPosterSubassemblyList
())){
if
(
CollectionUtils
.
isEmpty
(
poster
.
getPosterSubassemblyList
())){
poster
.
setSampleImgPath
(
poster
.
getBackgroundImgPath
());
return
poster
.
getBackgroundImgPath
();
return
poster
.
getBackgroundImgPath
();
}
}
Map
<
Long
,
Font
>
fontMap
=
poster
.
getPosterSubassemblyList
().
stream
().
filter
(
wePosterSubassembly
->
wePosterSubassembly
.
getType
().
equals
(
1
))
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