diff --git a/FrontendWebApi/ApiControllers/HistoryController.cs b/FrontendWebApi/ApiControllers/HistoryController.cs index db21123..7ed5160 100644 --- a/FrontendWebApi/ApiControllers/HistoryController.cs +++ b/FrontendWebApi/ApiControllers/HistoryController.cs @@ -235,7 +235,7 @@ namespace FrontendWebApi.ApiControllers history_Sub_System.sub_system_tag = sub.Select(x => x.sub_system_tag).FirstOrDefault(); history_Sub_System.is_show_history = sub.Select(x => x.device_item_is_show_hsitory).FirstOrDefault(); - var devices = dbsub.Where(x => x.main_system_tag == main.Select(m => m.main_system_tag).FirstOrDefault() && x.sub_system_tag == sub.Select(x => x.sub_system_tag).FirstOrDefault() && x.device_number != null).ToList(); + var devices = dbsub.Where(x => x.main_system_tag == main.Select(m => m.main_system_tag).FirstOrDefault() && x.sub_system_tag == sub.Select(x => x.sub_system_tag).FirstOrDefault() && x.device_number != null).OrderBy(x=>x.device_full_name.Length).ThenBy(x=>x.device_full_name).ToList(); history_Sub_System.device = devices.Count > 0 ? new List() : null; foreach (var d in devices) { @@ -252,10 +252,13 @@ namespace FrontendWebApi.ApiControllers } } - apiResult.Data.history_Main_Systems.Add(history_Main_System); + apiResult.Data.history_Main_Systems.Add(history_Main_System); } apiResult.Data.history_Builds = dbbuilding; apiResult.Code = "0000"; + + + } catch (Exception exception) {