修复
This commit is contained in:
parent
26e84ce64b
commit
4b5b281f85
@ -339,43 +339,32 @@ public class ResultRecordController extends AbstractController {
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "绩效id可为空,为空时使用token的用户获取"),
|
||||
@ApiImplicitParam(name = "startId", value = "任务id可为空,为空时使用token的用户获取")})
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = ResultRecordDetailDto.class)})
|
||||
public R getDetail(Map<String, Object> param) {
|
||||
public R getDetail(@RequestParam Map<String, Object> param) {
|
||||
Long id = null;
|
||||
Long startId = null;
|
||||
if(param.containsKey("id")){
|
||||
id = Long.parseLong(param.get("id").toString());
|
||||
}else if(param.containsKey("startId")){
|
||||
startId = Long.parseLong(param.get("startId").toString());
|
||||
}
|
||||
|
||||
|
||||
SysUserEntity user = getUser();
|
||||
ResultRecord resultRecord = null;
|
||||
if(id == null){
|
||||
//id = getUserId();//
|
||||
if(startId == null){//根据token获取
|
||||
resultRecord = lzResultRecordService.selectLastResultRecordByUserId(getUserId());
|
||||
}else{//根据startId和token获取
|
||||
resultRecord = lzResultRecordService.selectResultRecordByStaffIdAndStartId(getUserId(), startId);
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
if(param.containsKey("id")){
|
||||
id = Long.parseLong(param.get("id").toString());
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
if(resultRecord == null){
|
||||
return R.error("绩效不存在");
|
||||
}
|
||||
id = resultRecord.getId();
|
||||
if(resultRecord.getStaffId().longValue() != user.getUserId().longValue()){
|
||||
//下面判断权限,是否可读
|
||||
EvaluationStartStaff evaluationStartStaff =
|
||||
evaluationStartStaffService.selectManagerEvaluationStartStaff(resultRecord.getEvaluationId(), user.getUserId());
|
||||
if(evaluationStartStaff == null){//非考核组设置的绩效管理人员,下面应在查询其他权限
|
||||
return R.error("未被授权访问");
|
||||
}
|
||||
}
|
||||
|
||||
//获取考核维度等信息
|
||||
ResultRecordDetailDto resultRecordDetailDto = new ResultRecordDetailDto();
|
||||
BeanUtils.copyProperties(resultRecord, resultRecordDetailDto);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user