42a51b0fc2041b872691637db0ec01391a67e026..7f42a3ef9bc83bdc199317d12c1905d8696dac4f
4 天以前 huangxiaoqiang
代码提交
7f42a3 对比 | 目录
4 天以前 huangxiaoqiang
1
bafe1d 对比 | 目录
已修改8个文件
已删除1个文件
333 ■■■■ 文件已修改
.gitignore 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/.vs/ProjectEvaluation/wideseawcs_server.metadata.v9.bin 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/.vs/ProjectEvaluation/wideseawcs_server.projects.v9.bin 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/.futdcache.v2 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Enum/TaskStatusEnum.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/DeviceInfoService.cs 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile2.pubxml.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob_FirstFloor/CommonRGV_FirstFloorJob.cs 284 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -3378,3 +3378,6 @@
/项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/DocumentLayout.json
/项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/99346251-82cc-4de0-b1da-6db61a4af76b.vsidx
/项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/edc42545-064e-448c-8f3c-a1485c2bc545.vsidx
/项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/2f8f0eaf-3967-4a3b-bf67-c01642a535ae.vsidx
/项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/c49ba225-ed27-4d81-9d09-cad78e867071.vsidx
/项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/.futdcache.v2
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/.vs/ProjectEvaluation/wideseawcs_server.metadata.v9.bin
Binary files differ
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/.vs/ProjectEvaluation/wideseawcs_server.projects.v9.bin
Binary files differ
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/.futdcache.v2
Binary files differ
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/Enum/TaskStatusEnum.cs
@@ -187,7 +187,7 @@
        RGV_OutFinish = 140,
        /// <summary>
        /// å…¥åº“中转
        /// å‡ºåº“中转
        /// </summary>
        [Description("出库中转")]
        RGV_TransFer = 145,
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/DeviceInfoService.cs
@@ -20,6 +20,7 @@
using Newtonsoft.Json;
using SixLabors.ImageSharp.ColorSpaces;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
@@ -231,7 +232,14 @@
                {
                    CommonStackerCrane commonStackerCrane = (CommonStackerCrane)device;
                    commonStackerCrane.SetValue(StackerCraneDBName.WorkType, Convert.ToSByte(2));
                    //commonStackerCrane.SetValue(StackerCraneDBName.WorkType, Convert.ToSByte(2));
                    DeviceProDTO? devicePro = commonStackerCrane.DeviceProDTOs.Where(x => x.DeviceChildCode == commonStackerCrane.DeviceCode && x.DeviceProParamName == "WorkType").FirstOrDefault();
                    byte valueToWrite = 2;
                    byte[] buffer = new byte[] { valueToWrite };
                    commonStackerCrane.Communicator.Write(devicePro.DeviceProAddress, buffer);
                    return content.OK();
                }
                else
@@ -257,7 +265,14 @@
                {
                    CommonStackerCrane commonStackerCrane = (CommonStackerCrane)device;
                    commonStackerCrane.SetValue(StackerCraneDBName.WorkType, Convert.ToSByte(4));
                    //commonStackerCrane.SetValue(StackerCraneDBName.WorkType, Convert.ToSByte(4));
                    DeviceProDTO? devicePro = commonStackerCrane.DeviceProDTOs.Where(x => x.DeviceChildCode == commonStackerCrane.DeviceCode && x.DeviceProParamName == "WorkType").FirstOrDefault();
                    byte valueToWrite = 4;
                    byte[] buffer = new byte[] { valueToWrite };
                    commonStackerCrane.Communicator.Write(devicePro.DeviceProAddress, buffer);
                    return content.OK();
                }
                else
@@ -563,7 +578,7 @@
                        {
                            InStock = structs[2] == true ? "有货" : "空闲",
                            TaskNum = ConveyorLineTaskNum.ToString(),
                            Alarm = AlarmInfo(ConveyorLineAlarm)
                            Alarm = GetAlarm(ConveyorLineAlarm)
                        };
                        return content.OK(data:obj);
                    }
