作者 tangxvhui

修bug

package service
import (
"time"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
roleService "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role"
... ... @@ -218,6 +220,7 @@ func (srv *SummaryEvaluationService) EditEvaluationFinish(param *command.EditEva
}
result.Status = domain.EvaluationCompleted
result.CompletedAt = time.Now().Unix()
result.CheckResult = domain.EvaluationCheckUncompleted
err = evaluationRepo.Save(result)
if err != nil {
... ...
... ... @@ -222,6 +222,7 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp(
evaluationFinishList[0].BeginTime = nowTime
}
evaluationFinishList[0].Status = domain.EvaluationCompleted
evaluationFinishList[0].CompletedAt = time.Now().Unix()
err = evaluationRepo.Save(evaluationFinishList[0])
if err != nil {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
... ...
... ... @@ -190,6 +190,7 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(
evaluationFinish.BeginTime = nowTime
}
evaluationFinish.Status = domain.EvaluationCompleted
evaluationFinish.CompletedAt = time.Now().Unix()
err = evaluationRepo.Save(evaluationFinish)
if err != nil {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
... ...
... ... @@ -466,7 +466,7 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app
CompletedAt: evaluationData.CompletedAt,
Version: string(evaluationData.Version),
}
if evaluationData.CompletedAt == 0 {
if evaluationData.Status == domain.EvaluationUncompleted {
result.Status = string(domain.EvaluationUncompleted) //未完成
} else {
if evaluationData.EndTime.Unix() < evaluationData.CompletedAt {
... ...
... ... @@ -251,7 +251,7 @@ func (srv *SummaryEvaluationService) GetEvaluation360(param *command.QueryEvalua
// 评估项截止时间
endTime := sEvaluation.EndTime.Local().Format("2006-01-02 15:04:05")
result := map[string]interface{}{"endTime": endTime, "version": sEvaluation.Version, "status": sEvaluation.Status, "list": itemValuesAdapter}
if sEvaluation.CompletedAt == 0 {
if sEvaluation.Status == domain.EvaluationUncompleted {
result["status"] = string(domain.EvaluationUncompleted) //未完成
} else {
if sEvaluation.EndTime.Unix() < sEvaluation.CompletedAt {
... ... @@ -560,7 +560,7 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu
// 评估项截止时间
endTime := sEvaluation.EndTime.Local().Format("2006-01-02 15:04:05")
result := map[string]interface{}{"endTime": endTime, "version": sEvaluation.Version, "status": "", "list": itemValuesAdapter}
if sEvaluation.CompletedAt == 0 {
if sEvaluation.Status == domain.EvaluationUncompleted {
result["status"] = string(domain.EvaluationUncompleted) //未完成
} else {
if sEvaluation.EndTime.Unix() < sEvaluation.CompletedAt {
... ...