|
@@ -42,7 +42,7 @@ func Departments(header *protocol.RequestHeader, request *protocol.DepartmentsRe |
|
@@ -42,7 +42,7 @@ func Departments(header *protocol.RequestHeader, request *protocol.DepartmentsRe |
42
|
walkDepartment(tmpDepartment, item)
|
42
|
walkDepartment(tmpDepartment, item)
|
43
|
}
|
43
|
}
|
44
|
rsp.Departments = tmpDepartment.Departments
|
44
|
rsp.Departments = tmpDepartment.Departments
|
45
|
- rsp.Departments = rsp.GetRootDepartment()
|
45
|
+ //rsp.Departments = rsp.GetRootDepartment()
|
46
|
default:
|
46
|
default:
|
47
|
break
|
47
|
break
|
48
|
}
|
48
|
}
|
|
@@ -82,7 +82,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
@@ -82,7 +82,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
82
|
log.Error(err)
|
82
|
log.Error(err)
|
83
|
return
|
83
|
return
|
84
|
}
|
84
|
}
|
85
|
- departments := departmentsResponse.GetRootDepartment()
|
85
|
+ departments := departmentsResponse.GetRootDepartments()
|
86
|
iterateDepartments := func(call func(d *protocol.Department) *protocol.DepartmentStatistics) {
|
86
|
iterateDepartments := func(call func(d *protocol.Department) *protocol.DepartmentStatistics) {
|
87
|
for i := range departments {
|
87
|
for i := range departments {
|
88
|
department := departments[i]
|
88
|
department := departments[i]
|
|
@@ -126,6 +126,17 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
@@ -126,6 +126,17 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
126
|
}
|
126
|
}
|
127
|
sort.Stable(rsp)
|
127
|
sort.Stable(rsp)
|
128
|
sort.Stable(sort.Reverse(rsp))
|
128
|
sort.Stable(sort.Reverse(rsp))
|
|
|
129
|
+
|
|
|
130
|
+ companyDep := departmentsResponse.GetCompanyDepartment()
|
|
|
131
|
+ if companyDep.DepartmentId > 0 {
|
|
|
132
|
+ var companyDepStatistic *protocol.DepartmentStatisticResponse
|
|
|
133
|
+ if companyDepStatistic, err = DepartmentStatistic(header, &protocol.DepartmentStatisticRequest{DepartmentId: companyDep.DepartmentId}); err != nil {
|
|
|
134
|
+ log.Error(err)
|
|
|
135
|
+ return
|
|
|
136
|
+ }
|
|
|
137
|
+ rsp.List = append(rsp.List, &companyDepStatistic.DepartmentStatistic)
|
|
|
138
|
+ rsp.Total += companyDepStatistic.DepartmentStatistic.ChanceApprovedTotal + companyDepStatistic.DepartmentStatistic.AchievementTotal
|
|
|
139
|
+ }
|
129
|
return
|
140
|
return
|
130
|
}
|
141
|
}
|
131
|
|
142
|
|