@@ -755,7 +770,22 @@
            }
        }
        string AlarmInfo(uint Alarm) => Alarm switch
        public string GetAlarm(uint value)
        {
            byte[] bytes = BitConverter.GetBytes(value);
            BitArray bits = new BitArray(bytes);
            for (int i = 0; i < bits.Length; i++)
            {
                if (bits[i])
                {
                    return AlarmInfo(i);
                }
            }
            return "";
        }
        string AlarmInfo(int Alarm) => Alarm switch
        {
            0 => "急停",
            1 => "变频器报警1",
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile2.pubxml.user
@@ -3,7 +3,7 @@
<Project>
  <PropertyGroup>
    <_PublishTargetUrl>E:\GET\AoTanSiWCS\项目代码\WCS\WIDESEAWCS_Server\WIDESEAWCS_Server\bin\Release\net6.0\publish\</_PublishTargetUrl>
    <History>True|2025-08-18T05:08:36.7873753Z||;True|2025-08-18T11:46:56.4805705+08:00||;True|2025-08-18T11:22:02.9054606+08:00||;True|2025-08-18T11:07:33.4630780+08:00||;True|2025-08-18T10:50:48.4350473+08:00||;True|2025-08-16T16:33:07.2265013+08:00||;True|2025-08-16T16:08:02.5366587+08:00||;True|2025-08-16T16:04:57.6117051+08:00||;True|2025-08-16T15:48:46.1045456+08:00||;True|2025-08-16T15:30:17.3989863+08:00||;True|2025-08-16T14:46:36.5094682+08:00||;True|2025-08-16T14:14:17.0500765+08:00||;True|2025-08-16T13:31:48.8727652+08:00||;True|2025-08-16T13:24:29.8307713+08:00||;True|2025-08-16T13:16:29.9622111+08:00||;True|2025-08-16T11:23:35.5640992+08:00||;True|2025-08-16T11:02:59.2985083+08:00||;True|2025-08-16T10:27:02.8633285+08:00||;True|2025-08-16T10:10:08.1477861+08:00||;True|2025-08-15T16:44:40.1716233+08:00||;True|2025-08-15T16:37:15.4095592+08:00||;True|2025-08-15T16:10:23.4132871+08:00||;True|2025-08-15T15:39:23.4095856+08:00||;True|2025-08-15T15:28:40.1757665+08:00||;True|2025-08-15T15:17:03.4120137+08:00||;True|2025-08-14T14:56:07.9836766+08:00||;True|2025-08-14T13:46:14.8376860+08:00||;True|2025-08-14T13:40:06.1474672+08:00||;True|2025-08-14T13:35:01.0314827+08:00||;True|2025-08-14T13:30:22.4451955+08:00||;True|2025-08-14T13:01:53.0152050+08:00||;True|2025-08-14T09:25:26.2041015+08:00||;True|2025-08-14T08:52:03.5944496+08:00||;True|2025-08-13T16:03:14.7435997+08:00||;True|2025-08-13T15:45:41.5991008+08:00||;True|2025-08-13T15:16:36.2021682+08:00||;True|2025-08-13T09:09:27.8499524+08:00||;True|2025-08-13T09:06:29.1371955+08:00||;True|2025-08-12T16:20:01.1810979+08:00||;True|2025-08-12T15:15:58.7445192+08:00||;True|2025-08-12T14:56:43.1314180+08:00||;True|2025-08-07T16:09:37.4325511+08:00||;True|2025-08-07T15:03:02.4443822+08:00||;True|2025-08-07T14:51:02.2746340+08:00||;True|2025-08-07T14:50:52.4634781+08:00||;True|2025-08-07T14:44:25.7952161+08:00||;True|2025-08-06T16:05:13.6764446+08:00||;True|2025-08-06T15:48:26.9347397+08:00||;True|2025-08-06T15:24:30.4982821+08:00||;True|2025-08-06T15:23:27.4513567+08:00||;True|2025-08-06T14:57:04.0476264+08:00||;True|2025-08-06T14:43:06.1306795+08:00||;True|2025-08-06T14:30:32.8125962+08:00||;True|2025-08-06T14:22:42.8305756+08:00||;True|2025-08-06T14:08:24.3056726+08:00||;True|2025-08-06T12:49:07.0122619+08:00||;True|2025-08-06T09:53:47.1995016+08:00||;True|2025-08-06T09:23:43.4599118+08:00||;True|2025-08-06T09:17:41.5263742+08:00||;True|2025-08-01T13:15:58.0733845+08:00||;</History>
    <History>True|2025-08-20T04:19:58.6819487Z||;True|2025-08-20T10:19:55.2486460+08:00||;True|2025-08-20T10:10:55.8587756+08:00||;True|2025-08-19T17:04:09.2993217+08:00||;True|2025-08-19T16:51:22.2908004+08:00||;True|2025-08-19T16:30:53.6567391+08:00||;True|2025-08-19T16:26:50.4254303+08:00||;True|2025-08-19T16:12:13.1559703+08:00||;True|2025-08-19T15:46:01.4343164+08:00||;True|2025-08-19T15:43:17.4326410+08:00||;True|2025-08-19T14:05:04.6649580+08:00||;True|2025-08-18T13:08:36.7873753+08:00||;True|2025-08-18T11:46:56.4805705+08:00||;True|2025-08-18T11:22:02.9054606+08:00||;True|2025-08-18T11:07:33.4630780+08:00||;True|2025-08-18T10:50:48.4350473+08:00||;True|2025-08-16T16:33:07.2265013+08:00||;True|2025-08-16T16:08:02.5366587+08:00||;True|2025-08-16T16:04:57.6117051+08:00||;True|2025-08-16T15:48:46.1045456+08:00||;True|2025-08-16T15:30:17.3989863+08:00||;True|2025-08-16T14:46:36.5094682+08:00||;True|2025-08-16T14:14:17.0500765+08:00||;True|2025-08-16T13:31:48.8727652+08:00||;True|2025-08-16T13:24:29.8307713+08:00||;True|2025-08-16T13:16:29.9622111+08:00||;True|2025-08-16T11:23:35.5640992+08:00||;True|2025-08-16T11:02:59.2985083+08:00||;True|2025-08-16T10:27:02.8633285+08:00||;True|2025-08-16T10:10:08.1477861+08:00||;True|2025-08-15T16:44:40.1716233+08:00||;True|2025-08-15T16:37:15.4095592+08:00||;True|2025-08-15T16:10:23.4132871+08:00||;True|2025-08-15T15:39:23.4095856+08:00||;True|2025-08-15T15:28:40.1757665+08:00||;True|2025-08-15T15:17:03.4120137+08:00||;True|2025-08-14T14:56:07.9836766+08:00||;True|2025-08-14T13:46:14.8376860+08:00||;True|2025-08-14T13:40:06.1474672+08:00||;True|2025-08-14T13:35:01.0314827+08:00||;True|2025-08-14T13:30:22.4451955+08:00||;True|2025-08-14T13:01:53.0152050+08:00||;True|2025-08-14T09:25:26.2041015+08:00||;True|2025-08-14T08:52:03.5944496+08:00||;True|2025-08-13T16:03:14.7435997+08:00||;True|2025-08-13T15:45:41.5991008+08:00||;True|2025-08-13T15:16:36.2021682+08:00||;True|2025-08-13T09:09:27.8499524+08:00||;True|2025-08-13T09:06:29.1371955+08:00||;True|2025-08-12T16:20:01.1810979+08:00||;True|2025-08-12T15:15:58.7445192+08:00||;True|2025-08-12T14:56:43.1314180+08:00||;True|2025-08-07T16:09:37.4325511+08:00||;True|2025-08-07T15:03:02.4443822+08:00||;True|2025-08-07T14:51:02.2746340+08:00||;True|2025-08-07T14:50:52.4634781+08:00||;True|2025-08-07T14:44:25.7952161+08:00||;True|2025-08-06T16:05:13.6764446+08:00||;True|2025-08-06T15:48:26.9347397+08:00||;True|2025-08-06T15:24:30.4982821+08:00||;True|2025-08-06T15:23:27.4513567+08:00||;True|2025-08-06T14:57:04.0476264+08:00||;True|2025-08-06T14:43:06.1306795+08:00||;True|2025-08-06T14:30:32.8125962+08:00||;True|2025-08-06T14:22:42.8305756+08:00||;True|2025-08-06T14:08:24.3056726+08:00||;True|2025-08-06T12:49:07.0122619+08:00||;True|2025-08-06T09:53:47.1995016+08:00||;True|2025-08-06T09:23:43.4599118+08:00||;True|2025-08-06T09:17:41.5263742+08:00||;True|2025-08-01T13:15:58.0733845+08:00||;</History>
    <LastFailureDetails />
  </PropertyGroup>
</Project>
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob_FirstFloor/CommonRGV_FirstFloorJob.cs
@@ -129,12 +129,14 @@
                                                if (IsExecutingTask.TaskType == (int)TaskInboundTypeEnum.Inbound)
                                                {
                                                    IsExecutingTask.TargetStation = station.stationRemark;
                                                    IsExecutingTask.TaskState = (int)TaskInStatusEnum.RGV_TransFer;
                                                }
                                                else
                                                {
                                                    IsExecutingTask.TargetStation = station.remark;
                                                    IsExecutingTask.TaskState = (int)TaskOutStatusEnum.RGV_TransFer;
                                                }
                                                IsExecutingTask.TaskState = (int)TaskInStatusEnum.RGV_TransFer;
                                                _taskRepository.UpdateData(IsExecutingTask);
                                                Thread.Sleep(1000);
                                            }
