增加对id传空的判断

This commit is contained in:
wulin 2020-11-16 14:57:14 +08:00
parent 1cb8b1332f
commit 2cc3f35379

View File

@ -346,23 +346,31 @@ public class ResultRecordController extends AbstractController {
ResultRecord resultRecord = null;
if(param.containsKey("id")){
id = Long.parseLong(param.get("id").toString());
resultRecord = lzResultRecordService.selectResultRecordById(id);
//下面判断权限
if(user.getUserId().longValue() != resultRecord.getStaffId().longValue()){
//不是自己的绩效判断是否为绩效管理人员老板部门管理人员
log.info("不是自己的绩效");
String value = param.get("id").toString();
if(value.length() > 0){
id = Long.parseLong(value);
resultRecord = lzResultRecordService.selectResultRecordById(id);
//下面判断权限
if(user.getUserId().longValue() != resultRecord.getStaffId().longValue()){
//不是自己的绩效判断是否为绩效管理人员老板部门管理人员
log.info("不是自己的绩效");
}
}
}else if(param.containsKey("startId")){//根据startId和token获取
startId = Long.parseLong(param.get("startId").toString());
resultRecord = lzResultRecordService.selectResultRecordByStaffIdAndStartId(getUserId(), startId);
}else{//根据token获取
resultRecord = lzResultRecordService.selectLastResultRecordByUserId(getUserId());
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("绩效不存在");
resultRecord = lzResultRecordService.selectLastResultRecordByUserId(getUserId());//根据token获取
if(resultRecord == null){
return R.error("绩效不存在");
}
}
//获取考核维度等信息