Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
entrance_api
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
王琮
entrance_api
Commits
d7a87cf4
Commit
d7a87cf4
authored
Jan 12, 2023
by
gaoyingwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 考勤定时同步,用户加权重
parent
0e457e05
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
100 additions
and
45 deletions
+100
-45
AttendanceController.java
...isoft/sys/attendance/controller/AttendanceController.java
+2
-1
AttendanceSyncSchedule.java
...isoft/sys/attendance/schedule/AttendanceSyncSchedule.java
+16
-10
AttendanceService.java
...org/rcisoft/sys/attendance/service/AttendanceService.java
+2
-1
AttendanceServiceImpl.java
...ft/sys/attendance/service/impl/AttendanceServiceImpl.java
+32
-4
ScheduledResultServiceImpl.java
...s/attendance/service/impl/ScheduledResultServiceImpl.java
+35
-23
SysUser.java
src/main/java/org/rcisoft/sys/sysuser/entity/SysUser.java
+1
-1
AttendanceSyncMapper.xml
src/main/resources/mapper/AttendanceSyncMapper.xml
+4
-3
SysUserRepositorys.xml
src/main/resources/mapper/SysUserRepositorys.xml
+8
-2
No files found.
src/main/java/org/rcisoft/sys/attendance/controller/AttendanceController.java
View file @
d7a87cf4
...
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.text.ParseException
;
@RestController
@RestController
@RequestMapping
(
"/attendance"
)
@RequestMapping
(
"/attendance"
)
...
@@ -27,7 +28,7 @@ public class AttendanceController extends CyPaginationController<Attendance> {
...
@@ -27,7 +28,7 @@ public class AttendanceController extends CyPaginationController<Attendance> {
@CyOpeLogAnno
(
title
=
"system-通行记录信息表管理-查询通行记录信息表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@CyOpeLogAnno
(
title
=
"system-通行记录信息表管理-查询通行记录信息表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询通行记录信息表集合"
,
notes
=
"查询通行记录信息表集合"
)
@ApiOperation
(
value
=
"查询通行记录信息表集合"
,
notes
=
"查询通行记录信息表集合"
)
@GetMapping
(
value
=
"/queryKQRecords"
)
@GetMapping
(
value
=
"/queryKQRecords"
)
public
CyResult
queryKQRecords
(
Attendance
attendance
)
{
public
CyResult
queryKQRecords
(
Attendance
attendance
)
throws
ParseException
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
...
...
src/main/java/org/rcisoft/sys/attendance/schedule/AttendanceSyncSchedule.java
View file @
d7a87cf4
...
@@ -78,17 +78,20 @@ public class AttendanceSyncSchedule {
...
@@ -78,17 +78,20 @@ public class AttendanceSyncSchedule {
attendanceSync
.
setFlag
(
all
.
get
(
i
).
getKqFlag
());
attendanceSync
.
setFlag
(
all
.
get
(
i
).
getKqFlag
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setPassageTime
(
all
.
get
(
i
).
getCrossTime
());
attendanceSync
.
setPassageTime
(
all
.
get
(
i
).
getCrossTime
());
// 判断考勤是否已经存在,已经存在不会添加
if
(
attendanceSyncRepository
.
queryAttendanceSyncs
(
attendanceSync
).
size
()
==
0
)
{
if
(
attendanceSync
.
getFlag
().
equals
(
"正常"
))
{
if
(
attendanceSync
.
getFlag
().
equals
(
"正常"
))
{
attendanceSync
.
setFlag
(
"1"
);
attendanceSync
.
setFlag
(
"1"
);
}
else
if
(
attendanceSync
.
getFlag
().
equals
(
"异常"
))
{
}
else
if
(
attendanceSync
.
getFlag
().
equals
(
"异常"
))
{
attendanceSync
.
setFlag
(
"0"
);
attendanceSync
.
setFlag
(
"0"
);
}
}
// 判断考勤是否已经存在,已经存在不会添加
QueryWrapper
<
AttendanceSync
>
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"date_of_attendance"
,
attendanceSync
.
getDateOfAttendance
());
wrapper
.
eq
(
"user_id"
,
attendanceSync
.
getUserId
());
List
<
AttendanceSync
>
attendanceSyncList
=
attendanceSyncRepository
.
selectList
(
wrapper
);
if
(
attendanceSyncList
.
size
()==
0
)
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
}
}
}
}
}
SysUser
user
=
new
SysUser
();
SysUser
user
=
new
SysUser
();
user
.
setFlag
(
"1"
);
user
.
setFlag
(
"1"
);
user
.
setAttendanceShow
(
"0"
);
user
.
setAttendanceShow
(
"0"
);
...
@@ -115,12 +118,15 @@ public class AttendanceSyncSchedule {
...
@@ -115,12 +118,15 @@ public class AttendanceSyncSchedule {
attendanceSync
.
setNltBzLabel
(
sysUser
.
getNltBzLabel
());
attendanceSync
.
setNltBzLabel
(
sysUser
.
getNltBzLabel
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setPassageTime
(
null
);
attendanceSync
.
setPassageTime
(
null
);
// 判断考勤是否已经存在,已经存在不会添加
if
(
attendanceSyncRepository
.
queryAttendanceSyncs
(
attendanceSync
).
size
()
==
0
)
{
attendanceSync
.
setFlag
(
"0"
);
attendanceSync
.
setFlag
(
"0"
);
// 判断考勤是否已经存在,已经存在不会添加
QueryWrapper
<
AttendanceSync
>
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"date_of_attendance"
,
attendanceSync
.
getDateOfAttendance
());
wrapper
.
eq
(
"user_id"
,
attendanceSync
.
getUserId
());
List
<
AttendanceSync
>
attendanceSyncList
=
attendanceSyncRepository
.
selectList
(
wrapper
);
if
(
attendanceSyncList
.
size
()==
0
)
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
}
}
}
ScheduledResult
scheduledResult
=
new
ScheduledResult
();
ScheduledResult
scheduledResult
=
new
ScheduledResult
();
scheduledResult
.
setType
(
"考勤同步"
);
scheduledResult
.
setType
(
"考勤同步"
);
scheduledResult
.
setKqDate
(
TimeUtils
.
getDateNotTime
(
update
));
scheduledResult
.
setKqDate
(
TimeUtils
.
getDateNotTime
(
update
));
...
...
src/main/java/org/rcisoft/sys/attendance/service/AttendanceService.java
View file @
d7a87cf4
...
@@ -4,6 +4,7 @@ import org.rcisoft.sys.attendance.entity.Attendance;
...
@@ -4,6 +4,7 @@ import org.rcisoft.sys.attendance.entity.Attendance;
import
org.rcisoft.sys.sysuser.entity.DoorRecord
;
import
org.rcisoft.sys.sysuser.entity.DoorRecord
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.text.ParseException
;
import
java.util.List
;
import
java.util.List
;
public
interface
AttendanceService
{
public
interface
AttendanceService
{
...
@@ -14,7 +15,7 @@ public interface AttendanceService {
...
@@ -14,7 +15,7 @@ public interface AttendanceService {
* @param attendance
* @param attendance
* @return
* @return
*/
*/
List
<
Attendance
>
findAll
(
Attendance
attendance
);
List
<
Attendance
>
findAll
(
Attendance
attendance
)
throws
ParseException
;
//查询全部考勤
//查询全部考勤
List
<
DoorRecord
>
findAllBy
(
Attendance
attendance
,
HttpServletRequest
request
);
List
<
DoorRecord
>
findAllBy
(
Attendance
attendance
,
HttpServletRequest
request
);
...
...
src/main/java/org/rcisoft/sys/attendance/service/impl/AttendanceServiceImpl.java
View file @
d7a87cf4
...
@@ -42,7 +42,7 @@ public class AttendanceServiceImpl implements AttendanceService {
...
@@ -42,7 +42,7 @@ public class AttendanceServiceImpl implements AttendanceService {
private
CyJwtUtil
cyJwtUtil
;
private
CyJwtUtil
cyJwtUtil
;
@Override
@Override
public
List
<
Attendance
>
findAll
(
Attendance
attendance
)
{
public
List
<
Attendance
>
findAll
(
Attendance
attendance
)
throws
ParseException
{
List
<
Attendance
>
attendanceList
=
new
ArrayList
<>();
List
<
Attendance
>
attendanceList
=
new
ArrayList
<>();
// 根据时间范围筛选所有打卡成功的记录
// 根据时间范围筛选所有打卡成功的记录
// 获取前一天的时间
// 获取前一天的时间
...
@@ -78,9 +78,10 @@ public class AttendanceServiceImpl implements AttendanceService {
...
@@ -78,9 +78,10 @@ public class AttendanceServiceImpl implements AttendanceService {
}
}
// 整合考勤信息
// 整合考勤信息
public
Attendance
setValue
(
List
<
DoorRecord
>
records
,
Attendance
attendance
)
{
public
Attendance
setValue
(
List
<
DoorRecord
>
records
,
Attendance
attendance
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
SimpleDateFormat
time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
day
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
attendance
.
setDuration
(
BigDecimal
.
ZERO
);
attendance
.
setDuration
(
BigDecimal
.
ZERO
);
// 根据时间升序排序
// 根据时间升序排序
records
=
records
.
stream
().
sorted
(
Comparator
.
comparing
(
DoorRecord:
:
getCrossTime
)).
collect
(
Collectors
.
toList
());
records
=
records
.
stream
().
sorted
(
Comparator
.
comparing
(
DoorRecord:
:
getCrossTime
)).
collect
(
Collectors
.
toList
());
...
@@ -100,10 +101,37 @@ public class AttendanceServiceImpl implements AttendanceService {
...
@@ -100,10 +101,37 @@ public class AttendanceServiceImpl implements AttendanceService {
attendance
.
setWorkDeviceName
(
work
.
getDeviceName
());
attendance
.
setWorkDeviceName
(
work
.
getDeviceName
());
attendance
.
setClosingTime
(
sdf
.
format
(
out
.
getCrossTime
()));
attendance
.
setClosingTime
(
sdf
.
format
(
out
.
getCrossTime
()));
attendance
.
setOfficeDeviceName
(
out
.
getDeviceName
());
attendance
.
setOfficeDeviceName
(
out
.
getDeviceName
());
}
else
if
(
work
!=
null
)
{
//如果进数据存在,出数据为空,出站时间算23:59:59
String
begin
=
time
.
format
(
work
.
getCrossTime
());
String
end
=
day
.
format
(
work
.
getCrossTime
())+
" 23:59:59"
;
if
(
begin
.
compareTo
(
end
)
>
0
)
return
null
;
attendance
.
setWorkShift
(
sdf
.
format
(
work
.
getCrossTime
()));
attendance
.
setWorkDeviceName
(
work
.
getDeviceName
());
attendance
.
setClosingTime
(
"23:59"
);
// attendance.setOfficeDeviceName(null);
}
else
if
(
out
!=
null
)
{
//如果进数据为空,出数据存在,入站时间算00:00:01
String
begin
=
day
.
format
(
out
.
getCrossTime
())+
" 00:00:01"
;
String
end
=
time
.
format
(
out
.
getCrossTime
());
if
(
begin
.
compareTo
(
end
)
>
0
)
return
null
;
attendance
.
setWorkShift
(
"00:00"
);
// attendance.setWorkDeviceName(work.getDeviceName());
attendance
.
setClosingTime
(
sdf
.
format
(
out
.
getCrossTime
()));
attendance
.
setOfficeDeviceName
(
out
.
getDeviceName
());
}
else
}
else
return
null
;
return
null
;
Date
beginTime
=
work
.
getCrossTime
();
Date
endTime
=
out
.
getCrossTime
();
Date
beginTime
=
null
;
if
(
work
!=
null
)
beginTime
=
work
.
getCrossTime
();
else
beginTime
=
time
.
parse
(
day
.
format
(
out
.
getCrossTime
())+
" 00:00:01"
);
Date
endTime
=
null
;
if
(
out
!=
null
)
endTime
=
out
.
getCrossTime
();
else
endTime
=
time
.
parse
(
day
.
format
(
work
.
getCrossTime
())+
" 23:59:59"
);
long
sumTime
=
0
l
;
long
sumTime
=
0
l
;
/* for (int i = 0; i < records.size(); i++) {
/* for (int i = 0; i < records.size(); i++) {
if (records.get(i).getDeviceType().equals("1"))
if (records.get(i).getDeviceType().equals("1"))
...
...
src/main/java/org/rcisoft/sys/attendance/service/impl/ScheduledResultServiceImpl.java
View file @
d7a87cf4
...
@@ -100,17 +100,20 @@ public class ScheduledResultServiceImpl extends ServiceImpl<ScheduledResultRepos
...
@@ -100,17 +100,20 @@ public class ScheduledResultServiceImpl extends ServiceImpl<ScheduledResultRepos
attendanceSync
.
setFlag
(
all
.
get
(
i
).
getKqFlag
());
attendanceSync
.
setFlag
(
all
.
get
(
i
).
getKqFlag
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setPassageTime
(
all
.
get
(
i
).
getCrossTime
());
attendanceSync
.
setPassageTime
(
all
.
get
(
i
).
getCrossTime
());
// 判断考勤是否已经存在,已经存在不会添加
if
(
attendanceSyncRepository
.
queryAttendanceSyncs
(
attendanceSync
).
size
()
==
0
)
{
if
(
attendanceSync
.
getFlag
().
equals
(
"正常"
))
{
if
(
attendanceSync
.
getFlag
().
equals
(
"正常"
))
{
attendanceSync
.
setFlag
(
"1"
);
attendanceSync
.
setFlag
(
"1"
);
}
else
if
(
attendanceSync
.
getFlag
().
equals
(
"异常"
))
{
}
else
if
(
attendanceSync
.
getFlag
().
equals
(
"异常"
))
{
attendanceSync
.
setFlag
(
"0"
);
attendanceSync
.
setFlag
(
"0"
);
}
}
// 判断考勤是否已经存在,已经存在不会添加
QueryWrapper
<
AttendanceSync
>
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"date_of_attendance"
,
attendanceSync
.
getDateOfAttendance
());
wrapper
.
eq
(
"user_id"
,
attendanceSync
.
getUserId
());
List
<
AttendanceSync
>
attendanceSyncList
=
attendanceSyncRepository
.
selectList
(
wrapper
);
if
(
attendanceSyncList
.
size
()==
0
)
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
}
}
}
}
}
SysUser
user
=
new
SysUser
();
SysUser
user
=
new
SysUser
();
user
.
setFlag
(
"1"
);
user
.
setFlag
(
"1"
);
user
.
setAttendanceShow
(
"0"
);
user
.
setAttendanceShow
(
"0"
);
...
@@ -137,12 +140,15 @@ public class ScheduledResultServiceImpl extends ServiceImpl<ScheduledResultRepos
...
@@ -137,12 +140,15 @@ public class ScheduledResultServiceImpl extends ServiceImpl<ScheduledResultRepos
attendanceSync
.
setNltBzLabel
(
sysUser
.
getNltBzLabel
());
attendanceSync
.
setNltBzLabel
(
sysUser
.
getNltBzLabel
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setPassageTime
(
null
);
attendanceSync
.
setPassageTime
(
null
);
// 判断考勤是否已经存在,已经存在不会添加
if
(
attendanceSyncRepository
.
queryAttendanceSyncs
(
attendanceSync
).
size
()
==
0
)
{
attendanceSync
.
setFlag
(
"0"
);
attendanceSync
.
setFlag
(
"0"
);
// 判断考勤是否已经存在,已经存在不会添加
QueryWrapper
<
AttendanceSync
>
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"date_of_attendance"
,
attendanceSync
.
getDateOfAttendance
());
wrapper
.
eq
(
"user_id"
,
attendanceSync
.
getUserId
());
List
<
AttendanceSync
>
attendanceSyncList
=
attendanceSyncRepository
.
selectList
(
wrapper
);
if
(
attendanceSyncList
.
size
()==
0
)
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
}
}
}
scheduledResult
.
setType
(
"考勤同步"
);
scheduledResult
.
setType
(
"考勤同步"
);
scheduledResult
.
setKqDate
(
TimeUtils
.
getDateNotTime
(
scheduledResult
.
getKqDate
()));
scheduledResult
.
setKqDate
(
TimeUtils
.
getDateNotTime
(
scheduledResult
.
getKqDate
()));
scheduledResult
.
setFlag
(
"1"
);
scheduledResult
.
setFlag
(
"1"
);
...
@@ -189,17 +195,20 @@ public class ScheduledResultServiceImpl extends ServiceImpl<ScheduledResultRepos
...
@@ -189,17 +195,20 @@ public class ScheduledResultServiceImpl extends ServiceImpl<ScheduledResultRepos
attendanceSync
.
setFlag
(
all
.
get
(
i
).
getKqFlag
());
attendanceSync
.
setFlag
(
all
.
get
(
i
).
getKqFlag
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setPassageTime
(
all
.
get
(
i
).
getCrossTime
());
attendanceSync
.
setPassageTime
(
all
.
get
(
i
).
getCrossTime
());
// 判断考勤是否已经存在,已经存在不会添加
if
(
attendanceSyncRepository
.
queryAttendanceSyncs
(
attendanceSync
).
size
()
==
0
)
{
if
(
attendanceSync
.
getFlag
().
equals
(
"正常"
))
{
if
(
attendanceSync
.
getFlag
().
equals
(
"正常"
))
{
attendanceSync
.
setFlag
(
"1"
);
attendanceSync
.
setFlag
(
"1"
);
}
else
if
(
attendanceSync
.
getFlag
().
equals
(
"异常"
))
{
}
else
if
(
attendanceSync
.
getFlag
().
equals
(
"异常"
))
{
attendanceSync
.
setFlag
(
"0"
);
attendanceSync
.
setFlag
(
"0"
);
}
}
// 判断考勤是否已经存在,已经存在不会添加
QueryWrapper
<
AttendanceSync
>
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"date_of_attendance"
,
attendanceSync
.
getDateOfAttendance
());
wrapper
.
eq
(
"user_id"
,
attendanceSync
.
getUserId
());
List
<
AttendanceSync
>
attendanceSyncList
=
attendanceSyncRepository
.
selectList
(
wrapper
);
if
(
attendanceSyncList
.
size
()==
0
)
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
}
}
}
}
}
SysUser
user
=
new
SysUser
();
SysUser
user
=
new
SysUser
();
user
.
setFlag
(
"1"
);
user
.
setFlag
(
"1"
);
user
.
setAttendanceShow
(
"0"
);
user
.
setAttendanceShow
(
"0"
);
...
@@ -229,18 +238,21 @@ public class ScheduledResultServiceImpl extends ServiceImpl<ScheduledResultRepos
...
@@ -229,18 +238,21 @@ public class ScheduledResultServiceImpl extends ServiceImpl<ScheduledResultRepos
attendanceSync
.
setNltBzLabel
(
sysUser
.
getNltBzLabel
());
attendanceSync
.
setNltBzLabel
(
sysUser
.
getNltBzLabel
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setCreateDate
(
new
Date
());
attendanceSync
.
setPassageTime
(
null
);
attendanceSync
.
setPassageTime
(
null
);
// 判断考勤是否已经存在,已经存在不会添加
if
(
attendanceSyncRepository
.
queryAttendanceSyncs
(
attendanceSync
).
size
()
==
0
)
{
attendanceSync
.
setFlag
(
"0"
);
attendanceSync
.
setFlag
(
"0"
);
// 判断考勤是否已经存在,已经存在不会添加
QueryWrapper
<
AttendanceSync
>
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"date_of_attendance"
,
attendanceSync
.
getDateOfAttendance
());
wrapper
.
eq
(
"user_id"
,
attendanceSync
.
getUserId
());
List
<
AttendanceSync
>
attendanceSyncList
=
attendanceSyncRepository
.
selectList
(
wrapper
);
if
(
attendanceSyncList
.
size
()==
0
)
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
attendanceSyncRepository
.
addAttendanceSync
(
attendanceSync
);
}
}
}
}
}
}
}
return
new
CyPersistModel
(
1
);
return
new
CyPersistModel
(
1
);
}
}
List
<
Attendance
>
selectAttendanceList
(
Attendance
attendance
,
ScheduledResult
scheduledResult
){
List
<
Attendance
>
selectAttendanceList
(
Attendance
attendance
,
ScheduledResult
scheduledResult
)
throws
ParseException
{
List
<
Attendance
>
attendanceList
=
new
ArrayList
<>();
List
<
Attendance
>
attendanceList
=
new
ArrayList
<>();
// 根据时间范围筛选所有打卡成功的记录
// 根据时间范围筛选所有打卡成功的记录
// 获取前一天的时间
// 获取前一天的时间
...
...
src/main/java/org/rcisoft/sys/sysuser/entity/SysUser.java
View file @
d7a87cf4
...
@@ -67,7 +67,7 @@ public class SysUser extends CyIdIncreEntity<SysUser> {
...
@@ -67,7 +67,7 @@ public class SysUser extends CyIdIncreEntity<SysUser> {
private
String
deptName
;
private
String
deptName
;
//排序
//排序
@Transient
//
@Transient
private
String
sort
;
private
String
sort
;
@Transient
@Transient
...
...
src/main/resources/mapper/AttendanceSyncMapper.xml
View file @
d7a87cf4
...
@@ -89,14 +89,15 @@
...
@@ -89,14 +89,15 @@
<if
test=
"entity.nltBz != null and entity.nltBz != ''"
>
<if
test=
"entity.nltBz != null and entity.nltBz != ''"
>
and attendance_sync.nlt_bz = #{entity.nltBz}
and attendance_sync.nlt_bz = #{entity.nltBz}
</if>
</if>
order by IF(ISNULL(sd.weight),1,0) , sd.weight, IF(ISNULL(su.sort),1,0) ,su.sort , attendance_sync.date_of_attendance desc ,
<if
test=
"entity.sort == '0'.toString()"
>
<if
test=
"entity.sort == '0'.toString()"
>
order by attendance_sync.date_of_attendance desc ,IF(ISNULL(sd.weight),1,0) , sd.weight,
attendance_sync.work_hours desc
attendance_sync.work_hours desc
</if>
</if>
<if
test=
"entity.sort == '1'.toString()"
>
<if
test=
"entity.sort == '1'.toString()"
>
order by attendance_sync.date_of_attendance desc ,IF(ISNULL(sd.weight),1,0) , sd.weight,
attendance_sync.off_hours desc
attendance_sync.off_hours desc
</if>
</if>
<if
test=
"entity.sort == '2'.toString()"
>
<if
test=
"entity.sort == '2'.toString()"
>
order by attendance_sync.date_of_attendance desc ,IF(ISNULL(sd.weight),1,0) , sd.weight,
attendance_sync.time_on_job + 0
attendance_sync.time_on_job + 0
</if>
</if>
</select>
</select>
...
...
src/main/resources/mapper/SysUserRepositorys.xml
View file @
d7a87cf4
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<result
column=
"address"
jdbcType=
"VARCHAR"
property=
"address"
/>
<result
column=
"address"
jdbcType=
"VARCHAR"
property=
"address"
/>
<result
column=
"face_address"
jdbcType=
"VARCHAR"
property=
"faceAddress"
/>
<result
column=
"face_address"
jdbcType=
"VARCHAR"
property=
"faceAddress"
/>
<result
column=
"blacklist_flag"
jdbcType=
"VARCHAR"
property=
"blacklistFlag"
/>
<result
column=
"blacklist_flag"
jdbcType=
"VARCHAR"
property=
"blacklistFlag"
/>
<result
column=
"sort"
jdbcType=
"BIGINT"
property=
"sort"
/>
<result
column=
"positionLabel"
jdbcType=
"VARCHAR"
property=
"positionLabel"
/>
<result
column=
"positionLabel"
jdbcType=
"VARCHAR"
property=
"positionLabel"
/>
<result
column=
"nltBzLabel"
jdbcType=
"VARCHAR"
property=
"nltBzLabel"
/>
<result
column=
"nltBzLabel"
jdbcType=
"VARCHAR"
property=
"nltBzLabel"
/>
<result
column=
"deptName"
jdbcType=
"VARCHAR"
property=
"deptName"
/>
<result
column=
"deptName"
jdbcType=
"VARCHAR"
property=
"deptName"
/>
...
@@ -240,6 +240,7 @@
...
@@ -240,6 +240,7 @@
<if
test=
"addressLabel != null"
>
address_label ,
</if>
<if
test=
"addressLabel != null"
>
address_label ,
</if>
<if
test=
"positionLabel != null"
>
position_label ,
</if>
<if
test=
"positionLabel != null"
>
position_label ,
</if>
<if
test=
"nltBzLabel != null"
>
nlt_bz_label ,
</if>
<if
test=
"nltBzLabel != null"
>
nlt_bz_label ,
</if>
<if
test=
"sort != null"
>
sort ,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"username != null"
>
#{username},
</if>
<if
test=
"username != null"
>
#{username},
</if>
...
@@ -260,6 +261,7 @@
...
@@ -260,6 +261,7 @@
<if
test=
"addressLabel != null"
>
#{addressLabel},
</if>
<if
test=
"addressLabel != null"
>
#{addressLabel},
</if>
<if
test=
"positionLabel != null"
>
#{positionLabel},
</if>
<if
test=
"positionLabel != null"
>
#{positionLabel},
</if>
<if
test=
"nltBzLabel != null"
>
#{nltBzLabel},
</if>
<if
test=
"nltBzLabel != null"
>
#{nltBzLabel},
</if>
<if
test=
"sort != null"
>
#{sort},
</if>
</trim>
</trim>
</insert>
</insert>
...
@@ -287,6 +289,7 @@
...
@@ -287,6 +289,7 @@
<if
test=
"addressLabel != null"
>
address_label ,
</if>
<if
test=
"addressLabel != null"
>
address_label ,
</if>
<if
test=
"positionLabel != null"
>
position_label ,
</if>
<if
test=
"positionLabel != null"
>
position_label ,
</if>
<if
test=
"nltBzLabel != null"
>
nlt_bz_label ,
</if>
<if
test=
"nltBzLabel != null"
>
nlt_bz_label ,
</if>
<if
test=
"sort != null"
>
sort ,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"username != null"
>
#{username},
</if>
<if
test=
"username != null"
>
#{username},
</if>
...
@@ -310,6 +313,7 @@
...
@@ -310,6 +313,7 @@
<if
test=
"addressLabel != null"
>
#{addressLabel},
</if>
<if
test=
"addressLabel != null"
>
#{addressLabel},
</if>
<if
test=
"positionLabel != null"
>
#{positionLabel},
</if>
<if
test=
"positionLabel != null"
>
#{positionLabel},
</if>
<if
test=
"nltBzLabel != null"
>
#{nltBzLabel},
</if>
<if
test=
"nltBzLabel != null"
>
#{nltBzLabel},
</if>
<if
test=
"sort != null"
>
#{sort},
</if>
</trim>
</trim>
</insert>
</insert>
...
@@ -339,6 +343,7 @@
...
@@ -339,6 +343,7 @@
<if
test=
"entity.glFlag != null and entity.glFlag !=''"
>
gl_flag = #{entity.glFlag},
</if>
<if
test=
"entity.glFlag != null and entity.glFlag !=''"
>
gl_flag = #{entity.glFlag},
</if>
<if
test=
"entity.addressLabel != null and entity.addressLabel !=''"
>
address_label = #{entity.addressLabel} ,
</if>
<if
test=
"entity.addressLabel != null and entity.addressLabel !=''"
>
address_label = #{entity.addressLabel} ,
</if>
<if
test=
"entity.positionLabel != null and entity.positionLabel !=''"
>
position_label = #{entity.positionLabel},
</if>
<if
test=
"entity.positionLabel != null and entity.positionLabel !=''"
>
position_label = #{entity.positionLabel},
</if>
<if
test=
"entity.sort != null and entity.sort !='' "
>
sort = #{entity.sort},
</if>
</trim>
</trim>
where business_id = #{entity.businessId}
where business_id = #{entity.businessId}
</update>
</update>
...
@@ -355,7 +360,8 @@
...
@@ -355,7 +360,8 @@
position,
position,
person_id,
person_id,
nlt_bz,
nlt_bz,
flag
flag,
sort
from sys_user
from sys_user
where del_flag = 0
where del_flag = 0
and business_id = #{businessId}
and business_id = #{businessId}
...
...
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