@@ -288,15 +290,17 @@
                                                IsExecutingTask.RGVName = "RGV01";
                                                IsExecutingTask.CurrentAddress = IsExecutingTask.Remark;
                                                IsExecutingTask.Remark = "";
                                                IsExecutingTask.TaskState = (int)TaskInStatusEnum.RGV_TransFer;
                                                Dt_StationManager station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == IsExecutingTask.NextAddress);
                                                IsExecutingTask.SourceStation = IsExecutingTask.CurrentAddress == "1025" ? 10 : 7;
                                                if (IsExecutingTask.TaskType == (int)TaskInboundTypeEnum.Inbound)
                                                {
                                                    IsExecutingTask.TaskState = (int)TaskInStatusEnum.RGV_TransFer;
                                                    IsExecutingTask.TargetStation = station.stationRemark;
                                                }
                                                else
                                                {
                                                    IsExecutingTask.TaskState = (int)TaskOutStatusEnum.RGV_TransFer;
                                                    IsExecutingTask.TargetStation = station.remark;
                                                }
@@ -446,11 +450,12 @@
                                            Thread.Sleep(1000);
                                            if (task.Remark != null)
                                            if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))))
                                            {
                                                task.Remark = "1025";
                                                _taskRepository.UpdateData(task);
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
                                        }
                                    }
