Commit c0a96cf1 authored by 廖旭伟's avatar 廖旭伟

个人自动考核指标配

parent af96e53c
...@@ -13,6 +13,7 @@ import lombok.Data; ...@@ -13,6 +13,7 @@ import lombok.Data;
@Data @Data
public class PerformDeptConfDetailVo extends BaseEntityLong { public class PerformDeptConfDetailVo extends BaseEntityLong {
/** 分类Id */
private Long categoryId;
} }
\ No newline at end of file
...@@ -13,6 +13,7 @@ import lombok.Data; ...@@ -13,6 +13,7 @@ import lombok.Data;
@Data @Data
public class PerformStaffConfDetailVo extends BaseEntityLong { public class PerformStaffConfDetailVo extends BaseEntityLong {
/** 分类Id */
private Long categoryId;
} }
\ No newline at end of file
...@@ -5,7 +5,9 @@ import com.mortals.xhx.module.dept.model.DeptEntity; ...@@ -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.dept.service.DeptService;
import com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity; import com.mortals.xhx.module.perform.model.PerformDeptConfDetailEntity;
import com.mortals.xhx.module.perform.model.PerformDeptConfDetailQuery; 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.PerformDeptConfDetailService;
import com.mortals.xhx.module.perform.service.PerformRulesCategoryService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -36,6 +38,8 @@ public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformD ...@@ -36,6 +38,8 @@ public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformD
private PerformDeptConfDetailService performDeptConfDetailService; private PerformDeptConfDetailService performDeptConfDetailService;
@Autowired @Autowired
private DeptService deptService; private DeptService deptService;
@Autowired
private PerformRulesCategoryService performRulesCategoryService;
@Override @Override
protected void findAfter(PerformDeptConfEntity params, PageInfo pageInfo, Context context, List<PerformDeptConfEntity> list) throws AppException { protected void findAfter(PerformDeptConfEntity params, PageInfo pageInfo, Context context, List<PerformDeptConfEntity> list) throws AppException {
...@@ -93,6 +97,10 @@ public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformD ...@@ -93,6 +97,10 @@ public class PerformDeptConfServiceImpl extends AbstractCRUDServiceImpl<PerformD
item.setCreateUser(entity.getCreateUser()); item.setCreateUser(entity.getCreateUser());
item.setDeptId(entity.getDeptId()); item.setDeptId(entity.getDeptId());
item.setDeptName(entity.getDeptName()); item.setDeptName(entity.getDeptName());
PerformRulesCategoryEntity categoryEntity = performRulesCategoryService.get(item.getCategoryId());
if(categoryEntity!=null){
item.setCategoryName(categoryEntity.getName());
}
item.setId(null); item.setId(null);
} }
performDeptConfDetailService.save(entity.getDeptConfDetail(),context); performDeptConfDetailService.save(entity.getDeptConfDetail(),context);
......
package com.mortals.xhx.module.perform.service.impl; package com.mortals.xhx.module.perform.service.impl;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.CheckTypeEnum; import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.module.perform.model.*; 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.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.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -30,52 +35,77 @@ public class PerformStaffConfServiceImpl extends AbstractCRUDServiceImpl<Perform ...@@ -30,52 +35,77 @@ public class PerformStaffConfServiceImpl extends AbstractCRUDServiceImpl<Perform
@Autowired @Autowired
private PerformStaffConfDetailService performStaffConfDetailService; private PerformStaffConfDetailService performStaffConfDetailService;
@Autowired
private StaffService staffService;
@Autowired
private PerformRulesCategoryService performRulesCategoryService;
@Override @Override
protected void saveBefore(PerformStaffConfEntity entity, Context context) throws AppException { protected void saveBefore(PerformStaffConfEntity entity, Context context) throws AppException {
super.saveBefore(entity,context); 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())){ if(CollectionUtils.isNotEmpty(entity.getStaffConfDetail())){
// Map<Integer,List<PerformStaffConfDetailEntity>> groupMap = entity.getStaffConfDetail().stream().collect(Collectors.groupingBy(PerformStaffConfDetailEntity::getType)); Map<Integer,List<PerformStaffConfDetailEntity>> groupMap = entity.getStaffConfDetail().stream().collect(Collectors.groupingBy(PerformStaffConfDetailEntity::getType));
// if(groupMap.containsKey(CheckTypeEnum.考勤绩效.getValue())) { if(groupMap.containsKey(CheckTypeEnum.考勤绩效.getValue())) {
// entity.setAttendCount(groupMap.get(CheckTypeEnum.考勤绩效.getValue()).size()); entity.setAttendCount(groupMap.get(CheckTypeEnum.考勤绩效.getValue()).size());
// }else { }else {
// entity.setAttendCount(0); entity.setAttendCount(0);
// } }
// if(groupMap.containsKey(CheckTypeEnum.评价绩效.getValue())) { if(groupMap.containsKey(CheckTypeEnum.评价绩效.getValue())) {
// entity.setAssessCount(groupMap.get(CheckTypeEnum.评价绩效.getValue()).size()); entity.setAssessCount(groupMap.get(CheckTypeEnum.评价绩效.getValue()).size());
// }else { }else {
// entity.setAssessCount(0); entity.setAssessCount(0);
// } }
// if(groupMap.containsKey(CheckTypeEnum.办件绩效.getValue())) { if(groupMap.containsKey(CheckTypeEnum.办件绩效.getValue())) {
// entity.setWorkCount(groupMap.get(CheckTypeEnum.办件绩效.getValue()).size()); entity.setWorkCount(groupMap.get(CheckTypeEnum.办件绩效.getValue()).size());
// }else { }else {
// entity.setWorkCount(0); entity.setWorkCount(0);
// } }
// if(groupMap.containsKey(CheckTypeEnum.效能绩效.getValue())) { if(groupMap.containsKey(CheckTypeEnum.效能绩效.getValue())) {
// entity.setEffectCount(groupMap.get(CheckTypeEnum.效能绩效.getValue()).size()); entity.setEffectCount(groupMap.get(CheckTypeEnum.效能绩效.getValue()).size());
// }else { }else {
// entity.setEffectCount(0); entity.setEffectCount(0);
// } }
// if(groupMap.containsKey(CheckTypeEnum.其它绩效.getValue())) { if(groupMap.containsKey(CheckTypeEnum.其它绩效.getValue())) {
// entity.setOtherCount(groupMap.get(CheckTypeEnum.其它绩效.getValue()).size()); entity.setOtherCount(groupMap.get(CheckTypeEnum.其它绩效.getValue()).size());
// }else { }else {
// entity.setOtherCount(0); entity.setOtherCount(0);
// } }
} }
} }
@Override @Override
protected void saveAfter(PerformStaffConfEntity entity, Context context) throws AppException { protected void saveAfter(PerformStaffConfEntity entity, Context context) throws AppException {
if(CollectionUtils.isNotEmpty(entity.getStaffConfDetail())){ if(CollectionUtils.isNotEmpty(entity.getStaffConfDetail())){
// for(PerformStaffConfDetailEntity item:entity.getStaffConfDetail()){ for(PerformStaffConfDetailEntity item:entity.getStaffConfDetail()){
// item.setStaffConfId(entity.getId()); item.setStaffConfId(entity.getId());
// item.setCreateTime(entity.getCreateTime()); item.setCreateTime(entity.getCreateTime());
// item.setCreateUser(entity.getCreateUser()); item.setCreateUser(entity.getCreateUser());
// item.setStaffId(entity.getStaffId()); item.setId(null);
// item.setStaffName(entity.getStaffName()); PerformRulesCategoryEntity categoryEntity = performRulesCategoryService.get(item.getCategoryId());
// item.setId(null); if(categoryEntity!=null){
// } item.setCategoryName(categoryEntity.getName());
// performDeptConfDetailService.save(entity.getDeptConfDetail(),context); }
}
performStaffConfDetailService.save(entity.getStaffConfDetail(),context);
} }
} }
...@@ -88,4 +118,25 @@ public class PerformStaffConfServiceImpl extends AbstractCRUDServiceImpl<Perform ...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment