...
|
...
|
@@ -82,7 +82,9 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
//公司部门统计
|
|
|
//列表 = 公司一级部门 + 子部门
|
|
|
|
|
|
//公司一级部门
|
|
|
companyDep := departmentsResponse.GetCompanyDepartment()
|
|
|
if companyDep.DepartmentId > 0 {
|
|
|
var companyDepStatistic *protocol.DepartmentStatisticResponse
|
...
|
...
|
@@ -91,9 +93,10 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
|
return
|
|
|
}
|
|
|
rsp.List = append(rsp.List, &companyDepStatistic.DepartmentStatistic)
|
|
|
rsp.Total += companyDepStatistic.DepartmentStatistic.ChanceApprovedTotal + companyDepStatistic.DepartmentStatistic.AchievementTotal
|
|
|
rsp.Total += companyDepStatistic.DepartmentStatistic.ChanceApprovedTotal + companyDepStatistic.DepartmentStatistic.AchievementTotal + companyDepStatistic.DepartmentStatistic.ChanceReservedTotal
|
|
|
}
|
|
|
|
|
|
//子部门
|
|
|
departments := departmentsResponse.GetRootDepartments()
|
|
|
iterateDepartments := func(call func(d *protocol.Department) *protocol.DepartmentStatistics) {
|
|
|
for i := range departments {
|
...
|
...
|
@@ -105,7 +108,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
|
Time: department.CreateTime.Unix(),
|
|
|
}
|
|
|
rsp.List = append(rsp.List, item)
|
|
|
rsp.Total += item.ChanceApprovedTotal + item.AchievementTotal
|
|
|
rsp.Total += item.ChanceApprovedTotal + item.AchievementTotal + item.ChanceReservedTotal
|
|
|
}
|
|
|
}
|
|
|
switch request.Type {
|
...
|
...
|
|