@@ -465,11 +470,12 @@
                                            Thread.Sleep(1000);
                                            if (task.Remark != null)
                                            if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))))
                                            {
                                                task.Remark = "1025";
                                                _taskRepository.UpdateData(task);
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
                                        }
                                    }
@@ -482,8 +488,10 @@
                                        {
                                            LogAndWarn("执行调度任务控制", $"【{commonRGV.DeviceCode}工作模式:【{commonRGV.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】设备状态:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】【{commonRGVSecond.DeviceCode}】任务【{JsonConvert.SerializeObject(taskSecond)}】{commonRGVSecond.DeviceCode}返回任务:【{JsonConvert.SerializeObject(task.TaskNum)}】】");
                                            Thread.Sleep(1000);
                                            if (task.Remark != null)
                                            if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))))
                                            {
                                                task.Remark = "1025";
                                                _taskRepository.UpdateData(task);
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
@@ -511,16 +519,28 @@
                                        TaskType = (byte)Convert.ToSByte(1)
                                    };
                                    SendCommand(commonRGVSecond, command);
                                    Thread.Sleep(1000);
                                    Thread.Sleep(3000);
                                    if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running))
                                    {
                                        return null;
                                    }
                                }
                                Thread.Sleep(1000);
                                if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))))
                                {
                                    task.Remark = "1025";
                                    _taskRepository.UpdateData(task);
                                    return GetDispatchExecutingTask(task);
                                }
                                return task;
                            }
                        }
                    }
                    if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))))
                    {
                        task.Remark = "1025";
                        _taskRepository.UpdateData(task);
                        return GetDispatchExecutingTask(task);
                    }
                    return task;
                }
