解决冲突

This commit is contained in:
wulin 2020-11-11 16:55:42 +08:00
commit 53025af273
4 changed files with 26 additions and 14 deletions

View File

@ -353,7 +353,8 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
}
if(evaluationGroup.getConfirm()==0){
return R.error(504,notInGroupNames + "已在其他类型为月度的考评组中,是否改为到此考评组中进行考核");
return R.error(504,notInGroupNames + "已在其他类型为月度的考评组中,是否改为到此考评组中进行考核").put("data",staffSimpleDtos);
}
List<String> stringCollect = staffIdsByGroup.stream().distinct().collect(toList());
@ -378,18 +379,28 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
private int removeStaffsToAssessGroup(List<String> ids,EvaluationGroup group) {
String staffIds = group.getStaffIds();
String outIds = group.getOutIds();
//删除选中人员
if(StringUtil.isNotBlank(staffIds)){
String[] split = staffIds.split(",");
Set<String> set = new HashSet(Arrays.asList(split));
set.removeAll(new HashSet(ids)); //set.addAll(new HashSet(ids));
String join = StringUtils.join(set, ",");
group.setStaffIds(join);
int i = evaluationGroupMapper.updateCoverEvaluationGroupById(group);
return i;
}
return 0;
String[] staffs = staffIds.split(",");
Set<String> staffsSet = new HashSet(Arrays.asList(staffs));
staffsSet.removeAll(ids);
group.setStaffIds(StringUtils.join(staffsSet, ","));
}
//增加排除人员
if(StringUtil.isBlank(outIds)){
group.setOutIds(StringUtils.join(ids, ","));
}
else {
String[] outs = outIds.split(",");
Set<String> outsSet = new HashSet(Arrays.asList(outs));
outsSet.addAll(ids);
group.setOutIds(StringUtils.join(outsSet, ","));
}
return evaluationGroupMapper.updateById(group);
}
@Override
public String getEvaluationCopyIdsByEvaluationIds(String evaluationIds,Long startId) {

View File

@ -3,6 +3,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.app.dto.StaffSimpleDto;
import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.req.AssessChangeReq;
@ -105,7 +106,7 @@ public class AssessManagerController extends AbstractController{
@PostMapping("assess/manager/change")
@ApiOperation("考核管理组管理变更")
@ApiResponses({@ApiResponse(code = 200,message = "成功"),@ApiResponse(code = 503,message = "去设置")})
@ApiResponses({@ApiResponse(code = 200,message = "成功"),@ApiResponse(code = 503,message = "去设置",response = StaffSimpleDto.class)})
public R assessChange(@RequestBody AssessChangeReq req){
if(req.getStartId()==null){
return R.error("考核id不能为空");

View File

@ -224,7 +224,7 @@ public class EvaluationGroupController extends AbstractController {
@PostMapping("/checkStaff")
@ApiOperation("校验是否有跨组人员")
@ApiResponses({@ApiResponse(code = 200,message = "成功"),@ApiResponse(code = 504,message = "已跨组")})
@ApiResponses({@ApiResponse(code = 200,message = "成功"),@ApiResponse(code = 504,message = "已跨组",response = StaffSimpleDto.class)})
public R checkStaff(@RequestBody @ApiParam(required = true,name = "body") CheckStaffReq checkStaffReq) {
return evaluationGroupService.checkStaff(checkStaffReq);
}

View File

@ -218,7 +218,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
notInGroupNames = notInGroupNames + dto.getName() + " ";
}
return R.error(503,notInGroupNames + "未加入月度类型考评组,被考核人需要加入月度考评组后才能参与当前月度考核。");
return R.error(503,notInGroupNames + "未加入月度类型考评组,被考核人需要加入月度考评组后才能参与当前月度考核。").put("data",staffSimpleDtos);
}
//初始化添加用户的数据