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
f85d5b1a
Commit
f85d5b1a
authored
Feb 02, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效汇总数据初始化时不生成已离职员工数据
parent
7c8fa494
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
36 deletions
+61
-36
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/StaffPerformInitDataTaskImpl.java
...mortals/xhx/daemon/task/StaffPerformInitDataTaskImpl.java
+61
-36
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/task/StaffPerformInitDataTaskImpl.java
View file @
f85d5b1a
...
...
@@ -4,6 +4,7 @@ import com.mortals.framework.exception.AppException;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.xhx.common.code.StaffSatusEnum
;
import
com.mortals.xhx.module.holiday.model.HolidayEntity
;
import
com.mortals.xhx.module.holiday.model.HolidayQuery
;
import
com.mortals.xhx.module.holiday.service.HolidayService
;
...
...
@@ -70,24 +71,36 @@ public class StaffPerformInitDataTaskImpl implements ITaskExcuteService {
if
(
CollectionUtils
.
isNotEmpty
(
allStaff
))
{
List
<
StaffPerformStatEntity
>
list
=
new
ArrayList
<>();
allStaff
.
stream
().
forEach
(
item
->
{
StaffPerformStatEntity
statEntity
=
new
StaffPerformStatEntity
();
statEntity
.
initAttrValue
();
statEntity
.
setStaffId
(
item
.
getId
());
statEntity
.
setStaffName
(
item
.
getName
());
statEntity
.
setYear
(
year
);
statEntity
.
setMonth
(
month
);
statEntity
.
setDay
(
dayOfMonth
);
statEntity
.
setTotalScore
(
totalScore
);
statEntity
.
setCreateUserId
(
1
l
);
statEntity
.
setCreateTime
(
new
Date
());
StaffPerformStatQuery
tempQuery
=
new
StaffPerformStatQuery
();
tempQuery
.
setStaffId
(
statEntity
.
getStaffId
());
tempQuery
.
setYear
(
statEntity
.
getYear
());
tempQuery
.
setMonth
(
statEntity
.
getMonth
());
tempQuery
.
setDay
(
statEntity
.
getDay
());
StaffPerformStatEntity
temp
=
staffPerformStatService
.
selectOne
(
tempQuery
);
if
(
temp
==
null
)
{
list
.
add
(
statEntity
);
boolean
flag
=
true
;
if
(
item
.
getStatus
()
==
StaffSatusEnum
.
离职
.
getValue
())
{
if
(
item
.
getLeaveDate
()!=
null
){
String
leaveDateStr
=
DateUtils
.
getStrDate
(
item
.
getLeaveDate
());
if
(
DateUtils
.
StrToDate
(
leaveDateStr
).
compareTo
(
DateUtils
.
StrToDate
(
dateStr
))
<
0
){
//离职日期在统计日期之前不统计
flag
=
false
;
}
}
}
if
(
flag
){
StaffPerformStatEntity
statEntity
=
new
StaffPerformStatEntity
();
statEntity
.
initAttrValue
();
statEntity
.
setStaffId
(
item
.
getId
());
statEntity
.
setStaffName
(
item
.
getName
());
statEntity
.
setYear
(
year
);
statEntity
.
setMonth
(
month
);
statEntity
.
setDay
(
dayOfMonth
);
statEntity
.
setTotalScore
(
totalScore
);
statEntity
.
setCreateUserId
(
1
l
);
statEntity
.
setCreateTime
(
new
Date
());
StaffPerformStatQuery
tempQuery
=
new
StaffPerformStatQuery
();
tempQuery
.
setStaffId
(
statEntity
.
getStaffId
());
tempQuery
.
setYear
(
statEntity
.
getYear
());
tempQuery
.
setMonth
(
statEntity
.
getMonth
());
tempQuery
.
setDay
(
statEntity
.
getDay
());
StaffPerformStatEntity
temp
=
staffPerformStatService
.
selectOne
(
tempQuery
);
if
(
temp
==
null
)
{
list
.
add
(
statEntity
);
}
}
});
staffPerformStatService
.
save
(
list
);
...
...
@@ -99,24 +112,36 @@ public class StaffPerformInitDataTaskImpl implements ITaskExcuteService {
if
(
CollectionUtils
.
isNotEmpty
(
allStaff
))
{
List
<
StaffPerformSummaryEntity
>
summaryList
=
new
ArrayList
<>();
allStaff
.
stream
().
forEach
(
item
->
{
StaffPerformSummaryEntity
staffPerformSummaryEntity
=
new
StaffPerformSummaryEntity
();
staffPerformSummaryEntity
.
initAttrValue
();
staffPerformSummaryEntity
.
setStaffId
(
item
.
getId
());
staffPerformSummaryEntity
.
setStaffName
(
item
.
getName
());
staffPerformSummaryEntity
.
setDeptId
(
item
.
getDeptId
());
staffPerformSummaryEntity
.
setDeptName
(
item
.
getDeptName
());
staffPerformSummaryEntity
.
setYear
(
year
);
staffPerformSummaryEntity
.
setMonth
(
month
);
staffPerformSummaryEntity
.
setTotalScore
(
totalScore
);
staffPerformSummaryEntity
.
setCreateUserId
(
1
l
);
staffPerformSummaryEntity
.
setCreateTime
(
new
Date
());
StaffPerformSummaryQuery
summaryQuery
=
new
StaffPerformSummaryQuery
();
summaryQuery
.
setStaffId
(
staffPerformSummaryEntity
.
getStaffId
());
summaryQuery
.
setYear
(
staffPerformSummaryEntity
.
getYear
());
summaryQuery
.
setMonth
(
staffPerformSummaryEntity
.
getMonth
());
StaffPerformSummaryEntity
tempSummary
=
staffPerformSummaryService
.
selectOne
(
summaryQuery
);
if
(
tempSummary
==
null
){
summaryList
.
add
(
staffPerformSummaryEntity
);
boolean
flag
=
true
;
if
(
item
.
getStatus
()
==
StaffSatusEnum
.
离职
.
getValue
())
{
if
(
item
.
getLeaveDate
()!=
null
){
String
leaveDateStr
=
DateUtils
.
getStrDate
(
item
.
getLeaveDate
());
if
(
DateUtils
.
StrToDate
(
leaveDateStr
).
compareTo
(
DateUtils
.
StrToDate
(
dateStr
))
<
0
){
//离职日期在统计日期之前不统计
flag
=
false
;
}
}
}
if
(
flag
)
{
StaffPerformSummaryEntity
staffPerformSummaryEntity
=
new
StaffPerformSummaryEntity
();
staffPerformSummaryEntity
.
initAttrValue
();
staffPerformSummaryEntity
.
setStaffId
(
item
.
getId
());
staffPerformSummaryEntity
.
setStaffName
(
item
.
getName
());
staffPerformSummaryEntity
.
setDeptId
(
item
.
getDeptId
());
staffPerformSummaryEntity
.
setDeptName
(
item
.
getDeptName
());
staffPerformSummaryEntity
.
setYear
(
year
);
staffPerformSummaryEntity
.
setMonth
(
month
);
staffPerformSummaryEntity
.
setTotalScore
(
totalScore
);
staffPerformSummaryEntity
.
setCreateUserId
(
1
l
);
staffPerformSummaryEntity
.
setCreateTime
(
new
Date
());
StaffPerformSummaryQuery
summaryQuery
=
new
StaffPerformSummaryQuery
();
summaryQuery
.
setStaffId
(
staffPerformSummaryEntity
.
getStaffId
());
summaryQuery
.
setYear
(
staffPerformSummaryEntity
.
getYear
());
summaryQuery
.
setMonth
(
staffPerformSummaryEntity
.
getMonth
());
StaffPerformSummaryEntity
tempSummary
=
staffPerformSummaryService
.
selectOne
(
summaryQuery
);
if
(
tempSummary
==
null
)
{
summaryList
.
add
(
staffPerformSummaryEntity
);
}
}
});
staffPerformSummaryService
.
save
(
summaryList
);
...
...
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