作者 tangxvhui

微调评估内容输出

... ... @@ -1196,6 +1196,11 @@ func (srv StaffAssessServeice) StaffAssess360BeforeEdit(param *query.AssessInfoQ
}
//360评估全部是选填项
for i := range result.AssessContent {
if len(result.AssessContent[i].Value) == 0 {
result.AssessContent[i].LevelValue = ""
result.AssessContent[i].ScoreValue = 0
result.AssessContent[i].ReteResult = ""
}
result.AssessContent[i].Required = domain.NodeRequiredNo
}
return result, nil
... ... @@ -1209,6 +1214,11 @@ func (srv StaffAssessServeice) StaffAssessSuperBeforeEdit(param *query.AssessInf
}
//上级评估全部是选填项
for i := range result.AssessContent {
if len(result.AssessContent[i].Value) == 0 {
result.AssessContent[i].LevelValue = ""
result.AssessContent[i].ScoreValue = 0
result.AssessContent[i].ReteResult = ""
}
result.AssessContent[i].Required = domain.NodeRequiredNo
}
return result, nil
... ...
... ... @@ -50,6 +50,9 @@ func (content *StaffAssessContent) TransformValue() error {
// 规则是评级方式
func (content *StaffAssessContent) ratingValue() error {
content.LevelValue = ""
content.ScoreValue = 0
content.ReteResult = ""
levels := content.Rule.Rating.Levels
for _, v := range levels {
if v.Code != content.Value {
... ... @@ -81,6 +84,9 @@ func (content *StaffAssessContent) scoreValue() error {
// 未开启按分数子区间匹配等级
// return nil
//}
content.LevelValue = ""
content.ScoreValue = 0
content.ReteResult = ""
for _, v := range rule.Score.Levels {
if valueFloat < v.Start || valueFloat > v.End {
continue
... ...
... ... @@ -16,7 +16,7 @@ type SummaryEvaluationValue struct {
Score string //评定得分
Types int //评估类型
Executor domain.StaffDesc //填写评估的用户,执行人
Weight float64 //权重
Weight float64 `pg:",use_zero"` //权重
Rating domain.RatingLevel //评级填写值
Remark string //填写的内容反馈
CreatedAt time.Time //数据创建时间
... ...