|
@@ -82,7 +82,9 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
@@ -82,7 +82,9 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
82
|
log.Error(err)
|
82
|
log.Error(err)
|
83
|
return
|
83
|
return
|
84
|
}
|
84
|
}
|
85
|
- //公司部门统计
|
85
|
+ //列表 = 公司一级部门 + 子部门
|
|
|
86
|
+
|
|
|
87
|
+ //公司一级部门
|
86
|
companyDep := departmentsResponse.GetCompanyDepartment()
|
88
|
companyDep := departmentsResponse.GetCompanyDepartment()
|
87
|
if companyDep.DepartmentId > 0 {
|
89
|
if companyDep.DepartmentId > 0 {
|
88
|
var companyDepStatistic *protocol.DepartmentStatisticResponse
|
90
|
var companyDepStatistic *protocol.DepartmentStatisticResponse
|
|
@@ -91,9 +93,10 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
@@ -91,9 +93,10 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
91
|
return
|
93
|
return
|
92
|
}
|
94
|
}
|
93
|
rsp.List = append(rsp.List, &companyDepStatistic.DepartmentStatistic)
|
95
|
rsp.List = append(rsp.List, &companyDepStatistic.DepartmentStatistic)
|
94
|
- rsp.Total += companyDepStatistic.DepartmentStatistic.ChanceApprovedTotal + companyDepStatistic.DepartmentStatistic.AchievementTotal
|
96
|
+ rsp.Total += companyDepStatistic.DepartmentStatistic.ChanceApprovedTotal + companyDepStatistic.DepartmentStatistic.AchievementTotal + companyDepStatistic.DepartmentStatistic.ChanceReservedTotal
|
95
|
}
|
97
|
}
|
96
|
|
98
|
|
|
|
99
|
+ //子部门
|
97
|
departments := departmentsResponse.GetRootDepartments()
|
100
|
departments := departmentsResponse.GetRootDepartments()
|
98
|
iterateDepartments := func(call func(d *protocol.Department) *protocol.DepartmentStatistics) {
|
101
|
iterateDepartments := func(call func(d *protocol.Department) *protocol.DepartmentStatistics) {
|
99
|
for i := range departments {
|
102
|
for i := range departments {
|
|
@@ -105,7 +108,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
|
@@ -105,7 +108,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat |
105
|
Time: department.CreateTime.Unix(),
|
108
|
Time: department.CreateTime.Unix(),
|
106
|
}
|
109
|
}
|
107
|
rsp.List = append(rsp.List, item)
|
110
|
rsp.List = append(rsp.List, item)
|
108
|
- rsp.Total += item.ChanceApprovedTotal + item.AchievementTotal
|
111
|
+ rsp.Total += item.ChanceApprovedTotal + item.AchievementTotal + item.ChanceReservedTotal
|
109
|
}
|
112
|
}
|
110
|
}
|
113
|
}
|
111
|
switch request.Type {
|
114
|
switch request.Type {
|