歷史紀錄修改選單排序

This commit is contained in:
史萬澤 2023-02-18 18:31:48 +08:00
parent aecb795124
commit 9a27834be0

View File

@ -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<Device>() : 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)
{