Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elleai
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
ai-tech
E
ellehuis-group
backend
elleai
Commits
d4a1e3b9
Commit
d4a1e3b9
authored
Oct 24, 2024
by
陈立彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对练列表返回对练练习次数
parent
6d150b86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
AppExamineService.java
.../breeze/elleai/application/service/AppExamineService.java
+20
-12
No files found.
src/main/java/cn/breeze/elleai/application/service/AppExamineService.java
View file @
d4a1e3b9
...
...
@@ -487,7 +487,7 @@ public class AppExamineService {
if
(
CollectionUtil
.
isNotEmpty
(
recordList
))
{
examCount
=
recordList
.
stream
().
filter
(
v
->
Objects
.
equals
(
v
.
getExamineMode
(),
1
)).
count
();
examTotalCount
=
recordList
.
size
();
practiceCount
=
examTotalCount
-
exam
Total
Count
;
practiceCount
=
examTotalCount
-
examCount
;
maxOverallScore
=
recordList
.
stream
().
filter
(
v
->
Objects
.
nonNull
(
v
.
getOverallScore
())).
mapToDouble
(
ExamineRecordResponseModel:
:
getOverallScore
).
max
().
getAsDouble
();
}
...
...
@@ -666,28 +666,36 @@ public class AppExamineService {
PageResult
<
ExamineMobileDto
>
pageResult
=
PageResult
.
of
(
request
.
getPageNo
(),
request
.
getPageSize
(),
(
int
)
page
.
getTotalRow
(),
null
);
if
(
CollectionUtil
.
isNotEmpty
(
page
.
getRecords
()))
{
ExamineRecordRequestModel
rm
=
new
ExamineRecordRequestModel
();
rm
.
setUserId
(
userPrincipal
.
getUserId
());
List
<
ExamineRecordResponseModel
>
userRecordList
=
examineService
.
examineRecordList
(
rm
);
List
<
ExamineMobileDto
>
dtoList
=
page
.
getRecords
().
stream
().
map
(
v
->
{
ExamineMobileDto
dto
=
BeanUtil
.
copyProperties
(
v
,
ExamineMobileDto
.
class
);
// 已考人数
long
examTotalCount
=
0
;
// 考试次数
long
examCount
=
0
;
long
practiceCount
=
0
;
double
maxOverallScore
=
0
;
ExamineRecordRequestModel
req
=
new
ExamineRecordRequestModel
();
req
.
setExamineId
(
v
.
getId
());
List
<
ExamineRecordResponseModel
>
recordList
=
examineService
.
examineRecordList
(
req
);
if
(
CollectionUtil
.
isNotEmpty
(
recordList
))
{
examCount
=
recordList
.
size
();
}
dto
.
setExamTotalCount
(
examCount
);
examTotalCount
=
recordList
.
size
();
// 是否已考
long
count
=
userRecordList
.
stream
().
filter
(
u
->
Objects
.
equals
(
u
.
getExamineId
(),
v
.
getId
())).
count
();
if
(
count
>
0
)
{
dto
.
setExamFlag
(
true
);
examCount
=
recordList
.
stream
().
filter
(
r
->
Objects
.
equals
(
r
.
getExamineMode
(),
1
)).
count
();
practiceCount
=
examTotalCount
-
examCount
;
maxOverallScore
=
recordList
.
stream
().
filter
(
r
->
Objects
.
nonNull
(
r
.
getOverallScore
())).
mapToDouble
(
ExamineRecordResponseModel:
:
getOverallScore
).
max
().
getAsDouble
();
// 是否已考
long
count
=
recordList
.
stream
().
filter
(
r
->
Objects
.
equals
(
r
.
getUserId
(),
userPrincipal
.
getUserId
())).
count
();
if
(
count
>
0
)
{
dto
.
setExamFlag
(
true
);
}
}
dto
.
setExamTotalCount
(
examTotalCount
);
dto
.
setMaxOverallScore
(
maxOverallScore
);
dto
.
setExamCount
(
examCount
);
dto
.
setPracticeCount
(
practiceCount
);
return
dto
;
}).
collect
(
Collectors
.
toList
());
...
...
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