@@ -543,8 +563,10 @@
                                            LogAndWarn("执行调度任务控制", $"【{commonRGV.DeviceCode}工作模式:【{commonRGV.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】设备状态:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】【{commonRGVFirst.DeviceCode}】任务【{JsonConvert.SerializeObject(taskSecond)}】{commonRGVFirst.DeviceCode}返回任务:【{JsonConvert.SerializeObject(task.TaskNum)}】】");
                                            Thread.Sleep(1000);
                                            if (task.Remark != null)
                                            if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))))
                                            {
                                                task.Remark = "1026";
                                                _taskRepository.UpdateData(task);
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
@@ -560,8 +582,10 @@
                                            LogAndWarn("执行调度任务控制", $"【{commonRGV.DeviceCode}工作模式:【{commonRGV.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】设备状态:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】【{commonRGVFirst.DeviceCode}】任务【{JsonConvert.SerializeObject(taskSecond)}】{commonRGVFirst.DeviceCode}返回任务:【{JsonConvert.SerializeObject(task.TaskNum)}】】");
                                            Thread.Sleep(1000);
                                            if (task.Remark != null)
                                            if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))))
                                            {
                                                task.Remark = "1026";
                                                _taskRepository.UpdateData(task);
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
@@ -577,8 +601,10 @@
                                            LogAndWarn("执行调度任务控制", $"【{commonRGV.DeviceCode}工作模式:【{commonRGV.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】设备状态:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】【{commonRGVFirst.DeviceCode}】任务【{JsonConvert.SerializeObject(taskSecond)}】{commonRGVFirst.DeviceCode}返回任务:【{JsonConvert.SerializeObject(task.TaskNum)}】】");
                                            Thread.Sleep(1000);
                                            if (task.Remark != null)
                                            if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))))
                                            {
                                                task.Remark = "1026";
                                                _taskRepository.UpdateData(task);
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
@@ -606,16 +632,28 @@
                                        TaskType = (byte)Convert.ToSByte(1)
                                    };
                                    SendCommand(commonRGVFirst, command);
                                    Thread.Sleep(1000);
                                    Thread.Sleep(3000);
                                    if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running))
                                    {
                                        return null;
                                    }
                                }
                                Thread.Sleep(1000);
                                if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))))
                                {
                                    task.Remark = "1026";
                                    _taskRepository.UpdateData(task);
                                    return GetDispatchExecutingTask(task);
                                }
                                return task;
                            }
                        }
                    }
                    if (task.Remark != null || ((task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV02" && task.TargetAddress == "1002") || (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.RGVName == "RGV01" && (task.TargetAddress == "1030" || task.TargetAddress == "1029"))))
                    {
                        task.Remark = "1026";
                        _taskRepository.UpdateData(task);
                        return GetDispatchExecutingTask(task);
                    }
                    return task;
                }
@@ -645,13 +683,13 @@
                        if (commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Automatic) && !commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Fault))
                        {
                            var taskSecond = _taskRepository.QueryFirst(x => x.RGVName == "RGV02" && x.TaskNum == commonRGVSecond.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && (x.TaskState < 230 || x.TaskState == (int)TaskInStatusEnum.RGV_TransFer || x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish)) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound)));
                             if (taskSecond != null)
                            if (taskSecond != null)
                            {
                                task = GetDispatchTask(tasks, taskSecond);
                                LogAndWarn("调度任务控制", $"【{commonRGV.DeviceCode}工作模式:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】设备状态:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】【{commonRGVSecond.DeviceCode}】任务【{JsonConvert.SerializeObject(taskSecond)}】{commonRGVSecond.DeviceCode}返回任务:【{JsonConvert.SerializeObject(task.TaskNum)}】】");
                                Thread.Sleep(1000);
                                Thread.Sleep(1000);
                                return task;
                            }
                        }
@@ -677,40 +715,42 @@
                                TaskType = (byte)Convert.ToSByte(1)
                            };
                            SendCommand(commonRGVSecond, command);
                            Thread.Sleep(1000);
                            Thread.Sleep(3000);
                            if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running))
                            {
                                return null;
                            }
                        }
                        if (tasks.FirstOrDefault(x => x.RGVName == "RGV01") != null)
                        task = GetDispatchTask(taskNews, "RGV01");
                        if (task == null)
                        {
                            LogAndWarn("调度任务控制", $"【{commonRGVSecond.DeviceCode}工作模式:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】作业状态:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running)}】设备状态:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】是否有货:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.InStock)}】返回任务:【{JsonConvert.SerializeObject(taskNews.FirstOrDefault(x => x.RGVName == "RGV01").TaskNum)}】】");
                            Thread.Sleep(1000);
                            return taskNews.FirstOrDefault(x => x.RGVName == "RGV01");
                            return tasks.FirstOrDefault(x => x.RGVName != "RGV02");
                        }
                        else
                        {
                            LogAndWarn("调度任务控制", $"【{commonRGVSecond.DeviceCode}工作模式:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】作业状态:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running)}】设备状态:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】是否有货:【{commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.InStock)}】返回任务:【{JsonConvert.SerializeObject(taskNews.FirstOrDefault(x => x.RGVName != "RGV02").TaskNum)}】】");
                            Thread.Sleep(1000);
                            return taskNews.FirstOrDefault(x => x.RGVName != "RGV02");
                        }
                        return task;
                        //if (taskNews.FirstOrDefault(x => x.RGVName == "RGV01") != null)
                        //{
                        //    return taskNews.FirstOrDefault(x => x.RGVName == "RGV01");
                        //}
                        //else
                        //{
                        //    return taskNews.FirstOrDefault(x => x.RGVName != "RGV02");
                        //}
                    }
                    else
                    {
                        if (tasks.FirstOrDefault(x => x.RGVName == "RGV01") != null)
                        {
                            LogAndWarn("调度任务控制", $"【未找到RGV02设备信息】返回任务:【{JsonConvert.SerializeObject(tasks.FirstOrDefault(x => x.RGVName == "RGV01").TaskNum)}】】");
                            Thread.Sleep(1000);
                            return tasks.FirstOrDefault(x => x.RGVName == "RGV01");
                        }
                        else
                        {
                            LogAndWarn("调度任务控制", $"【未找到RGV02设备信息】返回任务:【{JsonConvert.SerializeObject(tasks.FirstOrDefault(x => x.RGVName != "RGV02").TaskNum)}】】");
                            Thread.Sleep(1000);
                            return tasks.FirstOrDefault(x => x.RGVName != "RGV02");
                        }
                        return GetDispatchTask(tasks, "RGV01");
                        //if (tasks.FirstOrDefault(x => x.RGVName == "RGV01") != null)
                        //{
                        //    LogAndWarn("调度任务控制", $"【未找到RGV02设备信息】返回任务:【{JsonConvert.SerializeObject(tasks.FirstOrDefault(x => x.RGVName == "RGV01").TaskNum)}】】");
                        //    Thread.Sleep(1000);
                        //    return tasks.FirstOrDefault(x => x.RGVName == "RGV01");
                        //}
                        //else
                        //{
                        //    LogAndWarn("调度任务控制", $"【未找到RGV02设备信息】返回任务:【{JsonConvert.SerializeObject(tasks.FirstOrDefault(x => x.RGVName != "RGV02").TaskNum)}】】");
                        //    Thread.Sleep(1000);
                        //    return tasks.FirstOrDefault(x => x.RGVName != "RGV02");
                        //}
                    }
                }
                else
