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
7d488592
Commit
7d488592
authored
Jul 18, 2023
by
Ryan Loong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 点名次数筛选失效的bug
parent
3783b0bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
StudentInfoService.java
...xploring/engine/server/db/service/StudentInfoService.java
+10
-5
StudentPointService.java
...ploring/engine/server/db/service/StudentPointService.java
+14
-7
No files found.
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentInfoService.java
View file @
7d488592
...
...
@@ -174,12 +174,17 @@ public class StudentInfoService {
}
Map
<
Integer
,
Integer
>
callTimeMap
=
studentPointService
.
countByClassGroupByStudent
(
classId
);
if
(
Objects
.
nonNull
(
minCall
)
||
Objects
.
nonNull
(
maxCall
))
{
List
<
Integer
>
excluded
=
callTimeMap
.
entrySet
().
stream
()
.
filter
(
entry
->
(
Objects
.
nonNull
(
minCall
)
&&
entry
.
getValue
()
<
minCall
)
||
(
Objects
.
nonNull
(
maxCall
)
&&
entry
.
getValue
()
>
maxCall
))
.
map
(
Map
.
Entry
::
getKey
).
collect
(
Collectors
.
toList
());
if
(
Objects
.
nonNull
(
minCall
))
{
List
<
Integer
>
included
=
callTimeMap
.
entrySet
().
stream
().
filter
(
entry
->
entry
.
getValue
()
>=
minCall
).
map
(
Map
.
Entry
::
getKey
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
included
))
{
criteria
.
andIdEqualTo
(-
1
);
}
else
{
criteria
.
andIdIn
(
included
);
}
}
if
(
Objects
.
nonNull
(
maxCall
))
{
List
<
Integer
>
excluded
=
callTimeMap
.
entrySet
().
stream
().
filter
(
entry
->
entry
.
getValue
()
>
maxCall
).
map
(
Map
.
Entry
::
getKey
).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
excluded
))
{
criteria
.
andIdNotIn
(
excluded
);
}
...
...
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentPointService.java
View file @
7d488592
...
...
@@ -5,10 +5,12 @@ import cn.exploring.engine.server.db.dao.StudentPointInfoMapper;
import
cn.exploring.engine.server.db.domain.StudentInfo
;
import
cn.exploring.engine.server.db.domain.StudentPointInfo
;
import
cn.exploring.engine.server.db.domain.StudentPointInfoExample
;
import
cn.exploring.engine.server.db.domain.vo.StudentInfoExcelImportVo
;
import
cn.exploring.engine.server.db.domain.vo.StudentPointExcelExportVo
;
import
cn.exploring.engine.server.db.util.StrUtil
;
import
cn.exploring.engine.server.db.util.Util
;
import
com.alibaba.excel.EasyExcel
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -16,7 +18,6 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.StringUtils
;
import
javax.annotation.Resource
;
import
javax.print.attribute.IntegerSyntax
;
import
java.io.File
;
import
java.io.IOException
;
import
java.time.LocalDateTime
;
...
...
@@ -27,6 +28,8 @@ import java.util.stream.Collectors;
@Service
public
class
StudentPointService
{
public
static
final
Log
log
=
LogFactory
.
getLog
(
StudentPointService
.
class
);
@Resource
StudentPointInfoMapper
studentPointInfoMapper
;
...
...
@@ -117,13 +120,17 @@ public class StudentPointService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
removeByStudentId
(
Integer
studentId
)
{
studentPointInfoMapper
.
updateByExampleSelective
(
new
StudentPointInfo
(){{
setUpdateTime
(
LocalDateTime
.
now
());
setDeleted
(
StudentPointInfo
.
IS_DELETED
);
}},
new
StudentPointInfoExample
().
createCriteria
()
StudentPointInfo
record
=
new
StudentPointInfo
();
record
.
setUpdateTime
(
LocalDateTime
.
now
());
record
.
setDeleted
(
true
);
int
i
=
studentPointInfoMapper
.
updateByExampleSelective
(
record
,
new
StudentPointInfoExample
().
createCriteria
()
.
andDeletedEqualTo
(
StudentPointInfo
.
NOT_DELETED
)
.
andStudentIdEqualTo
(
studentId
)
.
example
());
.
example
());
log
.
info
(
StrUtil
.
format
(
"【成绩服务】已批量删除成绩 学生ID:'{}' 删除数量: '{}'"
,
studentId
,
i
));
}
@Transactional
(
propagation
=
Propagation
.
NOT_SUPPORTED
,
readOnly
=
true
)
...
...
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