...
|
...
|
@@ -975,3 +975,52 @@ func (srv *SummaryEvaluationService) getEvaluationSuperDefaultValue(transactionC |
|
|
}
|
|
|
return result, nil
|
|
|
}
|
|
|
|
|
|
// 获取上级评估的列表
|
|
|
func (srv *SummaryEvaluationService) ListEvaluationSuper(param *command.QueryEvaluationList) (map[string]interface{}, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
userRepo := factory.CreateUserRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
cnt, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
"cycleId": param.CycleId,
|
|
|
"executorId": param.ExecutorId,
|
|
|
"types": int(domain.EvaluationSuper),
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
targetUserIds := []int{}
|
|
|
for _, v := range evaluationList {
|
|
|
targetUserIds = append(targetUserIds, v.TargetUser.UserId)
|
|
|
}
|
|
|
var userList []*domain.User
|
|
|
if len(targetUserIds) > 0 {
|
|
|
_, userList, err = userRepo.Find(map[string]interface{}{
|
|
|
"ids": targetUserIds,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
}
|
|
|
|
|
|
_ = userList
|
|
|
_ = evaluationList
|
|
|
_ = cnt
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
return nil, nil
|
|
|
} |
...
|
...
|
|