|
@@ -31,44 +31,6 @@ type SummaryEvaluationValueRepository interface { |
|
@@ -31,44 +31,6 @@ type SummaryEvaluationValueRepository interface { |
|
31
|
Find(queryOptions map[string]interface{}) (int, []*SummaryEvaluationValue, error)
|
31
|
Find(queryOptions map[string]interface{}) (int, []*SummaryEvaluationValue, error)
|
|
32
|
}
|
32
|
}
|
|
33
|
|
33
|
|
|
34
|
-// 计算周期评估
|
|
|
|
35
|
-// 当指标项没有权重的时候,还是进行评级操作,不计算分数
|
|
|
|
36
|
-// 分数保留2位小数
|
|
|
|
37
|
-// func (itemValue *SummaryEvaluationValue) SummaryEvaluationScore() error {
|
|
|
|
38
|
-// //计算方式
|
|
|
|
39
|
-// score, err := itemValue.SumScore()
|
|
|
|
40
|
-// if err != nil {
|
|
|
|
41
|
-// return err
|
|
|
|
42
|
-// }
|
|
|
|
43
|
-// itemValue.Score = fmt.Sprintf("%.2f", score)
|
|
|
|
44
|
-// return nil
|
|
|
|
45
|
-// }
|
|
|
|
46
|
-
|
|
|
|
47
|
-// func (itemValue *SummaryEvaluationValue) SumScore() (float64, error) {
|
|
|
|
48
|
-// if len(itemValue.Value) == 0 {
|
|
|
|
49
|
-// return 0, nil
|
|
|
|
50
|
-// }
|
|
|
|
51
|
-// if itemValue.Weight == 0 {
|
|
|
|
52
|
-// //使用评级
|
|
|
|
53
|
-// return 0, nil
|
|
|
|
54
|
-// }
|
|
|
|
55
|
-// if itemValue.Types == EvaluationHrbp {
|
|
|
|
56
|
-// //hrbp 填写值就是得分
|
|
|
|
57
|
-// valueFloat, err := strconv.ParseFloat(itemValue.Value, 64)
|
|
|
|
58
|
-// if err != nil {
|
|
|
|
59
|
-// return 0, fmt.Errorf("条目%d系数值异常,%s", itemValue.Id, itemValue.Value)
|
|
|
|
60
|
-// }
|
|
|
|
61
|
-// return valueFloat, nil
|
|
|
|
62
|
-// }
|
|
|
|
63
|
-// valueFloat, err := strconv.ParseFloat(itemValue.Value, 64)
|
|
|
|
64
|
-// if err != nil {
|
|
|
|
65
|
-// return 0, fmt.Errorf("条目%d系数值异常,%s", itemValue.Id, itemValue.Value)
|
|
|
|
66
|
-// }
|
|
|
|
67
|
-// //得分计算方式
|
|
|
|
68
|
-// score := itemValue.Weight * valueFloat
|
|
|
|
69
|
-// return score, nil
|
|
|
|
70
|
-// }
|
|
|
|
71
|
-
|
|
|
|
72
|
// 初始化一个空的value
|
34
|
// 初始化一个空的value
|
|
73
|
func (itemValue *SummaryEvaluationValue) SetBlankValue(evaluation *SummaryEvaluation, item *EvaluationItemUsed) {
|
35
|
func (itemValue *SummaryEvaluationValue) SetBlankValue(evaluation *SummaryEvaluation, item *EvaluationItemUsed) {
|
|
74
|
itemValue.Types = evaluation.Types
|
36
|
itemValue.Types = evaluation.Types
|