作者 tangxvhui

修复bug

... ... @@ -230,6 +230,10 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp(
evaluationFinishList[0].BeginTime = nowTime
}
evaluationFinishList[0].Status = domain.EvaluationCompleted
err = evaluationRepo.Save(evaluationFinishList[0])
if err != nil {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
}
//添加确认绩效成绩提醒短信提醒
err = notify.AddNotifyConfirmEvaluationScore(evaluationFinishList[0])
if err != nil {
... ... @@ -237,17 +241,17 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp(
}
}
}
if noSuper && len(evaluationFinishList) > 0 {
//不存在上级评估
// 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 {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
}
}
// if noSuper && len(evaluationFinishList) > 0 {
//不存在上级评估
// 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 {
// return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
// }
// }
return nil
}
... ...
... ... @@ -192,6 +192,10 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(
evaluationFinish.BeginTime = nowTime
}
evaluationFinish.Status = domain.EvaluationCompleted
err = evaluationRepo.Save(evaluationFinish)
if err != nil {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
}
//添加确认绩效成绩提醒短信提醒
err = notify.AddNotifyConfirmEvaluationScore(evaluationFinish)
if err != nil {
... ... @@ -199,45 +203,45 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(
}
}
}
_ = noSuper
// if noSuper && evaluationFinish != nil {
//没有上级评估 同步数据到考核结果
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)
if err != nil {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
}
}
// } else if len(targetEvaluation) == 0 && evaluationFinish != nil {
// err = evaluationRepo.Save(evaluationFinish)
// if err != nil {
// return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
// }
// }
return nil
}
... ...