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
8a4d177c
Commit
8a4d177c
authored
Aug 15, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正异常记录有重复的记录
parent
b88d4cd6
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
112 additions
and
240 deletions
+112
-240
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceRecordHikServiceImpl.java
...tendance/service/impl/AttendanceRecordHikServiceImpl.java
+15
-17
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/CommonData.java
...ortals/xhx/module/attendance/service/work/CommonData.java
+4
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkAttendance.java
...xhx/module/attendance/service/work/FixWorkAttendance.java
+5
-2
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckAttendRecordServiceImpl.java
...dule/check/service/impl/CheckAttendRecordServiceImpl.java
+2
-18
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckComplainRecordServiceImpl.java
...le/check/service/impl/CheckComplainRecordServiceImpl.java
+26
-40
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckEffectRecordServiceImpl.java
...dule/check/service/impl/CheckEffectRecordServiceImpl.java
+54
-116
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckGoworkRecordServiceImpl.java
...dule/check/service/impl/CheckGoworkRecordServiceImpl.java
+0
-11
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckOtherRecordServiceImpl.java
...odule/check/service/impl/CheckOtherRecordServiceImpl.java
+2
-14
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckReviewRecordServiceImpl.java
...dule/check/service/impl/CheckReviewRecordServiceImpl.java
+2
-12
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckWindowWorkmanPerformServiceImpl.java
...ck/service/impl/CheckWindowWorkmanPerformServiceImpl.java
+2
-4
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/web/CheckWindowPerformController.java
...ls/xhx/module/check/web/CheckWindowPerformController.java
+0
-3
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/web/CheckWindowWorkmanPerformController.java
...module/check/web/CheckWindowWorkmanPerformController.java
+0
-3
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/impl/AttendanceRecordHikServiceImpl.java
View file @
8a4d177c
...
...
@@ -64,6 +64,8 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
private
HolidayService
holidayService
;
@Autowired
private
IHikDoorService
hikDoorService
;
@Autowired
private
AttendanceClassService
attendanceClassService
;
@Override
...
...
@@ -135,6 +137,10 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
List
<
AttendanceRecordEntity
>
saveList
=
new
ArrayList
<>();
List
<
AttendanceRecordEntity
>
updateList
=
new
ArrayList
<>();
Map
<
Long
,
List
<
AttendanceGroupStaffEntity
>>
groupStaffMap
=
attendanceGroupStaffService
.
find
(
new
AttendanceGroupStaffQuery
()).
parallelStream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getStaffId
()));
Map
<
Long
,
AttendanceGroupEntity
>
groupMap
=
attendanceGroupService
.
find
(
new
AttendanceGroupQuery
()).
parallelStream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
(),
y
->
y
,
(
o
,
n
)
->
n
));
Map
<
Long
,
AttendanceClassEntity
>
classEntityMap
=
attendanceClassService
.
find
(
new
AttendanceClassQuery
()).
parallelStream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
(),
y
->
y
,
(
o
,
n
)
->
n
));
for
(
Map
.
Entry
<
Long
,
List
<
AttendanceRecordHikEntity
>>
itemEntry
:
listMap
.
entrySet
())
{
//按人员
Long
staffId
=
itemEntry
.
getKey
();
...
...
@@ -171,15 +177,16 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
attendanceRecordEntity
.
setSalaName
(
staffEntity
.
getSalaName
());
//通过员工id查询考勤组人员信息
List
<
AttendanceGroupStaffEntity
>
attendanceGroupStaffEntities
=
attendanceGroupStaffService
.
find
(
new
AttendanceGroupStaffQuery
().
staffId
(
staffId
));
// List<AttendanceGroupStaffEntity> attendanceGroupStaffEntities = attendanceGroupStaffService.find(new AttendanceGroupStaffQuery().staffId(staffId));
List
<
AttendanceGroupStaffEntity
>
attendanceGroupStaffEntities
=
groupStaffMap
.
getOrDefault
(
staffId
,
new
ArrayList
<>(
0
));
//过滤重复考勤组与人员
attendanceGroupStaffEntities
=
attendanceGroupStaffEntities
.
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getGroupId
()
+
"#"
+
x
.
getStaffId
(),
y
->
y
,
(
o
,
n
)
->
n
)).
values
().
stream
().
collect
(
Collectors
.
toList
());
List
<
AttendanceRecordDetailEntity
>
detailEntityList
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
attendanceGroupStaffEntities
)
&&
attendanceGroupStaffEntities
.
size
()
==
1
)
{
//checkAttendGroupByOne(attendanceRecordEntity, detailEntityList, attendanceDate, attendanceGroupStaffEntities.get(0), context);
//查询考勤组
AttendanceGroupEntity
attendanceGroupEntity
=
attendanceGroupService
.
get
(
attendanceGroupStaffEntities
.
get
(
0
).
getGroupId
(),
context
);
//AttendanceGroupEntity attendanceGroupEntity = attendanceGroupService.get(attendanceGroupStaffEntities.get(0).getGroupId(), context);
AttendanceGroupEntity
attendanceGroupEntity
=
groupMap
.
get
(
attendanceGroupStaffEntities
.
get
(
0
).
getGroupId
());
attendanceRecordEntity
.
setAttendanceGroupId
(
attendanceGroupEntity
==
null
?
0L
:
attendanceGroupEntity
.
getId
());
attendanceRecordEntity
.
setAttendanceGroupName
(
attendanceGroupEntity
==
null
?
""
:
attendanceGroupEntity
.
getGroupName
());
//查询考勤组详细信息获取班次 todo 默认固定班次 还有自由 与排班制
...
...
@@ -192,6 +199,7 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
commonData
.
setDetailEntityList
(
detailEntityList
);
commonData
.
setStaffId
(
attendanceRecordEntity
.
getStaffId
());
commonData
.
setDateStr
(
dateStr
);
commonData
.
setClassEntityMap
(
classEntityMap
);
workAbstract
.
doHandleWork
(
commonData
);
}
...
...
@@ -202,7 +210,9 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
//多考勤组 todo 暂时和单一覆盖
//checkAttendGroupByOne(attendanceRecordEntity, detailEntityList, attendanceDate, groupStaffEntity, context);
//查询考勤组
AttendanceGroupEntity
attendanceGroupEntity
=
attendanceGroupService
.
get
(
groupStaffEntity
.
getGroupId
(),
context
);
// AttendanceGroupEntity attendanceGroupEntity = attendanceGroupService.get(groupStaffEntity.getGroupId(), context);
AttendanceGroupEntity
attendanceGroupEntity
=
groupMap
.
get
(
groupStaffEntity
.
getGroupId
());
attendanceRecordEntity
.
setAttendanceGroupId
(
attendanceGroupEntity
==
null
?
0L
:
attendanceGroupEntity
.
getId
());
attendanceRecordEntity
.
setAttendanceGroupName
(
attendanceGroupEntity
==
null
?
""
:
attendanceGroupEntity
.
getGroupName
());
//查询考勤组详细信息获取班次 todo 默认固定班次 还有自由 与排班制
...
...
@@ -215,6 +225,7 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
commonData
.
setAttendanceDate
(
attendanceRecordEntity
.
getAttendanceDate
());
commonData
.
setStaffId
(
attendanceRecordEntity
.
getStaffId
());
commonData
.
setDateStr
(
dateStr
);
commonData
.
setClassEntityMap
(
classEntityMap
);
workAbstract
.
doHandleWork
(
commonData
);
}
}
...
...
@@ -247,9 +258,6 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
//判断是否存在记录 如果存在 则更新 维度 staffId attendanceDate shiftsId attendanceGroupId
AttendanceRecordQuery
query
=
new
AttendanceRecordQuery
();
query
.
setStaffId
(
attendanceRecordEntity
.
getStaffId
());
// query.setClassId(attendanceRecordEntity.getClassId());
// query.setAttendanceGroupId(attendanceRecordEntity.getAttendanceGroupId());
//query.setAttendanceDate(attendanceRecordEntity.getAttendanceDate());
query
.
setAttendanceDateStart
(
dateStr
);
query
.
setAttendanceDateEnd
(
dateStr
);
...
...
@@ -259,33 +267,23 @@ public class AttendanceRecordHikServiceImpl extends AbstractCRUDServiceImpl<Atte
attendanceRecordEntity
.
setUpdateTime
(
new
Date
());
attendanceRecordEntity
.
setUpdateUserId
(
this
.
getContextUserId
(
context
));
updateList
.
add
(
attendanceRecordEntity
);
// attendanceRecordService.update(attendanceRecordEntity, context);
}
else
{
saveList
.
add
(
attendanceRecordEntity
);
// attendanceRecordService.save(attendanceRecordEntity, context);
}
}
}
}
if
(!
ObjectUtils
.
isEmpty
(
saveList
))
{
for
(
AttendanceRecordEntity
attendanceRecordEntity
:
saveList
)
{
attendanceRecordService
.
save
(
attendanceRecordEntity
,
context
);
}
//attendanceRecordService.save(saveList, context);
}
if
(!
ObjectUtils
.
isEmpty
(
updateList
))
{
for
(
AttendanceRecordEntity
attendanceRecordEntity
:
updateList
)
{
attendanceRecordService
.
update
(
attendanceRecordEntity
,
context
);
}
/* List<List<AttendanceRecordEntity>> partition = ListUtil.partition(updateList, 30);
for (List<AttendanceRecordEntity> attendanceRecordEntities : partition) {
attendanceRecordService.update(attendanceRecordEntities, context);
}*/
}
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/CommonData.java
View file @
8a4d177c
...
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.module.attendance.service.work;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.module.attendance.model.AttendanceClassEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceGroupEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceRecordDetailEntity
;
import
com.mortals.xhx.module.attendance.model.AttendanceRecordEntity
;
...
...
@@ -9,6 +10,7 @@ import lombok.Data;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* 通用参数
...
...
@@ -33,5 +35,7 @@ public class CommonData {
private
Context
context
;
private
Map
<
Long
,
AttendanceClassEntity
>
classEntityMap
;
}
attendance-performance-manager/src/main/java/com/mortals/xhx/module/attendance/service/work/FixWorkAttendance.java
View file @
8a4d177c
...
...
@@ -62,6 +62,7 @@ public class FixWorkAttendance extends AttendanceWorkAbstract {
public
void
doHandleWork
(
CommonData
commonData
)
{
AttendanceGroupFixedworkEntity
attendanceGroupFixedworkEntity
=
attendanceGroupFixedworkService
.
selectOne
(
new
AttendanceGroupFixedworkQuery
()
.
groupId
(
commonData
.
getAttendanceGroupEntity
().
getId
()));
Map
<
Long
,
AttendanceClassEntity
>
classEntityMap
=
commonData
.
getClassEntityMap
();
//判断当前考勤日期为周几
String
week
=
super
.
getWeek
(
commonData
.
getAttendanceDate
());
//log.info("week:{}", week);
...
...
@@ -117,7 +118,8 @@ public class FixWorkAttendance extends AttendanceWorkAbstract {
if
(
DateUtil
.
formatDate
(
commonData
.
getAttendanceDate
()).
equals
(
DateUtil
.
formatDate
(
specialTime
)))
{
//当前日期不需要考勤打卡
//获取班次信息
AttendanceClassEntity
attendanceClassEntity
=
attendanceClassService
.
get
(
weekClassId
);
// AttendanceClassEntity attendanceClassEntity = attendanceClassService.get(weekClassId);
AttendanceClassEntity
attendanceClassEntity
=
classEntityMap
.
get
(
weekClassId
);
if
(
ObjectUtils
.
isEmpty
(
attendanceClassEntity
))
{
log
.
info
(
"attendanceClassEntity is null ,weekClassId:{}"
,
weekClassId
);
return
;
...
...
@@ -147,7 +149,8 @@ public class FixWorkAttendance extends AttendanceWorkAbstract {
}
//获取班次信息
AttendanceClassEntity
attendanceClassEntity
=
attendanceClassService
.
get
(
weekClassId
);
// AttendanceClassEntity attendanceClassEntity = attendanceClassService.get(weekClassId);
AttendanceClassEntity
attendanceClassEntity
=
classEntityMap
.
get
(
weekClassId
);
if
(
ObjectUtils
.
isEmpty
(
attendanceClassEntity
))
{
log
.
info
(
"attendanceClassEntity is null ,weekClassId:{}"
,
weekClassId
);
return
;
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckAttendRecordServiceImpl.java
View file @
8a4d177c
...
...
@@ -84,13 +84,10 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
private
DeptService
deptService
;
@Autowired
private
PerformAttendRecordService
attendRecordService
;
@Autowired
private
PerformRulesService
rulesService
;
@Autowired
private
ParamService
paramService
;
@Autowired
private
ICacheService
cacheService
;
@Autowired
...
...
@@ -143,20 +140,6 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
}
catch
(
Exception
e
)
{
log
.
error
(
"新增绩效异常信息核查状态出错"
,
e
);
}
// try {
// if(!entity.getErrorTime().after(new Date())) {
// StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
// query.setStaffId(entity.getStaffId());
// query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
// query.setCheckTimeEnd(query.getCheckTimeStart());
// query.setCheckType(CheckTypeEnum.考勤绩效.getValue());
// cacheService.lpush(KEY_CHECK_SUMMARY_CACHE, query);
// }
// //summaryCheck(query);
// } catch (Exception e) {
// log.error("汇总已审核的核查记录出错", e);
// }
}
@Override
...
...
@@ -287,7 +270,8 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
weightPdu
=
JSONObject
.
parseObject
(
value
,
WeightPdu
.
class
);
}
for
(
StaffCheckSummaryVo
vo
:
summaryVoList
)
{
StaffEntity
staffEntity
=
staffService
.
get
(
vo
.
getStaffId
());
StaffEntity
staffEntity
=
staffService
.
getCache
(
vo
.
getStaffId
().
toString
());
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
continue
;
if
(
staffEntity
.
getStatus
()
==
StaffSatusEnum
.
离职
.
getValue
())
{
if
(
staffEntity
.
getLeaveDate
()!=
null
){
String
leaveDateStr
=
DateUtils
.
getStrDate
(
staffEntity
.
getLeaveDate
());
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckComplainRecordServiceImpl.java
View file @
8a4d177c
...
...
@@ -66,7 +66,6 @@ import static com.mortals.xhx.common.key.RedisKey.KEY_CHECK_SUMMARY_CACHE;
@Service
(
"checkComplainRecordService"
)
@Slf4j
public
class
CheckComplainRecordServiceImpl
extends
AbstractCRUDServiceImpl
<
CheckComplainRecordDao
,
CheckComplainRecordEntity
,
Long
>
implements
CheckComplainRecordService
{
@Autowired
private
StaffPerformSummaryService
staffPerformSummaryService
;
@Autowired
...
...
@@ -83,8 +82,6 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
private
DeptService
deptService
;
@Autowired
private
PerformComplainRecordService
recordService
;
@Autowired
private
PerformRulesService
rulesService
;
@Autowired
...
...
@@ -124,7 +121,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
protected
void
saveAfter
(
CheckComplainRecordEntity
entity
,
Context
context
)
throws
AppException
{
//添加绩效异常信息
try
{
if
(
entity
.
getRemark
().
indexOf
(
"申诉成功"
)
<
0
)
{
if
(
entity
.
getRemark
().
indexOf
(
"申诉成功"
)
<
0
)
{
PerformErrorMessageEntity
errorMessageEntity
=
new
PerformErrorMessageEntity
();
errorMessageEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
entity
,
errorMessageEntity
,
BeanUtil
.
getNullPropertyNames
(
entity
));
...
...
@@ -133,21 +130,9 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
errorMessageEntity
.
setPerformType
(
PerformTypeEnum
.
评价投诉绩效
.
getValue
());
performErrorMessageService
.
save
(
errorMessageEntity
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"新增绩效异常信息核查状态出错"
,
e
);
}
// try {
// StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
// query.setStaffId(entity.getStaffId());
// query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
// query.setCheckTimeEnd(query.getCheckTimeStart());
// query.setCheckType(CheckTypeEnum.评价绩效.getValue());
// cacheService.lpush(KEY_CHECK_SUMMARY_CACHE, query);
// //summaryCheck(query);
// } catch (Exception e) {
// log.error("汇总已审核的核查记录出错", e);
// }
}
@Override
...
...
@@ -161,7 +146,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
Long
[]
deleteIds
=
errorList
.
stream
().
map
(
i
->
i
.
getId
()).
toArray
(
Long
[]::
new
);
performErrorMessageService
.
remove
(
deleteIds
,
context
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"删除绩效异常信息核查状态出错"
,
e
);
}
}
...
...
@@ -181,7 +166,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
checkDingMsg
.
setScore
(
entity
.
getScore
().
toString
());
checkDingMsg
.
setSubAddType
(
entity
.
getSubAddType
());
checkDingMsg
.
setPath
(
String
.
format
(
"#/appealinfo?id=%s&&performType=%s&subAddType=%s"
,
entity
.
getId
(),
PerformTypeEnum
.
评价投诉绩效
.
getValue
(),
entity
.
getSubAddType
()));
checkDingMsg
.
setPath
(
String
.
format
(
"#/appealinfo?id=%s&&performType=%s&subAddType=%s"
,
entity
.
getId
(),
PerformTypeEnum
.
评价投诉绩效
.
getValue
(),
entity
.
getSubAddType
()));
//checkDingMsg.setPath(String.format("/api/v1/perform/info?id=%s&&performType=complain", entity.getId()));
Rest
<
String
>
msgRest
=
messageService
.
sendDingTalkWorkMsg
(
checkDingMsg
);
...
...
@@ -207,7 +192,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
entity
.
setUpdateUserId
(
user
.
getId
());
entity
.
setCheckPerson
(
user
.
getRealName
());
}
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getSubAddType
())&&!
ObjectUtils
.
isEmpty
(
entity
.
getCheckResult
()))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getSubAddType
())
&&
!
ObjectUtils
.
isEmpty
(
entity
.
getCheckResult
()))
{
AuditUtil
.
audit
(
entity
);
}
entity
.
setCheckTime
(
temp
.
getComplainTime
());
...
...
@@ -218,7 +203,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
//更新绩效异常信息核查状态
try
{
PerformErrorMessageEntity
errorMessageEntity
=
performErrorMessageService
.
selectOne
(
new
PerformErrorMessageQuery
().
checkRecordId
(
entity
.
getId
()).
performType
(
PerformTypeEnum
.
评价投诉绩效
.
getValue
()));
if
(
errorMessageEntity
!=
null
)
{
if
(
errorMessageEntity
!=
null
)
{
PerformErrorMessageEntity
updateEntity
=
new
PerformErrorMessageEntity
();
updateEntity
.
setId
(
errorMessageEntity
.
getId
());
updateEntity
.
setCheckStatus
(
CheckStatusEnum
.
已处理
.
getValue
());
...
...
@@ -226,14 +211,14 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
updateEntity
.
setUpdateTime
(
new
Date
());
performErrorMessageService
.
update
(
updateEntity
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"更新绩效异常信息核查状态出错"
,
e
);
}
try
{
if
(!
ObjectUtils
.
isEmpty
(
temp
.
getRecordId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
temp
.
getRecordId
()))
{
PerformComplainRecordEntity
recordEntity
=
recordService
.
get
(
temp
.
getRecordId
());
if
(!
ObjectUtils
.
isEmpty
(
recordEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
recordEntity
))
{
recordEntity
.
setProcessStatus
(
ProcessStatusEnum
.
已处理
.
getValue
());
recordEntity
.
setUpdateTime
(
new
Date
());
recordEntity
.
setUpdateUserId
(
this
.
getContextUserId
(
context
));
...
...
@@ -269,25 +254,26 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
if
(
CollectionUtils
.
isNotEmpty
(
summaryVoList
))
{
String
value
=
paramService
.
getValueByKey
(
SYS_PARAM_WEIGHT
);
WeightPdu
weightPdu
;
if
(
ObjectUtils
.
isEmpty
(
value
)){
if
(
ObjectUtils
.
isEmpty
(
value
))
{
weightPdu
=
new
WeightPdu
();
}
else
{
weightPdu
=
JSONObject
.
parseObject
(
value
,
WeightPdu
.
class
);
}
else
{
weightPdu
=
JSONObject
.
parseObject
(
value
,
WeightPdu
.
class
);
}
for
(
StaffCheckSummaryVo
vo
:
summaryVoList
)
{
StaffEntity
staffEntity
=
staffService
.
get
(
vo
.
getStaffId
());
if
(
staffEntity
.
getStatus
()
==
StaffSatusEnum
.
离职
.
getValue
())
{
if
(
staffEntity
.
getLeaveDate
()!=
null
){
StaffEntity
staffEntity
=
staffService
.
getCache
(
vo
.
getStaffId
().
toString
());
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
continue
;
if
(
staffEntity
.
getStatus
()
==
StaffSatusEnum
.
离职
.
getValue
())
{
if
(
staffEntity
.
getLeaveDate
()
!=
null
)
{
String
leaveDateStr
=
DateUtils
.
getStrDate
(
staffEntity
.
getLeaveDate
());
String
month
=
vo
.
getMonth
()
>
9
?
String
.
valueOf
(
vo
.
getMonth
()):
"0"
+
vo
.
getMonth
();
String
summaryDate
=
vo
.
getYear
()
+
"-"
+
month
+
"-01"
;
if
(
DateUtils
.
StrToDate
(
leaveDateStr
).
compareTo
(
DateUtils
.
StrToDate
(
summaryDate
))
<
0
)
{
String
month
=
vo
.
getMonth
()
>
9
?
String
.
valueOf
(
vo
.
getMonth
())
:
"0"
+
vo
.
getMonth
();
String
summaryDate
=
vo
.
getYear
()
+
"-"
+
month
+
"-01"
;
if
(
DateUtils
.
StrToDate
(
leaveDateStr
).
compareTo
(
DateUtils
.
StrToDate
(
summaryDate
))
<
0
)
{
//离职日期在统计日期之前不统计
continue
;
}
}
}
if
(
staffEntity
.
getAttendCheck
()==
0
&&
staffEntity
.
getEffectCheck
()==
0
&&
staffEntity
.
getGoworkCheck
()==
0
&&
staffEntity
.
getComplainCheck
()==
0
)
{
if
(
staffEntity
.
getAttendCheck
()
==
0
&&
staffEntity
.
getEffectCheck
()
==
0
&&
staffEntity
.
getGoworkCheck
()
==
0
&&
staffEntity
.
getComplainCheck
()
==
0
)
{
continue
;
}
...
...
@@ -295,9 +281,9 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
staffPerformSummaryEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
vo
,
staffPerformSummaryEntity
,
BeanUtil
.
getNullPropertyNames
(
vo
));
BigDecimal
reviewScore
=
weightPdu
.
reviewWeight
().
add
(
vo
.
getSumScore
());
if
(
reviewScore
.
compareTo
(
BigDecimal
.
ZERO
)<
0
)
{
if
(
reviewScore
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
staffPerformSummaryEntity
.
setReviewScore
(
weightPdu
.
reviewWeight
());
}
else
{
}
else
{
staffPerformSummaryEntity
.
setReviewScore
(
vo
.
getSumScore
());
}
StaffPerformSummaryQuery
summaryQuery
=
new
StaffPerformSummaryQuery
();
...
...
@@ -327,14 +313,14 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
BigDecimal
erro
=
new
BigDecimal
(
0
);
erro
=
erro
.
add
(
staffPerformSummaryEntity
.
getReviewScore
());
erro
=
erro
.
add
(
staffPerformSummaryEntity
.
getAttendScore
());
if
(
staffPerformSummaryEntity
.
getComplainScore
().
compareTo
(
BigDecimal
.
ZERO
)!=
0
)
{
if
(
staffPerformSummaryEntity
.
getComplainScore
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
BigDecimal
complainScoreErro
=
StaffPerformUtil
.
SCORE100
.
subtract
(
staffPerformSummaryEntity
.
getComplainScore
());
erro
=
erro
.
add
(
BigDecimal
.
ZERO
.
subtract
(
complainScoreErro
));
}
erro
=
erro
.
add
(
staffPerformSummaryEntity
.
getGoworkScore
());
erro
=
erro
.
add
(
staffPerformSummaryEntity
.
getEffectScore
());
staffPerformSummaryEntity
.
setErrorScore
(
erro
);
StaffPerformUtil
.
computeSummary
(
staffPerformSummaryEntity
,
weightPdu
,
staffEntity
);
StaffPerformUtil
.
computeSummary
(
staffPerformSummaryEntity
,
weightPdu
,
staffEntity
);
staffPerformSummaryEntity
.
setId
(
temp
.
getId
());
staffPerformSummaryEntity
.
setUpdateTime
(
new
Date
());
staffPerformSummaryService
.
update
(
staffPerformSummaryEntity
);
...
...
@@ -347,7 +333,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
staffPerformSummaryEntity
.
setErrorScore
(
vo
.
getSumScore
());
// BigDecimal total = new BigDecimal(100);
// staffPerformSummaryEntity.setTotalScore(total.add(vo.getSumScore()));
StaffPerformUtil
.
computeSummary
(
staffPerformSummaryEntity
,
weightPdu
,
staffEntity
);
StaffPerformUtil
.
computeSummary
(
staffPerformSummaryEntity
,
weightPdu
,
staffEntity
);
staffPerformSummaryEntity
.
setCreateUserId
(
1
l
);
staffPerformSummaryEntity
.
setCreateTime
(
new
Date
());
staffPerformSummaryService
.
save
(
staffPerformSummaryEntity
);
...
...
@@ -376,7 +362,7 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
if
(
CollectionUtils
.
isNotEmpty
(
performStatList
))
{
for
(
StaffPerformStatEntity
entity
:
performStatList
)
{
StaffEntity
staffEntity
=
staffService
.
get
(
entity
.
getStaffId
());
if
(
staffEntity
.
getAttendCheck
()==
0
&&
staffEntity
.
getEffectCheck
()==
0
&&
staffEntity
.
getGoworkCheck
()==
0
&&
staffEntity
.
getComplainCheck
()==
0
)
{
if
(
staffEntity
.
getAttendCheck
()
==
0
&&
staffEntity
.
getEffectCheck
()
==
0
&&
staffEntity
.
getGoworkCheck
()
==
0
&&
staffEntity
.
getComplainCheck
()
==
0
)
{
continue
;
}
StaffPerformStatQuery
tempQuery
=
new
StaffPerformStatQuery
();
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckEffectRecordServiceImpl.java
View file @
8a4d177c
...
...
@@ -57,12 +57,12 @@ import static com.mortals.xhx.common.key.ParamKey.SYS_PARAM_WEIGHT;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
RedisKey
.
KEY_CHECK_SUMMARY_CACHE
;
/**
* CheckEffectRecordService
* 效能绩效核查信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
* CheckEffectRecordService
* 效能绩效核查信息 service实现
*
* @author zxfei
* @date 2023-07-11
*/
@Service
(
"checkEffectRecordService"
)
@Slf4j
public
class
CheckEffectRecordServiceImpl
extends
AbstractCRUDServiceImpl
<
CheckEffectRecordDao
,
CheckEffectRecordEntity
,
Long
>
implements
CheckEffectRecordService
{
...
...
@@ -83,15 +83,12 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
private
DeptService
deptService
;
@Autowired
private
PerformEffectRecordService
recordService
;
@Autowired
private
PerformRulesService
rulesService
;
@Autowired
private
ParamService
paramService
;
@Autowired
private
ICacheService
cacheService
;
@Autowired
private
PerformErrorMessageService
performErrorMessageService
;
@Override
protected
void
saveBefore
(
CheckEffectRecordEntity
entity
,
Context
context
)
throws
AppException
{
...
...
@@ -117,51 +114,6 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
}
@Override
protected
void
saveAfter
(
CheckEffectRecordEntity
entity
,
Context
context
)
throws
AppException
{
//添加绩效异常信息
// try {
// PerformErrorMessageEntity errorMessageEntity = new PerformErrorMessageEntity();
// errorMessageEntity.initAttrValue();
// BeanUtils.copyProperties(entity, errorMessageEntity, BeanUtil.getNullPropertyNames(entity));
// errorMessageEntity.setCheckRecordId(entity.getId());
// errorMessageEntity.setErrorTime(entity.getHappenTime());
// errorMessageEntity.setPerformType(PerformTypeEnum.效能绩效.getValue());
// performErrorMessageService.save(errorMessageEntity);
// }catch (Exception e) {
// log.error("新增绩效异常信息核查状态出错", e);
// }
// try{
// StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
// query.setStaffId(entity.getStaffId());
// query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
// query.setCheckTimeEnd(query.getCheckTimeStart());
// query.setCheckType(CheckTypeEnum.效能绩效.getValue());
// cacheService.lpush(KEY_CHECK_SUMMARY_CACHE, query);
// //summaryCheck(query);
// }catch (Exception e){
// log.error("汇总已审核的核查记录出错",e);
// }
}
@Override
protected
void
removeAfter
(
Long
[]
ids
,
Context
context
,
int
result
)
throws
AppException
{
super
.
removeAfter
(
ids
,
context
,
result
);
// try {
// PerformErrorMessageQuery query = new PerformErrorMessageQuery();
// query.setPerformType(PerformTypeEnum.效能绩效.getValue());
// query.setCheckRecordIdList(Arrays.asList(ids));
// List<PerformErrorMessageEntity> errorList = performErrorMessageService.find(query);
// if (CollectionUtils.isNotEmpty(errorList)) {
// Long[] deleteIds = errorList.stream().map(i -> i.getId()).toArray(Long[]::new);
// performErrorMessageService.remove(deleteIds, context);
// }
// }catch (Exception e){
// log.error("删除绩效异常信息核查状态出错", e);
// }
}
private
void
sendCheckDingTalk
(
CheckEffectRecordEntity
entity
)
{
String
ruleStr
=
String
.
format
(
"%s/%s/%s"
,
PerformTypeEnum
.
效能绩效
.
getDesc
(),
entity
.
getCategoryName
(),
entity
.
getRuleName
());
//绩效核查通知
...
...
@@ -176,9 +128,9 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
checkDingMsg
.
setPerformTypeStr
(
PerformTypeEnum
.
效能绩效
.
getDesc
());
checkDingMsg
.
setScore
(
entity
.
getScore
().
toString
());
checkDingMsg
.
setSubAddType
(
entity
.
getSubAddType
());
// checkDingMsg.setPath(String.format("/api/v1/perform/info?id=%s&&performType=effect", entity.getId()));
checkDingMsg
.
setPath
(
String
.
format
(
"#/appealinfo?id=%s&&performType=%s&subAddType=%s"
,
entity
.
getId
(),
PerformTypeEnum
.
效能绩效
.
getValue
(),
entity
.
getSubAddType
()));
// checkDingMsg.setPath(String.format("/api/v1/perform/info?id=%s&&performType=effect", entity.getId()));
// checkDingMsg.setPath(String.format("/api/v1/perform/info?id=%s&&performType=effect", entity.getId()));
checkDingMsg
.
setPath
(
String
.
format
(
"#/appealinfo?id=%s&&performType=%s&subAddType=%s"
,
entity
.
getId
(),
PerformTypeEnum
.
效能绩效
.
getValue
(),
entity
.
getSubAddType
()));
// checkDingMsg.setPath(String.format("/api/v1/perform/info?id=%s&&performType=effect", entity.getId()));
Rest
<
String
>
msgRest
=
messageService
.
sendDingTalkWorkMsg
(
checkDingMsg
);
}
else
{
log
.
error
(
"根据手机号码获取人员错误,msg:{}"
,
personRest
.
getMsg
());
...
...
@@ -191,50 +143,35 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
@Override
public
void
examine
(
CheckEffectRecordEntity
entity
,
Context
context
)
throws
AppException
{
if
(
entity
.
getId
()==
null
)
{
if
(
entity
.
getId
()
==
null
)
{
throw
new
AppException
(
"核查记录ID不能为空"
);
}
CheckEffectRecordEntity
temp
=
this
.
get
(
entity
.
getId
());
if
(
temp
==
null
)
{
throw
new
AppException
(
"核查记录ID不正确"
);
}
if
(
context
!=
null
&&
context
.
getUser
()
!=
null
)
{
if
(
context
!=
null
&&
context
.
getUser
()
!=
null
)
{
IUser
user
=
context
.
getUser
();
entity
.
setUpdateUserId
(
user
.
getId
());
entity
.
setCheckPerson
(
user
.
getRealName
());
}
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getSubAddType
())&&!
ObjectUtils
.
isEmpty
(
entity
.
getCheckResult
()))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getSubAddType
())
&&
!
ObjectUtils
.
isEmpty
(
entity
.
getCheckResult
()))
{
AuditUtil
.
audit
(
entity
);
}
entity
.
setCheckTime
(
temp
.
getHappenTime
());
entity
.
setUpdateTime
(
new
Date
());
entity
.
setCheckStatus
(
CheckStatusEnum
.
已处理
.
getValue
());
//处理状态(1.未处理,2.已处理)
dao
.
update
(
entity
);
//更新绩效异常信息核查状态
// try {
// PerformErrorMessageEntity errorMessageEntity = performErrorMessageService.selectOne(new PerformErrorMessageQuery().checkRecordId(entity.getId()).performType(PerformTypeEnum.效能绩效.getValue()));
// if(errorMessageEntity!=null){
// PerformErrorMessageEntity updateEntity = new PerformErrorMessageEntity();
// updateEntity.setId(errorMessageEntity.getId());
// updateEntity.setCheckStatus(CheckStatusEnum.已处理.getValue());
// updateEntity.setCheckTime(entity.getCheckTime());
// updateEntity.setUpdateTime(new Date());
// performErrorMessageService.update(updateEntity);
// }
// }catch (Exception e){
// log.error("更新绩效异常信息核查状态出错", e);
// }
try
{
if
(!
ObjectUtils
.
isEmpty
(
temp
.
getRecordId
())){
try
{
if
(!
ObjectUtils
.
isEmpty
(
temp
.
getRecordId
()))
{
PerformEffectRecordEntity
recordEntity
=
recordService
.
get
(
temp
.
getRecordId
());
if
(!
ObjectUtils
.
isEmpty
(
recordEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
recordEntity
))
{
recordEntity
.
setProcessStatus
(
ProcessStatusEnum
.
已处理
.
getValue
());
recordEntity
.
setUpdateTime
(
new
Date
());
recordEntity
.
setUpdateUserId
(
this
.
getContextUserId
(
context
));
recordService
.
update
(
recordEntity
);
}
}
sendCheckDingTalk
(
temp
);
StaffCheckSummaryQuery
query
=
new
StaffCheckSummaryQuery
();
query
.
setStaffId
(
temp
.
getStaffId
());
...
...
@@ -243,16 +180,16 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
query
.
setCheckType
(
CheckTypeEnum
.
效能绩效
.
getValue
());
cacheService
.
lpush
(
KEY_CHECK_SUMMARY_CACHE
,
query
);
//summaryCheck(query);
}
catch
(
Exception
e
)
{
log
.
error
(
"汇总已审核的核查记录出错"
,
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"汇总已审核的核查记录出错"
,
e
);
}
}
@Override
public
List
<
StaffCheckSummaryVo
>
summaryCheck
(
StaffCheckSummaryQuery
query
)
throws
AppException
{
if
(
StringUtils
.
isEmpty
(
query
.
getCheckTimeStart
())||
StringUtils
.
isEmpty
(
query
.
getCheckTimeStart
()))
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
calendar
=
Calendar
.
getInstance
();
if
(
StringUtils
.
isEmpty
(
query
.
getCheckTimeStart
())
||
StringUtils
.
isEmpty
(
query
.
getCheckTimeStart
()))
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
String
startTime
=
format
.
format
(
calendar
.
getTime
());
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
...
...
@@ -261,53 +198,54 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
query
.
setCheckTimeEnd
(
endTime
);
}
List
<
StaffCheckSummaryVo
>
summaryVoList
=
dao
.
summaryCheck
(
query
);
if
(
CollectionUtils
.
isNotEmpty
(
summaryVoList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
summaryVoList
))
{
String
value
=
paramService
.
getValueByKey
(
SYS_PARAM_WEIGHT
);
WeightPdu
weightPdu
;
if
(
ObjectUtils
.
isEmpty
(
value
)){
if
(
ObjectUtils
.
isEmpty
(
value
))
{
weightPdu
=
new
WeightPdu
();
}
else
{
weightPdu
=
JSONObject
.
parseObject
(
value
,
WeightPdu
.
class
);
}
else
{
weightPdu
=
JSONObject
.
parseObject
(
value
,
WeightPdu
.
class
);
}
for
(
StaffCheckSummaryVo
vo:
summaryVoList
){
StaffEntity
staffEntity
=
staffService
.
get
(
vo
.
getStaffId
());
if
(
staffEntity
.
getStatus
()
==
StaffSatusEnum
.
离职
.
getValue
())
{
if
(
staffEntity
.
getLeaveDate
()!=
null
){
for
(
StaffCheckSummaryVo
vo
:
summaryVoList
)
{
StaffEntity
staffEntity
=
staffService
.
getCache
(
vo
.
getStaffId
().
toString
());
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
continue
;
if
(
staffEntity
.
getStatus
()
==
StaffSatusEnum
.
离职
.
getValue
())
{
if
(
staffEntity
.
getLeaveDate
()
!=
null
)
{
String
leaveDateStr
=
DateUtils
.
getStrDate
(
staffEntity
.
getLeaveDate
());
String
month
=
vo
.
getMonth
()
>
9
?
String
.
valueOf
(
vo
.
getMonth
()):
"0"
+
vo
.
getMonth
();
String
summaryDate
=
vo
.
getYear
()
+
"-"
+
month
+
"-01"
;
if
(
DateUtils
.
StrToDate
(
leaveDateStr
).
compareTo
(
DateUtils
.
StrToDate
(
summaryDate
))
<
0
)
{
String
month
=
vo
.
getMonth
()
>
9
?
String
.
valueOf
(
vo
.
getMonth
())
:
"0"
+
vo
.
getMonth
();
String
summaryDate
=
vo
.
getYear
()
+
"-"
+
month
+
"-01"
;
if
(
DateUtils
.
StrToDate
(
leaveDateStr
).
compareTo
(
DateUtils
.
StrToDate
(
summaryDate
))
<
0
)
{
//离职日期在统计日期之前不统计
continue
;
}
}
}
if
(
staffEntity
.
getAttendCheck
()==
0
&&
staffEntity
.
getEffectCheck
()==
0
&&
staffEntity
.
getGoworkCheck
()==
0
&&
staffEntity
.
getComplainCheck
()==
0
)
{
if
(
staffEntity
.
getAttendCheck
()
==
0
&&
staffEntity
.
getEffectCheck
()
==
0
&&
staffEntity
.
getGoworkCheck
()
==
0
&&
staffEntity
.
getComplainCheck
()
==
0
)
{
continue
;
}
StaffPerformSummaryEntity
staffPerformSummaryEntity
=
new
StaffPerformSummaryEntity
();
staffPerformSummaryEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
vo
,
staffPerformSummaryEntity
,
BeanUtil
.
getNullPropertyNames
(
vo
));
BeanUtils
.
copyProperties
(
vo
,
staffPerformSummaryEntity
,
BeanUtil
.
getNullPropertyNames
(
vo
));
staffPerformSummaryEntity
.
setEffectScore
(
vo
.
getSumScore
());
StaffPerformSummaryQuery
summaryQuery
=
new
StaffPerformSummaryQuery
();
summaryQuery
.
setStaffId
(
vo
.
getStaffId
());
summaryQuery
.
setYear
(
vo
.
getYear
());
summaryQuery
.
setMonth
(
vo
.
getMonth
());
StaffPerformSummaryEntity
temp
=
staffPerformSummaryService
.
selectOne
(
summaryQuery
);
if
(
temp
!=
null
)
{
if
(
temp
!=
null
)
{
staffPerformSummaryEntity
.
setRemarkAdd
(
temp
.
getRemarkAdd
());
staffPerformSummaryEntity
.
setRemark
(
temp
.
getRemark
());
staffPerformSummaryEntity
.
setAddTotalScore
(
temp
.
getAddTotalScore
());
if
(
temp
.
getReviewScore
()!=
null
)
{
if
(
temp
.
getReviewScore
()
!=
null
)
{
staffPerformSummaryEntity
.
setReviewScore
(
temp
.
getReviewScore
());
}
if
(
temp
.
getOtherScore
()!=
null
)
{
if
(
temp
.
getOtherScore
()
!=
null
)
{
staffPerformSummaryEntity
.
setOtherScore
(
temp
.
getOtherScore
());
}
if
(
temp
.
getGoworkScore
()!=
null
)
{
if
(
temp
.
getGoworkScore
()
!=
null
)
{
staffPerformSummaryEntity
.
setGoworkScore
(
temp
.
getGoworkScore
());
}
if
(
temp
.
getAttendScore
()!=
null
)
{
if
(
temp
.
getAttendScore
()
!=
null
)
{
staffPerformSummaryEntity
.
setAttendScore
(
temp
.
getAttendScore
());
}
if
(
temp
.
getComplainScore
()
!=
null
)
{
...
...
@@ -316,25 +254,25 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
BigDecimal
erro
=
new
BigDecimal
(
0
);
erro
=
erro
.
add
(
staffPerformSummaryEntity
.
getReviewScore
());
erro
=
erro
.
add
(
staffPerformSummaryEntity
.
getAttendScore
());
if
(
staffPerformSummaryEntity
.
getComplainScore
().
compareTo
(
BigDecimal
.
ZERO
)!=
0
)
{
if
(
staffPerformSummaryEntity
.
getComplainScore
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
BigDecimal
complainScoreErro
=
StaffPerformUtil
.
SCORE100
.
subtract
(
staffPerformSummaryEntity
.
getComplainScore
());
erro
=
erro
.
add
(
BigDecimal
.
ZERO
.
subtract
(
complainScoreErro
));
}
erro
=
erro
.
add
(
staffPerformSummaryEntity
.
getGoworkScore
());
erro
=
erro
.
add
(
staffPerformSummaryEntity
.
getEffectScore
());
staffPerformSummaryEntity
.
setErrorScore
(
erro
);
StaffPerformUtil
.
computeSummary
(
staffPerformSummaryEntity
,
weightPdu
,
staffEntity
);
StaffPerformUtil
.
computeSummary
(
staffPerformSummaryEntity
,
weightPdu
,
staffEntity
);
staffPerformSummaryEntity
.
setId
(
temp
.
getId
());
staffPerformSummaryEntity
.
setUpdateTime
(
new
Date
());
staffPerformSummaryService
.
update
(
staffPerformSummaryEntity
);
}
else
{
}
else
{
staffPerformSummaryEntity
.
setAttendScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setReviewScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setOtherScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setGoworkScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setComplainScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setErrorScore
(
vo
.
getSumScore
());
StaffPerformUtil
.
computeSummary
(
staffPerformSummaryEntity
,
weightPdu
,
staffEntity
);
StaffPerformUtil
.
computeSummary
(
staffPerformSummaryEntity
,
weightPdu
,
staffEntity
);
staffPerformSummaryEntity
.
setCreateUserId
(
1
l
);
staffPerformSummaryEntity
.
setCreateTime
(
new
Date
());
staffPerformSummaryService
.
save
(
staffPerformSummaryEntity
);
...
...
@@ -360,10 +298,10 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
query
.
setCheckTimeEnd
(
endTime
);
}
List
<
StaffPerformStatEntity
>
performStatList
=
dao
.
getStaffPerformStat
(
query
);
if
(
CollectionUtils
.
isNotEmpty
(
performStatList
))
{
for
(
StaffPerformStatEntity
entity:
performStatList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
performStatList
))
{
for
(
StaffPerformStatEntity
entity
:
performStatList
)
{
StaffEntity
staffEntity
=
staffService
.
get
(
entity
.
getStaffId
());
if
(
staffEntity
.
getAttendCheck
()==
0
&&
staffEntity
.
getEffectCheck
()==
0
&&
staffEntity
.
getGoworkCheck
()==
0
&&
staffEntity
.
getComplainCheck
()==
0
)
{
if
(
staffEntity
.
getAttendCheck
()
==
0
&&
staffEntity
.
getEffectCheck
()
==
0
&&
staffEntity
.
getGoworkCheck
()
==
0
&&
staffEntity
.
getComplainCheck
()
==
0
)
{
continue
;
}
StaffPerformStatQuery
tempQuery
=
new
StaffPerformStatQuery
();
...
...
@@ -382,7 +320,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
statEntity
.
setEffectScoreSub
(
entity
.
getEffectScoreSub
());
computeStaff
(
statEntity
);
staffPerformStatService
.
update
(
statEntity
);
}
else
{
}
else
{
StaffPerformStatEntity
statEntity
=
new
StaffPerformStatEntity
();
statEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
entity
,
statEntity
,
BeanUtil
.
getNullPropertyNames
(
entity
));
...
...
@@ -409,8 +347,8 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
query
.
setCheckTimeEnd
(
endTime
);
}
List
<
DeptPerformStatEntity
>
performStatList
=
dao
.
getDeptPerformStat
(
query
);
if
(
CollectionUtils
.
isNotEmpty
(
performStatList
))
{
for
(
DeptPerformStatEntity
entity:
performStatList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
performStatList
))
{
for
(
DeptPerformStatEntity
entity
:
performStatList
)
{
DeptPerformStatQuery
tempQuery
=
new
DeptPerformStatQuery
();
tempQuery
.
setDeptId
(
entity
.
getDeptId
());
tempQuery
.
setYear
(
entity
.
getYear
());
...
...
@@ -427,7 +365,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
statEntity
.
setEffectScoreSub
(
entity
.
getEffectScoreSub
());
computeDept
(
statEntity
);
deptPerformStatService
.
update
(
statEntity
);
}
else
{
}
else
{
DeptPerformStatEntity
statEntity
=
new
DeptPerformStatEntity
();
statEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
entity
,
statEntity
,
BeanUtil
.
getNullPropertyNames
(
entity
));
...
...
@@ -441,7 +379,7 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
}
}
private
void
computeStaff
(
StaffPerformStatEntity
statEntity
){
private
void
computeStaff
(
StaffPerformStatEntity
statEntity
)
{
BigDecimal
totalAddScore
=
new
BigDecimal
(
0
);
BigDecimal
totalSubScore
=
new
BigDecimal
(
0
);
BigDecimal
totalScore
=
new
BigDecimal
(
100
);
...
...
@@ -464,14 +402,14 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
statEntity
.
setTotalScore
(
totalScore
);
}
private
void
computeDept
(
DeptPerformStatEntity
statEntity
){
private
void
computeDept
(
DeptPerformStatEntity
statEntity
)
{
DeptEntity
deptEntity
=
deptService
.
get
(
statEntity
.
getDeptId
());
BigDecimal
totalAddScore
=
new
BigDecimal
(
0
);
BigDecimal
totalSubScore
=
new
BigDecimal
(
0
);
BigDecimal
totalScore
=
new
BigDecimal
(
100
);
if
(
deptEntity
!=
null
)
{
if
(
deptEntity
!=
null
)
{
totalScore
=
totalScore
.
multiply
(
new
BigDecimal
(
deptEntity
.
getPersonNum
()));
}
else
{
}
else
{
totalScore
=
totalScore
.
multiply
(
new
BigDecimal
(
10
));
}
totalAddScore
=
totalAddScore
.
add
(
statEntity
.
getAttendScoreAdd
());
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckGoworkRecordServiceImpl.java
View file @
8a4d177c
...
...
@@ -133,17 +133,6 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
}
catch
(
Exception
e
)
{
log
.
error
(
"新增绩效异常信息核查状态出错"
,
e
);
}
// try{
// StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
// query.setStaffId(entity.getStaffId());
// query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
// query.setCheckTimeEnd(query.getCheckTimeStart());
// query.setCheckType(CheckTypeEnum.办件绩效.getValue());
// cacheService.lpush(KEY_CHECK_SUMMARY_CACHE, query);
// //summaryCheck(query);
// }catch (Exception e){
// log.error("汇总已审核的核查记录出错",e);
// }
}
@Override
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckOtherRecordServiceImpl.java
View file @
8a4d177c
...
...
@@ -134,17 +134,6 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
}
catch
(
Exception
e
)
{
log
.
error
(
"新增绩效异常信息核查状态出错"
,
e
);
}
// try {
// StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
// query.setStaffId(entity.getStaffId());
// query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
// query.setCheckTimeEnd(query.getCheckTimeStart());
// query.setCheckType(CheckTypeEnum.其它绩效.getValue());
// cacheService.lpush(KEY_CHECK_SUMMARY_CACHE, query);
// //summaryCheck(query);
// } catch (Exception e) {
// log.error("汇总已审核的核查记录出错", e);
// }
}
@Override
...
...
@@ -244,8 +233,6 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
query
.
setCheckTimeEnd
(
query
.
getCheckTimeStart
());
query
.
setCheckType
(
CheckTypeEnum
.
其它绩效
.
getValue
());
cacheService
.
lpush
(
KEY_CHECK_SUMMARY_CACHE
,
query
);
//summaryCheck(query);
}
catch
(
Exception
e
)
{
log
.
error
(
"汇总已审核的核查记录出错"
,
e
);
}
...
...
@@ -274,7 +261,8 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
weightPdu
=
JSONObject
.
parseObject
(
value
,
WeightPdu
.
class
);
}
for
(
StaffCheckSummaryVo
vo
:
summaryVoList
)
{
StaffEntity
staffEntity
=
staffService
.
get
(
vo
.
getStaffId
());
StaffEntity
staffEntity
=
staffService
.
getCache
(
vo
.
getStaffId
().
toString
());
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
continue
;
if
(
staffEntity
.
getStatus
()
==
StaffSatusEnum
.
离职
.
getValue
())
{
if
(
staffEntity
.
getLeaveDate
()!=
null
){
String
leaveDateStr
=
DateUtils
.
getStrDate
(
staffEntity
.
getLeaveDate
());
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckReviewRecordServiceImpl.java
View file @
8a4d177c
...
...
@@ -136,17 +136,6 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
}
catch
(
Exception
e
)
{
log
.
error
(
"新增绩效异常信息核查状态出错"
,
e
);
}
// try {
// StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
// query.setStaffId(entity.getStaffId());
// query.setCheckTimeStart(DateUtils.getStrDate(entity.getCheckTime()));
// query.setCheckTimeEnd(query.getCheckTimeStart());
// query.setCheckType(CheckTypeEnum.评价绩效.getValue());
// cacheService.lpush(KEY_CHECK_SUMMARY_CACHE, query);
// //summaryCheck(query);
// } catch (Exception e) {
// log.error("汇总已审核的核查记录出错", e);
// }
}
@Override
...
...
@@ -273,7 +262,8 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
weightPdu
=
JSONObject
.
parseObject
(
value
,
WeightPdu
.
class
);
}
for
(
StaffCheckSummaryVo
vo
:
summaryVoList
)
{
StaffEntity
staffEntity
=
staffService
.
get
(
vo
.
getStaffId
());
StaffEntity
staffEntity
=
staffService
.
getCache
(
vo
.
getStaffId
().
toString
());
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
continue
;
if
(
staffEntity
.
getStatus
()
==
StaffSatusEnum
.
离职
.
getValue
())
{
if
(
staffEntity
.
getLeaveDate
()!=
null
){
String
leaveDateStr
=
DateUtils
.
getStrDate
(
staffEntity
.
getLeaveDate
());
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/service/impl/CheckWindowWorkmanPerformServiceImpl.java
View file @
8a4d177c
...
...
@@ -115,7 +115,8 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
weightPdu
=
JSONObject
.
parseObject
(
value
,
WeightPdu
.
class
);
}
for
(
StaffCheckSummaryVo
vo
:
summaryVoList
)
{
StaffEntity
staffEntity
=
staffService
.
get
(
vo
.
getStaffId
());
StaffEntity
staffEntity
=
staffService
.
getCache
(
vo
.
getStaffId
().
toString
());
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
continue
;
if
(
staffEntity
.
getStatus
()
==
StaffSatusEnum
.
离职
.
getValue
())
{
if
(
staffEntity
.
getLeaveDate
()!=
null
){
String
leaveDateStr
=
DateUtils
.
getStrDate
(
staffEntity
.
getLeaveDate
());
...
...
@@ -169,9 +170,6 @@ public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImp
staffPerformSummaryEntity
.
setId
(
temp
.
getId
());
staffPerformSummaryEntity
.
setUpdateTime
(
new
Date
());
staffPerformSummaryService
.
update
(
staffPerformSummaryEntity
);
staffPerformSummaryEntity
.
setId
(
temp
.
getId
());
staffPerformSummaryEntity
.
setUpdateTime
(
new
Date
());
staffPerformSummaryService
.
update
(
staffPerformSummaryEntity
);
}
else
{
staffPerformSummaryEntity
.
setAttendScore
(
BigDecimal
.
ZERO
);
staffPerformSummaryEntity
.
setReviewScore
(
BigDecimal
.
ZERO
);
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/web/CheckWindowPerformController.java
View file @
8a4d177c
...
...
@@ -34,9 +34,6 @@ import com.mortals.xhx.common.code.*;
@RequestMapping
(
"check/window/perform"
)
public
class
CheckWindowPerformController
extends
BaseCRUDJsonBodyMappingController
<
CheckWindowPerformService
,
CheckWindowPerformEntity
,
Long
>
{
@Autowired
private
ParamService
paramService
;
public
CheckWindowPerformController
(){
super
.
setModuleDesc
(
"窗口考核核查"
);
}
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/check/web/CheckWindowWorkmanPerformController.java
View file @
8a4d177c
...
...
@@ -35,9 +35,6 @@ import com.mortals.xhx.common.code.*;
@RequestMapping
(
"check/window/workman/perform"
)
public
class
CheckWindowWorkmanPerformController
extends
BaseCRUDJsonBodyMappingController
<
CheckWindowWorkmanPerformService
,
CheckWindowWorkmanPerformEntity
,
Long
>
{
@Autowired
private
ParamService
paramService
;
public
CheckWindowWorkmanPerformController
(){
super
.
setModuleDesc
(
"窗口人员考核汇总核查"
);
}
...
...
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