This commit is contained in:
杜建超 2020-10-30 15:01:35 +08:00
parent 18195d0a4b
commit 8506e6f274
3 changed files with 24 additions and 22 deletions

View File

@ -90,9 +90,10 @@ public class AssessManagerController {
if(StringUtil.isBlank(req.getStaffIds())){
return R.error("变动人员不能为空");
}
String errorMsg = assessManagerService.assessChange(req);
if(StringUtil.isNotBlank(errorMsg)){
return R.error(errorMsg);
try {
assessManagerService.assessChange(req);
} catch (Exception e) {
return R.error(e.getMessage());
}
return R.ok();

View File

@ -1,6 +1,7 @@
package com.lz.modules.performance.service;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessDetailReq;
@ -20,7 +21,7 @@ public interface AssessManagerService {
void accessDelete(FlowStart flowStart);
String assessChange(AssessChangeReq req);
R assessChange(AssessChangeReq req);
void toScore(AssessToScoreReq req);
}

View File

@ -2,6 +2,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.exception.RRException;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
@ -122,11 +123,10 @@ public class AssessManagerServiceImpl implements AssessManagerService {
@Override
public String assessChange(AssessChangeReq req) {
String ok = StringUtil.EMPTY;
public R assessChange(AssessChangeReq req) {
FlowStart flowStart = flowStartMapper.selectFlowStartById(req.getStartId());
if(flowStart == null){
return "暂无此考核组信息";
throw new RRException("暂无此考核组信息");
}
//获取本次考的所有考评组信息
String[] split = flowStart.getGroupIds().split(",");
@ -161,7 +161,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
for(StaffSimpleDto dto:staffSimpleDtos){
notInGroupNames = notInGroupNames + dto.getName() + " ";
}
return notInGroupNames + "已在其他类型为月度的考评组中,是否改为到此考评组中进行考核";
throw new RRException(notInGroupNames + "已在其他类型为月度的考评组中,是否改为到此考评组中进行考核");
}
//初始化添加用户的数据
@ -175,7 +175,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
groupStaffs.setEvaluationGroup(group);
List<String> staffs = map.get(group.getId());
staffs.retainAll(notInGroup);
staffs.retainAll(change);
List<Long> collect = staffs.stream().map(s -> Long.valueOf(s)).collect(toList());
collect.removeAll(longs);
@ -187,7 +187,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
startGroups.setStartId(req.getStartId());
startGroups.setGroups(groupS);
flowStartService.startStaffs(startGroups);
return ok;
return R.ok();
}
@ -195,9 +195,9 @@ public class AssessManagerServiceImpl implements AssessManagerService {
//删除本次考核任务
resultRecordMapper.batchDeleteByStartIdAndStaffId(req.getStartId(),change);
evaluationStartStaffMapper.deleteEvaluationStartStaffChangeAssess(req.getStartId(),change);
return ok;
return R.ok();
}
return ok;
return R.ok();
}
@ -211,16 +211,16 @@ public class AssessManagerServiceImpl implements AssessManagerService {
int i = evaluationStartStaffService.updateBatchToScore(req.getStartId(), evaluation);
List<Long> longs = resultRecordMapper.selectToScoreList(req.getStartId(), evaluation);
}
List<String> strings = Arrays.asList(split);
//更新流程绩效
ApprovalDto approvalDto = new ApprovalDto();
try {
resultRecordService.newApproval(approvalDto);
} catch (Exception e) {
e.printStackTrace();
//更新流程绩效
ApprovalDto approvalDto = new ApprovalDto();
approvalDto.setStatus(1);
approvalDto.setResultRecordId(1L);
approvalDto.setMenuName("开始评分");
try {
resultRecordService.newApproval(approvalDto);
} catch (Exception e) {
e.printStackTrace();
}
}