|
|
package service
|
|
|
|
|
|
import (
|
|
|
"time"
|
|
|
|
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/adapter"
|
...
|
...
|
@@ -156,6 +158,7 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit |
|
|
newItemValueList = append(newItemValueList, &temp)
|
|
|
}
|
|
|
|
|
|
nowTime := time.Now()
|
|
|
// 处理人资评估
|
|
|
if evalutionHrbp != nil {
|
|
|
evalutionHrbp.EvaluationTotalScore(newHrbpItemValueList)
|
...
|
...
|
@@ -167,6 +170,9 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit |
|
|
|
|
|
evalutionHrbp.HrCheckResult = domain.EvaluationCheckCompleted
|
|
|
evalutionHrbp.Status = domain.EvaluationCompleted
|
|
|
if evalutionHrbp.BeginTime.After(nowTime) {
|
|
|
evalutionHrbp.BeginTime = nowTime
|
|
|
}
|
|
|
err = evaluationRepo.Save(evalutionHrbp)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -186,8 +192,11 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
val.Status = domain.EvaluationCompleted
|
|
|
val.HrCheckResult = domain.EvaluationCheckCompleted
|
|
|
if val.BeginTime.After(nowTime) {
|
|
|
val.BeginTime = nowTime
|
|
|
}
|
|
|
err = evaluationRepo.Save(val)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -207,8 +216,11 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
evalutionHrbp.Status = domain.EvaluationCompleted
|
|
|
evaluationSuper.Status = domain.EvaluationCompleted
|
|
|
evaluationSuper.HrCheckResult = domain.EvaluationCheckCompleted
|
|
|
if evaluationSuper.BeginTime.After(nowTime) {
|
|
|
evaluationSuper.BeginTime = nowTime
|
|
|
}
|
|
|
err = evaluationRepo.Save(evaluationSuper)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -228,8 +240,11 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
evalutionHrbp.Status = domain.EvaluationCompleted
|
|
|
evalutionFinish.Status = domain.EvaluationCompleted
|
|
|
evalutionFinish.HrCheckResult = domain.EvaluationCheckCompleted
|
|
|
if evalutionFinish.BeginTime.After(nowTime) {
|
|
|
evalutionFinish.BeginTime = nowTime
|
|
|
}
|
|
|
err = evaluationRepo.Save(evalutionFinish)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
|