...
|
...
|
@@ -2,6 +2,7 @@ package department |
|
|
|
|
|
import (
|
|
|
"opp/protocol"
|
|
|
"sort"
|
|
|
"testing"
|
|
|
)
|
|
|
|
...
|
...
|
@@ -28,3 +29,25 @@ func TestGetRootDepartment(t *testing.T) { |
|
|
t.Log("部门:", d.DepartmentId, deps.GetChildDepartmentIds(d, true))
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//排序
|
|
|
func TestSortDepartmentStastics(t *testing.T) {
|
|
|
s := &protocol.DepartmentStatisticsResponse{
|
|
|
//List:[]*protocol.DepartmentStatistics{
|
|
|
// {ChanceApprovedTotal:10,AchievementTotal:10,ACTotal:20},
|
|
|
// {ChanceApprovedTotal:10,AchievementTotal:10,ACTotal:20},
|
|
|
// {ChanceApprovedTotal:20,AchievementTotal:10,ACTotal:30},
|
|
|
// {ChanceApprovedTotal:5,AchievementTotal:10,ACTotal:15},
|
|
|
//},
|
|
|
List: []*protocol.DepartmentStatistics{
|
|
|
{ChanceApprovingTotal: 10},
|
|
|
{ChanceApprovingTotal: 10},
|
|
|
{ChanceApprovingTotal: 30},
|
|
|
{ChanceApprovingTotal: 40},
|
|
|
{ChanceApprovingTotal: 60},
|
|
|
{ChanceApprovingTotal: 50},
|
|
|
},
|
|
|
}
|
|
|
sort.Sort(s)
|
|
|
//t.Log(common.AssertJson(s))
|
|
|
} |
...
|
...
|
|