作者 郑周

1. 考核结果优化

@@ -1689,6 +1689,14 @@ func (srv *SummaryEvaluationService) GetTargetEvaluationResult(param *command.Qu @@ -1689,6 +1689,14 @@ func (srv *SummaryEvaluationService) GetTargetEvaluationResult(param *command.Qu
1689 1689
1690 // 基础数据 1690 // 基础数据
1691 evaluationBase := srv.getSummaryEvaluation(transactionContext, result) 1691 evaluationBase := srv.getSummaryEvaluation(transactionContext, result)
  1692 +
  1693 + // 未完成考核,需要重新计算分数
  1694 + if result.CheckResult == domain.EvaluationCheckUncompleted {
  1695 + if err = result.EvaluationTotalScore(itemValues); err != nil {
  1696 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  1697 + }
  1698 + }
  1699 +
1692 if err := transactionContext.CommitTransaction(); err != nil { 1700 if err := transactionContext.CommitTransaction(); err != nil {
1693 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1701 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
1694 } 1702 }
@@ -1698,6 +1706,9 @@ func (srv *SummaryEvaluationService) GetTargetEvaluationResult(param *command.Qu @@ -1698,6 +1706,9 @@ func (srv *SummaryEvaluationService) GetTargetEvaluationResult(param *command.Qu
1698 codeList := make([]*adapter.LevalCodeCount, 0) 1706 codeList := make([]*adapter.LevalCodeCount, 0)
1699 codeMap := map[string]*adapter.LevalCodeCount{} 1707 codeMap := map[string]*adapter.LevalCodeCount{}
1700 for _, v := range itemValuesAdapter { 1708 for _, v := range itemValuesAdapter {
  1709 + if len(v.Value) == 0 {
  1710 + continue
  1711 + }
1701 if v.Weight == 0 { 1712 if v.Weight == 0 {
1702 if _, ok := codeMap[v.Value]; !ok { 1713 if _, ok := codeMap[v.Value]; !ok {
1703 code := &adapter.LevalCodeCount{ 1714 code := &adapter.LevalCodeCount{