作者 tangxvhui

bug #3841

... ... @@ -1731,10 +1731,12 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi
for i := range itemList {
result.ResetTotalRating(itemList[i])
}
if err := result.EvaluationTotalScore(itemValues); err != nil {
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
//存在 超级管理员直接修改填写 总分的情况,此时不重新计算总分
if result.TotalScore == "0" || result.TotalScore == "" {
if err := result.EvaluationTotalScore(itemValues); err != nil {
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
}
result.CheckResult = domain.EvaluationCheckCompleted
if err := evaluationRepo.Save(result); err != nil {
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ... @@ -1817,9 +1819,6 @@ func (srv *SummaryEvaluationService) GetTargetEvaluationResult(param *command.Qu
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
// if err := transactionContext.StartTransaction(); err != nil {
// return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
// }
defer func() {
_ = transactionContext.RollbackTransaction()
}()
... ... @@ -1907,8 +1906,11 @@ func (srv *SummaryEvaluationService) GetTargetEvaluationResult(param *command.Qu
for i := range itemList {
result.ResetTotalRating(itemList[i])
}
if err = result.EvaluationTotalScore(itemValues); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
//存在 超级管理员直接修改填写 总分的情况,此时不重新计算总分
if result.TotalScore == "0" || result.TotalScore == "" {
if err = result.EvaluationTotalScore(itemValues); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
}
}
... ...
... ... @@ -50,6 +50,7 @@ const (
type EvaluationStatus string
const (
// EvaluationEditTotalScore EvaluationStatus = "completed_by_edit_score" //通过超级管理员直接修改分数完成的
EvaluationUncompleted EvaluationStatus = "uncompleted" //未提交填写的内容
EvaluationCompleted EvaluationStatus = "completed" //已提交填写的内容
)
... ...