@@ -754,43 +794,44 @@
                                TaskType = (byte)Convert.ToSByte(1)
                            };
                            SendCommand(commonRGVFirst, command);
                            Thread.Sleep(1000);
                            Thread.Sleep(3000);
                            if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running))
                            {
                                return null;
                            }
                        }
                        if (tasks.FirstOrDefault(x => x.RGVName == "RGV02") != null)
                        task = GetDispatchTask(taskNews, "RGV02");
                        if (task == null)
                        {
                            LogAndWarn("调度任务控制", $"【{commonRGVFirst.DeviceCode}工作模式:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】作业状态:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running)}】设备状态:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】是否有货:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.InStock)}】返回任务:【{JsonConvert.SerializeObject(taskNews.FirstOrDefault(x => x.RGVName == "RGV02").TaskNum)}】】");
                            Thread.Sleep(1000);
                            return taskNews.FirstOrDefault(x => x.RGVName == "RGV02");
                            return tasks.FirstOrDefault(x => x.RGVName != "RGV01");
                        }
                        else
                        {
                            LogAndWarn("调度任务控制", $"【{commonRGVFirst.DeviceCode}工作模式:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】作业状态:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running)}】设备状态:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】是否有货:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.InStock)}】返回任务:【{JsonConvert.SerializeObject(taskNews.FirstOrDefault(x => x.RGVName != "RGV01").TaskNum)}】】");
                            Thread.Sleep(1000);
                            return taskNews.FirstOrDefault(x => x.RGVName != "RGV01");
                        }
                        return task;
                        //if (taskNews.FirstOrDefault(x => x.RGVName == "RGV02") != null)
                        //{
                        //    return taskNews.FirstOrDefault(x => x.RGVName == "RGV02");
                        //}
                        //else
                        //{
                        //    return taskNews.FirstOrDefault(x => x.RGVName != "RGV01");
                        //}
                    }
                    else
                    {
                        if (tasks.FirstOrDefault(x => x.RGVName == "RGV02") != null)
                        {
                            LogAndWarn("调度任务控制", $"【未找到RGV01设备信息】 è¿”回任务:【{JsonConvert.SerializeObject(tasks.FirstOrDefault(x => x.RGVName == "RGV02").TaskNum)}】】");
                       return GetDispatchTask(tasks, "RGV02");
                        //if (tasks.FirstOrDefault(x => x.RGVName == "RGV02") != null)
                        //{
                        //    LogAndWarn("调度任务控制", $"【未找到RGV01设备信息】 è¿”回任务:【{JsonConvert.SerializeObject(tasks.FirstOrDefault(x => x.RGVName == "RGV02").TaskNum)}】】");
                            Thread.Sleep(1000);
                            return tasks.FirstOrDefault(x => x.RGVName == "RGV02");
                        }
                        else
                        {
                            LogAndWarn("调度任务控制", $"【未找到RGV01设备信息】返回任务:【{JsonConvert.SerializeObject(tasks.FirstOrDefault(x => x.RGVName != "RGV01").TaskNum)}】】");
                        //    Thread.Sleep(1000);
                        //    return tasks.FirstOrDefault(x => x.RGVName == "RGV02");
                        //}
                        //else
                        //{
                        //    LogAndWarn("调度任务控制", $"【未找到RGV01设备信息】返回任务:【{JsonConvert.SerializeObject(tasks.FirstOrDefault(x => x.RGVName != "RGV01").TaskNum)}】】");
                            Thread.Sleep(1000);
                            return tasks.FirstOrDefault(x => x.RGVName != "RGV01");
                        }
                        //    Thread.Sleep(1000);
                        //    return tasks.FirstOrDefault(x => x.RGVName != "RGV01");
                        //}
                    }
                }
            }
