From 6d9829c889a826d39cbc911ef5d01825edd1bffc Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 26 六月 2025 16:33:29 +0800 Subject: [PATCH] 添加设备交互日志 --- 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs" index 7d517be..cc779d0 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskExecuteDetailService.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/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}銆�"); -- Gitblit v1.9.3