作者 郑周

1. 员工考核结果确认后,就不能在进行编辑

... ... @@ -1212,6 +1212,20 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
}
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
"targetUserId": evaluationData.TargetUser.UserId,
"typesList": []int{int(domain.EvaluationFinish)},
"cycleId": evaluationData.CycleId,
"limit": 1,
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
// 如果目标员工已经确认考核结果,就不能在进行评估编辑
if len(evaluationList) > 0 && evaluationList[0].Status == domain.EvaluationCompleted {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能在编辑!")
}
_, itemList, err := itemUsedRepo.Find(map[string]interface{}{
"evaluationProjectId": evaluationData.EvaluationProjectId,
"nodeType": domain.LinkNodeSelfAssessment,
... ... @@ -1307,6 +1321,20 @@ func (srv *SummaryEvaluationService) EditEvaluationSuperForAdmin(param *command.
if evaluationData.CompanyId != param.CompanyId {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限")
}
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
"targetUserId": evaluationData.TargetUser.UserId,
"typesList": []int{int(domain.EvaluationFinish)},
"cycleId": evaluationData.CycleId,
"limit": 1,
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
// 如果目标员工已经确认考核结果,就不能在进行评估编辑
if len(evaluationList) > 0 && evaluationList[0].Status == domain.EvaluationCompleted {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能在编辑!")
}
_, itemList, err := itemUsedRepo.Find(map[string]interface{}{"evaluationProjectId": evaluationData.EvaluationProjectId, "nodeType": domain.LinkNodeSelfAssessment})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
... ...