@@ -818,7 +859,6 @@
                    {
                        if (commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Automatic) && !commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Fault))
                        {
                            var taskSecond = _taskRepository.QueryFirst(x => x.RGVName == "RGV02" && x.TaskNum == commonRGVSecond.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum) && ((x.TaskType == (int)TaskInboundTypeEnum.Inbound && (x.TaskState < 230 || x.TaskState == (int)TaskInStatusEnum.RGV_TransFer || x.TaskState == (int)TaskInStatusEnum.RGV_TransFerFInish)) || (x.TaskType == (int)TaskOutboundTypeEnum.Outbound)));
                            if (taskSecond != null)
                            {
@@ -861,7 +901,7 @@
                                        TaskType = (byte)Convert.ToSByte(1)
                                    };
                                    SendCommand(commonRGVSecond, command);
                                    Thread.Sleep(1000);
                                    Thread.Sleep(3000);
                                    if (!commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running))
                                    {
                                        return null;
@@ -948,7 +988,7 @@
                                        TaskType = (byte)Convert.ToSByte(1)
                                    };
                                    SendCommand(commonRGVFirst, command);
                                    Thread.Sleep(1000);
                                    Thread.Sleep(3000);
                                    if (!commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running))
                                    {
                                        return null;
@@ -1088,7 +1128,7 @@
            return null;
        }
        public Dt_Task? GetDispatchTask(List<Dt_Task> tasks, Dt_Task oldtask)
        public Dt_Task? GetDispatchTask(List<Dt_Task> tasks,Dt_Task oldtask)
        {
            Dt_Task y = tasks.Where(x => x.Remark != null&& ((x.SourceStation - oldtask.TargetStation > 1 && x.SourceStation - oldtask.SourceStation > 1 && x.TaskType == (int)TaskInboundTypeEnum.Inbound) || (x.SourceStation - oldtask.TargetStation > 1 && x.TargetStation - oldtask.SourceStation > 1 && x.SourceStation - oldtask.SourceStation > 1 && x.TargetStation - oldtask.TargetStation > 1 && x.TaskType == (int)TaskOutboundTypeEnum.Outbound))).FirstOrDefault();
            if (y == null)
@@ -1175,6 +1215,82 @@
            }
        }
        public Dt_Task? GetDispatchTask(List<Dt_Task> tasks,string RGVName)
        {
            Dt_Task y = tasks.Where(x => x.Remark != null).FirstOrDefault();
            if (y == null)
            {
                if (RGVName == "RGV01")
                {
                    if (tasks.FirstOrDefault(x => x.RGVName == RGVName) != null)
                    {
                        return tasks.FirstOrDefault(x => x.RGVName == RGVName);
                    }
                    else
                    {
                        return tasks.FirstOrDefault(x => x.RGVName != "RGV02");
                    }
                }
                else
                {
                    if (tasks.FirstOrDefault(x => x.RGVName == RGVName) != null)
                    {
                        return tasks.FirstOrDefault(x => x.RGVName == RGVName);
                    }
                    else
                    {
                        return tasks.FirstOrDefault(x => x.RGVName != "RGV01");
                    }
                }
            }
            else
            {
                var stationManager = _stationManagerRepository.QueryData(x => x.stationType == 15);
                if (stationManager.Count() > 0)
                {
                    string next = null;
                    foreach (var item in stationManager)
                    {
                        var x = _taskRepository.QueryFirst(x => x.NextAddress == item.stationChildCode || x.CurrentAddress == item.stationChildCode);
                        if (x == null)
                        {
                            next = item.stationChildCode;
                            break;
                        }
                    }
                    if (next != null)
                    {
                        y.Remark = next;
                        _taskRepository.UpdateData(y);
                        LogAndWarn("中转任务", $" è¿”回任务:【{JsonConvert.SerializeObject(y)}】】");
                        return y;
                    }
                }
                if (RGVName == "RGV01")
                {
                    if (tasks.FirstOrDefault(x => x.RGVName == RGVName) != null)
                    {
                        return tasks.FirstOrDefault(x => x.RGVName == RGVName);
                    }
                    else
                    {
                        return tasks.FirstOrDefault(x => x.RGVName != "RGV02");
                    }
                }
                else
                {
                    if (tasks.FirstOrDefault(x => x.RGVName == RGVName) != null)
                    {
                        return tasks.FirstOrDefault(x => x.RGVName == RGVName);
                    }
                    else
                    {
                        return tasks.FirstOrDefault(x => x.RGVName != "RGV01");
                    }
                }
            }
        }
        public Dt_Task? GetDispatchExecutingTask(Dt_Task oldtask,Dt_Task task)
        {
            var stationManagers = _stationManagerRepository.QueryData(x => x.stationType == 15);
@@ -1187,6 +1303,7 @@
                    if (x == null)
                    {
                        next = item.stationChildCode;
                        LogAndWarn("中转获取站台", $" è¿”回任务:【{JsonConvert.SerializeObject(x)}】】【{next}】");
                        break;
                    }
                }
