...
|
...
|
@@ -42,7 +42,7 @@ func Departments(header *protocol.RequestHeader, request *protocol.DepartmentsRe |
|
|
walkDepartment(tmpDepartment, item)
|
|
|
}
|
|
|
rsp.Departments = tmpDepartment.Departments
|
|
|
rsp.Departments = rsp.GetRootDepartment()
|
|
|
//rsp.Departments = rsp.GetRootDepartment()
|
|
|
default:
|
|
|
break
|
|
|
}
|
...
|
...
|
@@ -82,7 +82,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
departments := departmentsResponse.GetRootDepartment()
|
|
|
departments := departmentsResponse.GetRootDepartments()
|
|
|
iterateDepartments := func(call func(d *protocol.Department) *protocol.DepartmentStatistics) {
|
|
|
for i := range departments {
|
|
|
department := departments[i]
|
...
|
...
|
@@ -126,6 +126,17 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
|
}
|
|
|
sort.Stable(rsp)
|
|
|
sort.Stable(sort.Reverse(rsp))
|
|
|
|
|
|
companyDep := departmentsResponse.GetCompanyDepartment()
|
|
|
if companyDep.DepartmentId > 0 {
|
|
|
var companyDepStatistic *protocol.DepartmentStatisticResponse
|
|
|
if companyDepStatistic, err = DepartmentStatistic(header, &protocol.DepartmentStatisticRequest{DepartmentId: companyDep.DepartmentId}); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
rsp.List = append(rsp.List, &companyDepStatistic.DepartmentStatistic)
|
|
|
rsp.Total += companyDepStatistic.DepartmentStatistic.ChanceApprovedTotal + companyDepStatistic.DepartmentStatistic.AchievementTotal
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
...
|
...
|
|