作者 yangfu

修改

... ... @@ -3,7 +3,7 @@ package contrab
import "github.com/astaxie/beego/toolbox"
var (
taskComputeRankScore = "0 10 0 * * *" //每0:5分 计算排行榜分数
taskComputeRankScore = "0 */10 * * * *" //每0:5分 计算排行榜分数
)
func Run() {
... ...
... ... @@ -43,9 +43,6 @@ func Departments(header *protocol.RequestHeader, request *protocol.DepartmentsRe
}
rsp.Departments = tmpDepartment.Departments
rsp.Departments = rsp.GetRootDepartment()
//for i := range rsp.Departments {
// rsp.Departments[i].Departments = make([]*protocol.Department, 0)
//}
default:
break
}
... ... @@ -101,7 +98,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat
}
switch request.Type {
case protocol.StatisticApproved:
iterateDepartments(func(d *protocol.Department) *protocol.DepartmentStatistics {
callBack := func(d *protocol.Department) *protocol.DepartmentStatistics {
item := &protocol.DepartmentStatistics{}
dIds := departmentsResponse.GetChildDepartmentIds(d, true)
item.AchievementTotal, _ = agg.AchievementDepartmentStatic(header, 0, dIds)
... ... @@ -109,7 +106,8 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DepartmentStat
item.ACTotal = item.AchievementTotal + item.ChanceApprovedTotal
item.ChanceApprovingTotal, _ = agg.ChanceApprovingStatistic(header, departmentsResponse.GetChildDepartmentIds(d, true))
return item
})
}
iterateDepartments(callBack)
break
//case protocol.StatisticApproving:
// iterateDepartments(func(d *protocol.Department) *protocol.DepartmentStatistics {
... ...