...
|
...
|
@@ -249,8 +249,8 @@ func (srv *SummaryEvaluationService) GetEvaluation360(param *command.QueryEvalua |
|
|
return &itemValuesAdapter, nil
|
|
|
}
|
|
|
|
|
|
// GetEvaluation360All 获取360综评详情-上级综评(所有的评估人,评估内容)
|
|
|
func (srv *SummaryEvaluationService) GetEvaluation360All(param *command.QueryEvaluation360) (*[]adapter.EvaluationItemAdapter, error) {
|
|
|
// GetEvaluation360Complete 获取360综评详情(他人评估目标用户)(已完成状态)
|
|
|
func (srv *SummaryEvaluationService) GetEvaluation360Complete(param *command.QueryEvaluation360) (*[]adapter.EvaluationItemAdapter, error) {
|
|
|
transactionContext, err := factory.ValidateStartTransaction(param)
|
|
|
if err != nil {
|
|
|
return nil, err
|
...
|
...
|
@@ -263,12 +263,13 @@ func (srv *SummaryEvaluationService) GetEvaluation360All(param *command.QueryEva |
|
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
_, evaluations, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
"limit": 1,
|
|
|
"companyId": param.CompanyId,
|
|
|
"cycleId": param.CycleId,
|
|
|
"targetUserId": param.TargetUserId,
|
|
|
"types": domain.Evaluation360},
|
|
|
)
|
|
|
"types": domain.Evaluation360,
|
|
|
"status": domain.EvaluationCompleted,
|
|
|
"limit": 99999,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -583,7 +584,53 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval |
|
|
}
|
|
|
|
|
|
// GetEvaluationHRBP 获取人资综评详情
|
|
|
func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvaluationHRBP) (*[]adapter.EvaluationItemAdapter, error) {
|
|
|
func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvaluationHRBPMy) (*[]adapter.EvaluationItemAdapter, error) {
|
|
|
transactionContext, err := factory.ValidateStartTransaction(param)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
|
|
|
sEvaluation, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
// 自评评估内容(自评模板、筛选项目评估人)
|
|
|
_, itemList, err := evaluationItemRepo.Find(map[string]interface{}{
|
|
|
"evaluationProjectId": sEvaluation.EvaluationProjectId,
|
|
|
"nodeType": domain.LinkNodeSelfAssessment,
|
|
|
"evaluatorId": -1,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
// 评估内容对应的分数
|
|
|
_, itemValues, err := itemValueRepo.Find(map[string]interface{}{"summaryEvaluationId": sEvaluation.Id})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
itemValuesAdapter := srv.buildSummaryItemValue(itemList, itemValues)
|
|
|
for i := range itemValuesAdapter { // 评估人名称赋值
|
|
|
itemValuesAdapter[i].EvaluatorName = sEvaluation.Executor.UserName
|
|
|
}
|
|
|
return &itemValuesAdapter, nil
|
|
|
}
|
|
|
|
|
|
// GetEvaluationHRBPComplete 获取人资综评详情(已完成状态)
|
|
|
func (srv *SummaryEvaluationService) GetEvaluationHRBPComplete(param *command.QueryEvaluationHRBP) (*[]adapter.EvaluationItemAdapter, error) {
|
|
|
transactionContext, err := factory.ValidateStartTransaction(param)
|
|
|
if err != nil {
|
|
|
return nil, err
|
...
|
...
|
@@ -597,13 +644,13 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu |
|
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
|
|
|
_, evaluations, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
"limit": 1,
|
|
|
"limit": 99999,
|
|
|
"companyId": param.CompanyId,
|
|
|
"cycleId": param.CycleId,
|
|
|
"targetUserId": param.TargetUserId,
|
|
|
"status": domain.EvaluationCompleted,
|
|
|
"types": domain.EvaluationHrbp},
|
|
|
)
|
|
|
// sEvaluation, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -653,21 +700,6 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu |
|
|
itemValuesAdapter[i].EvaluatorName = executor.UserName
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//result := adapter.EvaluationInfoAdapter{
|
|
|
// SummaryEvaluationId: sEvaluation.Id,
|
|
|
// CycleId: int(sEvaluation.CycleId),
|
|
|
// CycleName: sEvaluation.CycleName,
|
|
|
// EvaluationProjectId: sEvaluation.EvaluationProjectId,
|
|
|
// EvaluationProjectName: sEvaluation.EvaluationProjectName,
|
|
|
// LinkNodeId: sEvaluation.NodeId,
|
|
|
// BeginTime: sEvaluation.BeginTime.Format("2006-01-02 15:04:05"),
|
|
|
// EndTime: sEvaluation.EndTime.Format("2006-01-02 15:04:05"),
|
|
|
// TargetUserId: sEvaluation.TargetUser.UserId,
|
|
|
// TargetUserName: sEvaluation.TargetUser.UserName,
|
|
|
// Status: string(sEvaluation.Status),
|
|
|
// EvaluationItems: itemValuesAdapter,
|
|
|
//}
|
|
|
return &itemValuesAdapter, nil
|
|
|
}
|
|
|
|
...
|
...
|
|