提交修改
This commit is contained in:
commit
94e54af6a3
@ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
@ -367,14 +368,16 @@ public class ResultRecordController extends AbstractController {
|
||||
flowChartDetailRecordService.selectFlowChartDetailRecordsByFlowProcess(resultRecord.getEvaluationId(), ChartFlowType.SCORE.getCode());//获取参与评分的人
|
||||
List<StaffEntity> staffs = new ArrayList<>();
|
||||
Boolean isAllScore = true;//false表示返回所有的评分,true表示值返回评分了的人
|
||||
Boolean isOrScore = false;//是否为或签
|
||||
for (FlowChartDetailRecord record:flowChartDetailRecords
|
||||
) {
|
||||
List<StaffEntity> staffs1 = new ArrayList<>();
|
||||
if(record.getOptType().intValue() == -1){
|
||||
//自己
|
||||
StaffEntity staffEntity = new StaffEntity();
|
||||
staffEntity.setId(resultRecord.getId());
|
||||
staffEntity.setName(resultRecord.getStaffName());
|
||||
staffs.add(staffEntity);
|
||||
staffs1.add(staffEntity);
|
||||
}else if(record.getOptType().intValue() == 0){
|
||||
//指定人员
|
||||
//获取人员信息
|
||||
@ -384,50 +387,58 @@ public class ResultRecordController extends AbstractController {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
staffs.addAll(staffService.selectNamesByIds(sIds));//这里不过滤离职人员,因为过滤了可能涉及到评分规则的变更
|
||||
staffs1.addAll(staffService.selectNamesByIds(sIds));//这里不过滤离职人员,因为过滤了可能涉及到评分规则的变更
|
||||
|
||||
}else{
|
||||
//领导
|
||||
DepartManagers departManagers = staffService.findLeader(resultRecord.getStaffId(), record.getOptType());
|
||||
if(departManagers.getManagers().size() > 0){
|
||||
staffs.addAll(departManagers.getManagers());
|
||||
staffs1.addAll(departManagers.getManagers());
|
||||
}
|
||||
}
|
||||
if(staffs.size() == 0){
|
||||
if(staffs1.size() == 0){
|
||||
log.info("无法找到评分人员,开始找绩效管理人员");
|
||||
staffs = staffService.findManger(resultRecord.getId(), ChartFlowType.SCORE.getCode());
|
||||
staffs1 = staffService.findManger(resultRecord.getId(), ChartFlowType.SCORE.getCode());
|
||||
}
|
||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(resultRecord.getId(), 0);//获取未执行的节点
|
||||
//流程已经到了审批节点,那么判断评分是否为或签,如果是那么只需要返回实际评分的那个人即可,否则全部返回
|
||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdFlowProcess(resultRecord.getId(), ChartFlowType.SCORE.getCode());//获取当前的流程节点
|
||||
if(flowRecords.get(0).getType().intValue() == 1){
|
||||
//或签
|
||||
isOrScore = true;
|
||||
}
|
||||
|
||||
for (StaffEntity staff:staffs1
|
||||
) {
|
||||
ResultScoreDto resultScore = new ResultScoreDto();
|
||||
resultScore.setApprovalId(staff.getId());
|
||||
resultScore.setApprovalName(staff.getName());
|
||||
if(isOrScore){
|
||||
//或签每个权重一样
|
||||
resultScore.setWeight(record.getWeight());
|
||||
}else{
|
||||
//多人的时候权重平分
|
||||
resultScore.setWeight(record.getWeight().divide(BigDecimal.valueOf(staffs1.size()), RoundingMode.CEILING));
|
||||
}
|
||||
|
||||
scoreDtos.add(resultScore);
|
||||
}
|
||||
|
||||
flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(resultRecord.getId(), 0);//获取未执行的节点
|
||||
if(flowRecords.size() > 0){
|
||||
if(flowRecords.get(0).getFlowProcess().intValue() > ChartFlowType.SCORE.getCode()){
|
||||
//流程已经到了审批节点,那么判断评分是否为或签,如果是那么只需要返回实际评分的那个人即可,否则全部返回
|
||||
flowRecords = flowRecordService.selectFlowRecordByRecordIdFlowProcess(resultRecord.getId(), ChartFlowType.SCORE.getCode());//获取当前的流程节点
|
||||
if(flowRecords.get(0).getType().intValue() == 1){
|
||||
//或签
|
||||
if(isOrScore){
|
||||
isAllScore = false;
|
||||
}
|
||||
}
|
||||
}else{//绩效流程已经走完
|
||||
//流程已经到了审批节点,那么判断评分是否为或签,如果是那么只需要返回实际评分的那个人即可,否则全部返回
|
||||
flowRecords = flowRecordService.selectFlowRecordByRecordIdFlowProcess(resultRecord.getId(), ChartFlowType.SCORE.getCode());//获取当前的流程节点
|
||||
if(flowRecords.get(0).getType().intValue() == 1){
|
||||
//或签
|
||||
if(isOrScore){
|
||||
isAllScore = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (StaffEntity staff:staffs
|
||||
) {
|
||||
ResultScoreDto resultScore = new ResultScoreDto();
|
||||
resultScore.setApprovalId(staff.getId());
|
||||
resultScore.setApprovalName(staff.getName());
|
||||
resultScore.setWeight(record.getWeight());
|
||||
scoreDtos.add(resultScore);
|
||||
}
|
||||
staffs.addAll(staffs1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user