作者 tangxvhui

微调

... ... @@ -37,6 +37,7 @@ type EvaluationItemAdapter struct {
Required int `json:"required"` // 必填项
Value string `json:"value"` //评估填写的评分
Score string `json:"score"` //计算的评定得分
Rating domain.RatingLevel `json:"rating"` //评级的选项
Remark string `json:"remark"` //填写的内容反馈
EvaluatorId int `json:"evaluatorId"` //评估人id
EvaluatorName string `json:"evaluatorName"` //评估人名称
... ...
... ... @@ -2,7 +2,6 @@ package service
import (
"fmt"
"time"
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/tool_funs"
... ... @@ -278,6 +277,7 @@ func (srv *SummaryEvaluationService) buildSummaryItemValue(itemList []*domain.Ev
item.Score = value.Score
item.Value = value.Value
item.Remark = value.Remark
item.Rating = value.Rating
}
itemValues = append(itemValues, item)
}
... ... @@ -474,7 +474,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu
mValue.Id = v.Id
}
}
nowTime := time.Now()
for _, v := range param.EvaluationItems {
updatedData, ok := evaluationValueMap[v.EvaluationItemId]
if !ok {
... ... @@ -484,7 +483,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu
if !ok {
continue
}
updatedData.UpdatedAt = nowTime
//填充评估填写值
err = updatedData.FillValue(evaluationItem, v.Value, v.Remark)
if err != nil {
... ... @@ -506,7 +504,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
evaluationData.UpdatedAt = nowTime
evaluationData.Status = domain.EvaluationCompleted
//保存填写值
err = evaluationRepo.Save(evaluationData)
... ... @@ -862,7 +859,7 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval
mValue.Id = v.Id
}
}
nowTime := time.Now()
for _, v := range param.EvaluationItems {
updatedData, ok := evaluationValueMap[v.EvaluationItemId]
if !ok {
... ... @@ -884,7 +881,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
}
updatedData.UpdatedAt = nowTime
}
evaluationValueList := []*domain.SummaryEvaluationValue{}
for _, v := range evaluationValueMap {
... ... @@ -900,7 +896,7 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
evaluationData.UpdatedAt = nowTime
//变更评估状态为已填写
evaluationData.Status = domain.EvaluationCompleted
//保存填写值
err = evaluationRepo.Save(evaluationData)
... ...