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
4027e3bc
Commit
4027e3bc
authored
Jul 22, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效汇总前初始化绩效避免之前有扣分但被全部撤销的情况
parent
ddc111c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
24 deletions
+56
-24
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/StaffCheckSummaryService.java
...x/daemon/applicationservice/StaffCheckSummaryService.java
+32
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/web/StaffPerformSummaryController.java
...s/xhx/module/staff/web/StaffPerformSummaryController.java
+24
-24
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/StaffCheckSummaryService.java
View file @
4027e3bc
...
@@ -7,15 +7,21 @@ import com.mortals.framework.springcloud.service.IApplicationStartedService;
...
@@ -7,15 +7,21 @@ import com.mortals.framework.springcloud.service.IApplicationStartedService;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.common.code.CheckTypeEnum
;
import
com.mortals.xhx.common.code.CheckTypeEnum
;
import
com.mortals.xhx.common.utils.StaffPerformUtil
;
import
com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery
;
import
com.mortals.xhx.module.check.model.vo.StaffCheckSummaryQuery
;
import
com.mortals.xhx.module.check.service.*
;
import
com.mortals.xhx.module.check.service.*
;
import
com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity
;
import
com.mortals.xhx.module.staff.service.StaffPerformSummaryService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.math.BigDecimal
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
RedisKey
.
KEY_CHECK_SUMMARY_CACHE
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
RedisKey
.
KEY_CHECK_SUMMARY_CACHE
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
RedisKey
.
STAFF_PERFORM_SUMMARY
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
RedisKey
.
STAFF_PERFORM_SUMMARY
;
...
@@ -45,6 +51,8 @@ public class StaffCheckSummaryService implements IApplicationStartedService {
...
@@ -45,6 +51,8 @@ public class StaffCheckSummaryService implements IApplicationStartedService {
private
CheckWindowWorkmanPerformService
checkWindowWorkmanPerformService
;
private
CheckWindowWorkmanPerformService
checkWindowWorkmanPerformService
;
@Autowired
@Autowired
private
CheckOtherRecordService
checkOtherRecordService
;
private
CheckOtherRecordService
checkOtherRecordService
;
@Autowired
private
StaffPerformSummaryService
staffPerformSummaryService
;
@Override
@Override
public
void
start
()
{
public
void
start
()
{
...
@@ -74,6 +82,30 @@ public class StaffCheckSummaryService implements IApplicationStartedService {
...
@@ -74,6 +82,30 @@ public class StaffCheckSummaryService implements IApplicationStartedService {
}
}
}
}
//汇总前初始化绩效避免之前有扣分但被全部撤销的情况
Date
date
=
DateUtils
.
StrToDateTime
(
query
.
getCheckTimeStart
());
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
int
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
StaffPerformSummaryEntity
staffPerformSummaryEntity
=
new
StaffPerformSummaryEntity
();
staffPerformSummaryEntity
.
setReviewScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setOtherScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setGoworkScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setEffectScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setComplainScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setAttendScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setTotalScore
(
StaffPerformUtil
.
SCORE100
);
staffPerformSummaryEntity
.
setErrorScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setUpdateTime
(
new
Date
());
Map
<
String
,
Object
>
condition
=
new
HashMap
<>();
condition
.
put
(
"year"
,
year
);
condition
.
put
(
"month"
,
month
);
if
(
query
.
getStaffId
()!=
null
){
condition
.
put
(
"staffId"
,
query
.
getStaffId
());
}
staffPerformSummaryService
.
getDao
().
update
(
staffPerformSummaryEntity
,
condition
);
if
(
query
.
getCheckType
()
==
CheckTypeEnum
.
考勤绩效
.
getValue
()){
if
(
query
.
getCheckType
()
==
CheckTypeEnum
.
考勤绩效
.
getValue
()){
checkAttendRecordService
.
summaryCheck
(
query
);
checkAttendRecordService
.
summaryCheck
(
query
);
}
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/web/StaffPerformSummaryController.java
View file @
4027e3bc
...
@@ -138,30 +138,30 @@ public class StaffPerformSummaryController extends BaseCRUDJsonBodyMappingContro
...
@@ -138,30 +138,30 @@ public class StaffPerformSummaryController extends BaseCRUDJsonBodyMappingContro
if
(
StringUtils
.
isNotEmpty
(
verify
)&&
verify
.
equals
(
"true"
)){
if
(
StringUtils
.
isNotEmpty
(
verify
)&&
verify
.
equals
(
"true"
)){
throw
new
AppException
(
"汇总任务正在执行,请勿重复操作"
);
throw
new
AppException
(
"汇总任务正在执行,请勿重复操作"
);
}
}
if
(
StringUtils
.
isNotEmpty
(
query
.
getCheckTimeStart
())){
//
if(StringUtils.isNotEmpty(query.getCheckTimeStart())){
Date
date
=
DateUtils
.
StrToDateTime
(
query
.
getCheckTimeStart
());
//
Date date = DateUtils.StrToDateTime(query.getCheckTimeStart());
Calendar
calendar
=
Calendar
.
getInstance
();
//
Calendar calendar = Calendar.getInstance();
calendar
.
setTime
(
date
);
//
calendar.setTime(date);
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
//
int year = calendar.get(Calendar.YEAR);
int
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
//
int month = calendar.get(Calendar.MONTH) + 1;
StaffPerformSummaryEntity
staffPerformSummaryEntity
=
new
StaffPerformSummaryEntity
();
//
StaffPerformSummaryEntity staffPerformSummaryEntity = new StaffPerformSummaryEntity();
staffPerformSummaryEntity
.
setReviewScore
(
BigDecimal
.
ZERO
);
//
staffPerformSummaryEntity.setReviewScore(BigDecimal.ZERO);
staffPerformSummaryEntity
.
setOtherScore
(
BigDecimal
.
ZERO
);
//
staffPerformSummaryEntity.setOtherScore(BigDecimal.ZERO);
staffPerformSummaryEntity
.
setGoworkScore
(
BigDecimal
.
ZERO
);
//
staffPerformSummaryEntity.setGoworkScore(BigDecimal.ZERO);
staffPerformSummaryEntity
.
setEffectScore
(
BigDecimal
.
ZERO
);
//
staffPerformSummaryEntity.setEffectScore(BigDecimal.ZERO);
staffPerformSummaryEntity
.
setComplainScore
(
BigDecimal
.
ZERO
);
//
staffPerformSummaryEntity.setComplainScore(BigDecimal.ZERO);
staffPerformSummaryEntity
.
setAttendScore
(
BigDecimal
.
ZERO
);
//
staffPerformSummaryEntity.setAttendScore(BigDecimal.ZERO);
staffPerformSummaryEntity
.
setTotalScore
(
StaffPerformUtil
.
SCORE100
);
//
staffPerformSummaryEntity.setTotalScore(StaffPerformUtil.SCORE100);
staffPerformSummaryEntity
.
setErrorScore
(
BigDecimal
.
ZERO
);
//
staffPerformSummaryEntity.setErrorScore(BigDecimal.ZERO);
staffPerformSummaryEntity
.
setUpdateTime
(
new
Date
());
//
staffPerformSummaryEntity.setUpdateTime(new Date());
Map
<
String
,
Object
>
condition
=
new
HashMap
<>();
//
Map<String,Object> condition = new HashMap<>();
condition
.
put
(
"year"
,
year
);
//
condition.put("year",year);
condition
.
put
(
"month"
,
month
);
//
condition.put("month",month);
if
(
query
.
getStaffId
()!=
null
){
//
if(query.getStaffId()!=null){
condition
.
put
(
"staffId"
,
query
.
getStaffId
());
//
condition.put("staffId",query.getStaffId());
}
//
}
this
.
service
.
getDao
().
update
(
staffPerformSummaryEntity
,
condition
);
//
this.service.getDao().update(staffPerformSummaryEntity,condition);
}
//
}
cacheService
.
lpush
(
KEY_CHECK_SUMMARY_CACHE
,
query
);
cacheService
.
lpush
(
KEY_CHECK_SUMMARY_CACHE
,
query
);
cacheService
.
set
(
SUMMARY_TASK_KEY
,
"true"
,
900
);
//15分钟过期
cacheService
.
set
(
SUMMARY_TASK_KEY
,
"true"
,
900
);
//15分钟过期
model
.
put
(
"message_info"
,
"开始执行绩效汇总,请稍后查看"
);
model
.
put
(
"message_info"
,
"开始执行绩效汇总,请稍后查看"
);
...
...
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