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())){ if(StringUtil.isBlank(req.getStaffIds())){
return R.error("变动人员不能为空"); return R.error("变动人员不能为空");
} }
String errorMsg = assessManagerService.assessChange(req); try {
if(StringUtil.isNotBlank(errorMsg)){ assessManagerService.assessChange(req);
return R.error(errorMsg); } catch (Exception e) {
return R.error(e.getMessage());
} }
return R.ok(); return R.ok();

View File

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