修复获取详情时获取的分数不对的问题

This commit is contained in:
wulin 2020-11-13 15:20:56 +08:00
parent 00966dd7e2
commit 543a284ecf

View File

@ -369,12 +369,13 @@ public class ResultRecordController extends AbstractController {
Boolean isAllScore = true;//false表示返回所有的评分true表示值返回评分了的人 Boolean isAllScore = true;//false表示返回所有的评分true表示值返回评分了的人
for (FlowChartDetailRecord record:flowChartDetailRecords for (FlowChartDetailRecord record:flowChartDetailRecords
) { ) {
List<StaffEntity> staffs1 = new ArrayList<>();
if(record.getOptType().intValue() == -1){ if(record.getOptType().intValue() == -1){
//自己 //自己
StaffEntity staffEntity = new StaffEntity(); StaffEntity staffEntity = new StaffEntity();
staffEntity.setId(resultRecord.getId()); staffEntity.setId(resultRecord.getId());
staffEntity.setName(resultRecord.getStaffName()); staffEntity.setName(resultRecord.getStaffName());
staffs.add(staffEntity); staffs1.add(staffEntity);
}else if(record.getOptType().intValue() == 0){ }else if(record.getOptType().intValue() == 0){
//指定人员 //指定人员
//获取人员信息 //获取人员信息
@ -384,18 +385,18 @@ public class ResultRecordController extends AbstractController {
return Long.parseLong(s); return Long.parseLong(s);
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
staffs.addAll(staffService.selectNamesByIds(sIds));//这里不过滤离职人员因为过滤了可能涉及到评分规则的变更 staffs1.addAll(staffService.selectNamesByIds(sIds));//这里不过滤离职人员因为过滤了可能涉及到评分规则的变更
}else{ }else{
//领导 //领导
DepartManagers departManagers = staffService.findLeader(resultRecord.getStaffId(), record.getOptType()); DepartManagers departManagers = staffService.findLeader(resultRecord.getStaffId(), record.getOptType());
if(departManagers.getManagers().size() > 0){ if(departManagers.getManagers().size() > 0){
staffs.addAll(departManagers.getManagers()); staffs1.addAll(departManagers.getManagers());
} }
} }
if(staffs.size() == 0){ if(staffs1.size() == 0){
log.info("无法找到评分人员,开始找绩效管理人员"); 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.selectFlowRecordByRecordIdStatus(resultRecord.getId(), 0);//获取未执行的节点
if(flowRecords.size() > 0){ if(flowRecords.size() > 0){
@ -416,11 +417,7 @@ public class ResultRecordController extends AbstractController {
} }
} }
for (StaffEntity staff:staffs1
for (StaffEntity staff:staffs
) { ) {
ResultScoreDto resultScore = new ResultScoreDto(); ResultScoreDto resultScore = new ResultScoreDto();
resultScore.setApprovalId(staff.getId()); resultScore.setApprovalId(staff.getId());
@ -428,6 +425,7 @@ public class ResultRecordController extends AbstractController {
resultScore.setWeight(record.getWeight()); resultScore.setWeight(record.getWeight());
scoreDtos.add(resultScore); scoreDtos.add(resultScore);
} }
staffs.addAll(staffs1);
} }