...
|
...
|
@@ -94,11 +94,7 @@ func DepartmentStatistics(header *protocol.RequestHeader, request *protocol.Depa |
|
|
Name: department.Name,
|
|
|
}
|
|
|
rsp.List = append(rsp.List, item)
|
|
|
if request.Type == protocol.StatisticApproved {
|
|
|
rsp.Total += item.ChanceApprovedTotal + item.AchievementTotal
|
|
|
} else {
|
|
|
rsp.Total += item.ChanceApprovingTotal
|
|
|
}
|
|
|
rsp.Total += item.ChanceApprovedTotal + item.AchievementTotal
|
|
|
}
|
|
|
}
|
|
|
switch request.Type {
|
...
|
...
|
@@ -109,16 +105,21 @@ func DepartmentStatistics(header *protocol.RequestHeader, request *protocol.Depa |
|
|
rsp.AchievementTotal, _ = agg.AchievementDepartmentStatic(header, 0, dIds)
|
|
|
rsp.ChanceApprovedTotal, _ = agg.GetChancePool(header.UserId, header.CompanyId, 0, d.DepartmentId, 0, 0, nil)
|
|
|
rsp.ACTotal = rsp.AchievementTotal + rsp.ChanceApprovedTotal
|
|
|
return rsp
|
|
|
})
|
|
|
break
|
|
|
case protocol.StatisticApproving:
|
|
|
iterateDepartments(func(d *protocol.Department) *protocol.DepartmentStatistics {
|
|
|
rsp := &protocol.DepartmentStatistics{}
|
|
|
rsp.ChanceApprovingTotal, _ = agg.ChanceApprovingStatistic(header, departmentsResponse.GetChildDepartmentIds(d, true))
|
|
|
return rsp
|
|
|
})
|
|
|
break
|
|
|
//case protocol.StatisticApproving:
|
|
|
// iterateDepartments(func(d *protocol.Department) *protocol.DepartmentStatistics {
|
|
|
// rsp := &protocol.DepartmentStatistics{}
|
|
|
// dIds := departmentsResponse.GetChildDepartmentIds(d, true)
|
|
|
// rsp.AchievementTotal, _ = agg.AchievementDepartmentStatic(header, 0, dIds)
|
|
|
// rsp.ChanceApprovedTotal, _ = agg.GetChancePool(header.UserId, header.CompanyId, 0, d.DepartmentId, 0, 0, nil)
|
|
|
// rsp.ACTotal = rsp.AchievementTotal + rsp.ChanceApprovedTotal
|
|
|
// rsp.ChanceApprovingTotal, _ = agg.ChanceApprovingStatistic(header, departmentsResponse.GetChildDepartmentIds(d, true))
|
|
|
// return rsp
|
|
|
// })
|
|
|
// break
|
|
|
default:
|
|
|
err = protocol.NewErrWithMessage(2)
|
|
|
return
|
...
|
...
|
|