获取绩效详情逻辑变更

This commit is contained in:
wulin 2020-11-20 10:42:38 +08:00
parent cbf0ced7f5
commit caaf6f75ce

View File

@ -349,6 +349,28 @@ public class ResultRecordController extends AbstractController {
String value = param.get("id").toString(); String value = param.get("id").toString();
if(value.length() > 0){ if(value.length() > 0){
id = Long.parseLong(value); id = Long.parseLong(value);
}
}else if(param.containsKey("startId")){//根据startId和token获取
String value = param.get("startId").toString();
if(value.length() > 0){
startId = Long.parseLong(value);
}
}
if(id == null){
if(startId == null){
//根据token获取
resultRecord = lzResultRecordService.selectLastResultRecordByUserId(getUserId());
if(resultRecord == null){
return R.error("绩效不存在");
}
}else{
resultRecord = lzResultRecordService.selectResultRecordByStaffIdAndStartId(getUserId(), startId);
if(resultRecord == null){
return R.error("绩效不存在");
}
}
}else{
resultRecord = lzResultRecordService.selectResultRecordById(id); resultRecord = lzResultRecordService.selectResultRecordById(id);
if(resultRecord == null){ if(resultRecord == null){
return R.error("绩效不存在"); return R.error("绩效不存在");
@ -360,24 +382,6 @@ public class ResultRecordController extends AbstractController {
} }
} }
}else if(param.containsKey("startId")){//根据startId和token获取
String value = param.get("startId").toString();
if(value.length() > 0){
startId = Long.parseLong(value);
resultRecord = lzResultRecordService.selectResultRecordByStaffIdAndStartId(getUserId(), startId);
if(resultRecord == null){
return R.error("绩效不存在");
}
}
}else{
//根据token获取
resultRecord = lzResultRecordService.selectLastResultRecordByUserId(getUserId());
if(resultRecord == null){
return R.error("绩效不存在");
}
}
//获取考核维度等信息 //获取考核维度等信息
ResultRecordDetailDto resultRecordDetailDto = new ResultRecordDetailDto(); ResultRecordDetailDto resultRecordDetailDto = new ResultRecordDetailDto();
BeanUtils.copyProperties(resultRecord, resultRecordDetailDto); BeanUtils.copyProperties(resultRecord, resultRecordDetailDto);