@@ -1194,12 +1311,13 @@
                {
                    var stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == next);
                    oldtask.Remark = next;
                    //oldtask.CurrentAddress = next;
                    _taskRepository.UpdateData(oldtask);
                    if (task.RGVName == "RGV01")
                    {
                        if (task.TargetStation - stationManager.stationRemark > 1 && task.SourceStation - stationManager.stationRemark > 1 && task.SourceStation - oldtask.SourceStation > 1 && task.TargetStation - oldtask.SourceStation > 1)
                        {
                            _taskRepository.UpdateData(oldtask);
                            LogAndWarn("中转任务GetDispatchExecutingTask", $" è¿”回任务:【{JsonConvert.SerializeObject(oldtask)}】】");
                            LogAndWarn("中转任务GetDispatchExecutingTask", $" è¿”回任务:【{JsonConvert.SerializeObject(oldtask)}】】【{next}】");
                            return oldtask;
                        }
                        else
@@ -1211,7 +1329,6 @@
                    {
                        if (stationManager.stationRemark - task.TargetStation > 1 && stationManager.stationRemark - task.SourceStation > 1 && oldtask.SourceStation - task.SourceStation > 1 && oldtask.SourceStation - task.TargetStation > 1)
                        {
                            _taskRepository.UpdateData(oldtask);
                            LogAndWarn("中转任务GetDispatchExecutingTask", $" è¿”回任务:【{JsonConvert.SerializeObject(oldtask)}】】");
                            return oldtask;
                        }
@@ -1225,6 +1342,33 @@
            return null;
        }
        public Dt_Task? GetDispatchExecutingTask(Dt_Task oldtask)
        {
            var stationManagers = _stationManagerRepository.QueryData(x => x.stationType == 15);
            if (stationManagers.Count() > 0)
            {
                string next = null;
                foreach (var item in stationManagers)
                {
                    var x = _taskRepository.QueryFirst(x => x.NextAddress == item.stationChildCode || x.CurrentAddress == item.stationChildCode);
                    if (x == null)
                    {
                        next = item.stationChildCode;
                        LogAndWarn("中转获取站台", $" è¿”回任务:【{JsonConvert.SerializeObject(x)}】】【{next}】");
                        break;
                    }
                }
                if (next != null)
                {
                    var stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == next);
                    oldtask.Remark = next;
                    _taskRepository.UpdateData(oldtask);
                    return oldtask;
                }
            }
            return null;
        }
        /// <summary>
        /// ä»»åŠ¡å®žä½“è½¬æ¢æˆå‘½ä»¤Model
        /// </summary>
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -195,8 +195,8 @@
            27 => "放货时货架有货",
            28 => "放货后载货台有货",
            29 => "放深货时浅货位有货",
            30 => "",
            31 => "",
            30 => "行走位置异常",
            31 => "提升位置异常",
            _ => $"未知报警({alarm})"
        };