dengjunjie
5 天以前 6d9829c889a826d39cbc911ef5d01825edd1bffc
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs
@@ -15,6 +15,7 @@
 *----------------------------------------------------------------*/
#endregion << ç‰ˆ æœ¬ æ³¨ é‡Š >>
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -219,7 +220,7 @@
                            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)
@@ -238,6 +239,25 @@
                            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}】");