Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
tjmdp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
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
other-project
tjmdp
Commits
237ee3b6
Commit
237ee3b6
authored
Apr 30, 2019
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改证书模板
parent
9a6c9942
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
15 deletions
+21
-15
MdpController.java
src/main/java/com/qiankun/controller/mdp/MdpController.java
+11
-8
UserUtils.java
src/main/java/com/qiankun/utils/UserUtils.java
+10
-7
certificate.jpeg
src/main/resources/certificate.jpeg
+0
-0
certificate.png
src/main/resources/certificate.png
+0
-0
No files found.
src/main/java/com/qiankun/controller/mdp/MdpController.java
View file @
237ee3b6
...
@@ -65,7 +65,7 @@ public class MdpController extends BaseController<Object> {
...
@@ -65,7 +65,7 @@ public class MdpController extends BaseController<Object> {
return
propertis
.
getConfigs
().
get
(
1
).
getAppid
();
return
propertis
.
getConfigs
().
get
(
1
).
getAppid
();
}
}
private
String
uploadAvatarPath
=
File
.
separator
+
"mdp"
+
File
.
separator
+
"uploadAvatar"
;
private
String
uploadAvatarPath
=
File
.
separator
+
"mdp"
+
File
.
separator
+
"uploadAvatar"
;
private
String
certificateTemplate
=
"classpath:certificate.
jpe
g"
;
private
String
certificateTemplate
=
"classpath:certificate.
pn
g"
;
private
String
userCertificatePath
=
File
.
separator
+
"mdp"
+
File
.
separator
+
"certificate"
;
private
String
userCertificatePath
=
File
.
separator
+
"mdp"
+
File
.
separator
+
"certificate"
;
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
@Auth
(
verifyLogin
=
false
,
verifyURL
=
false
)
...
@@ -484,14 +484,17 @@ public class MdpController extends BaseController<Object> {
...
@@ -484,14 +484,17 @@ public class MdpController extends BaseController<Object> {
List
<
CertificateVo
>
addTexts
=
Lists
.
newArrayList
();
List
<
CertificateVo
>
addTexts
=
Lists
.
newArrayList
();
Calendar
now
=
Calendar
.
getInstance
();
Calendar
now
=
Calendar
.
getInstance
();
addTexts
.
add
(
new
CertificateVo
(
user
.
getName
(),
new
Font
(
"宋体"
,
Font
.
BOLD
,
50
),
200
,
600
));
String
year
=
now
.
get
(
Calendar
.
YEAR
)
+
""
;
addTexts
.
add
(
new
CertificateVo
(
code
,
new
Font
(
"宋体"
,
Font
.
BOLD
,
30
),
280
,
1310
));
String
month
=
now
.
get
(
Calendar
.
MONTH
)
+
1
>=
10
?
""
+
(
now
.
get
(
Calendar
.
MONTH
)
+
1
)
:
"0"
+
(
now
.
get
(
Calendar
.
MONTH
)
+
1
);
addTexts
.
add
(
new
CertificateVo
(
now
.
get
(
Calendar
.
YEAR
)+
""
,
new
Font
(
"宋体"
,
Font
.
PLAIN
,
30
),
550
,
1245
));
String
day
=
now
.
get
(
Calendar
.
DATE
)
>=
10
?
""
+
now
.
get
(
Calendar
.
DATE
)
:
"0"
+
now
.
get
(
Calendar
.
DATE
);
addTexts
.
add
(
new
CertificateVo
(
now
.
get
(
Calendar
.
MONTH
)
+
1
+
""
,
new
Font
(
"宋体"
,
Font
.
PLAIN
,
30
),
680
,
1245
));
addTexts
.
add
(
new
CertificateVo
(
user
.
getName
(),
new
Font
(
"宋体"
,
Font
.
BOLD
,
50
),
190
,
570
));
addTexts
.
add
(
new
CertificateVo
(
now
.
get
(
Calendar
.
DATE
)+
""
,
new
Font
(
"宋体"
,
Font
.
PLAIN
,
30
),
790
,
1245
));
addTexts
.
add
(
new
CertificateVo
(
code
,
new
Font
(
"宋体"
,
Font
.
BOLD
,
30
),
270
,
1265
));
String
outputFilePath
=
rb
.
getString
(
"file_path"
)
+
this
.
userCertificatePath
+
File
.
separator
+
user
.
getId
()
+
".jpeg"
;
addTexts
.
add
(
new
CertificateVo
(
year
,
new
Font
(
"宋体"
,
Font
.
PLAIN
,
30
),
525
,
1200
));
addTexts
.
add
(
new
CertificateVo
(
month
,
new
Font
(
"宋体"
,
Font
.
PLAIN
,
30
),
650
,
1200
));
addTexts
.
add
(
new
CertificateVo
(
day
,
new
Font
(
"宋体"
,
Font
.
PLAIN
,
30
),
740
,
1200
));
String
outputFilePath
=
rb
.
getString
(
"file_path"
)
+
this
.
userCertificatePath
+
File
.
separator
+
user
.
getId
()
+
".png"
;
UserUtils
.
generateCertificate
(
this
.
certificateTemplate
,
outputFilePath
,
addTexts
);
UserUtils
.
generateCertificate
(
this
.
certificateTemplate
,
outputFilePath
,
addTexts
);
user
.
setCerfificatePath
(
this
.
userCertificatePath
+
File
.
separator
+
user
.
getId
()
+
".
jpe
g"
);
user
.
setCerfificatePath
(
this
.
userCertificatePath
+
File
.
separator
+
user
.
getId
()
+
".
pn
g"
);
}
}
private
String
getCollectBloodCode
(
User
user
)
{
private
String
getCollectBloodCode
(
User
user
)
{
...
...
src/main/java/com/qiankun/utils/UserUtils.java
View file @
237ee3b6
...
@@ -111,16 +111,19 @@ public class UserUtils {
...
@@ -111,16 +111,19 @@ public class UserUtils {
// }
// }
List<CertificateVo> addTexts = Lists.newArrayList();
List<CertificateVo> addTexts = Lists.newArrayList();
Calendar now = Calendar.getInstance();
Calendar now = Calendar.getInstance();
addTexts.add(new CertificateVo("刘扬",new Font("宋体",Font.PLAIN,50),200,600));
String year = now.get(Calendar.YEAR) + "";
addTexts.add(new CertificateVo("0222189765",new Font("宋体",Font.PLAIN,30),280,1310));
String month = now.get(Calendar.MONTH) + 1 >=10 ? "" + (now.get(Calendar.MONTH) + 1) : "0" + (now.get(Calendar.MONTH) + 1);
addTexts.add(new CertificateVo(now.get(Calendar.YEAR)+"",new Font("宋体",Font.PLAIN,30),550,1245));
String day = now.get(Calendar.DATE) >=10 ? "" + now.get(Calendar.DATE) : "0" + now.get(Calendar.DATE);
addTexts.add(new CertificateVo(now.get(Calendar.MONTH) +1+"",new Font("宋体",Font.PLAIN,30),690,1245));
addTexts.add(new CertificateVo("刘扬",new Font("宋体",Font.BOLD,50),190,570));
addTexts.add(new CertificateVo(now.get(Calendar.DATE)+"",new Font("宋体",Font.PLAIN,30),790,1245));
addTexts.add(new CertificateVo("02223456",new Font("宋体",Font.BOLD,30),270,1265));
UserUtils.generateCertificate("classpath:certificate.jpeg","/Users/liuyang/Pictures/certificate.jpeg",addTexts);
addTexts.add(new CertificateVo(year,new Font("宋体",Font.PLAIN,30),525,1200));
addTexts.add(new CertificateVo(month,new Font("宋体",Font.PLAIN,30),650,1200));
addTexts.add(new CertificateVo(day,new Font("宋体",Font.PLAIN,30),740,1200));
UserUtils.generateCertificate("classpath:certificate.png","/Users/liuyang/Pictures/certificate.png",addTexts);
}catch (IOException e){
}catch (IOException e){
e.printStackTrace();;
e.printStackTrace();;
}
}
}
}
*/
*/
}
}
src/main/resources/certificate.jpeg
deleted
100644 → 0
View file @
9a6c9942
424 KB
src/main/resources/certificate.png
0 → 100644
View file @
237ee3b6
506 KB
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