作者 tangxvhui

修bug

1 package service 1 package service
2 2
3 import ( 3 import (
  4 + "time"
  5 +
4 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
5 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory" 7 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
6 roleService "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role" 8 roleService "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role"
@@ -218,6 +220,7 @@ func (srv *SummaryEvaluationService) EditEvaluationFinish(param *command.EditEva @@ -218,6 +220,7 @@ func (srv *SummaryEvaluationService) EditEvaluationFinish(param *command.EditEva
218 } 220 }
219 221
220 result.Status = domain.EvaluationCompleted 222 result.Status = domain.EvaluationCompleted
  223 + result.CompletedAt = time.Now().Unix()
221 result.CheckResult = domain.EvaluationCheckUncompleted 224 result.CheckResult = domain.EvaluationCheckUncompleted
222 err = evaluationRepo.Save(result) 225 err = evaluationRepo.Save(result)
223 if err != nil { 226 if err != nil {
@@ -222,6 +222,7 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp( @@ -222,6 +222,7 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluation360Hrbp(
222 evaluationFinishList[0].BeginTime = nowTime 222 evaluationFinishList[0].BeginTime = nowTime
223 } 223 }
224 evaluationFinishList[0].Status = domain.EvaluationCompleted 224 evaluationFinishList[0].Status = domain.EvaluationCompleted
  225 + evaluationFinishList[0].CompletedAt = time.Now().Unix()
225 err = evaluationRepo.Save(evaluationFinishList[0]) 226 err = evaluationRepo.Save(evaluationFinishList[0])
226 if err != nil { 227 if err != nil {
227 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error()) 228 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
@@ -190,6 +190,7 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf( @@ -190,6 +190,7 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(
190 evaluationFinish.BeginTime = nowTime 190 evaluationFinish.BeginTime = nowTime
191 } 191 }
192 evaluationFinish.Status = domain.EvaluationCompleted 192 evaluationFinish.Status = domain.EvaluationCompleted
  193 + evaluationFinish.CompletedAt = time.Now().Unix()
193 err = evaluationRepo.Save(evaluationFinish) 194 err = evaluationRepo.Save(evaluationFinish)
194 if err != nil { 195 if err != nil {
195 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error()) 196 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "保存考核结果,"+err.Error())
@@ -466,7 +466,7 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app @@ -466,7 +466,7 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app
466 CompletedAt: evaluationData.CompletedAt, 466 CompletedAt: evaluationData.CompletedAt,
467 Version: string(evaluationData.Version), 467 Version: string(evaluationData.Version),
468 } 468 }
469 - if evaluationData.CompletedAt == 0 { 469 + if evaluationData.Status == domain.EvaluationUncompleted {
470 result.Status = string(domain.EvaluationUncompleted) //未完成 470 result.Status = string(domain.EvaluationUncompleted) //未完成
471 } else { 471 } else {
472 if evaluationData.EndTime.Unix() < evaluationData.CompletedAt { 472 if evaluationData.EndTime.Unix() < evaluationData.CompletedAt {
@@ -251,7 +251,7 @@ func (srv *SummaryEvaluationService) GetEvaluation360(param *command.QueryEvalua @@ -251,7 +251,7 @@ func (srv *SummaryEvaluationService) GetEvaluation360(param *command.QueryEvalua
251 // 评估项截止时间 251 // 评估项截止时间
252 endTime := sEvaluation.EndTime.Local().Format("2006-01-02 15:04:05") 252 endTime := sEvaluation.EndTime.Local().Format("2006-01-02 15:04:05")
253 result := map[string]interface{}{"endTime": endTime, "version": sEvaluation.Version, "status": sEvaluation.Status, "list": itemValuesAdapter} 253 result := map[string]interface{}{"endTime": endTime, "version": sEvaluation.Version, "status": sEvaluation.Status, "list": itemValuesAdapter}
254 - if sEvaluation.CompletedAt == 0 { 254 + if sEvaluation.Status == domain.EvaluationUncompleted {
255 result["status"] = string(domain.EvaluationUncompleted) //未完成 255 result["status"] = string(domain.EvaluationUncompleted) //未完成
256 } else { 256 } else {
257 if sEvaluation.EndTime.Unix() < sEvaluation.CompletedAt { 257 if sEvaluation.EndTime.Unix() < sEvaluation.CompletedAt {
@@ -560,7 +560,7 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu @@ -560,7 +560,7 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu
560 // 评估项截止时间 560 // 评估项截止时间
561 endTime := sEvaluation.EndTime.Local().Format("2006-01-02 15:04:05") 561 endTime := sEvaluation.EndTime.Local().Format("2006-01-02 15:04:05")
562 result := map[string]interface{}{"endTime": endTime, "version": sEvaluation.Version, "status": "", "list": itemValuesAdapter} 562 result := map[string]interface{}{"endTime": endTime, "version": sEvaluation.Version, "status": "", "list": itemValuesAdapter}
563 - if sEvaluation.CompletedAt == 0 { 563 + if sEvaluation.Status == domain.EvaluationUncompleted {
564 result["status"] = string(domain.EvaluationUncompleted) //未完成 564 result["status"] = string(domain.EvaluationUncompleted) //未完成
565 } else { 565 } else {
566 if sEvaluation.EndTime.Unix() < sEvaluation.CompletedAt { 566 if sEvaluation.EndTime.Unix() < sEvaluation.CompletedAt {