作者 tangxvhui

微调

@@ -37,6 +37,7 @@ type EvaluationItemAdapter struct { @@ -37,6 +37,7 @@ type EvaluationItemAdapter struct {
37 Required int `json:"required"` // 必填项 37 Required int `json:"required"` // 必填项
38 Value string `json:"value"` //评估填写的评分 38 Value string `json:"value"` //评估填写的评分
39 Score string `json:"score"` //计算的评定得分 39 Score string `json:"score"` //计算的评定得分
  40 + Rating domain.RatingLevel `json:"rating"` //评级的选项
40 Remark string `json:"remark"` //填写的内容反馈 41 Remark string `json:"remark"` //填写的内容反馈
41 EvaluatorId int `json:"evaluatorId"` //评估人id 42 EvaluatorId int `json:"evaluatorId"` //评估人id
42 EvaluatorName string `json:"evaluatorName"` //评估人名称 43 EvaluatorName string `json:"evaluatorName"` //评估人名称
@@ -2,7 +2,6 @@ package service @@ -2,7 +2,6 @@ package service
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 - "time"  
6 5
7 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
8 "github.com/linmadan/egglib-go/utils/tool_funs" 7 "github.com/linmadan/egglib-go/utils/tool_funs"
@@ -278,6 +277,7 @@ func (srv *SummaryEvaluationService) buildSummaryItemValue(itemList []*domain.Ev @@ -278,6 +277,7 @@ func (srv *SummaryEvaluationService) buildSummaryItemValue(itemList []*domain.Ev
278 item.Score = value.Score 277 item.Score = value.Score
279 item.Value = value.Value 278 item.Value = value.Value
280 item.Remark = value.Remark 279 item.Remark = value.Remark
  280 + item.Rating = value.Rating
281 } 281 }
282 itemValues = append(itemValues, item) 282 itemValues = append(itemValues, item)
283 } 283 }
@@ -474,7 +474,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu @@ -474,7 +474,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu
474 mValue.Id = v.Id 474 mValue.Id = v.Id
475 } 475 }
476 } 476 }
477 - nowTime := time.Now()  
478 for _, v := range param.EvaluationItems { 477 for _, v := range param.EvaluationItems {
479 updatedData, ok := evaluationValueMap[v.EvaluationItemId] 478 updatedData, ok := evaluationValueMap[v.EvaluationItemId]
480 if !ok { 479 if !ok {
@@ -484,7 +483,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu @@ -484,7 +483,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu
484 if !ok { 483 if !ok {
485 continue 484 continue
486 } 485 }
487 - updatedData.UpdatedAt = nowTime  
488 //填充评估填写值 486 //填充评估填写值
489 err = updatedData.FillValue(evaluationItem, v.Value, v.Remark) 487 err = updatedData.FillValue(evaluationItem, v.Value, v.Remark)
490 if err != nil { 488 if err != nil {
@@ -506,7 +504,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu @@ -506,7 +504,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu
506 if err != nil { 504 if err != nil {
507 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 505 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
508 } 506 }
509 - evaluationData.UpdatedAt = nowTime  
510 evaluationData.Status = domain.EvaluationCompleted 507 evaluationData.Status = domain.EvaluationCompleted
511 //保存填写值 508 //保存填写值
512 err = evaluationRepo.Save(evaluationData) 509 err = evaluationRepo.Save(evaluationData)
@@ -862,7 +859,7 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval @@ -862,7 +859,7 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval
862 mValue.Id = v.Id 859 mValue.Id = v.Id
863 } 860 }
864 } 861 }
865 - nowTime := time.Now() 862 +
866 for _, v := range param.EvaluationItems { 863 for _, v := range param.EvaluationItems {
867 updatedData, ok := evaluationValueMap[v.EvaluationItemId] 864 updatedData, ok := evaluationValueMap[v.EvaluationItemId]
868 if !ok { 865 if !ok {
@@ -884,7 +881,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval @@ -884,7 +881,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval
884 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 881 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
885 } 882 }
886 } 883 }
887 - updatedData.UpdatedAt = nowTime  
888 } 884 }
889 evaluationValueList := []*domain.SummaryEvaluationValue{} 885 evaluationValueList := []*domain.SummaryEvaluationValue{}
890 for _, v := range evaluationValueMap { 886 for _, v := range evaluationValueMap {
@@ -900,7 +896,7 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval @@ -900,7 +896,7 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval
900 if err != nil { 896 if err != nil {
901 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 897 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
902 } 898 }
903 - evaluationData.UpdatedAt = nowTime 899 + //变更评估状态为已填写
904 evaluationData.Status = domain.EvaluationCompleted 900 evaluationData.Status = domain.EvaluationCompleted
905 //保存填写值 901 //保存填写值
906 err = evaluationRepo.Save(evaluationData) 902 err = evaluationRepo.Save(evaluationData)