Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
engine-class-work
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
liuchengjiu
engine-class-work
Commits
9448718c
Commit
9448718c
authored
Aug 03, 2023
by
Ryan Loong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 分数统计增加最大和最小分的限制
parent
68f03ce7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
StudentPointService.java
...ploring/engine/server/db/service/StudentPointService.java
+8
-10
PointController.java
...va/cn/exploring/engine/server/wx/web/PointController.java
+6
-4
No files found.
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentPointService.java
View file @
9448718c
...
...
@@ -11,10 +11,7 @@ import cn.exploring.engine.server.db.util.SqlUtil;
import
cn.exploring.engine.server.db.util.StrUtil
;
import
cn.zhxu.bs.BeanSearcher
;
import
cn.zhxu.bs.SearchResult
;
import
cn.zhxu.bs.operator.Contain
;
import
cn.zhxu.bs.operator.Equal
;
import
cn.zhxu.bs.operator.GreaterEqual
;
import
cn.zhxu.bs.operator.LessEqual
;
import
cn.zhxu.bs.operator.*
;
import
cn.zhxu.bs.util.MapBuilder
;
import
cn.zhxu.bs.util.MapUtils
;
import
com.alibaba.excel.EasyExcel
;
...
...
@@ -54,20 +51,20 @@ public class StudentPointService {
@Autowired
BeanSearcher
beanSearcher
;
public
Map
<
String
,
Object
>
selectPointByWeb
(
String
studentName
,
String
studentUniqueId
,
Integer
classId
,
String
startTime
,
String
endTime
,
Integer
page
,
Integer
limit
,
String
sort
,
String
order
)
{
SearchResult
<
StudentPointWithStudentInfoVo
>
result
=
beanSearcher
.
search
(
StudentPointWithStudentInfoVo
.
class
,
SqlUtil
.
page
(
voWrapper
(
studentName
,
studentUniqueId
,
classId
,
startTime
,
endTime
),
page
,
limit
,
sort
,
order
).
build
());
public
Map
<
String
,
Object
>
selectPointByWeb
(
String
studentName
,
String
studentUniqueId
,
Integer
classId
,
String
startTime
,
String
endTime
,
Integer
page
,
Integer
limit
,
String
sort
,
String
order
,
Integer
min
,
Integer
max
)
{
SearchResult
<
StudentPointWithStudentInfoVo
>
result
=
beanSearcher
.
search
(
StudentPointWithStudentInfoVo
.
class
,
SqlUtil
.
page
(
voWrapper
(
studentName
,
studentUniqueId
,
classId
,
startTime
,
endTime
,
min
,
max
),
page
,
limit
,
sort
,
order
).
build
());
return
ImmutableMap
.
of
(
"total"
,
result
.
getTotalCount
().
longValue
(),
"items"
,
result
.
getDataList
());
}
public
File
exportList
(
String
studentName
,
String
studentUniqueId
,
Integer
classId
,
String
startTime
,
String
endTime
)
{
List
<
StudentPointExcelExportVo
>
list
=
beanSearcher
.
searchAll
(
StudentPointWithStudentInfoVo
.
class
,
voWrapper
(
studentName
,
studentUniqueId
,
classId
,
startTime
,
endTime
).
build
())
public
File
exportList
(
String
studentName
,
String
studentUniqueId
,
Integer
classId
,
String
startTime
,
String
endTime
,
String
sort
,
String
order
,
Integer
min
,
Integer
max
)
{
List
<
StudentPointExcelExportVo
>
list
=
beanSearcher
.
searchAll
(
StudentPointWithStudentInfoVo
.
class
,
SqlUtil
.
page
(
voWrapper
(
studentName
,
studentUniqueId
,
classId
,
startTime
,
endTime
,
min
,
max
),
null
,
null
,
sort
,
order
).
build
())
.
stream
().
map
(
StudentPointExcelExportVo:
:
new
).
collect
(
Collectors
.
toList
());
return
transToExcelFile
(
list
);
}
public
MapBuilder
voWrapper
(
String
studentName
,
String
studentUniqueId
,
Integer
classId
,
String
startTime
,
String
endTime
)
{
public
MapBuilder
voWrapper
(
String
studentName
,
String
studentUniqueId
,
Integer
classId
,
String
startTime
,
String
endTime
,
Integer
min
,
Integer
max
)
{
LocalDateTime
start
=
Optional
.
ofNullable
(
startTime
).
filter
(
StringUtils:
:
isNotBlank
).
map
(
s
->
LocalDateTime
.
parse
(
s
,
DateTimeUtil
.
DATE_TIME_FORMATTER3
)).
orElse
(
null
);
LocalDateTime
end
=
Optional
.
ofNullable
(
endTime
).
filter
(
StringUtils:
:
isNotBlank
).
map
(
s
->
LocalDateTime
.
parse
(
s
,
DateTimeUtil
.
DATE_TIME_FORMATTER3
)).
orElse
(
null
);
...
...
@@ -77,7 +74,8 @@ public class StudentPointService {
.
field
(
StudentPointWithStudentInfoVo:
:
getStudentUniqueId
,
studentUniqueId
).
op
(
Contain
.
class
)
.
field
(
StudentPointWithStudentInfoVo:
:
getClassId
,
classId
).
op
(
Equal
.
class
)
.
field
(
StudentPointWithStudentInfoVo:
:
getRecordTime
,
start
).
op
(
GreaterEqual
.
class
)
.
field
(
StudentPointWithStudentInfoVo:
:
getRecordTime
,
end
).
op
(
LessEqual
.
class
);
.
field
(
StudentPointWithStudentInfoVo:
:
getRecordTime
,
end
).
op
(
LessEqual
.
class
)
.
field
(
StudentPointWithStudentInfoVo:
:
getPoint
,
min
,
max
).
op
(
Between
.
class
);
}
/**
...
...
server-wx-api/src/main/java/cn/exploring/engine/server/wx/web/PointController.java
View file @
9448718c
...
...
@@ -36,23 +36,25 @@ public class PointController {
@GetMapping
(
"selectPoint"
)
public
Object
selectPoint
(
@RequestParam
String
studentName
,
@RequestParam
String
studentUniqueId
,
@RequestParam
Integer
classId
,
@RequestParam
String
startTime
,
@RequestParam
String
endTime
,
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
required
=
false
,
defaultValue
=
"10"
)
Integer
limit
,
@RequestParam
(
required
=
false
,
defaultValue
=
"addTime"
)
String
sort
,
@RequestParam
(
required
=
false
,
defaultValue
=
"desc"
)
String
order
)
{
@RequestParam
(
required
=
false
,
defaultValue
=
"addTime"
)
String
sort
,
@RequestParam
(
required
=
false
,
defaultValue
=
"desc"
)
String
order
,
@RequestParam
Integer
min
,
@RequestParam
Integer
max
)
{
studentUniqueId
=
StringUtils
.
isEmpty
(
studentUniqueId
)
?
null
:
studentUniqueId
;
studentName
=
StringUtils
.
isEmpty
(
studentName
)
?
null
:
studentName
;
startTime
=
StringUtils
.
isEmpty
(
startTime
)
?
null
:
startTime
;
endTime
=
StringUtils
.
isEmpty
(
endTime
)
?
null
:
endTime
;
return
ResponseUtil
.
ok
(
pointService
.
selectPointByWeb
(
studentName
,
studentUniqueId
,
classId
,
startTime
,
endTime
,
page
,
limit
,
sort
,
order
));
return
ResponseUtil
.
ok
(
pointService
.
selectPointByWeb
(
studentName
,
studentUniqueId
,
classId
,
startTime
,
endTime
,
page
,
limit
,
sort
,
order
,
min
,
max
));
}
@GetMapping
(
"export"
)
public
Object
export
(
@RequestParam
String
studentName
,
@RequestParam
String
studentUniqueId
,
@RequestParam
Integer
classId
,
@RequestParam
String
startTime
,
@RequestParam
String
endTime
,
@RequestParam
(
required
=
false
,
defaultValue
=
"addTime"
)
String
sort
,
@RequestParam
(
required
=
false
,
defaultValue
=
"desc"
)
String
order
)
{
@RequestParam
(
required
=
false
,
defaultValue
=
"addTime"
)
String
sort
,
@RequestParam
(
required
=
false
,
defaultValue
=
"desc"
)
String
order
,
@RequestParam
Integer
min
,
@RequestParam
Integer
max
)
{
studentUniqueId
=
StringUtils
.
isEmpty
(
studentUniqueId
)
?
null
:
studentUniqueId
;
studentName
=
StringUtils
.
isEmpty
(
studentName
)
?
null
:
studentName
;
startTime
=
StringUtils
.
isEmpty
(
startTime
)
?
null
:
startTime
;
endTime
=
StringUtils
.
isEmpty
(
endTime
)
?
null
:
endTime
;
File
file
=
pointService
.
exportList
(
studentName
,
studentUniqueId
,
classId
,
startTime
,
endTime
);
File
file
=
pointService
.
exportList
(
studentName
,
studentUniqueId
,
classId
,
startTime
,
endTime
,
sort
,
order
,
min
,
max
);
FileInputStream
in
=
null
;
try
{
in
=
new
FileInputStream
(
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