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
50b252fc
Commit
50b252fc
authored
Jul 18, 2023
by
Ryan Loong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 移除部分接口
parent
81da93ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
56 deletions
+33
-56
StudentVo.java
...va/cn/exploring/engine/server/db/domain/vo/StudentVo.java
+0
-9
StudentInfoService.java
...xploring/engine/server/db/service/StudentInfoService.java
+29
-39
StudentPointService.java
...ploring/engine/server/db/service/StudentPointService.java
+0
-4
PointController.java
...va/cn/exploring/engine/server/wx/web/PointController.java
+4
-4
No files found.
server-db/src/main/java/cn/exploring/engine/server/db/domain/vo/StudentVo.java
View file @
50b252fc
...
@@ -7,7 +7,6 @@ import cn.exploring.engine.server.db.domain.StudentInfo;
...
@@ -7,7 +7,6 @@ import cn.exploring.engine.server.db.domain.StudentInfo;
*/
*/
public
class
StudentVo
extends
StudentInfo
{
public
class
StudentVo
extends
StudentInfo
{
public
String
ClassName
;
public
String
ClassName
;
private
Integer
callTimes
;
public
String
getClassName
()
{
public
String
getClassName
()
{
return
ClassName
;
return
ClassName
;
...
@@ -16,12 +15,4 @@ public class StudentVo extends StudentInfo {
...
@@ -16,12 +15,4 @@ public class StudentVo extends StudentInfo {
public
void
setClassName
(
String
className
)
{
public
void
setClassName
(
String
className
)
{
ClassName
=
className
;
ClassName
=
className
;
}
}
public
Integer
getCallTimes
()
{
return
callTimes
;
}
public
void
setCallTimes
(
Integer
callTimes
)
{
this
.
callTimes
=
callTimes
;
}
}
}
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentInfoService.java
View file @
50b252fc
...
@@ -169,19 +169,10 @@ public class StudentInfoService {
...
@@ -169,19 +169,10 @@ public class StudentInfoService {
criteria
.
andClassIdEqualTo
(
classId
);
criteria
.
andClassIdEqualTo
(
classId
);
}
}
Map
<
Integer
,
Integer
>
callTimeMap
=
studentPointService
.
countByClassGroupByStudent
(
classId
);
if
(
Objects
.
nonNull
(
minCall
)
||
Objects
.
nonNull
(
maxCall
))
{
criteria
.
andIdNotIn
(
callTimeMap
.
entrySet
().
stream
()
.
filter
(
entry
->
(
Objects
.
nonNull
(
minCall
)
&&
entry
.
getValue
()
<
minCall
)
||
(
Objects
.
nonNull
(
maxCall
)
&&
entry
.
getValue
()
>
maxCall
))
.
map
(
Map
.
Entry
::
getKey
).
collect
(
Collectors
.
toList
()));
}
PageHelper
.
startPage
(
page
,
limit
);
PageHelper
.
startPage
(
page
,
limit
);
example
.
setOrderByClause
(
sort
+
" "
+
order
);
example
.
setOrderByClause
(
sort
+
" "
+
order
);
List
<
StudentInfo
>
studentInfoList
=
studentInfoMapper
.
selectByExample
(
example
);
List
<
StudentInfo
>
studentInfoList
=
studentInfoMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
studentInfoList
))
{
if
(
CollectionUtils
.
isEmpty
(
studentInfoList
))
{
...
@@ -195,7 +186,6 @@ public class StudentInfoService {
...
@@ -195,7 +186,6 @@ public class StudentInfoService {
StudentVo
voData
=
new
StudentVo
();
StudentVo
voData
=
new
StudentVo
();
BeanUtils
.
copyProperties
(
x
,
voData
);
BeanUtils
.
copyProperties
(
x
,
voData
);
voData
.
setClassName
(
classMap
.
get
(
x
.
getClassId
()));
voData
.
setClassName
(
classMap
.
get
(
x
.
getClassId
()));
voData
.
setCallTimes
(
callTimeMap
.
getOrDefault
(
x
.
getId
(),
0
));
if
(
StringUtils
.
isEmpty
(
x
.
getHead
())
||
x
.
getHead
().
trim
().
equalsIgnoreCase
(
STRING_DEFAULT_HEAD
))
{
if
(
StringUtils
.
isEmpty
(
x
.
getHead
())
||
x
.
getHead
().
trim
().
equalsIgnoreCase
(
STRING_DEFAULT_HEAD
))
{
voData
.
setHead
(
URL_DEFAULT_HEAD
);
voData
.
setHead
(
URL_DEFAULT_HEAD
);
...
@@ -209,35 +199,35 @@ public class StudentInfoService {
...
@@ -209,35 +199,35 @@ public class StudentInfoService {
}};
}};
}
}
/**
//
/**
* 查询可以被点名的学生名单
//
* 查询可以被点名的学生名单
* @param classId 班级ID
//
* @param classId 班级ID
* @param maxCall 排除点名达到指定次数的学生(null为不排除)
//
* @param maxCall 排除点名达到指定次数的学生(null为不排除)
* @return 查询到的list和总数信息
//
* @return 查询到的list和总数信息
*/
//
*/
@Transactional
(
propagation
=
Propagation
.
NOT_SUPPORTED
,
readOnly
=
true
)
//
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public
Map
<
String
,
Object
>
listForCall
(
Integer
classId
,
Integer
maxCall
)
{
//
public Map<String, Object> listForCall(Integer classId, Integer maxCall) {
Set
<
Integer
>
excluded
=
null
;
//
Set<Integer> excluded = null;
if
(
Objects
.
nonNull
(
maxCall
)
&&
maxCall
>
0
)
{
//
if (Objects.nonNull(maxCall) && maxCall > 0) {
excluded
=
studentPointService
.
countByClassGroupByStudent
(
classId
).
entrySet
().
stream
().
filter
(
entry
->
entry
.
getValue
()
>=
maxCall
).
map
(
Map
.
Entry
::
getKey
).
collect
(
Collectors
.
toSet
());
//
excluded = studentPointService.countByClassGroupByStudent(classId).entrySet().stream().filter(entry -> entry.getValue() >= maxCall).map(Map.Entry::getKey).collect(Collectors.toSet());
}
//
}
//
StudentInfoExample
.
Criteria
criteria
=
new
StudentInfoExample
().
createCriteria
()
//
StudentInfoExample.Criteria criteria = new StudentInfoExample().createCriteria()
.
andDeletedEqualTo
(
StudentInfo
.
NOT_DELETED
)
//
.andDeletedEqualTo(StudentInfo.NOT_DELETED)
.
andClassIdEqualTo
(
classId
);
//
.andClassIdEqualTo(classId);
//
if
(
Objects
.
nonNull
(
maxCall
)
&&
maxCall
>
0
)
{
//
if (Objects.nonNull(maxCall) && maxCall > 0) {
criteria
.
andIdNotIn
(
studentPointService
.
countByClassGroupByStudent
(
classId
).
entrySet
().
stream
().
filter
(
entry
->
entry
.
getValue
()
>=
maxCall
).
map
(
Map
.
Entry
::
getKey
).
collect
(
Collectors
.
toList
()));
//
criteria.andIdNotIn(studentPointService.countByClassGroupByStudent(classId).entrySet().stream().filter(entry -> entry.getValue() >= maxCall).map(Map.Entry::getKey).collect(Collectors.toList()));
}
//
}
//
List
<
StudentInfo
>
queryList
=
studentInfoMapper
.
selectByExample
(
criteria
.
example
())
//
List<StudentInfo> queryList = studentInfoMapper.selectByExample(criteria.example())
.
stream
().
peek
(
x
->
{
//
.stream().peek(x -> {
if
(
StringUtils
.
isEmpty
(
x
.
getHead
())
||
x
.
getHead
().
trim
().
equalsIgnoreCase
(
STRING_DEFAULT_HEAD
))
{
//
if (StringUtils.isEmpty(x.getHead()) || x.getHead().trim().equalsIgnoreCase(STRING_DEFAULT_HEAD)) {
x
.
setHead
(
URL_DEFAULT_HEAD
);
//
x.setHead(URL_DEFAULT_HEAD);
}
//
}
}).
collect
(
Collectors
.
toList
());
//
}).collect(Collectors.toList());
return
ImmutableMap
.
of
(
"total"
,
queryList
.
size
(),
"items"
,
queryList
);
//
return ImmutableMap.of("total", queryList.size(), "items", queryList);
}
//
}
public
List
<
StudentInfoExcelImportVo
>
importByExcel
(
MultipartFile
file
)
throws
IOException
{
public
List
<
StudentInfoExcelImportVo
>
importByExcel
(
MultipartFile
file
)
throws
IOException
{
ExcelReaderListener
<
StudentInfoExcelImportVo
>
listener
=
new
StudentInfoExcelReaderListener
();
ExcelReaderListener
<
StudentInfoExcelImportVo
>
listener
=
new
StudentInfoExcelReaderListener
();
...
...
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentPointService.java
View file @
50b252fc
...
@@ -101,10 +101,6 @@ public class StudentPointService {
...
@@ -101,10 +101,6 @@ public class StudentPointService {
.
stream
().
collect
(
Collectors
.
groupingBy
(
StudentPointInfo:
:
getStudentId
,
Collectors
.
toList
()));
.
stream
().
collect
(
Collectors
.
groupingBy
(
StudentPointInfo:
:
getStudentId
,
Collectors
.
toList
()));
}
}
public
Map
<
Integer
,
Integer
>
countByClassGroupByStudent
(
Integer
classId
)
{
return
selectByClassGroupByStudent
(
classId
).
entrySet
().
stream
().
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
entry
->
entry
.
getValue
().
size
()));
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
removeAll
()
{
public
void
removeAll
()
{
studentPointInfoMapper
.
updateByExampleSelective
(
new
StudentPointInfo
(){{
studentPointInfoMapper
.
updateByExampleSelective
(
new
StudentPointInfo
(){{
...
...
server-wx-api/src/main/java/cn/exploring/engine/server/wx/web/PointController.java
View file @
50b252fc
...
@@ -69,10 +69,10 @@ public class PointController {
...
@@ -69,10 +69,10 @@ public class PointController {
}
}
@PostMapping
(
"getStuList"
)
//
@PostMapping("getStuList")
public
Object
getStuList
(
@RequestParam
Integer
classId
,
@RequestParam
Integer
maxCall
)
{
//
public Object getStuList(@RequestParam Integer classId, @RequestParam Integer maxCall) {
return
ResponseUtil
.
ok
(
studentInfoService
.
listForCall
(
classId
,
maxCall
));
//
return ResponseUtil.ok(studentInfoService.listForCall(classId, maxCall));
}
//
}
@GetMapping
(
"export"
)
@GetMapping
(
"export"
)
...
...
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