|
@@ -94,11 +94,7 @@ func DepartmentStatistics(header *protocol.RequestHeader, request *protocol.Depa |
|
@@ -94,11 +94,7 @@ func DepartmentStatistics(header *protocol.RequestHeader, request *protocol.Depa |
94
|
Name: department.Name,
|
94
|
Name: department.Name,
|
95
|
}
|
95
|
}
|
96
|
rsp.List = append(rsp.List, item)
|
96
|
rsp.List = append(rsp.List, item)
|
97
|
- if request.Type == protocol.StatisticApproved {
|
|
|
98
|
rsp.Total += item.ChanceApprovedTotal + item.AchievementTotal
|
97
|
rsp.Total += item.ChanceApprovedTotal + item.AchievementTotal
|
99
|
- } else {
|
|
|
100
|
- rsp.Total += item.ChanceApprovingTotal
|
|
|
101
|
- }
|
|
|
102
|
}
|
98
|
}
|
103
|
}
|
99
|
}
|
104
|
switch request.Type {
|
100
|
switch request.Type {
|
|
@@ -109,16 +105,21 @@ func DepartmentStatistics(header *protocol.RequestHeader, request *protocol.Depa |
|
@@ -109,16 +105,21 @@ func DepartmentStatistics(header *protocol.RequestHeader, request *protocol.Depa |
109
|
rsp.AchievementTotal, _ = agg.AchievementDepartmentStatic(header, 0, dIds)
|
105
|
rsp.AchievementTotal, _ = agg.AchievementDepartmentStatic(header, 0, dIds)
|
110
|
rsp.ChanceApprovedTotal, _ = agg.GetChancePool(header.UserId, header.CompanyId, 0, d.DepartmentId, 0, 0, nil)
|
106
|
rsp.ChanceApprovedTotal, _ = agg.GetChancePool(header.UserId, header.CompanyId, 0, d.DepartmentId, 0, 0, nil)
|
111
|
rsp.ACTotal = rsp.AchievementTotal + rsp.ChanceApprovedTotal
|
107
|
rsp.ACTotal = rsp.AchievementTotal + rsp.ChanceApprovedTotal
|
112
|
- return rsp
|
|
|
113
|
- })
|
|
|
114
|
- break
|
|
|
115
|
- case protocol.StatisticApproving:
|
|
|
116
|
- iterateDepartments(func(d *protocol.Department) *protocol.DepartmentStatistics {
|
|
|
117
|
- rsp := &protocol.DepartmentStatistics{}
|
|
|
118
|
rsp.ChanceApprovingTotal, _ = agg.ChanceApprovingStatistic(header, departmentsResponse.GetChildDepartmentIds(d, true))
|
108
|
rsp.ChanceApprovingTotal, _ = agg.ChanceApprovingStatistic(header, departmentsResponse.GetChildDepartmentIds(d, true))
|
119
|
return rsp
|
109
|
return rsp
|
120
|
})
|
110
|
})
|
121
|
break
|
111
|
break
|
|
|
112
|
+ //case protocol.StatisticApproving:
|
|
|
113
|
+ // iterateDepartments(func(d *protocol.Department) *protocol.DepartmentStatistics {
|
|
|
114
|
+ // rsp := &protocol.DepartmentStatistics{}
|
|
|
115
|
+ // dIds := departmentsResponse.GetChildDepartmentIds(d, true)
|
|
|
116
|
+ // rsp.AchievementTotal, _ = agg.AchievementDepartmentStatic(header, 0, dIds)
|
|
|
117
|
+ // rsp.ChanceApprovedTotal, _ = agg.GetChancePool(header.UserId, header.CompanyId, 0, d.DepartmentId, 0, 0, nil)
|
|
|
118
|
+ // rsp.ACTotal = rsp.AchievementTotal + rsp.ChanceApprovedTotal
|
|
|
119
|
+ // rsp.ChanceApprovingTotal, _ = agg.ChanceApprovingStatistic(header, departmentsResponse.GetChildDepartmentIds(d, true))
|
|
|
120
|
+ // return rsp
|
|
|
121
|
+ // })
|
|
|
122
|
+ // break
|
122
|
default:
|
123
|
default:
|
123
|
err = protocol.NewErrWithMessage(2)
|
124
|
err = protocol.NewErrWithMessage(2)
|
124
|
return
|
125
|
return
|