1
hutongqing
2024-12-28 eee43c4cb7f9018688cd6da6a3611512f3e5c5c3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
 
namespace WIDESEAWCS_Common.TaskEnum
{
    public static class TaskEnumHelper
    {
        public static List<int> GetEnumIndexList(this Type type)
        {
            if (type is null) throw new ArgumentNullException("type");
            if (!type.IsEnum) return new List<int>();
            return Enum.GetValues(type).Cast<int>().ToList();
        }
 
        public static TaskTypeGroup GetTaskTypeGroup(this int taskType)
        {
            if (taskType >= 500 && taskType < 900)
            {
                return TaskTypeGroup.InboundGroup;
            }
            else if (taskType >= 100 && taskType < 500)
            {
                return TaskTypeGroup.OutbondGroup;
            }
            else if (taskType >= 900 && taskType < 1000)
            {
                return TaskTypeGroup.RelocationGroup;
            }
            else
            {
                return TaskTypeGroup.OtherGroup;
            }
        }
    }
}