|
|
package department
|
|
|
|
|
|
import (
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/gocomm/common"
|
|
|
"opp/protocol"
|
|
|
"sort"
|
|
|
"testing"
|
...
|
...
|
@@ -33,21 +34,21 @@ func TestGetRootDepartment(t *testing.T) { |
|
|
//排序
|
|
|
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},
|
|
|
{ChanceApprovedTotal: 8, AchievementTotal: 12, ACTotal: 20},
|
|
|
{ChanceApprovedTotal: 12, AchievementTotal: 8, ACTotal: 20},
|
|
|
{ChanceApprovedTotal: 20, AchievementTotal: 20, ACTotal: 40},
|
|
|
{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))
|
|
|
t.Log(common.AssertJson(s))
|
|
|
} |
...
|
...
|
|