fix
This commit is contained in:
parent
3e496962b1
commit
4ac8b8d51c
@ -2,6 +2,7 @@ package com.lz.modules.performance.controller;
|
||||
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.flow.dao.FlowStartMapper;
|
||||
import com.lz.modules.flow.entity.FlowStart;
|
||||
import com.lz.modules.performance.req.AssessChangeReq;
|
||||
@ -86,12 +87,13 @@ public class AssessManagerController {
|
||||
if(req.getChangeType()==null){
|
||||
return R.error("变动类型无效");
|
||||
}
|
||||
FlowStart flowStart = flowStartMapper.selectFlowStartById(req.getStartId());
|
||||
if(flowStart == null){
|
||||
return R.error("暂无此考核组信息");
|
||||
if(StringUtil.isBlank(req.getStaffIds())){
|
||||
return R.error("变动人员不能为空");
|
||||
}
|
||||
String errorMsg = assessManagerService.assessChange(req);
|
||||
if(StringUtil.isNotBlank(errorMsg)){
|
||||
return R.error(errorMsg);
|
||||
}
|
||||
flowStart.getGroupIds();
|
||||
assessManagerService.assessChange(req);
|
||||
return R.ok();
|
||||
|
||||
}
|
||||
|
||||
@ -21,6 +21,6 @@ public class AssessChangeReq {
|
||||
private Integer changeType;
|
||||
|
||||
@ApiModelProperty(value = "变动人员ids",name = "staffIds")
|
||||
private List<String> staffIds;
|
||||
private String staffIds;
|
||||
|
||||
}
|
||||
|
||||
@ -15,10 +15,9 @@ public interface AssessManagerService {
|
||||
|
||||
PageUtils assessList(AssessListReq req);
|
||||
|
||||
|
||||
PageUtils assessDetail(AssessDetailReq req);
|
||||
|
||||
void accessDelete(FlowStart flowStart);
|
||||
|
||||
void assessChange(AssessChangeReq req);
|
||||
String assessChange(AssessChangeReq req);
|
||||
}
|
||||
|
||||
@ -3,6 +3,8 @@ package com.lz.modules.performance.service.impl;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.dto.StaffSimpleDto;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.dao.FlowStartMapper;
|
||||
import com.lz.modules.flow.entity.EvaluationGroup;
|
||||
import com.lz.modules.flow.entity.FlowStart;
|
||||
@ -22,9 +24,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
* @Desc:
|
||||
@ -40,6 +45,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
private EvaluationGroupService evaluationGroupService;
|
||||
@Autowired
|
||||
private EvaluationStartStaffService evaluationStartStaffService;
|
||||
@Autowired
|
||||
private StaffService staffService;
|
||||
|
||||
@Override
|
||||
public PageUtils assessList(AssessListReq req) {
|
||||
@ -89,7 +96,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
if(StringUtil.isNotBlank(groupIds)){
|
||||
String[] split = groupIds.split(",");
|
||||
List<String> ids = Arrays.asList(split);
|
||||
List<Long> collect = ids.stream().map(s -> Long.valueOf(s)).collect(Collectors.toList());
|
||||
List<Long> collect = ids.stream().map(s -> Long.valueOf(s)).collect(toList());
|
||||
evaluationGroupService.deleteByIds(collect);
|
||||
}
|
||||
resultRecordMapper.batchDeleteByStartId(flowStart.getId());
|
||||
@ -98,15 +105,47 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
|
||||
|
||||
@Override
|
||||
public void assessChange(AssessChangeReq req) {
|
||||
|
||||
public String assessChange(AssessChangeReq req) {
|
||||
String ok = StringUtil.EMPTY;
|
||||
FlowStart flowStart = flowStartMapper.selectFlowStartById(req.getStartId());
|
||||
if(flowStart == null){
|
||||
return "暂无此考核组信息";
|
||||
}
|
||||
String[] split = flowStart.getGroupIds().split(",");
|
||||
String[] changeStaffIds = req.getStaffIds().split(",");
|
||||
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);
|
||||
List<String> change = Arrays.asList(changeStaffIds);
|
||||
if(req.getChangeType() == 0){
|
||||
//获取不在考评组的人员
|
||||
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<StaffSimpleDto> staffSimpleDtos = staffService.selectStaffSimpleInfoByIds(collect);
|
||||
String notInGroupNames = StringUtil.EMPTY;
|
||||
for(StaffSimpleDto dto:staffSimpleDtos){
|
||||
notInGroupNames = notInGroupNames + dto.getName() + " ";
|
||||
}
|
||||
return notInGroupNames;
|
||||
}
|
||||
//初始化添加用户的数据 TODO
|
||||
|
||||
return ok;
|
||||
|
||||
|
||||
}
|
||||
if(req.getChangeType() == 1){
|
||||
|
||||
|
||||
}
|
||||
return ok;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user