...
|
...
|
@@ -43,9 +43,6 @@ func Departments(header *protocol.RequestHeader, request *protocol.DepartmentsRe |
|
|
}
|
|
|
rsp.Departments = tmpDepartment.Departments
|
|
|
rsp.Departments = rsp.GetRootDepartment()
|
|
|
//for i := range rsp.Departments {
|
|
|
// rsp.Departments[i].Departments = make([]*protocol.Department, 0)
|
|
|
//}
|
|
|
default:
|
|
|
break
|
|
|
}
|
...
|
...
|
@@ -101,7 +98,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
|
}
|
|
|
switch request.Type {
|
|
|
case protocol.StatisticApproved:
|
|
|
iterateDepartments(func(d *protocol.Department) *protocol.DepartmentStatistics {
|
|
|
callBack := func(d *protocol.Department) *protocol.DepartmentStatistics {
|
|
|
item := &protocol.DepartmentStatistics{}
|
|
|
dIds := departmentsResponse.GetChildDepartmentIds(d, true)
|
|
|
item.AchievementTotal, _ = agg.AchievementDepartmentStatic(header, 0, dIds)
|
...
|
...
|
@@ -109,7 +106,8 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
|
item.ACTotal = item.AchievementTotal + item.ChanceApprovedTotal
|
|
|
item.ChanceApprovingTotal, _ = agg.ChanceApprovingStatistic(header, departmentsResponse.GetChildDepartmentIds(d, true))
|
|
|
return item
|
|
|
})
|
|
|
}
|
|
|
iterateDepartments(callBack)
|
|
|
break
|
|
|
//case protocol.StatisticApproving:
|
|
|
// iterateDepartments(func(d *protocol.Department) *protocol.DepartmentStatistics {
|
...
|
...
|
|