...
|
...
|
@@ -11,6 +11,7 @@ type PerformanceApplicationForm struct { |
|
|
Weight string //权重
|
|
|
Standard string //标准
|
|
|
Task string //任务、指标
|
|
|
Definition string //定义
|
|
|
}
|
|
|
|
|
|
type PerformanceDimension struct {
|
...
|
...
|
@@ -26,7 +27,8 @@ type PerformanceModule struct { |
|
|
}
|
|
|
|
|
|
type PerformanceTarget struct {
|
|
|
Task string `json:"task"`
|
|
|
Task string `json:"task"`
|
|
|
Definition string `json:"definition"`
|
|
|
}
|
|
|
|
|
|
func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) {
|
...
|
...
|
@@ -55,8 +57,14 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) |
|
|
//指标任务
|
|
|
if len(item) > 4 && item[4] != "" {
|
|
|
taskName = item[4]
|
|
|
} else {
|
|
|
taskName = "填写自评反馈"
|
|
|
}
|
|
|
form.Task = taskName
|
|
|
//定义
|
|
|
if len(item) > 5 {
|
|
|
form.Definition = strings.TrimSpace(item[5])
|
|
|
}
|
|
|
//权重
|
|
|
if len(item) > 6 && item[6] != "" {
|
|
|
weightName = item[6]
|
...
|
...
|
@@ -66,6 +74,11 @@ func LoadPerformanceDimensions(rows [][]string) ([]*PerformanceDimension, error) |
|
|
if len(item) > 7 && item[7] != "" {
|
|
|
standardName = item[7]
|
|
|
}
|
|
|
if key < len(rows)-1 {
|
|
|
if len(rows[key+1]) > 1 && rows[key+1][1] != "" {
|
|
|
standardName = ""
|
|
|
}
|
|
|
}
|
|
|
form.Standard = standardName
|
|
|
formRows = append(formRows, form)
|
|
|
}
|
...
|
...
|
@@ -192,7 +205,7 @@ func getStandard(items []*PerformanceApplicationForm) (string, error) { |
|
|
func getTasks(items []*PerformanceApplicationForm) ([]*PerformanceTarget, error) {
|
|
|
tasks := make([]*PerformanceTarget, 0)
|
|
|
for _, item := range items {
|
|
|
target := &PerformanceTarget{Task: item.Task}
|
|
|
target := &PerformanceTarget{Task: item.Task, Definition: item.Definition}
|
|
|
tasks = append(tasks, target)
|
|
|
}
|
|
|
return tasks, nil
|
...
|
...
|
|