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
30d31a3d
Commit
30d31a3d
authored
Oct 11, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理代码
parent
1d05a2b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
3 deletions
+57
-3
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkOtherAttendance.java
...odule/attendance/service/work/FixWorkOtherAttendance.java
+57
-3
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkOtherAttendance.java
View file @
30d31a3d
...
@@ -18,9 +18,13 @@ import com.mortals.xhx.module.holiday.model.HolidayQuery;
...
@@ -18,9 +18,13 @@ import com.mortals.xhx.module.holiday.model.HolidayQuery;
import
com.mortals.xhx.module.holiday.service.HolidayService
;
import
com.mortals.xhx.module.holiday.service.HolidayService
;
import
com.mortals.xhx.module.perform.model.PerformAttendRecordEntity
;
import
com.mortals.xhx.module.perform.model.PerformAttendRecordEntity
;
import
com.mortals.xhx.module.perform.model.PerformAttendRecordQuery
;
import
com.mortals.xhx.module.perform.model.PerformAttendRecordQuery
;
import
com.mortals.xhx.module.perform.model.PerformErrorMessageEntity
;
import
com.mortals.xhx.module.perform.model.PerformErrorMessageQuery
;
import
com.mortals.xhx.module.perform.service.PerformAttendRecordService
;
import
com.mortals.xhx.module.perform.service.PerformAttendRecordService
;
import
com.mortals.xhx.module.perform.service.PerformErrorMessageService
;
import
com.mortals.xhx.utils.SpringUtils
;
import
com.mortals.xhx.utils.SpringUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -52,6 +56,8 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
...
@@ -52,6 +56,8 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
private
CheckAttendRecordService
checkAttendRecordService
;
private
CheckAttendRecordService
checkAttendRecordService
;
private
PerformErrorMessageService
performErrorMessageService
;
public
FixWorkOtherAttendance
(
int
type
)
{
public
FixWorkOtherAttendance
(
int
type
)
{
super
(
type
);
super
(
type
);
this
.
attendanceGroupFixedworkService
=
SpringUtils
.
getBean
(
AttendanceGroupFixedworkService
.
class
);
this
.
attendanceGroupFixedworkService
=
SpringUtils
.
getBean
(
AttendanceGroupFixedworkService
.
class
);
...
@@ -59,6 +65,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
...
@@ -59,6 +65,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
this
.
attendanceLeaveRecordService
=
SpringUtils
.
getBean
(
AttendanceLeaveRecordService
.
class
);
this
.
attendanceLeaveRecordService
=
SpringUtils
.
getBean
(
AttendanceLeaveRecordService
.
class
);
this
.
performAttendRecordService
=
SpringUtils
.
getBean
(
PerformAttendRecordService
.
class
);
this
.
performAttendRecordService
=
SpringUtils
.
getBean
(
PerformAttendRecordService
.
class
);
this
.
checkAttendRecordService
=
SpringUtils
.
getBean
(
CheckAttendRecordService
.
class
);
this
.
checkAttendRecordService
=
SpringUtils
.
getBean
(
CheckAttendRecordService
.
class
);
this
.
performErrorMessageService
=
SpringUtils
.
getBean
(
PerformErrorMessageService
.
class
);
}
}
...
@@ -448,7 +455,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
...
@@ -448,7 +455,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
//删除当前员工当日未处理的异常后,重新添加 处理的 不做删除
//删除当前员工当日未处理的异常后,重新添加 处理的 不做删除
//deleteErrorRecord(dateStr, attendanceRecordEntity.getStaffId(), context);
//deleteErrorRecord(dateStr, attendanceRecordEntity.getStaffId(), context);
//todo 级联删除优化
//todo 级联删除优化
deleteErrorRecordCache
(
attendanceRecordEntity
.
getStaffId
(),
context
);
deleteErrorRecordCache
(
attendanceRecordEntity
.
getStaffId
(),
context
);
if
(!
ObjectUtils
.
isEmpty
(
errorEntityList
))
{
if
(!
ObjectUtils
.
isEmpty
(
errorEntityList
))
{
//过滤异常列表中存在相同的记录
//过滤异常列表中存在相同的记录
errorEntityList
=
errorEntityList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
errorEntityList
=
errorEntityList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
...
@@ -490,7 +497,8 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
...
@@ -490,7 +497,8 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
stopWatch
.
start
(
"删除异常记录耗时"
);
stopWatch
.
start
(
"删除异常记录耗时"
);
//todo 耗时长,删除优化
//todo 耗时长,删除优化
//errorService
//errorService
errorService
.
getDao
().
delete
(
errorIds
);
/*
//线程池去删除异常记录
//线程池去删除异常记录
Runnable runnable = new Runnable() {
Runnable runnable = new Runnable() {
@Override
@Override
...
@@ -498,7 +506,53 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
...
@@ -498,7 +506,53 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
errorService.remove(errorIds, context);
errorService.remove(errorIds, context);
}
}
};
};
ThreadPool
.
getInstance
().
execute
(
runnable
);
ThreadPool.getInstance().execute(runnable);*/
PerformAttendRecordQuery
query
=
new
PerformAttendRecordQuery
();
query
.
setStaffId
(
staffId
);
query
.
setErrorTimeStart
(
DateUtil
.
formatDate
(
delErrorList
.
get
(
0
).
getErrorDateTime
()));
query
.
setErrorTimeEnd
(
DateUtil
.
formatDate
(
delErrorList
.
get
(
0
).
getErrorDateTime
()));
query
.
setRuleIdNotList
(
Arrays
.
asList
(
9L
));
List
<
PerformAttendRecordEntity
>
attendRecords
=
performAttendRecordService
.
find
(
query
,
context
);
List
<
PerformAttendRecordEntity
>
delAttendRecords
=
attendRecords
.
stream
().
map
(
item
->
{
Date
errorTime
=
item
.
getErrorTime
();
for
(
AttendanceRecordErrorEntity
attendRecord
:
delErrorList
)
{
if
(
errorTime
.
getTime
()
==
attendRecord
.
getErrorDateTime
().
getTime
())
{
return
item
;
}
}
return
null
;
}).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
delAttendRecords
))
{
Long
[]
delIds
=
delAttendRecords
.
stream
().
map
(
i
->
i
.
getId
()).
toArray
(
Long
[]::
new
);
performAttendRecordService
.
getDao
().
delete
(
delIds
);
CheckAttendRecordQuery
checkAttendRecordQuery
=
new
CheckAttendRecordQuery
();
checkAttendRecordQuery
.
setRecordIdList
(
Arrays
.
asList
(
delIds
));
List
<
CheckAttendRecordEntity
>
checkAttendRecordEntities
=
checkAttendRecordService
.
find
(
checkAttendRecordQuery
,
context
);
if
(!
ObjectUtils
.
isEmpty
(
checkAttendRecordEntities
))
{
Long
[]
checkIds
=
checkAttendRecordEntities
.
stream
().
map
(
i
->
i
.
getId
()).
toArray
(
Long
[]::
new
);
checkAttendRecordService
.
getDao
().
delete
(
checkIds
);
// checkAttendRecordService.remove(checkIds, context);
// log.info("删除考勤核查记录成功,size:{}",checkIds.length);
PerformErrorMessageQuery
performErrorMessageQuery
=
new
PerformErrorMessageQuery
();
performErrorMessageQuery
.
setPerformType
(
PerformTypeEnum
.
考勤绩效
.
getValue
());
performErrorMessageQuery
.
setCheckRecordIdList
(
Arrays
.
asList
(
checkIds
));
List
<
PerformErrorMessageEntity
>
errorList
=
performErrorMessageService
.
find
(
performErrorMessageQuery
);
if
(
CollectionUtils
.
isNotEmpty
(
errorList
))
{
Long
[]
deleteIds
=
errorList
.
stream
().
map
(
i
->
i
.
getId
()).
toArray
(
Long
[]::
new
);
performErrorMessageService
.
remove
(
deleteIds
,
context
);
}
}
}
// errorService.getDao().delete(errorIds);
// errorService.getDao().delete(errorIds);
/*
/*
...
...
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