Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
43da2900
Commit
43da2900
authored
Apr 19, 2023
by
daijunxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新定时任务
parent
673d84b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
83 deletions
+82
-83
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
+82
-83
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
View file @
43da2900
...
@@ -77,7 +77,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -77,7 +77,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
DeptEntity
deptEntityParent
=
deptDao
.
queryDeptParient
(
listDept
.
getParentOrgIndexCode
());
DeptEntity
deptEntityParent
=
deptDao
.
queryDeptParient
(
listDept
.
getParentOrgIndexCode
());
//新增
//新增
if
(
Objects
.
isNull
(
deptEntity
))
{
if
(
Objects
.
isNull
(
deptEntity
))
{
DeptEntity
deptEntity1
=
new
DeptEntity
();
DeptEntity
deptEntity1
=
new
DeptEntity
();
deptEntity1
.
initAttrValue
();
deptEntity1
.
initAttrValue
();
if
(
Objects
.
nonNull
(
deptEntityParent
))
{
if
(
Objects
.
nonNull
(
deptEntityParent
))
{
deptEntity1
.
setParentId
(
deptEntityParent
.
getId
());
deptEntity1
.
setParentId
(
deptEntityParent
.
getId
());
...
@@ -118,10 +118,19 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -118,10 +118,19 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
//根据id获取本地数据
//根据id获取本地数据
StaffEntity
staffEntity1
=
staffDao
.
queryHik
(
list
.
getPersonId
());
StaffEntity
staffEntity1
=
staffDao
.
queryHik
(
list
.
getPersonId
());
DeptEntity
deptEntity
=
deptDao
.
queryDept
(
list
.
getOrgIndexCode
());
DeptEntity
deptEntity
=
deptDao
.
queryDept
(
list
.
getOrgIndexCode
());
AttendanceVacationBalanceEntity
balanceEntity
=
balanceDao
.
queryEntity
(
staffEntity1
.
getId
());
AttendanceStatEntity
statEntity
=
attendanceStatDao
.
queryEntity
(
staffEntity1
.
getId
());
//同步人员的考勤汇总信息
// //通过员工id获取考勤数据
// AttendanceRecordEntity attendanceRecordEntity = attendanceRecordDao.get(staffEntity1.getId());
// //通过考勤id统计上班迟到次数
//// int goWorkCountDele = attendanceRecordDetailDao.goWorkCount(attendanceRecordEntity.getId());
//// //员工id获取异常打卡所有记录
//// int errorAttendaceCount = attendanceRecordErrorDao.errorAttendance(attendanceRecordEntity.getId());
//判断本地数据是否为空
//判断本地数据是否为空
if
(
Objects
.
isNull
(
staffEntity1
))
{
if
(
Objects
.
isNull
(
staffEntity1
))
{
//新增员工信息
//新增员工信息
StaffEntity
staffEntity
=
new
StaffEntity
();
StaffEntity
staffEntity
=
new
StaffEntity
();
staffEntity
.
initAttrValue
();
staffEntity
.
initAttrValue
();
if
(
Objects
.
nonNull
(
staffEntity1
))
{
if
(
Objects
.
nonNull
(
staffEntity1
))
{
staffEntity
.
setDeptId
(
deptEntity
.
getId
());
staffEntity
.
setDeptId
(
deptEntity
.
getId
());
...
@@ -144,7 +153,43 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -144,7 +153,43 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity
.
setPhoneNumber
(
String
.
valueOf
(
list
.
getPhoneNo
()));
staffEntity
.
setPhoneNumber
(
String
.
valueOf
(
list
.
getPhoneNo
()));
}
}
service
.
save
(
staffEntity
);
service
.
save
(
staffEntity
);
AttendanceVacationBalanceEntity
attendanceVacationBalanceEntity
=
new
AttendanceVacationBalanceEntity
();
AttendanceStatEntity
attendanceStatEntity
=
new
AttendanceStatEntity
();
attendanceStatEntity
.
initAttrValue
();
attendanceStatEntity
.
setStaffId
(
staffEntity
.
getId
());
attendanceStatEntity
.
setStaffName
(
staffEntity
.
getName
());
attendanceStatEntity
.
setDeptId
(
staffEntity
.
getDeptId
());
attendanceStatEntity
.
setDeptName
(
staffEntity
.
getDeptName
());
attendanceStatEntity
.
setCreateTime
(
new
Date
());
attendanceStatEntity
.
setCreateUserId
(
Long
.
valueOf
(
1
));
//21假
attendanceStatEntity
.
setBackToUnit
(
balanceEntity
.
getBackToUnit
());
attendanceStatEntity
.
setOnDutyLeave
(
balanceEntity
.
getOnDutyLeave
());
attendanceStatEntity
.
setOutOfOffice
(
balanceEntity
.
getOutOfOffice
());
attendanceStatEntity
.
setShiftCompensation
(
balanceEntity
.
getShiftCompensation
());
attendanceStatEntity
.
setPhysicalExamination
(
balanceEntity
.
getPhysicalExamination
());
attendanceStatEntity
.
setQuarantine
(
balanceEntity
.
getQuarantine
());
attendanceStatEntity
.
setBusinessTrip
(
balanceEntity
.
getBusinessTrip
());
attendanceStatEntity
.
setPublicHoliday
(
balanceEntity
.
getPublicHoliday
());
attendanceStatEntity
.
setSickLeave
(
balanceEntity
.
getSickLeaveDays
());
attendanceStatEntity
.
setFuneralLeave
(
balanceEntity
.
getBereavementLeaveDays
());
attendanceStatEntity
.
setMarriageLeave
(
balanceEntity
.
getMarriageLeaveDays
());
attendanceStatEntity
.
setChildRearingLeave
(
balanceEntity
.
getChildRearingLeave
());
attendanceStatEntity
.
setBreastfeedingLeaveDays
(
balanceEntity
.
getBreastfeedingLeaveDays
());
attendanceStatEntity
.
setMenstrualLeaveDays
(
balanceEntity
.
getMenstrualLeaveDays
());
attendanceStatEntity
.
setAnnualLeaveDays
(
balanceEntity
.
getAnnualLeaveDays
());
attendanceStatEntity
.
setCompensatedLeaveDays
(
balanceEntity
.
getCompensatedLeaveDays
());
attendanceStatEntity
.
setPaternityLeaveDays
(
balanceEntity
.
getPaternityLeaveDays
());
attendanceStatEntity
.
setMaternityLeave
(
balanceEntity
.
getMaternityLeaveDays
());
attendanceStatEntity
.
setTransferBack
(
balanceEntity
.
getTransferBack
());
attendanceStatEntity
.
setHomeLeave
(
balanceEntity
.
getHomeLeave
());
attendanceStatEntity
.
setPersonalLeave
(
balanceEntity
.
getPersonalLeaveDays
());
// attendanceStatEntity.setLateTimes(goWorkCountDele);
// attendanceStatEntity.setNonCompliancePunch(BigDecimal.valueOf(errorAttendaceCount));
attendanceStatDao
.
insert
(
attendanceStatEntity
);
AttendanceVacationBalanceEntity
attendanceVacationBalanceEntity
=
new
AttendanceVacationBalanceEntity
();
attendanceVacationBalanceEntity
.
initAttrValue
();
attendanceVacationBalanceEntity
.
initAttrValue
();
attendanceVacationBalanceEntity
.
setStaffId
(
staffEntity
.
getId
());
attendanceVacationBalanceEntity
.
setStaffId
(
staffEntity
.
getId
());
attendanceVacationBalanceEntity
.
setStaffName
(
staffEntity
.
getName
());
attendanceVacationBalanceEntity
.
setStaffName
(
staffEntity
.
getName
());
...
@@ -186,7 +231,40 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -186,7 +231,40 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity1
.
setPhoneNumber
(
String
.
valueOf
(
list
.
getPhoneNo
()));
staffEntity1
.
setPhoneNumber
(
String
.
valueOf
(
list
.
getPhoneNo
()));
}
}
service
.
update
(
staffEntity1
);
service
.
update
(
staffEntity1
);
AttendanceVacationBalanceEntity
attendanceVacationBalanceEntity
=
new
AttendanceVacationBalanceEntity
();
if
(
Objects
.
nonNull
(
statEntity
)){
statEntity
.
initAttrValue
();
statEntity
.
setStaffId
(
staffEntity1
.
getId
());
statEntity
.
setStaffName
(
staffEntity1
.
getName
());
statEntity
.
setDeptId
(
staffEntity1
.
getDeptId
());
statEntity
.
setDeptName
(
staffEntity1
.
getDeptName
());
//21假
statEntity
.
setBackToUnit
(
balanceEntity
.
getBackToUnit
());
statEntity
.
setOnDutyLeave
(
balanceEntity
.
getOnDutyLeave
());
statEntity
.
setOutOfOffice
(
balanceEntity
.
getOutOfOffice
());
statEntity
.
setShiftCompensation
(
balanceEntity
.
getShiftCompensation
());
statEntity
.
setPhysicalExamination
(
balanceEntity
.
getPhysicalExamination
());
statEntity
.
setQuarantine
(
balanceEntity
.
getQuarantine
());
statEntity
.
setBusinessTrip
(
balanceEntity
.
getBusinessTrip
());
statEntity
.
setPublicHoliday
(
balanceEntity
.
getPublicHoliday
());
statEntity
.
setSickLeave
(
balanceEntity
.
getSickLeaveDays
());
statEntity
.
setFuneralLeave
(
balanceEntity
.
getBereavementLeaveDays
());
statEntity
.
setMarriageLeave
(
balanceEntity
.
getMarriageLeaveDays
());
statEntity
.
setChildRearingLeave
(
balanceEntity
.
getChildRearingLeave
());
statEntity
.
setBreastfeedingLeaveDays
(
balanceEntity
.
getBreastfeedingLeaveDays
());
statEntity
.
setMenstrualLeaveDays
(
balanceEntity
.
getMenstrualLeaveDays
());
statEntity
.
setAnnualLeaveDays
(
balanceEntity
.
getAnnualLeaveDays
());
statEntity
.
setCompensatedLeaveDays
(
balanceEntity
.
getCompensatedLeaveDays
());
statEntity
.
setPaternityLeaveDays
(
balanceEntity
.
getPaternityLeaveDays
());
statEntity
.
setMaternityLeave
(
balanceEntity
.
getMaternityLeaveDays
());
statEntity
.
setTransferBack
(
balanceEntity
.
getTransferBack
());
statEntity
.
setHomeLeave
(
balanceEntity
.
getHomeLeave
());
statEntity
.
setPersonalLeave
(
balanceEntity
.
getPersonalLeaveDays
());
// statEntity.setLateTimes(goWorkCountDele);
// statEntity.setNonCompliancePunch(BigDecimal.valueOf(errorAttendaceCount));
attendanceStatDao
.
update
(
statEntity
);
}
AttendanceVacationBalanceEntity
attendanceVacationBalanceEntity
=
new
AttendanceVacationBalanceEntity
();
attendanceVacationBalanceEntity
.
initAttrValue
();
attendanceVacationBalanceEntity
.
initAttrValue
();
attendanceVacationBalanceEntity
.
setStaffId
(
staffEntity1
.
getId
());
attendanceVacationBalanceEntity
.
setStaffId
(
staffEntity1
.
getId
());
attendanceVacationBalanceEntity
.
setStaffName
(
staffEntity1
.
getName
());
attendanceVacationBalanceEntity
.
setStaffName
(
staffEntity1
.
getName
());
...
@@ -201,90 +279,11 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -201,90 +279,11 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
if
(
Objects
.
nonNull
(
deptEntity2
))
{
if
(
Objects
.
nonNull
(
deptEntity2
))
{
deptEntity2
.
setPersonNum
(
deptEntity2
.
getPersonNum
()
+
1
);
deptEntity2
.
setPersonNum
(
deptEntity2
.
getPersonNum
()
+
1
);
deptService
.
update
(
deptEntity2
);
deptService
.
update
(
deptEntity2
);
System
.
out
.
println
(
"1"
);
}
}
}
}
}
}
//同步人员的考勤汇总信息
// //通过员工id获取考勤数据
// AttendanceRecordEntity attendanceRecordEntity = attendanceRecordDao.get(staffEntity1.getId());
// //通过考勤id统计上班迟到次数
//// int goWorkCountDele = attendanceRecordDetailDao.goWorkCount(attendanceRecordEntity.getId());
//// //员工id获取异常打卡所有记录
//// int errorAttendaceCount = attendanceRecordErrorDao.errorAttendance(attendanceRecordEntity.getId());
AttendanceVacationBalanceEntity
balanceEntity
=
balanceDao
.
queryEntity
(
staffEntity1
.
getId
());
AttendanceStatEntity
statEntity
=
attendanceStatDao
.
queryEntity
(
staffEntity1
.
getId
());
//为空执行新增
if
(
Objects
.
isNull
(
statEntity
)){
AttendanceStatEntity
attendanceStatEntity
=
new
AttendanceStatEntity
();
attendanceStatEntity
.
initAttrValue
();
attendanceStatEntity
.
setStaffId
(
staffEntity1
.
getId
());
attendanceStatEntity
.
setStaffName
(
staffEntity1
.
getName
());
attendanceStatEntity
.
setDeptId
(
staffEntity1
.
getDeptId
());
attendanceStatEntity
.
setDeptName
(
staffEntity1
.
getDeptName
());
attendanceStatEntity
.
setCreateTime
(
new
Date
());
attendanceStatEntity
.
setCreateUserId
(
Long
.
valueOf
(
1
));
//21假
attendanceStatEntity
.
setBackToUnit
(
balanceEntity
.
getBackToUnit
());
attendanceStatEntity
.
setOnDutyLeave
(
balanceEntity
.
getOnDutyLeave
());
attendanceStatEntity
.
setOutOfOffice
(
balanceEntity
.
getOutOfOffice
());
attendanceStatEntity
.
setShiftCompensation
(
balanceEntity
.
getShiftCompensation
());
attendanceStatEntity
.
setPhysicalExamination
(
balanceEntity
.
getPhysicalExamination
());
attendanceStatEntity
.
setQuarantine
(
balanceEntity
.
getQuarantine
());
attendanceStatEntity
.
setBusinessTrip
(
balanceEntity
.
getBusinessTrip
());
attendanceStatEntity
.
setPublicHoliday
(
balanceEntity
.
getPublicHoliday
());
attendanceStatEntity
.
setSickLeave
(
balanceEntity
.
getSickLeaveDays
());
attendanceStatEntity
.
setFuneralLeave
(
balanceEntity
.
getBereavementLeaveDays
());
attendanceStatEntity
.
setMarriageLeave
(
balanceEntity
.
getMarriageLeaveDays
());
attendanceStatEntity
.
setChildRearingLeave
(
balanceEntity
.
getChildRearingLeave
());
attendanceStatEntity
.
setBreastfeedingLeaveDays
(
balanceEntity
.
getBreastfeedingLeaveDays
());
attendanceStatEntity
.
setMenstrualLeaveDays
(
balanceEntity
.
getMenstrualLeaveDays
());
attendanceStatEntity
.
setAnnualLeaveDays
(
balanceEntity
.
getAnnualLeaveDays
());
attendanceStatEntity
.
setCompensatedLeaveDays
(
balanceEntity
.
getCompensatedLeaveDays
());
attendanceStatEntity
.
setPaternityLeaveDays
(
balanceEntity
.
getPaternityLeaveDays
());
attendanceStatEntity
.
setMaternityLeave
(
balanceEntity
.
getMaternityLeaveDays
());
attendanceStatEntity
.
setTransferBack
(
balanceEntity
.
getTransferBack
());
attendanceStatEntity
.
setHomeLeave
(
balanceEntity
.
getHomeLeave
());
attendanceStatEntity
.
setPersonalLeave
(
balanceEntity
.
getPersonalLeaveDays
());
// attendanceStatEntity.setLateTimes(goWorkCountDele);
// attendanceStatEntity.setNonCompliancePunch(BigDecimal.valueOf(errorAttendaceCount));
attendanceStatDao
.
insert
(
attendanceStatEntity
);
}
//不为空执行修改
else
{
statEntity
.
initAttrValue
();
statEntity
.
setStaffId
(
staffEntity1
.
getId
());
statEntity
.
setStaffName
(
staffEntity1
.
getName
());
statEntity
.
setDeptId
(
staffEntity1
.
getDeptId
());
statEntity
.
setDeptName
(
staffEntity1
.
getDeptName
());
//21假
statEntity
.
setBackToUnit
(
balanceEntity
.
getBackToUnit
());
statEntity
.
setOnDutyLeave
(
balanceEntity
.
getOnDutyLeave
());
statEntity
.
setOutOfOffice
(
balanceEntity
.
getOutOfOffice
());
statEntity
.
setShiftCompensation
(
balanceEntity
.
getShiftCompensation
());
statEntity
.
setPhysicalExamination
(
balanceEntity
.
getPhysicalExamination
());
statEntity
.
setQuarantine
(
balanceEntity
.
getQuarantine
());
statEntity
.
setBusinessTrip
(
balanceEntity
.
getBusinessTrip
());
statEntity
.
setPublicHoliday
(
balanceEntity
.
getPublicHoliday
());
statEntity
.
setSickLeave
(
balanceEntity
.
getSickLeaveDays
());
statEntity
.
setFuneralLeave
(
balanceEntity
.
getBereavementLeaveDays
());
statEntity
.
setMarriageLeave
(
balanceEntity
.
getMarriageLeaveDays
());
statEntity
.
setChildRearingLeave
(
balanceEntity
.
getChildRearingLeave
());
statEntity
.
setBreastfeedingLeaveDays
(
balanceEntity
.
getBreastfeedingLeaveDays
());
statEntity
.
setMenstrualLeaveDays
(
balanceEntity
.
getMenstrualLeaveDays
());
statEntity
.
setAnnualLeaveDays
(
balanceEntity
.
getAnnualLeaveDays
());
statEntity
.
setCompensatedLeaveDays
(
balanceEntity
.
getCompensatedLeaveDays
());
statEntity
.
setPaternityLeaveDays
(
balanceEntity
.
getPaternityLeaveDays
());
statEntity
.
setMaternityLeave
(
balanceEntity
.
getMaternityLeaveDays
());
statEntity
.
setTransferBack
(
balanceEntity
.
getTransferBack
());
statEntity
.
setHomeLeave
(
balanceEntity
.
getHomeLeave
());
statEntity
.
setPersonalLeave
(
balanceEntity
.
getPersonalLeaveDays
());
// statEntity.setLateTimes(goWorkCountDele);
// statEntity.setNonCompliancePunch(BigDecimal.valueOf(errorAttendaceCount));
attendanceStatDao
.
update
(
statEntity
);
}
}
}
}
}
...
...
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