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
48958ac7
Commit
48958ac7
authored
Nov 30, 2024
by
霍传世
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report
parent
57d6505c
Pipeline
#240
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
13 deletions
+12
-13
src/main/java/com/example/studentworkgenerator/config/DataCacheInit.java
...om/example/studentworkgenerator/config/DataCacheInit.java
+2
-2
src/main/java/com/example/studentworkgenerator/controller/studentPaperReportGeneratorController.java
...tor/controller/studentPaperReportGeneratorController.java
+8
-9
src/main/java/com/example/studentworkgenerator/dto/Province.java
...n/java/com/example/studentworkgenerator/dto/Province.java
+1
-1
src/main/java/com/example/studentworkgenerator/dto/School.java
...ain/java/com/example/studentworkgenerator/dto/School.java
+1
-1
No files found.
src/main/java/com/example/studentworkgenerator/config/DataCacheInit.java
View file @
48958ac7
...
...
@@ -15,9 +15,9 @@ import java.util.Map;
@Component
public
class
DataCacheInit
{
public
static
final
Map
<
String
,
Integer
>
schoolMaps
=
new
HashMap
<>();
public
static
final
Map
<
String
,
Long
>
schoolMaps
=
new
HashMap
<>();
public
static
final
Map
<
String
,
Integer
>
provinceMaps
=
new
HashMap
<>();
public
static
final
Map
<
String
,
Long
>
provinceMaps
=
new
HashMap
<>();
@Resource
private
JdbcTemplate
BaoMingJdbcTemplate
;
...
...
src/main/java/com/example/studentworkgenerator/controller/studentPaperReportGeneratorController.java
View file @
48958ac7
package
com.example.studentworkgenerator.controller
;
import
com.example.studentworkgenerator.config.DataCacheInit
;
import
com.qcloud.cos.COSClient
;
import
com.qcloud.cos.exception.CosClientException
;
...
...
@@ -48,10 +47,10 @@ public class studentPaperReportGeneratorController {
if
(!(
null
==
provinceName
)&&
null
==
schoolName
){
List
<
String
>
provinceList
=
Arrays
.
asList
(
provinceName
.
split
(
"#"
));
List
<
Integer
>
provinceIds
=
provinceList
.
stream
().
map
(
x
->(
int
)
DataCacheInit
.
provinceMaps
.
get
(
x
)).
collect
(
Collectors
.
toList
());
List
<
Long
>
provinceIds
=
provinceList
.
stream
().
map
(
x
->(
Long
)
DataCacheInit
.
provinceMaps
.
get
(
x
)).
collect
(
Collectors
.
toList
());
String
provinceStatement
=
" ( "
;
int
i
=
1
;
for
(
Integer
provinceId
:
provinceIds
)
{
for
(
Long
provinceId
:
provinceIds
)
{
if
(
i
==
provinceIds
.
size
()){
provinceStatement
=
provinceStatement
+
" ) "
;
}
else
{
...
...
@@ -64,10 +63,10 @@ public class studentPaperReportGeneratorController {
if
(!(
null
==
schoolName
)&&
null
==
provinceName
){
List
<
String
>
schoolList
=
Arrays
.
asList
(
schoolName
.
split
(
"#"
));
List
<
Integer
>
schoolIds
=
schoolList
.
stream
().
map
(
x
->(
int
)
DataCacheInit
.
provinceMaps
.
get
(
x
)).
collect
(
Collectors
.
toList
());
List
<
Long
>
schoolIds
=
schoolList
.
stream
().
map
(
x
->(
Long
)
DataCacheInit
.
provinceMaps
.
get
(
x
)).
collect
(
Collectors
.
toList
());
String
schoolStatement
=
" ( "
;
int
i
=
1
;
for
(
Integer
schoolId
:
schoolIds
)
{
for
(
Long
schoolId
:
schoolIds
)
{
if
(
i
==
schoolIds
.
size
()){
schoolStatement
=
schoolStatement
+
" ) "
;
}
else
{
...
...
@@ -80,10 +79,10 @@ public class studentPaperReportGeneratorController {
if
(!(
null
==
schoolName
)&&!(
null
==
provinceName
)){
List
<
String
>
provinceList
=
Arrays
.
asList
(
provinceName
.
split
(
"#"
));
List
<
Integer
>
provinceIds
=
provinceList
.
stream
().
map
(
x
->(
int
)
DataCacheInit
.
provinceMaps
.
get
(
x
)).
collect
(
Collectors
.
toList
());
List
<
Long
>
provinceIds
=
provinceList
.
stream
().
map
(
x
->(
Long
)
DataCacheInit
.
provinceMaps
.
get
(
x
)).
collect
(
Collectors
.
toList
());
String
provinceStatement
=
" ( "
;
int
i
=
1
;
for
(
Integer
provinceId
:
provinceIds
)
{
for
(
Long
provinceId
:
provinceIds
)
{
if
(
i
==
provinceIds
.
size
()){
provinceStatement
=
provinceStatement
+
" ) "
;
}
else
{
...
...
@@ -93,10 +92,10 @@ public class studentPaperReportGeneratorController {
}
appendStatement
=
appendStatement
+
" where province_id in "
+
provinceStatement
;
List
<
String
>
schoolList
=
Arrays
.
asList
(
schoolName
.
split
(
"#"
));
List
<
Integer
>
schoolIds
=
schoolList
.
stream
().
map
(
x
->(
int
)
DataCacheInit
.
provinceMaps
.
get
(
x
)).
collect
(
Collectors
.
toList
());
List
<
Long
>
schoolIds
=
schoolList
.
stream
().
map
(
x
->(
Long
)
DataCacheInit
.
provinceMaps
.
get
(
x
)).
collect
(
Collectors
.
toList
());
String
schoolStatement
=
" ( "
;
int
j
=
1
;
for
(
Integer
schoolId
:
schoolIds
)
{
for
(
Long
schoolId
:
schoolIds
)
{
if
(
j
==
schoolIds
.
size
()){
schoolStatement
=
schoolStatement
+
" ) "
;
}
else
{
...
...
src/main/java/com/example/studentworkgenerator/dto/Province.java
View file @
48958ac7
...
...
@@ -12,7 +12,7 @@ import lombok.ToString;
@ToString
public
class
Province
{
private
Integer
id
;
private
Long
id
;
private
String
name
;
...
...
src/main/java/com/example/studentworkgenerator/dto/School.java
View file @
48958ac7
...
...
@@ -11,7 +11,7 @@ import lombok.ToString;
@ToString
public
class
School
{
private
Integer
id
;
private
Long
id
;
private
String
name
;
...
...
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