From 9d75314e88f8aac494d57715e3231fe3540cb867 Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期二, 23 九月 2025 03:03:03 +0800 Subject: [PATCH] 优化更新 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/成品仓/AGV_CPExtend.cs | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/AGV_CPExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/AGV_CPExtend.cs" index d267cb4..2ad1a7e 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/AGV_CPExtend.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/AGV_CPExtend.cs" @@ -25,7 +25,7 @@ var stationMangers = _stationMangerRepository.QueryData(); #region 鍏ュ簱浠诲姟鎺ㄩ�� { - var newTasksIn = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && x.TaskType>=TaskTypeEnum.Inbound.ObjToInt() && nameof(AGV_CPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode) && x.TaskType!=999).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); + var newTasksIn = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && x.TaskType>=TaskTypeEnum.Inbound.ObjToInt() && nameof(AGV_CPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode) && x.TaskType!=999).ToList().OrderByDescending(x => x.Grade).ThenBy(x => x.CreateDate).ToList(); if (newTasksIn.Count>0) { foreach (var task in newTasksIn) @@ -99,7 +99,7 @@ #endregion #region 鍑哄簱鎺ㄩ�佷换鍔�1绾� { - var newTasksOut1 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress=="5236").OrderBy(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); + var newTasksOut1 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress=="5236").OrderByDescending(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); var downTasksOut1 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5236").ToList(); Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5236"); IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); @@ -174,6 +174,7 @@ { _taskService.UpdateData(newTasksOut1); } + WriteInfo("5236", $"1绾�5236鏃犱换鍔★紝鐘舵�亄stationCurrentStatus}鍙笅鍙戯紝涓嬪彂浠诲姟锛歿newTasksOut1.Select(x => x.TaskNum)}"); } } @@ -181,7 +182,7 @@ #endregion #region 鍑哄簱鎺ㄩ�佷换鍔�2绾� { - var newTasksOut2 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").OrderBy(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); + var newTasksOut2 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").OrderByDescending(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); var downTasksOut2 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").ToList(); Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5243"); IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); @@ -256,6 +257,7 @@ { _taskService.UpdateData(newTasksOut2); } + WriteInfo("5243", $"2绾�5243鏃犱换鍔★紝鐘舵�亄stationCurrentStatus}鍙笅鍙戯紝涓嬪彂浠诲姟锛歿newTasksOut2.Select(x => x.TaskNum)}"); } //else //{ @@ -267,7 +269,7 @@ #endregion #region 鍑哄簱鎺ㄩ�佷换鍔�3绾� { - var newTasksOut3 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").OrderBy(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); + var newTasksOut3 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").OrderByDescending(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList(); var downTasksOut3 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").ToList(); Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5250"); IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); @@ -342,6 +344,7 @@ { _taskService.UpdateData(newTasksOut3); } + WriteInfo("5250", $"3绾�5250鏃犱换鍔★紝鐘舵�亄stationCurrentStatus}鍙笅鍙戯紝涓嬪彂浠诲姟锛歿newTasksOut3.Select(x => x.TaskNum)}"); } //else //{ -- Gitblit v1.9.3