This commit is contained in:
杜建超 2020-10-30 14:11:22 +08:00
parent ff4316d3c5
commit b2406efb21
2 changed files with 47 additions and 13 deletions

View File

@ -276,7 +276,7 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
evaluationGroups.stream().map(new Function<EvaluationGroup, CheckStaffDto>() {
@Override
public CheckStaffDto apply(EvaluationGroup evaluationGroup) {
evaluationGroupService.
//evaluationGroupService.
return null;
}
});

View File

@ -1,6 +1,7 @@
package com.lz.modules.performance.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
@ -12,9 +13,12 @@ import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.EvaluationGroup;
import com.lz.modules.flow.entity.EvaluationStartStaff;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.model.GroupStaffs;
import com.lz.modules.flow.model.StartGroups;
import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.flow.service.EvaluationStartStaffService;
import com.lz.modules.flow.service.FlowRecordService;
import com.lz.modules.flow.service.FlowStartService;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.AssessListReq;
@ -58,6 +62,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
private ResultRecordService resultRecordService;
@Autowired
private EvaluationStartStaffMapper evaluationStartStaffMapper;
@Autowired
private FlowStartService flowStartService;
@Override
public PageUtils assessList(AssessListReq req) {
@ -127,29 +133,55 @@ public class AssessManagerServiceImpl implements AssessManagerService {
List<String> strings = Arrays.asList(split);
List<Long> ids = strings.stream().map(s -> Long.valueOf(s)).collect(toList());
List<EvaluationGroup> evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(ids);
Set<String> staffIds = new HashSet<>();
//获取所有考核人员
for(EvaluationGroup group:evaluationGroups){
List<String> staff = evaluationGroupService.selectAllStaffIdsByGroupId(group.getId());
staffIds.addAll(staff);
}
List<String> all = new ArrayList<>(staffIds);
//获取变更人员
String[] changeStaffIds = req.getStaffIds().split(",");
List<String> change = Arrays.asList(changeStaffIds);
List<String> change = new ArrayList<>(Arrays.asList(changeStaffIds));
if(req.getChangeType() == 0){
//获取不在考评组的人员
//获取所有考核人员
List<String> all = new ArrayList<>();
//根据组id成员分组
Map<Long,List<String>> map = Maps.newHashMap();
for(EvaluationGroup group:evaluationGroups){
List<String> staff = evaluationGroupService.selectAllStaffIdsByGroupId(group.getId());
all.addAll(staff);
map.put(group.getId(),staff);
}
//获取不在考核组成员
List<String> notInGroup = change.stream().filter(item -> !all.contains(item)).collect(toList());
//获取不在考评组的人员
if(CollectionUtils.isNotEmpty(notInGroup)){
List<Long> collect = notInGroup.stream().map(s -> Long.valueOf(s)).collect(toList());
List<Long> collect = notInGroup.stream().map(s -> Long.valueOf(s)).distinct().collect(toList());
List<StaffSimpleDto> staffSimpleDtos = staffService.selectStaffSimpleInfoByIds(collect);
String notInGroupNames = StringUtil.EMPTY;
for(StaffSimpleDto dto:staffSimpleDtos){
notInGroupNames = notInGroupNames + dto.getName() + " ";
}
return notInGroupNames;
return notInGroupNames + "已在其他类型为月度的考评组中,是否改为到此考评组中进行考核";
}
//初始化添加用户的数据 TODO
//初始化添加用户的数据
List<GroupStaffs> groupS = new ArrayList<>();
for(EvaluationGroup group:evaluationGroups){
List<String> staffs = map.get(group.getId());
staffs.retainAll(notInGroup);
map.put(group.getId(),staffs);
GroupStaffs groupStaffs = new GroupStaffs();
groupStaffs.setGroupId(group.getId());
List<Long> collect = staffs.stream().map(s -> Long.valueOf(s)).collect(toList());
groupStaffs.setStaffIds(collect);
groupS.add(groupStaffs);
}
StartGroups startGroups = new StartGroups();
startGroups.setStartId(req.getStartId());
startGroups.setStaffIds(groupS);
flowStartService.startStaffs(startGroups);
return ok;
@ -205,4 +237,6 @@ public class AssessManagerServiceImpl implements AssessManagerService {
return evaluationStartStaffs;
}
}