bec4a1b386c740ce4fc53a52b8ec8846ffb5f2bd..42a51b0fc2041b872691637db0ec01391a67e026
6 天以前 huangxiaoqiang
1
42a51b 对比 | 目录
6 天以前 huangxiaoqiang
1
619e40 对比 | 目录
已修改7个文件
165 ■■■■ 文件已修改
.gitignore 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task_hty.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Client/src/views/taskinfo/task.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Client/src/views/taskinfo/task_hty.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile2.pubxml.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob_FirstFloor/CommonRGV_FirstFloorJob.cs 151 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -3376,3 +3376,5 @@
/项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/.suo
/项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/DocumentLayout.backup.json
/项目代码/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_Client/src/extension/taskinfo/task_hty.js
@@ -67,7 +67,7 @@
        },
        rowClick({ row, column, event }) {
            //查询界面点击行事件
            this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
            //this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
        },
        modelOpenAfter(row) {
            //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Client/src/views/taskinfo/task.vue
@@ -45,7 +45,7 @@
        { title: "下一位置", field: "nextAddress", type: "like" },
      ],
      [
        { title: "巷道号", field: "roadway", type: "like" },
        { title: "巷道号", field: "roadway", type: "select" ,dataKey: "Stacker", data: [],},
        { title: "创建人", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Client/src/views/taskinfo/task_hty.vue
@@ -53,7 +53,7 @@
        { title: "下一位置", field: "nextAddress", type: "like" },
      ],
      [
        { title: "巷道号", field: "roadway", type: "like" },
        { title: "巷道号", field: "roadway", type: "select" ,dataKey: "Stacker", data: [],},
        { title: "创建人", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
ÏîÄ¿´úÂë/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-16T08:33:07.2265013Z||;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-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>
    <LastFailureDetails />
  </PropertyGroup>
</Project>
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -11,8 +11,8 @@
  "ConnectionStringsEncryption": false,
  "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
  //连接字符串
  //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_OTS;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionString": "Data Source=192.168.32.240;Initial Catalog=WIDESEAWCS_OTS;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_OTS;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionString": "Data Source=192.168.32.240;Initial Catalog=WIDESEAWCS_OTS;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //跨域
  "Cors": {
    "PolicyName": "CorsIpAccess", //策略名称
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob_FirstFloor/CommonRGV_FirstFloorJob.cs
@@ -433,7 +433,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)
                            {
@@ -449,7 +448,26 @@
                                            if (task.Remark != null)
                                            {
                                                return GetDispatchExecutingTask(task);
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
                                        }
                                    }
                                }
                                else if ((taskSecond.CurrentAddress == "1025" || taskSecond.CurrentAddress == "1026") && (taskSecond.TaskState == (int)TaskOutStatusEnum.RGV_OutExecuting || taskSecond.TaskState == (int)TaskInStatusEnum.RGV_InExecuting))
                                {
                                    if (task.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish || task.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish)
                                    {
                                        if (task.TargetStation - taskSecond.SourceStation > 1 && task.TargetStation - taskSecond.TargetStation > 1)
                                        {
                                            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)
                                            {
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
@@ -466,7 +484,7 @@
                                            Thread.Sleep(1000);
                                            if (task.Remark != null)
                                            {
                                                return GetDispatchExecutingTask(task);
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
                                        }
@@ -482,6 +500,10 @@
                                }
                                if (commonRGVSecond.GetValue<RGVDBName, int>(RGVDBName.LevelPoint) > 35000)
                                {
                                    if (commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running))
                                    {
                                        return null;
                                    }
                                    RGVTaskCommand command = new RGVTaskCommand()
                                    {
                                        PickupLocation = (byte)Convert.ToSByte(15),
@@ -523,7 +545,24 @@
                                            if (task.Remark != null)
                                            {
                                                return GetDispatchExecutingTask(task);
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
                                        }
                                    }
                                }
                                else if ((taskSecond.CurrentAddress == "1025" || taskSecond.CurrentAddress == "1026") && (taskSecond.TaskState == (int)TaskOutStatusEnum.RGV_OutExecuting || taskSecond.TaskState == (int)TaskInStatusEnum.RGV_InExecuting))
                                {
                                    if (task.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish || task.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish)
                                    {
                                        if (taskSecond.SourceStation - task.TargetStation > 1 && taskSecond.TargetStation - task.TargetStation > 1)
                                        {
                                            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)
                                            {
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
                                        }
@@ -540,7 +579,7 @@
                                            if (task.Remark != null)
                                            {
                                                return GetDispatchExecutingTask(task);
                                                return GetDispatchExecutingTask(task, taskSecond);
                                            }
                                            return task;
                                        }
@@ -556,6 +595,10 @@
                                }
                                if (commonRGVFirst.GetValue<RGVDBName, int>(RGVDBName.LevelPoint) < 420000)
                                {
                                    if (commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running))
                                    {
                                        return null;
                                    }
                                    RGVTaskCommand command = new RGVTaskCommand()
                                    {
                                        PickupLocation = (byte)Convert.ToSByte(26),
@@ -623,6 +666,10 @@
                        }
                        if (commonRGVSecond.GetValue<RGVDBName, int>(RGVDBName.LevelPoint) > 35000)
                        {
                            if (commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running))
                            {
                                return null;
                            }
                            RGVTaskCommand command = new RGVTaskCommand()
                            {
                                PickupLocation = (byte)Convert.ToSByte(15),
@@ -679,7 +726,7 @@
                            {
                                task = GetDispatchTask(tasks, taskFirst);
                                LogAndWarn("执行调度任务控制", $"【{commonRGVFirst.DeviceCode}工作模式:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】设备状态:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】【{commonRGVFirst.DeviceCode}】任务【{JsonConvert.SerializeObject(taskFirst)}】{commonRGVFirst.DeviceCode}返回任务:【{JsonConvert.SerializeObject(task.TaskNum)}】】");
                                LogAndWarn("调度任务控制", $"【{commonRGVFirst.DeviceCode}工作模式:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】设备状态:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】【{commonRGVFirst.DeviceCode}】任务【{JsonConvert.SerializeObject(taskFirst)}】{commonRGVFirst.DeviceCode}返回任务:【{JsonConvert.SerializeObject(task.TaskNum)}】】");
                                Thread.Sleep(1000);
                                return task;
@@ -696,6 +743,10 @@
                        }
                        if (commonRGVFirst.GetValue<RGVDBName, int>(RGVDBName.LevelPoint) < 420000)
                        {
                            if (commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running))
                            {
                                return null;
                            }
                            RGVTaskCommand command = new RGVTaskCommand()
                            {
                                PickupLocation = (byte)Convert.ToSByte(26),
@@ -799,6 +850,10 @@
                                }
                                if (commonRGVSecond.GetValue<RGVDBName, int>(RGVDBName.LevelPoint) > 35000)
                                {
                                    if (commonRGVSecond.GetValue<RGVDBName, bool>(RGVDBName.Running))
                                    {
                                        return null;
                                    }
                                    RGVTaskCommand command = new RGVTaskCommand()
                                    {
                                        PickupLocation = (byte)Convert.ToSByte(15),
@@ -856,7 +911,7 @@
                                if (taskFirst.TaskState == (int)TaskOutStatusEnum.RGV_Outdispatch || taskFirst.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish || taskFirst.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish)
                                {
                                    task = tasks.FirstOrDefault(x => ((x.SourceStation - taskFirst.TargetStation > 1 && x.SourceStation - taskFirst.SourceStation > 1 && x.TaskType == (int)TaskInboundTypeEnum.Inbound) || (x.SourceStation - taskFirst.TargetStation > 1 && x.TargetStation - taskFirst.SourceStation > 1 && x.SourceStation - taskFirst.SourceStation > 1 && x.TargetStation - taskFirst.TargetStation > 1 && x.TaskType == (int)TaskOutboundTypeEnum.Outbound)) && x.RGVName == "RGV02");
                                    task = tasks.FirstOrDefault(x => ((taskFirst.TargetStation-x.SourceStation  > 1 &&taskFirst.SourceStation - x.SourceStation > 1 && x.TaskType == (int)TaskInboundTypeEnum.Inbound) || ( taskFirst.TargetStation- x.SourceStation > 1 &&  taskFirst.SourceStation- x.TargetStation > 1 &&  taskFirst.SourceStation- x.SourceStation > 1 && taskFirst.TargetStation - x.TargetStation > 1 && x.TaskType == (int)TaskOutboundTypeEnum.Outbound)) && x.RGVName == "RGV02");
                                    LogAndWarn("中转调度任务控制", $"【{commonRGVFirst.DeviceCode}工作模式:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Automatic)}】设备状态:【{commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Fault)}】【{commonRGVFirst.DeviceCode}】任务【{JsonConvert.SerializeObject(taskFirst)}】{commonRGVFirst.DeviceCode}返回任务:【{JsonConvert.SerializeObject(task.TaskNum)}】】");
@@ -882,6 +937,10 @@
                                }
                                if (commonRGVFirst.GetValue<RGVDBName, int>(RGVDBName.LevelPoint) < 420000)
                                {
                                    if (commonRGVFirst.GetValue<RGVDBName, bool>(RGVDBName.Running))
                                    {
                                        return null;
                                    }
                                    RGVTaskCommand command = new RGVTaskCommand()
                                    {
                                        PickupLocation = (byte)Convert.ToSByte(26),
@@ -1034,19 +1093,44 @@
            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)
            {
                LogAndWarn("查询任务", $" è¿”回任务:【{JsonConvert.SerializeObject(oldtask)}】】");
                WriteInfo("查询任务", $" è¿”回任务:【{JsonConvert.SerializeObject(oldtask)}】】");
                if (oldtask.TaskState == (int)TaskOutStatusEnum.RGV_Outdispatch || oldtask.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish || oldtask.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish)
                {
                    return tasks.FirstOrDefault(x => (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));
                    if (oldtask.RGVName == "RGV01")
                    {
                        return tasks.FirstOrDefault(x => (oldtask.TargetStation - x.SourceStation > 1 && oldtask.SourceStation - x.SourceStation > 1 && x.TaskType == (int)TaskInboundTypeEnum.Inbound) || (oldtask.TargetStation - x.SourceStation > 1 && oldtask.SourceStation - x.TargetStation > 1 && oldtask.SourceStation - x.SourceStation > 1 && oldtask.TargetStation - x.TargetStation > 1 && x.TaskType == (int)TaskOutboundTypeEnum.Outbound));
                    }
                    else
                    {
                        return tasks.FirstOrDefault(x => (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));
                    }
                }
                else if ((oldtask.CurrentAddress == "1025" || oldtask.CurrentAddress == "1026") && (oldtask.TaskState == (int)TaskOutStatusEnum.RGV_OutExecuting || oldtask.TaskState == (int)TaskInStatusEnum.RGV_InExecuting))
                {
                    return tasks.FirstOrDefault(x => (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));
                    if (oldtask.RGVName == "RGV01")
                    {
                        return tasks.FirstOrDefault(x => (oldtask.TargetStation - x.SourceStation > 1 && oldtask.SourceStation - x.SourceStation > 1 && x.TaskType == (int)TaskInboundTypeEnum.Inbound) || (oldtask.TargetStation - x.SourceStation > 1 && oldtask.SourceStation - x.TargetStation > 1 && oldtask.SourceStation - x.SourceStation > 1 && oldtask.TargetStation - x.TargetStation > 1 && x.TaskType == (int)TaskOutboundTypeEnum.Outbound));
                    }
                    else
                    {
                        return tasks.FirstOrDefault(x => (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));
                    }
                }
                else if (oldtask.TaskState == (int)TaskOutStatusEnum.RGV_OutExecuting || oldtask.TaskState == (int)TaskInStatusEnum.RGV_InExecuting)
                {
                    return tasks.FirstOrDefault(x => x.SourceStation - oldtask.TargetStation > 1 && x.TargetStation - oldtask.TargetStation > 1);
                    if (oldtask.RGVName == "RGV01")
                    {
                        return tasks.FirstOrDefault(x => oldtask.TargetStation - x.SourceStation > 1 && oldtask.TargetStation - x.TargetStation > 1);
                    }
                    else
                    {
                        return tasks.FirstOrDefault(x => x.SourceStation - oldtask.TargetStation > 1 && x.TargetStation - oldtask.TargetStation > 1);
                    }
                }
                
                return null;
@@ -1079,6 +1163,10 @@
                    return tasks.FirstOrDefault(x => (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));
                }
                else if ((oldtask.CurrentAddress == "1025" || oldtask.CurrentAddress == "1026") && (oldtask.TaskState == (int)TaskOutStatusEnum.RGV_OutExecuting || oldtask.TaskState == (int)TaskInStatusEnum.RGV_InExecuting))
                {
                    return tasks.FirstOrDefault(x => (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));
                }
                else if (oldtask.TaskState == (int)TaskOutStatusEnum.RGV_OutExecuting || oldtask.TaskState == (int)TaskInStatusEnum.RGV_InExecuting)
                {
                    return tasks.FirstOrDefault(x => x.SourceStation - oldtask.TargetStation > 1 && x.TargetStation - oldtask.TargetStation > 1);
@@ -1087,13 +1175,13 @@
            }
        }
        public Dt_Task? GetDispatchExecutingTask(Dt_Task oldtask)
        public Dt_Task? GetDispatchExecutingTask(Dt_Task oldtask,Dt_Task task)
        {
            var stationManager = _stationManagerRepository.QueryData(x => x.stationType == 15);
            if (stationManager.Count() > 0)
            var stationManagers = _stationManagerRepository.QueryData(x => x.stationType == 15);
            if (stationManagers.Count() > 0)
            {
                string next = null;
                foreach (var item in stationManager)
                foreach (var item in stationManagers)
                {
                    var x = _taskRepository.QueryFirst(x => x.NextAddress == item.stationChildCode || x.CurrentAddress == item.stationChildCode);
                    if (x == null)
@@ -1104,13 +1192,36 @@
                }
                if (next != null)
                {
                    var stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == next);
                    oldtask.Remark = next;
                    _taskRepository.UpdateData(oldtask);
                    LogAndWarn("中转任务GetDispatchExecutingTask", $" è¿”回任务:【{JsonConvert.SerializeObject(oldtask)}】】");
                    return 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)}】】");
                            return oldtask;
                        }
                        else
                        {
                            return null;
                        }
                    }
                    else
                    {
                        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;
                        }
                        else
                        {
                            return null;
                        }
                    }
                }
            }
            return null;
        }