作者 tangxvhui
... ... @@ -371,6 +371,20 @@ func (srv *SummaryEvaluationService) EditEvaluation360(param *command.EditEvalua
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
}
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
"targetUserId": summaryEvaluation.TargetUser.UserId,
"typesList": []int{int(domain.EvaluationFinish)},
"cycleId": summaryEvaluation.CycleId,
"limit": 1,
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
// 如果目标员工已经确认考核结果,就不能在进行评估编辑
if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能在编辑!")
}
// 自评评估内容(自评模板、筛选项目评估人)
_, itemList, err := itemUsedRepo.Find(map[string]interface{}{
"evaluationProjectId": summaryEvaluation.EvaluationProjectId,
... ... @@ -757,6 +771,20 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
}
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
"targetUserId": summaryEvaluation.TargetUser.UserId,
"typesList": []int{int(domain.EvaluationFinish)},
"cycleId": summaryEvaluation.CycleId,
"limit": 1,
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
// 如果目标员工已经确认考核结果,就不能在进行评估编辑
if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能在编辑!")
}
// 自评评估内容(自评模板、筛选项目评估人)
_, itemList, err := itemUsedRepo.Find(map[string]interface{}{
"evaluationProjectId": summaryEvaluation.EvaluationProjectId,
... ...