| | |
| | | *----------------------------------------------------------------*/ |
| | | #endregion << ç æ¬ 注 é >> |
| | | |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | |
| | | list.Add(obj); |
| | | } |
| | | } |
| | | else if (!int.TryParse(Enum.Parse<TaskOtherTypeEnum>(task.TaskType.ToString()).ToString(), out result)) |
| | | else if (task.TaskType == TaskOtherTypeEnum.RelocationCar.ObjToInt()) |
| | | { |
| | | steps = Enum.GetValues(typeof(TaskCarStatusEnum)).Cast<int>().Where(x => x <= (int)TaskCarStatusEnum.RelocationCarFinish).ToList(); |
| | | foreach (var item in steps) |
| | |
| | | list.Add(obj); |
| | | } |
| | | } |
| | | else if (task.TaskType == TaskOtherTypeEnum.RelocationCarCharging.ObjToInt()) |
| | | { |
| | | steps = Enum.GetValues(typeof(CarChargingTaskEnum)).Cast<int>().Where(x => x <= (int)CarChargingTaskEnum.CarChargingFinish).ToList(); |
| | | foreach (var item in steps) |
| | | { |
| | | object obj; |
| | | FieldInfo? fieldInfo = typeof(CarChargingTaskEnum).GetField(((CarChargingTaskEnum)item).ToString()); |
| | | DescriptionAttribute? descriptionAttribute = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (descriptionAttribute != null) |
| | | { |
| | | obj = new { title = item, description = descriptionAttribute.Description }; |
| | | } |
| | | else |
| | | { |
| | | obj = new { title = item, description = ((CarChargingTaskEnum)item).ToString() }; |
| | | } |
| | | list.Add(obj); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | throw new Exception($"ä»»å¡ç±»åé误,æªæ¾å°è¯¥ä»»å¡ç±»å,ä»»å¡å·:ã{taskNum}ã,ä»»å¡ç±»å:ã{task.TaskType}ã"); |