...
|
...
|
@@ -1142,3 +1142,45 @@ func (srv *SummaryEvaluationService) ListEvaluationSuper(param *command.QueryEva |
|
|
}
|
|
|
return result, nil
|
|
|
}
|
|
|
|
|
|
// 员工确认综评考核结果
|
|
|
func (srv *SummaryEvaluationService) ConfirmScoreSuperEvaluation(param *command.ConfirmScore) error {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
|
|
|
evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{
|
|
|
"id": param.SummaryEvaluationId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if evaluationData.Types != domain.EvaluationSuper {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, "操作方式错误")
|
|
|
}
|
|
|
if evaluationData.TargetUser.UserId != param.UserId {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, "没有操作权限")
|
|
|
}
|
|
|
if evaluationData.Status == domain.EvaluationUncompleted {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, "上级还未正式提交评估内容")
|
|
|
}
|
|
|
evaluationData.CheckResult = domain.EvaluationCheckCompleted
|
|
|
err = evaluationRepo.Save(evaluationData)
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
return nil
|
|
|
} |
...
|
...
|
|