Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StudentPdfGen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
霍传世
StudentPdfGen
Commits
98a8b071
Commit
98a8b071
authored
Dec 01, 2024
by
霍传世
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
记录上传
parent
71a40784
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
src/main/java/com/example/studentworkgenerator/controller/studentPaperReportGeneratorController.java
...tor/controller/studentPaperReportGeneratorController.java
+7
-7
src/main/resources/application.properties
src/main/resources/application.properties
+2
-2
No files found.
src/main/java/com/example/studentworkgenerator/controller/studentPaperReportGeneratorController.java
View file @
98a8b071
...
...
@@ -9,8 +9,8 @@ import com.qcloud.cos.model.PutObjectResult;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.BeanPropertyRowMapper
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -38,9 +38,9 @@ public class studentPaperReportGeneratorController {
private
static
final
String
bucketName
=
"scorereport-1317275686"
;
private
static
final
String
requestHeader
=
"http://localhost:
8080
"
;
private
static
final
String
requestHeader
=
"http://localhost:
18388
"
;
@
Reques
tMapping
(
"/generatorPaperWork"
)
@
Ge
tMapping
(
"/generatorPaperWork"
)
public
String
generatorPaperWork
(
@RequestParam
(
value
=
"schoolName"
,
required
=
false
)
String
schoolName
,
@RequestParam
(
value
=
"provinceName"
,
required
=
false
)
String
provinceName
){
String
sql
=
"select zkz_num from dp_total_score "
;
String
appendStatement
=
""
;
...
...
@@ -117,7 +117,7 @@ public class studentPaperReportGeneratorController {
ProcessBuilder
processBuilderSubject
=
new
ProcessBuilder
();
String
httpRequest
=
requestHeader
+
"/student/taca/20241201/"
+
zkzNum
+
"/md5"
;
String
fileLocalPath
=
"/myworkSpace/jichu/"
+
zkzNum
+
".pdf"
;
processBuilderSubject
.
command
(
"bash"
,
"-c"
,
"node /myworkSpace/puppeteer.js "
+
"https://www.baidu.com "
+
" pdf "
+
fileLocalPath
);
processBuilderSubject
.
command
(
"bash"
,
"-c"
,
"node /myworkSpace/puppeteer.js "
+
httpRequest
+
" pdf "
+
fileLocalPath
);
processBuilderSubject
.
redirectErrorStream
(
true
);
// 合并标准输出和错误输出
Process
processSubject
=
null
;
try
{
...
...
@@ -164,7 +164,7 @@ public class studentPaperReportGeneratorController {
}
@
Reques
tMapping
(
"/generatorLocalPaperWork"
)
@
Ge
tMapping
(
"/generatorLocalPaperWork"
)
public
String
localPaperWork
(
@RequestParam
(
value
=
"schoolName"
,
required
=
false
)
String
schoolName
,
@RequestParam
(
value
=
"provinceName"
,
required
=
false
)
String
provinceName
){
String
sql
=
"select zkz_num from dp_total_score "
;
String
appendStatement
=
""
;
...
...
@@ -241,7 +241,7 @@ public class studentPaperReportGeneratorController {
ProcessBuilder
processBuilderSubject
=
new
ProcessBuilder
();
String
httpRequest
=
requestHeader
+
"/student/taca/20241201/"
+
zkzNum
+
"/md5"
;
String
fileLocalPath
=
"D:/myworkSpace/jichu/"
+
zkzNum
+
".pdf"
;
processBuilderSubject
.
command
(
"cmd.exe"
,
"/c"
,
"node D:/myworkSpace/puppeteer.js "
+
"
http://192.168.1.192:18388/student/taca/20241201/120180396604/xx
"
+
" pdf "
+
fileLocalPath
);
processBuilderSubject
.
command
(
"cmd.exe"
,
"/c"
,
"node D:/myworkSpace/puppeteer.js "
+
"
www.baidu.com
"
+
" pdf "
+
fileLocalPath
);
processBuilderSubject
.
redirectErrorStream
(
true
);
// 合并标准输出和错误输出
Process
processSubject
=
null
;
try
{
...
...
@@ -268,7 +268,7 @@ public class studentPaperReportGeneratorController {
assert
subjectFiles
!=
null
;
for
(
File
file
:
subjectFiles
)
{
String
fileName
=
file
.
getName
();
PutObjectRequest
putObjectRequest
=
new
PutObjectRequest
(
bucketName
,
"/CACA20241201/jichu/"
+
fileName
,
file
);
PutObjectRequest
putObjectRequest
=
new
PutObjectRequest
(
bucketName
,
"/CACA20241201
Test
/jichu/"
+
fileName
,
file
);
try
{
PutObjectResult
putObjectResult
=
cosClient
.
putObject
(
putObjectRequest
);
logger
.
info
(
putObjectResult
.
getRequestId
());
...
...
src/main/resources/application.properties
View file @
98a8b071
spring.application.name
=
studentWorkGenerator
# MySQL Database Configuration
spring.datasource.url
=
jdbc:mysql://192.168.0.
14:3306/tda_2024103
1?useSSL=false&serverTimezone=UTC
spring.datasource.url
=
jdbc:mysql://192.168.0.
95:3306/caca_2024120
1?useSSL=false&serverTimezone=UTC
spring.datasource.username
=
root
spring.datasource.password
=
T
hussat@2023
spring.datasource.password
=
T
da@20241125&#Qpke
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.hikari.maximum-pool-size
=
10
server.port
=
8013
\ No newline at end of file
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