dengjunjie
2025-01-07 ceb8c334e8ca10d569b4c7f72b74126ce1877e48
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGV_CSJExtend.cs
文件名从 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/AGV/AGVExtend.cs 修改
@@ -14,7 +14,7 @@
namespace WIDESEAWCS_Tasks
{
    public partial class AGVJob
    public partial class AGV_CSJJob
    {
        /// <summary>
        /// 涓嬪彂AGV浠诲姟
@@ -23,7 +23,7 @@
        {
            try
            {
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var agvTask in newTasks)
                {
                    try
@@ -66,14 +66,14 @@
                        agvTask.TaskState = TaskStatusEnum.Exception.ObjToInt();
                        //agvTask.Remark = content.Data.ObjToString();
                        agvTask.ExceptionMessage = ex.Message;
                        WriteError(nameof(AGVJob), ex.Message, ex);
                        WriteError(nameof(AGV_CSJJob), ex.Message, ex);
                    }
                }
                _taskService.UpdateData(newTasks);
            }
            catch (Exception ex)
            {
                WriteError(nameof(AGVJob), ex.Message, ex);
                WriteError(nameof(AGV_CSJJob), ex.Message, ex);
            }
        }
        /// <summary>
@@ -83,10 +83,10 @@
        {
            try
            {
                var WaitToTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                var WaitToTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                foreach (var WaitToTask in WaitToTasks)
                {
                    if(WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    if (WaitToTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == WaitToTask.NextAddress);
                        if (stationManger == null)
@@ -101,7 +101,7 @@
                        OtherDevice otherDevice = (OtherDevice)device;
                        bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode);
                        bool requestPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, stationManger.StationCode);
                        if(!requestPut)
                        if (!requestPut)
                        {
                            otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode);
                            continue;
@@ -157,7 +157,7 @@
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(nameof(AGVJob) + ":" + ex.Message);
                Console.Out.WriteLine(nameof(AGV_CSJJob) + ":" + ex.Message);
            }
        }