Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dd_school
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqi
dd_school
Commits
0cde0ab9
Commit
0cde0ab9
authored
Aug 24, 2023
by
xuwenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改打卡记录分页
parent
835041b2
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
147 additions
and
126 deletions
+147
-126
smart-campus/src/main/java/yangtz/cs/liu/campus/controller/schoolAtt/SchoolAttController.java
+10
-6
smart-campus/src/main/java/yangtz/cs/liu/campus/controller/schoolAtt/SchoolAttMonController.java
+8
-4
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolAtt/SchoolAttMapper.java
+2
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolAtt/SchoolAttMonServiceImpl.java
+3
-1
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolAtt/SchoolAttOtServiceImpl.java
+7
-1
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolAtt/SchoolAttServiceImpl.java
+76
-108
smart-campus/src/main/java/yangtz/cs/liu/campus/service/schoolAtt/ISchoolAttService.java
+3
-2
smart-campus/src/main/resources/mapper/schoolAtt/SchoolAttMapper.xml
+38
-4
No files found.
smart-campus/src/main/java/yangtz/cs/liu/campus/controller/schoolAtt/SchoolAttController.java
View file @
0cde0ab9
...
...
@@ -61,7 +61,8 @@ public class SchoolAttController extends BaseController {
*/
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SchoolAtt
schoolAtt
)
{
List
<
SchoolAttVO
>
list
=
schoolAttService
.
queryList
(
schoolAtt
);
startPage
();
List
<
SchoolAtt
>
list
=
schoolAttService
.
queryList
(
schoolAtt
);
return
getDataTable
(
list
);
}
...
...
@@ -71,7 +72,8 @@ public class SchoolAttController extends BaseController {
@GetMapping
(
"/personalList"
)
public
TableDataInfo
personalList
(
SchoolAtt
schoolAtt
)
{
schoolAtt
.
setUserId
(
getUserId
());
List
<
SchoolAttVO
>
list
=
schoolAttService
.
queryList
(
schoolAtt
);
startPage
();
List
<
SchoolAtt
>
list
=
schoolAttService
.
queryList
(
schoolAtt
);
return
getDataTable
(
list
);
}
...
...
@@ -94,7 +96,7 @@ public class SchoolAttController extends BaseController {
public
TableDataInfo
gradeList
(
SchoolAtt
schoolAtt
)
{
//获取当前登录人所在级部
//获取当前学年
int
schoolYear
=
HolidayDateUtil
.
getSchoolYear
();
//
int schoolYear = HolidayDateUtil.getSchoolYear();
//List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear);
List
<
SchoolGrade
>
gradeIds
=
gradeMentorService
.
selectGradeList
(
getUserId
());
if
(
StringUtils
.
isNull
(
gradeIds
)
||
gradeIds
.
size
()
==
0
){
...
...
@@ -116,7 +118,8 @@ public class SchoolAttController extends BaseController {
//设置查询条件,级部id,类型为教工
//schoolAtt.setOrgid(mentor.get(0).getGradeId());
schoolAtt
.
setUserType
(
TEACH
);
List
<
SchoolAttVO
>
list
=
schoolAttService
.
queryGradeList
(
idList
,
schoolAtt
);
startPage
();
List
<
SchoolAtt
>
list
=
schoolAttService
.
queryGradeList
(
idList
,
schoolAtt
);
return
getDataTable
(
list
);
}
...
...
@@ -126,7 +129,7 @@ public class SchoolAttController extends BaseController {
@PostMapping
(
"/gradeList/export"
)
public
void
gradeListExport
(
SchoolAtt
schoolAtt
,
HttpServletResponse
response
)
{
//获取当前学年
int
schoolYear
=
HolidayDateUtil
.
getSchoolYear
();
//
int schoolYear = HolidayDateUtil.getSchoolYear();
/*List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear);
if(StringUtils.isNull(gradeIds) || gradeIds.size() == 0){
throw new ServiceException("非级部成员,无法查看");
...
...
@@ -166,7 +169,8 @@ public class SchoolAttController extends BaseController {
//设置查询条件,部门id,类型为职工
schoolAtt
.
setOrgid
(
getDeptId
());
schoolAtt
.
setUserType
(
EMPLOYEE
);
List
<
SchoolAttVO
>
list
=
schoolAttService
.
queryList
(
schoolAtt
);
startPage
();
List
<
SchoolAtt
>
list
=
schoolAttService
.
queryList
(
schoolAtt
);
return
getDataTable
(
list
);
}
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/controller/schoolAtt/SchoolAttMonController.java
View file @
0cde0ab9
...
...
@@ -92,7 +92,7 @@ public class SchoolAttMonController extends BaseController {
public
TableDataInfo
gradeList
(
SchoolAttMon
schoolAttMon
)
{
//获取当前学年
int
schoolYear
=
HolidayDateUtil
.
getSchoolYear
();
//
int schoolYear = HolidayDateUtil.getSchoolYear();
//获取当前登录人所在级部(多个级部)
/*List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear);
if(StringUtils.isNull(gradeIds) || gradeIds.size() == 0){
...
...
@@ -128,7 +128,7 @@ public class SchoolAttMonController extends BaseController {
public
void
exportGrade
(
HttpServletResponse
response
,
SchoolAttMon
schoolAttMon
)
{
//获取当前学年
int
schoolYear
=
HolidayDateUtil
.
getSchoolYear
();
//
int schoolYear = HolidayDateUtil.getSchoolYear();
//获取当前登录人所在级部
//获取当前登录人所在级部(多个级部)
List
<
SchoolGrade
>
gradeIds
=
gradeMentorService
.
selectGradeList
(
getUserId
());
...
...
@@ -224,7 +224,9 @@ public class SchoolAttMonController extends BaseController {
throw
new
ServiceException
(
"请选择需要批量提交的月份"
);
}
//获取当前学年
int
schoolYear
=
HolidayDateUtil
.
getSchoolYear
();
// int schoolYear = HolidayDateUtil.getSchoolYear();
// TODO 修改获取最新学年
int
schoolYear
=
gradeService
.
isNewSchoolYear
();
List
<
SchoolGrade
>
gradeIds
=
gradeMentorService
.
selectGrades
(
getUserId
(),
schoolYear
);
if
(
StringUtils
.
isNull
(
gradeIds
)
||
gradeIds
.
size
()
==
0
){
//若管理员此时不是级部成员,则查出所有级部
...
...
@@ -274,7 +276,9 @@ public class SchoolAttMonController extends BaseController {
throw
new
ServiceException
(
"请选择需要批量初始化的月份"
);
}
//获取当前学年
int
schoolYear
=
HolidayDateUtil
.
getSchoolYear
();
// int schoolYear = HolidayDateUtil.getSchoolYear();
// TODO 修改最新学年
int
schoolYear
=
gradeService
.
isNewSchoolYear
();
List
<
SchoolGrade
>
gradeIds
=
gradeMentorService
.
selectGrades
(
getUserId
(),
schoolYear
);
if
(
StringUtils
.
isNull
(
gradeIds
)
||
gradeIds
.
size
()
==
0
){
//若管理员此时不是级部成员,则查出所有级部
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolAtt/SchoolAttMapper.java
View file @
0cde0ab9
...
...
@@ -23,4 +23,6 @@ public interface SchoolAttMapper extends BaseMapper<SchoolAtt> {
@Param
(
"userType"
)
String
userType
,
@Param
(
"beginDate"
)
Date
beginDate
,
@Param
(
"endDate"
)
Date
endDate
);
void
insertAttList
(
@Param
(
"list"
)
List
<
SchoolAtt
>
list
);
}
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolAtt/SchoolAttMonServiceImpl.java
View file @
0cde0ab9
...
...
@@ -750,7 +750,9 @@ public class SchoolAttMonServiceImpl extends ServiceImpl<SchoolAttMonMapper, Sch
* */
if
(
mid
.
compareTo
(
time2
)
<=
0
){
//获取当前学年,教师所在班级
int
schoolYear
=
getNewYear
();
// int schoolYear = getNewYear();
// TODO 修改最新学年
int
schoolYear
=
gradeMapper
.
isNewSchoolYear
();
List
<
SchoolClassMentor
>
mentors
=
mentorMapper
.
getMentors
(
teacherVO
.
getId
(),
schoolYear
);
//确保该教师在本学年有 所教班级
if
(
isNotNull
(
mentors
)
&&
mentors
.
size
()
>
0
){
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolAtt/SchoolAttOtServiceImpl.java
View file @
0cde0ab9
...
...
@@ -13,6 +13,7 @@ import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor;
import
yangtz.cs.liu.campus.domain.time.SchoolTimeTable
;
import
yangtz.cs.liu.campus.mapper.schoolAtt.SchoolAttOtMapper
;
import
yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMentorMapper
;
import
yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper
;
import
yangtz.cs.liu.campus.mapper.time.SchoolTimeTableMapper
;
import
yangtz.cs.liu.campus.service.schoolAtt.ISchoolAttOtService
;
import
yangtz.cs.liu.campus.service.workDay.ISchoolWorkDayService
;
...
...
@@ -42,6 +43,9 @@ public class SchoolAttOtServiceImpl extends ServiceImpl<SchoolAttOtMapper, Schoo
@Autowired
private
SchoolTimeTableMapper
tableMapper
;
@Autowired
private
SchoolGradeMapper
gradeMapper
;
public
static
final
String
s
=
"00:00:00"
;
public
static
final
String
e
=
"23:59:59"
;
...
...
@@ -214,7 +218,9 @@ public class SchoolAttOtServiceImpl extends ServiceImpl<SchoolAttOtMapper, Schoo
* */
if
(
mid
.
compareTo
(
schoolAttOt
.
getEndTime
())
<=
0
){
//获取当前学年,教师所在班级
int
schoolYear
=
getNewYear
();
// int schoolYear = getNewYear();
// TODO 修改最新学年
int
schoolYear
=
gradeMapper
.
isNewSchoolYear
();
List
<
SchoolClassMentor
>
mentors
=
mentorMapper
.
getMentors
(
schoolAttOt
.
getUserId
(),
schoolYear
);
//确保该教师在本学年有 所教班级
if
(
isNotNull
(
mentors
)
&&
mentors
.
size
()
>
0
){
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolAtt/SchoolAttServiceImpl.java
View file @
0cde0ab9
...
...
@@ -14,6 +14,7 @@ import lombok.Data;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
yangtz.cs.liu.campus.domain.schoolAtt.SchoolAtt
;
import
yangtz.cs.liu.campus.domain.schoolClass.SchoolClass
;
import
yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade
;
...
...
@@ -56,62 +57,17 @@ public class SchoolAttServiceImpl extends ServiceImpl<SchoolAttMapper, SchoolAtt
DateFormat
df
=
DateFormat
.
getTimeInstance
();
//只显示出时分秒
@Override
public
List
<
SchoolAtt
VO
>
queryList
(
SchoolAtt
schoolAtt
)
{
public
List
<
SchoolAtt
>
queryList
(
SchoolAtt
schoolAtt
)
{
List
<
SchoolAtt
>
list
=
schoolAttMapper
.
queryList
(
schoolAtt
);
if
(
null
==
list
&&
list
.
size
()
<=
0
){
return
new
ArrayList
<>();
}
//最后返回的结果集
List
<
SchoolAttVO
>
voList
=
new
ArrayList
<>();
for
(
SchoolAtt
att
:
list
){
SchoolAttVO
vo
=
new
SchoolAttVO
();
BeanUtils
.
copyProperties
(
att
,
vo
);
//获取该用户同一天内的所有打卡时间
List
<
String
>
strings
=
getSame
(
att
);
String
times
=
StringUtils
.
join
(
strings
.
toArray
(),
"、"
);
vo
.
setTimes
(
times
);
vo
.
setClockTime
(
null
);
vo
.
setId
(
null
);
voList
.
add
(
vo
);
}
//结果集List中含有重复值,去除重复值
List
<
SchoolAttVO
>
unique
=
voList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
return
unique
;
return
list
;
}
//级部打卡
@Override
public
List
<
SchoolAttVO
>
queryGradeList
(
List
<
Long
>
gradeIds
,
SchoolAtt
schoolAtt
)
{
List
<
SchoolAtt
>
list
=
schoolAttMapper
.
queryGradeList
(
gradeIds
,
schoolAtt
);
if
(
null
==
list
&&
list
.
size
()
<=
0
){
return
new
ArrayList
<>();
}
//最后返回的结果集
List
<
SchoolAttVO
>
voList
=
new
ArrayList
<>();
public
List
<
SchoolAtt
>
queryGradeList
(
List
<
Long
>
gradeIds
,
SchoolAtt
schoolAtt
)
{
for
(
SchoolAtt
att
:
list
){
SchoolAttVO
vo
=
new
SchoolAttVO
();
BeanUtils
.
copyProperties
(
att
,
vo
);
//获取该用户同一天内的所有打卡时间
List
<
String
>
strings
=
getSame
(
att
);
String
times
=
StringUtils
.
join
(
strings
.
toArray
(),
"、"
);
vo
.
setTimes
(
times
);
vo
.
setClockTime
(
null
);
vo
.
setId
(
null
);
voList
.
add
(
vo
);
}
//结果集List中含有重复值,去除重复值
List
<
SchoolAttVO
>
unique
=
voList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
return
unique
;
List
<
SchoolAtt
>
list
=
schoolAttMapper
.
queryGradeList
(
gradeIds
,
schoolAtt
);
return
list
;
}
//获取包括att在内所有与之在同一天,打卡时间不同的对象,获取打卡时间字符串数组
...
...
@@ -156,31 +112,32 @@ public class SchoolAttServiceImpl extends ServiceImpl<SchoolAttMapper, SchoolAtt
BeanUtils
.
copyProperties
(
att
,
vo
);
//获取该用户同一天内的所有打卡时间
List
<
String
>
strings
=
getSame
(
att
);
// List<String> strings = getSame(att);
String
[]
strings
=
att
.
getClockTime
().
split
(
","
);
//给打卡时间1-20赋值
for
(
int
i
=
0
;
i
<
strings
.
size
()
;
i
++){
for
(
int
i
=
0
;
i
<
strings
.
length
;
i
++){
int
j
=
i
+
1
;
switch
(
j
){
case
1
:
vo
.
setTime1
(
strings
.
get
(
i
)
);
continue
;
case
2
:
vo
.
setTime2
(
strings
.
get
(
i
)
);
continue
;
case
3
:
vo
.
setTime3
(
strings
.
get
(
i
)
);
continue
;
case
4
:
vo
.
setTime4
(
strings
.
get
(
i
)
);
continue
;
case
5
:
vo
.
setTime5
(
strings
.
get
(
i
)
);
continue
;
case
6
:
vo
.
setTime6
(
strings
.
get
(
i
)
);
continue
;
case
7
:
vo
.
setTime7
(
strings
.
get
(
i
)
);
continue
;
case
8
:
vo
.
setTime8
(
strings
.
get
(
i
)
);
continue
;
case
9
:
vo
.
setTime9
(
strings
.
get
(
i
)
);
continue
;
case
10
:
vo
.
setTime10
(
strings
.
get
(
i
)
);
continue
;
case
11
:
vo
.
setTime11
(
strings
.
get
(
i
)
);
continue
;
case
12
:
vo
.
setTime12
(
strings
.
get
(
i
)
);
continue
;
case
13
:
vo
.
setTime13
(
strings
.
get
(
i
)
);
continue
;
case
14
:
vo
.
setTime14
(
strings
.
get
(
i
)
);
continue
;
case
15
:
vo
.
setTime15
(
strings
.
get
(
i
)
);
continue
;
case
16
:
vo
.
setTime16
(
strings
.
get
(
i
)
);
continue
;
case
17
:
vo
.
setTime17
(
strings
.
get
(
i
)
);
continue
;
case
18
:
vo
.
setTime18
(
strings
.
get
(
i
)
);
continue
;
case
19
:
vo
.
setTime19
(
strings
.
get
(
i
)
);
continue
;
case
20
:
vo
.
setTime20
(
strings
.
get
(
i
)
);
case
1
:
vo
.
setTime1
(
strings
[
i
]
);
continue
;
case
2
:
vo
.
setTime2
(
strings
[
i
]
);
continue
;
case
3
:
vo
.
setTime3
(
strings
[
i
]
);
continue
;
case
4
:
vo
.
setTime4
(
strings
[
i
]
);
continue
;
case
5
:
vo
.
setTime5
(
strings
[
i
]
);
continue
;
case
6
:
vo
.
setTime6
(
strings
[
i
]
);
continue
;
case
7
:
vo
.
setTime7
(
strings
[
i
]
);
continue
;
case
8
:
vo
.
setTime8
(
strings
[
i
]
);
continue
;
case
9
:
vo
.
setTime9
(
strings
[
i
]
);
continue
;
case
10
:
vo
.
setTime10
(
strings
[
i
]
);
continue
;
case
11
:
vo
.
setTime11
(
strings
[
i
]
);
continue
;
case
12
:
vo
.
setTime12
(
strings
[
i
]
);
continue
;
case
13
:
vo
.
setTime13
(
strings
[
i
]
);
continue
;
case
14
:
vo
.
setTime14
(
strings
[
i
]
);
continue
;
case
15
:
vo
.
setTime15
(
strings
[
i
]
);
continue
;
case
16
:
vo
.
setTime16
(
strings
[
i
]
);
continue
;
case
17
:
vo
.
setTime17
(
strings
[
i
]
);
continue
;
case
18
:
vo
.
setTime18
(
strings
[
i
]
);
continue
;
case
19
:
vo
.
setTime19
(
strings
[
i
]
);
continue
;
case
20
:
vo
.
setTime20
(
strings
[
i
]
);
}
}
...
...
@@ -189,8 +146,8 @@ public class SchoolAttServiceImpl extends ServiceImpl<SchoolAttMapper, SchoolAtt
voList
.
add
(
vo
);
}
//结果集List中含有重复值,去除重复值
List
<
SchoolAttVO
>
unique
=
voList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
return
unique
;
//
List<SchoolAttVO> unique = voList.stream().distinct().collect(Collectors.toList());
return
voList
;
}
@Override
...
...
@@ -208,31 +165,32 @@ public class SchoolAttServiceImpl extends ServiceImpl<SchoolAttMapper, SchoolAtt
BeanUtils
.
copyProperties
(
att
,
vo
);
//获取该用户同一天内的所有打卡时间
List
<
String
>
strings
=
getSame
(
att
);
// List<String> strings = getSame(att);
String
[]
strings
=
att
.
getClockTime
().
split
(
","
);
//给打卡时间1-20赋值
for
(
int
i
=
0
;
i
<
strings
.
size
()
;
i
++){
for
(
int
i
=
0
;
i
<
strings
.
length
;
i
++){
int
j
=
i
+
1
;
switch
(
j
){
case
1
:
vo
.
setTime1
(
strings
.
get
(
i
)
);
continue
;
case
2
:
vo
.
setTime2
(
strings
.
get
(
i
)
);
continue
;
case
3
:
vo
.
setTime3
(
strings
.
get
(
i
)
);
continue
;
case
4
:
vo
.
setTime4
(
strings
.
get
(
i
)
);
continue
;
case
5
:
vo
.
setTime5
(
strings
.
get
(
i
)
);
continue
;
case
6
:
vo
.
setTime6
(
strings
.
get
(
i
)
);
continue
;
case
7
:
vo
.
setTime7
(
strings
.
get
(
i
)
);
continue
;
case
8
:
vo
.
setTime8
(
strings
.
get
(
i
)
);
continue
;
case
9
:
vo
.
setTime9
(
strings
.
get
(
i
)
);
continue
;
case
10
:
vo
.
setTime10
(
strings
.
get
(
i
)
);
continue
;
case
11
:
vo
.
setTime11
(
strings
.
get
(
i
)
);
continue
;
case
12
:
vo
.
setTime12
(
strings
.
get
(
i
)
);
continue
;
case
13
:
vo
.
setTime13
(
strings
.
get
(
i
)
);
continue
;
case
14
:
vo
.
setTime14
(
strings
.
get
(
i
)
);
continue
;
case
15
:
vo
.
setTime15
(
strings
.
get
(
i
)
);
continue
;
case
16
:
vo
.
setTime16
(
strings
.
get
(
i
)
);
continue
;
case
17
:
vo
.
setTime17
(
strings
.
get
(
i
)
);
continue
;
case
18
:
vo
.
setTime18
(
strings
.
get
(
i
)
);
continue
;
case
19
:
vo
.
setTime19
(
strings
.
get
(
i
)
);
continue
;
case
20
:
vo
.
setTime20
(
strings
.
get
(
i
)
);
case
1
:
vo
.
setTime1
(
strings
[
i
]
);
continue
;
case
2
:
vo
.
setTime2
(
strings
[
i
]
);
continue
;
case
3
:
vo
.
setTime3
(
strings
[
i
]
);
continue
;
case
4
:
vo
.
setTime4
(
strings
[
i
]
);
continue
;
case
5
:
vo
.
setTime5
(
strings
[
i
]
);
continue
;
case
6
:
vo
.
setTime6
(
strings
[
i
]
);
continue
;
case
7
:
vo
.
setTime7
(
strings
[
i
]
);
continue
;
case
8
:
vo
.
setTime8
(
strings
[
i
]
);
continue
;
case
9
:
vo
.
setTime9
(
strings
[
i
]
);
continue
;
case
10
:
vo
.
setTime10
(
strings
[
i
]
);
continue
;
case
11
:
vo
.
setTime11
(
strings
[
i
]
);
continue
;
case
12
:
vo
.
setTime12
(
strings
[
i
]
);
continue
;
case
13
:
vo
.
setTime13
(
strings
[
i
]
);
continue
;
case
14
:
vo
.
setTime14
(
strings
[
i
]
);
continue
;
case
15
:
vo
.
setTime15
(
strings
[
i
]
);
continue
;
case
16
:
vo
.
setTime16
(
strings
[
i
]
);
continue
;
case
17
:
vo
.
setTime17
(
strings
[
i
]
);
continue
;
case
18
:
vo
.
setTime18
(
strings
[
i
]
);
continue
;
case
19
:
vo
.
setTime19
(
strings
[
i
]
);
continue
;
case
20
:
vo
.
setTime20
(
strings
[
i
]
);
}
}
...
...
@@ -241,8 +199,8 @@ public class SchoolAttServiceImpl extends ServiceImpl<SchoolAttMapper, SchoolAtt
voList
.
add
(
vo
);
}
//结果集List中含有重复值,去除重复值
List
<
SchoolAttVO
>
unique
=
voList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
return
unique
;
//
List<SchoolAttVO> unique = voList.stream().distinct().collect(Collectors.toList());
return
voList
;
}
/**
...
...
@@ -292,17 +250,19 @@ public class SchoolAttServiceImpl extends ServiceImpl<SchoolAttMapper, SchoolAtt
schoolAttVO
.
setUserId
(
teacherVO
.
getId
());
schoolAttVO
.
setTeacherCode
(
teacherVO
.
getTeacherCode
());
schoolAttVO
.
setUserType
(
teacherVO
.
getEmployeeType
());
// TODO 修改最新学年
int
newSchoolYear
=
gradeMapper
.
isNewSchoolYear
();
//根据年级名称和最新学年获取级部id
LambdaQueryWrapper
<
SchoolGrade
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
eq
(
SchoolGrade:
:
getGradeName
,
schoolAttVO
.
getOrgname
())
.
eq
(
SchoolGrade:
:
getSchoolYear
,
HolidayDateUtil
.
getSchoolYear
()
);
.
eq
(
SchoolGrade:
:
getSchoolYear
,
newSchoolYear
);
SchoolGrade
grade
=
gradeMapper
.
selectOne
(
lqw
);
if
(
StringUtils
.
isNotNull
(
grade
)){
schoolAttVO
.
setOrgid
(
grade
.
getId
());
schoolAttVO
.
setOrgname
(
grade
.
getGradeName
());
}
else
{
throw
new
ServiceException
(
"当前学年为"
+
HolidayDateUtil
.
getSchoolYear
()
+
"学年,"
+
schoolAttVO
.
getUserName
()+
"所在级部名称为"
+
schoolAttVO
.
getOrgname
()+
"的级部不存在,请检查"
);
throw
new
ServiceException
(
"当前学年为"
+
newSchoolYear
+
"学年,"
+
schoolAttVO
.
getUserName
()+
"所在级部名称为"
+
schoolAttVO
.
getOrgname
()+
"的级部不存在,请检查"
);
}
}
...
...
@@ -421,20 +381,28 @@ public class SchoolAttServiceImpl extends ServiceImpl<SchoolAttMapper, SchoolAtt
* 导入数据
* */
@Override
@Transactional
public
String
importData
(
List
<
SchoolAtt
>
list
)
{
// 准备记录日志数据
int
successNum
=
0
;
StringBuilder
successMsg
=
new
StringBuilder
();
// 遍历并逐个导入
for
(
SchoolAtt
schoolAtt
:
list
)
{
try
{
schoolAttMapper
.
insert
(
schoolAtt
);
successNum
++;
//successMsg.append("<br/>" + successNum + "数据" + " 导入成功");
}
catch
(
Exception
e
)
{
// TODO 修改导入
try
{
schoolAttMapper
.
insertAttList
(
list
);
}
catch
(
Exception
e
){
throw
new
ServiceException
(
"导入失败"
);
}
}
// // 遍历并逐个导入
// for (SchoolAtt schoolAtt : list) {
// try {
// schoolAttMapper.insert(schoolAtt);
// successNum++;
// //successMsg.append("<br/>" + successNum + "数据" + " 导入成功");
// } catch (Exception e) {
// throw new ServiceException("导入失败");
// }
// }
successMsg
.
insert
(
0
,
"恭喜您,数据已导入成功!"
);
return
successMsg
.
toString
();
}
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/schoolAtt/ISchoolAttService.java
View file @
0cde0ab9
...
...
@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.service.schoolAtt;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.github.pagehelper.PageInfo
;
import
yangtz.cs.liu.campus.domain.schoolAtt.SchoolAtt
;
import
yangtz.cs.liu.campus.vo.schoolAtt.SchoolAttVO
;
import
yangtz.cs.liu.campus.vo.student.SchoolStudentVO
;
...
...
@@ -11,9 +12,9 @@ import java.util.List;
public
interface
ISchoolAttService
extends
IService
<
SchoolAtt
>
{
//查询打卡记录列表
public
List
<
SchoolAtt
VO
>
queryList
(
SchoolAtt
schoolAtt
);
public
List
<
SchoolAtt
>
queryList
(
SchoolAtt
schoolAtt
);
public
List
<
SchoolAtt
VO
>
queryGradeList
(
List
<
Long
>
gradeIds
,
SchoolAtt
schoolAtt
);
public
List
<
SchoolAtt
>
queryGradeList
(
List
<
Long
>
gradeIds
,
SchoolAtt
schoolAtt
);
//打卡导出
public
List
<
SchoolAttVO
>
export
(
SchoolAtt
schoolAtt
);
...
...
smart-campus/src/main/resources/mapper/schoolAtt/SchoolAttMapper.xml
View file @
0cde0ab9
...
...
@@ -41,8 +41,8 @@
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"yangtz.cs.liu.campus.domain.schoolAtt.SchoolAt
t"
>
<include
refid=
"selectSchoolAttVo"
/>
<select
id=
"queryList"
parameterType=
"yangtz.cs.liu.campus.domain.schoolAtt.SchoolAtt"
resultMap=
"SchoolAttResul
t"
>
select id, device_num, teacher_code, user_id, user_name, user_type, orgid, orgname, clock_date, GROUP_CONCAT(clock_time) as clock_time, create_by, create_time, remark from school_att
<where>
del_flag = '0'
<if
test=
"deviceNum != null and deviceNum != ''"
>
and device_num = #{deviceNum}
</if>
...
...
@@ -59,11 +59,12 @@
AND date_format(clock_date,'%y%m%d')
<
= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
GROUP BY device_num, teacher_code, user_id, user_name, user_type, orgid, orgname, clock_date
order by clock_date desc ,device_num asc
</select>
<select
id=
"queryGradeList"
resultType=
"yangtz.cs.liu.campus.domain.schoolAtt.SchoolAt
t"
>
<include
refid=
"selectSchoolAttVo"
/>
<select
id=
"queryGradeList"
parameterType=
"yangtz.cs.liu.campus.domain.schoolAtt.SchoolAtt"
resultMap=
"SchoolAttResul
t"
>
select id, device_num, teacher_code, user_id, user_name, user_type, orgid, orgname, clock_date, GROUP_CONCAT(clock_time) as clock_time, create_by, create_time, remark from school_att
<where>
del_flag = '0'
<if
test=
"entity.userName != null and entity.userName != ''"
>
and user_name like concat('%', #{entity.userName}, '%')
</if>
...
...
@@ -80,6 +81,7 @@
AND date_format(clock_date,'%y%m%d')
<
= date_format(#{entity.params.endTime},'%y%m%d')
</if>
</where>
GROUP BY device_num, teacher_code, user_id, user_name, user_type, orgid, orgname, clock_date
order by clock_date desc ,device_num asc
</select>
...
...
@@ -155,4 +157,36 @@
#{id}
</foreach>
</delete>
<insert
id=
"insertAttList"
parameterType=
"SchoolAtt"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<foreach
collection=
"list"
item=
"data"
separator=
";"
>
insert into school_att
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"data.deviceNum != null"
>
device_num,
</if>
<if
test=
"data.teacherCode != null"
>
teacher_code,
</if>
<if
test=
"data.userId != null"
>
user_id,
</if>
<if
test=
"data.userName != null"
>
user_name,
</if>
<if
test=
"data.userType != null"
>
user_type,
</if>
<if
test=
"data.orgid != null"
>
orgid,
</if>
<if
test=
"data.orgname != null"
>
orgname,
</if>
<if
test=
"data.clockDate != null"
>
clock_date,
</if>
<if
test=
"data.clockTime != null"
>
clock_time,
</if>
<if
test=
"data.createBy != null"
>
create_by,
</if>
<if
test=
"data.createTime != null"
>
create_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"data.deviceNum != null"
>
#{data.deviceNum},
</if>
<if
test=
"data.teacherCode != null"
>
#{data.teacherCode},
</if>
<if
test=
"data.userId != null"
>
#{data.userId},
</if>
<if
test=
"data.userName != null"
>
#{data.userName},
</if>
<if
test=
"data.userType != null"
>
#{data.userType},
</if>
<if
test=
"data.orgid != null"
>
#{data.orgid},
</if>
<if
test=
"data.orgname != null"
>
#{data.orgname},
</if>
<if
test=
"data.clockDate != null"
>
#{data.clockDate},
</if>
<if
test=
"data.clockTime != null"
>
#{data.clockTime},
</if>
<if
test=
"data.createBy != null"
>
#{data.createBy},
</if>
<if
test=
"data.createTime != null"
>
#{data.createTime},
</if>
</trim>
</foreach>
</insert>
</mapper>
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