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
c0a96cf1
Commit
c0a96cf1
authored
Jul 12, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人自动考核指标配
parent
af96e53c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
37 deletions
+98
-37
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/model/vo/PerformDeptConfDetailVo.java
.../xhx/module/perform/model/vo/PerformDeptConfDetailVo.java
+2
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/model/vo/PerformStaffConfDetailVo.java
...xhx/module/perform/model/vo/PerformStaffConfDetailVo.java
+2
-1
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformDeptConfServiceImpl.java
...dule/perform/service/impl/PerformDeptConfServiceImpl.java
+8
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformStaffConfServiceImpl.java
...ule/perform/service/impl/PerformStaffConfServiceImpl.java
+86
-35
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/model/vo/PerformDeptConfDetailVo.java
View file @
c0a96cf1
...
...
@@ -13,6 +13,7 @@ import lombok.Data;
@Data
public
class
PerformDeptConfDetailVo
extends
BaseEntityLong
{
/** 分类Id */
private
Long
categoryId
;
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/model/vo/PerformStaffConfDetailVo.java
View file @
c0a96cf1
...
...
@@ -13,6 +13,7 @@ import lombok.Data;
@Data
public
class
PerformStaffConfDetailVo
extends
BaseEntityLong
{
/** 分类Id */
private
Long
categoryId
;
}
\ No newline at end of file
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformDeptConfServiceImpl.java
View file @
c0a96cf1
...
...
@@ -5,7 +5,9 @@ import com.mortals.xhx.module.dept.model.DeptEntity;
import
com.mortals.xhx.module.dept.service.DeptService
;
import
com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity
;
import
com.mortals.xhx.module.perform.model.PerformDeptConfDetailQuery
;
import
com.mortals.xhx.module.perform.model.PerformRulesCategoryEntity
;
import
com.mortals.xhx.module.perform.service.PerformDeptConfDetailService
;
import
com.mortals.xhx.module.perform.service.PerformRulesCategoryService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -36,6 +38,8 @@ public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformD
private
PerformDeptConfDetailService
performDeptConfDetailService
;
@Autowired
private
DeptService
deptService
;
@Autowired
private
PerformRulesCategoryService
performRulesCategoryService
;
@Override
protected
void
findAfter
(
PerformDeptConfEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
PerformDeptConfEntity
>
list
)
throws
AppException
{
...
...
@@ -93,6 +97,10 @@ public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformD
item
.
setCreateUser
(
entity
.
getCreateUser
());
item
.
setDeptId
(
entity
.
getDeptId
());
item
.
setDeptName
(
entity
.
getDeptName
());
PerformRulesCategoryEntity
categoryEntity
=
performRulesCategoryService
.
get
(
item
.
getCategoryId
());
if
(
categoryEntity
!=
null
){
item
.
setCategoryName
(
categoryEntity
.
getName
());
}
item
.
setId
(
null
);
}
performDeptConfDetailService
.
save
(
entity
.
getDeptConfDetail
(),
context
);
...
...
attendance-performance-manager/src/main/java/com/mortals/xhx/module/perform/service/impl/PerformStaffConfServiceImpl.java
View file @
c0a96cf1
package
com.mortals.xhx.module.perform.service.impl
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.common.code.CheckTypeEnum
;
import
com.mortals.xhx.module.perform.model.*
;
import
com.mortals.xhx.module.perform.service.PerformRulesCategoryService
;
import
com.mortals.xhx.module.perform.service.PerformStaffConfDetailService
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.StaffQuery
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -30,52 +35,77 @@ public class PerformStaffConfServiceImpl extends AbstractCRUDServiceImpl<Perform
@Autowired
private
PerformStaffConfDetailService
performStaffConfDetailService
;
@Autowired
private
StaffService
staffService
;
@Autowired
private
PerformRulesCategoryService
performRulesCategoryService
;
@Override
protected
void
saveBefore
(
PerformStaffConfEntity
entity
,
Context
context
)
throws
AppException
{
super
.
saveBefore
(
entity
,
context
);
if
(
StringUtils
.
isNotEmpty
(
entity
.
getStaffIds
())){
List
<
Long
>
staffIdList
=
StringUtils
.
converStr2Long
(
entity
.
getStaffIds
());
StaffQuery
staffQuery
=
new
StaffQuery
();
staffQuery
.
setIdList
(
staffIdList
);
List
<
StaffEntity
>
staffEntityList
=
staffService
.
find
(
staffQuery
);
if
(
CollectionUtils
.
isNotEmpty
(
staffEntityList
)){
String
names
=
""
;
for
(
StaffEntity
item:
staffEntityList
){
names
+=
item
.
getName
()+
","
;
}
entity
.
setStaffNames
(
names
.
substring
(
0
,
names
.
length
()-
1
));
entity
.
setStaffCount
(
staffEntityList
.
size
());
}
else
{
entity
.
setStaffCount
(
0
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getStaffConfDetail
())){
//
Map<Integer,List<PerformStaffConfDetailEntity>> groupMap = entity.getStaffConfDetail().stream().collect(Collectors.groupingBy(PerformStaffConfDetailEntity::getType));
//
if(groupMap.containsKey(CheckTypeEnum.考勤绩效.getValue())) {
//
entity.setAttendCount(groupMap.get(CheckTypeEnum.考勤绩效.getValue()).size());
//
}else {
//
entity.setAttendCount(0);
//
}
//
if(groupMap.containsKey(CheckTypeEnum.评价绩效.getValue())) {
//
entity.setAssessCount(groupMap.get(CheckTypeEnum.评价绩效.getValue()).size());
//
}else {
//
entity.setAssessCount(0);
//
}
//
if(groupMap.containsKey(CheckTypeEnum.办件绩效.getValue())) {
//
entity.setWorkCount(groupMap.get(CheckTypeEnum.办件绩效.getValue()).size());
//
}else {
//
entity.setWorkCount(0);
//
}
//
if(groupMap.containsKey(CheckTypeEnum.效能绩效.getValue())) {
//
entity.setEffectCount(groupMap.get(CheckTypeEnum.效能绩效.getValue()).size());
//
}else {
//
entity.setEffectCount(0);
//
}
//
if(groupMap.containsKey(CheckTypeEnum.其它绩效.getValue())) {
//
entity.setOtherCount(groupMap.get(CheckTypeEnum.其它绩效.getValue()).size());
//
}else {
//
entity.setOtherCount(0);
//
}
Map
<
Integer
,
List
<
PerformStaffConfDetailEntity
>>
groupMap
=
entity
.
getStaffConfDetail
().
stream
().
collect
(
Collectors
.
groupingBy
(
PerformStaffConfDetailEntity:
:
getType
));
if
(
groupMap
.
containsKey
(
CheckTypeEnum
.
考勤绩效
.
getValue
()))
{
entity
.
setAttendCount
(
groupMap
.
get
(
CheckTypeEnum
.
考勤绩效
.
getValue
()).
size
());
}
else
{
entity
.
setAttendCount
(
0
);
}
if
(
groupMap
.
containsKey
(
CheckTypeEnum
.
评价绩效
.
getValue
()))
{
entity
.
setAssessCount
(
groupMap
.
get
(
CheckTypeEnum
.
评价绩效
.
getValue
()).
size
());
}
else
{
entity
.
setAssessCount
(
0
);
}
if
(
groupMap
.
containsKey
(
CheckTypeEnum
.
办件绩效
.
getValue
()))
{
entity
.
setWorkCount
(
groupMap
.
get
(
CheckTypeEnum
.
办件绩效
.
getValue
()).
size
());
}
else
{
entity
.
setWorkCount
(
0
);
}
if
(
groupMap
.
containsKey
(
CheckTypeEnum
.
效能绩效
.
getValue
()))
{
entity
.
setEffectCount
(
groupMap
.
get
(
CheckTypeEnum
.
效能绩效
.
getValue
()).
size
());
}
else
{
entity
.
setEffectCount
(
0
);
}
if
(
groupMap
.
containsKey
(
CheckTypeEnum
.
其它绩效
.
getValue
()))
{
entity
.
setOtherCount
(
groupMap
.
get
(
CheckTypeEnum
.
其它绩效
.
getValue
()).
size
());
}
else
{
entity
.
setOtherCount
(
0
);
}
}
}
@Override
protected
void
saveAfter
(
PerformStaffConfEntity
entity
,
Context
context
)
throws
AppException
{
if
(
CollectionUtils
.
isNotEmpty
(
entity
.
getStaffConfDetail
())){
// for(PerformStaffConfDetailEntity item:entity.getStaffConfDetail()){
// item.setStaffConfId(entity.getId());
// item.setCreateTime(entity.getCreateTime());
// item.setCreateUser(entity.getCreateUser());
// item.setStaffId(entity.getStaffId());
// item.setStaffName(entity.getStaffName());
// item.setId(null);
// }
// performDeptConfDetailService.save(entity.getDeptConfDetail(),context);
for
(
PerformStaffConfDetailEntity
item:
entity
.
getStaffConfDetail
()){
item
.
setStaffConfId
(
entity
.
getId
());
item
.
setCreateTime
(
entity
.
getCreateTime
());
item
.
setCreateUser
(
entity
.
getCreateUser
());
item
.
setId
(
null
);
PerformRulesCategoryEntity
categoryEntity
=
performRulesCategoryService
.
get
(
item
.
getCategoryId
());
if
(
categoryEntity
!=
null
){
item
.
setCategoryName
(
categoryEntity
.
getName
());
}
}
performStaffConfDetailService
.
save
(
entity
.
getStaffConfDetail
(),
context
);
}
}
...
...
@@ -88,4 +118,25 @@ public class PerformStaffConfServiceImpl extends AbstractCRUDServiceImpl<Perform
}
}
}
@Override
public
PerformStaffConfEntity
get
(
Long
key
,
Context
context
)
throws
AppException
{
PerformStaffConfEntity
entity
=
this
.
dao
.
get
(
key
);
if
(
entity
!=
null
)
{
List
<
PerformStaffConfDetailEntity
>
detailEntityList
=
performStaffConfDetailService
.
find
(
new
PerformStaffConfDetailQuery
().
staffConfId
(
entity
.
getId
()));
entity
.
setStaffConfDetail
(
detailEntityList
);
}
return
entity
;
}
@Override
protected
void
removeAfter
(
Long
[]
ids
,
Context
context
,
int
result
)
throws
AppException
{
if
(
ids
!=
null
&&
ids
.
length
!=
0
){
for
(
Long
id:
ids
){
PerformStaffConfDetailEntity
condition
=
new
PerformStaffConfDetailEntity
();
condition
.
setStaffConfId
(
id
);
performStaffConfDetailService
.
remove
(
condition
,
context
);
}
}
}
}
\ No newline at end of file
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