作者 郑周

1. 修复 上级评估未填写或未填写完成,获取360/人资评估的填写值

... ... @@ -1034,7 +1034,7 @@ func (srv *SummaryEvaluationService) GetEvaluationSuper(param *command.QueryEval
"transactionContext": transactionContext,
})
permissinData, err := getPermission(int64(param.CompanyId))
permissionData, err := getPermission(int64(param.CompanyId))
if err != nil {
return nil, err
}
... ... @@ -1069,8 +1069,8 @@ func (srv *SummaryEvaluationService) GetEvaluationSuper(param *command.QueryEval
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if len(itemValues) == 0 {
//上级还未填写评估,获取 360 ,人资评估
// 上级评估未填写或未填写完成,获取360/人资评估的填写值
if len(itemValues) == 0 || evaluationData.Status == domain.EvaluationUncompleted {
_, evaluationListOther, err := evaluationRepo.Find(map[string]interface{}{
"typesList": []int{int(domain.Evaluation360), int(domain.EvaluationHrbp)},
"targetUserId": evaluationData.TargetUser.UserId,
... ... @@ -1099,11 +1099,11 @@ func (srv *SummaryEvaluationService) GetEvaluationSuper(param *command.QueryEval
//组合 评估填写的值和评估项
itemValuesAdapter := srv.buildSummaryItemValue(itemList, itemValues)
for i, v := range itemValuesAdapter {
if permissinData.OptEvalScore == domain.PermissionOff &&
if permissionData.OptEvalScore == domain.PermissionOff &&
v.EvaluatorId > 0 {
itemValuesAdapter[i].ForbidEdit = true
}
if permissinData.OptHrScore == domain.PermissionOff &&
if permissionData.OptHrScore == domain.PermissionOff &&
v.EvaluatorId < 0 {
itemValuesAdapter[i].ForbidEdit = true
}
... ... @@ -1138,14 +1138,7 @@ func (srv *SummaryEvaluationService) GetEvaluationSuperForAdmin(param *command.Q
evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
// evaluationData, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
// if err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
// }
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
"id": []int{param.SummaryEvaluationId},
})
_, evaluationList, err := evaluationRepo.Find(map[string]interface{}{"id": []int{param.SummaryEvaluationId}})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
... ... @@ -1166,8 +1159,9 @@ func (srv *SummaryEvaluationService) GetEvaluationSuperForAdmin(param *command.Q
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if len(itemValues) == 0 {
// 上级还未填写评估,获取 360 ,人资评估
// 上级评估未填写或未填写完成,获取360/人资评估的填写值
if len(itemValues) == 0 || evaluationData.Status == domain.EvaluationUncompleted {
_, evaluationListOther, err := evaluationRepo.Find(map[string]interface{}{
"typesList": []int{int(domain.Evaluation360), int(domain.EvaluationHrbp)},
"targetUserId": evaluationData.TargetUser.UserId,
... ...