作者 tangxvhui

调整逻辑

... ... @@ -239,10 +239,10 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp(
}
if noSuper && len(evaluationFinishList) > 0 {
//不存在上级评估
// err = srv.syncEvaluationFinishValue(transactionContext, evaluationFinishList[0], evaluationValue)
// if err != nil {
// return err
// }
err = srv.syncEvaluationFinishValue(transactionContext, evaluationFinishList[0], evaluationValue)
if err != nil {
return err
}
} else if len(evaluationList) == 0 && len(evaluationFinishList) > 0 {
err = evaluationRepo.Save(evaluationFinishList[0])
if err != nil {
... ...
... ... @@ -203,34 +203,34 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(
if noSuper && evaluationFinish != nil {
//没有上级评估 同步数据到考核结果
// itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{
// "transactionContext": transactionContext,
// })
// _, itemList, err := itemUsedRepo.Find(map[string]interface{}{
// "evaluationProjectId": evaluationData.EvaluationProjectId,
// "nodeType": domain.LinkNodeSelfAssessment,
// })
// if err != nil {
// return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
// }
// //提取非360,hrbp 的评估项
// updateValue := []*domain.SummaryEvaluationValue{}
// for _, val := range itemList {
// if val.EvaluatorId != 0 {
// continue
// }
// for _, val2 := range evaluationValue {
// if val.Id == val2.EvaluationItemId {
// updateValue = append(updateValue, val2)
// break
// }
// }
// }
// //同步数据
// err = srv.syncEvaluationFinishValue(transactionContext, evaluationFinish, updateValue)
// if err != nil {
// return err
// }
itemUsedRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
_, itemList, err := itemUsedRepo.Find(map[string]interface{}{
"evaluationProjectId": evaluationData.EvaluationProjectId,
"nodeType": domain.LinkNodeSelfAssessment,
})
if err != nil {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
//提取非360,hrbp 的评估项
updateValue := []*domain.SummaryEvaluationValue{}
for _, val := range itemList {
if val.EvaluatorId != 0 {
continue
}
for _, val2 := range evaluationValue {
if val.Id == val2.EvaluationItemId {
updateValue = append(updateValue, val2)
break
}
}
}
//同步数据
err = srv.syncEvaluationFinishValue(transactionContext, evaluationFinish, updateValue)
if err != nil {
return err
}
} else if len(targetEvaluation) == 0 && evaluationFinish != nil {
err = evaluationRepo.Save(evaluationFinish)
... ...