分支自 SuZhouGuanHong/TaiYuanTaiZhong

AGV任务删除功能,取空托任务逻辑优化,检测上料任务下发逻辑优化(AGV备料两个)
已修改7个文件
已添加4个文件
723 ■■■■ 文件已修改
代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Pipeline.cs 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/Jobs/Task/AutoTaskJob.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/EmptyTrayTask.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_Comm/StateEnum/TrayEnum.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/EmptyPalletTask.cs 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/GetStation/EmptyPalletStation.cs 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/GetStation/EmptyTrayIn.cs 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/Taskinfo/Partial/dt_agvtaskService.cs 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WMS_Server/WIDESEA_WebApi/Controllers/JobTask.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Common/Pipeline.cs
@@ -16,6 +16,7 @@
using WIDESEA_Comm.TaskNo;
using WIDESEA_WCS.JobsPart.Common;
using System.Xml.Linq;
using WIDESEA_Common;
namespace WIDESEA_WCS
{
@@ -84,9 +85,9 @@
                        {
                            #region åˆ¤æ–­åŒºåŸŸå·æ˜¯å¦ä¸€è‡´
                            var area = Gantry_client.ReadByOrder<Int16>("place_prog", number);//放料完成的区域号
                            //var area = Gantry_client.ReadByOrder<Int16>("place_prog", number);//放料完成的区域号
                            WriteLog.Write_Log(number + "取料完成出错", bindSNS[bindSNS.Length - 1], "判断区域号是否一致", $"PCS区域号:{AreaNr};\n桁架区域号:{area}\n错误信息:PCS区域号与桁架区域号不一致!");
                            //WriteLog.Write_Log(number + "取料完成出错", bindSNS[bindSNS.Length - 1], "判断区域号是否一致", $"PCS区域号:{AreaNr};\n桁架区域号:{area}\n错误信息:PCS区域号与桁架区域号不一致!");
                            //if (AreaNr != area)
                            //{
                            //    client.WriteByOrder("W_AlarmSignal", (Int16)2, number);//报警
@@ -97,9 +98,9 @@
                            #endregion
                            #region åˆ¤æ–­è½¦è½®æ•°é‡æ˜¯å¦ä¸€è‡´
                            var quantity = Gantry_client.ReadByOrder<Int16>("pos_prog", number);//桁架记录的车轮数量
                            //var quantity = Gantry_client.ReadByOrder<Int16>("pos_prog", number);//桁架记录的车轮数量
                            WriteLog.Write_Log(number + "取料完成出错", bindSNS[bindSNS.Length - 1], "判断车轮数量是否一致", $"区域号:{AreaNr};\n桁架车轮数:{quantity}\nPCS车轮数:{station.quantity}\n错误信息:PCS区域号与桁架区域号不一致!");
                            //WriteLog.Write_Log(number + "取料完成出错", bindSNS[bindSNS.Length - 1], "判断车轮数量是否一致", $"区域号:{AreaNr};\n桁架车轮数:{quantity}\nPCS车轮数:{station.quantity}\n错误信息:PCS区域号与桁架区域号不一致!");
                            //if (quantity != station.quantity)
                            //{
                            //    client.WriteByOrder("W_AlarmSignal", (Int16)2, number);//报警
@@ -196,18 +197,18 @@
                        }
                        #region æ›´æ–°ä¸€ä¸ªæ£€æµ‹ä¸Šæ–™ä»»åŠ¡
                        Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context);
                        if (!agvtaskService.Find(x => x.agv_toaddress == Station.stationCode).Any())
                        {
                            var task = agvtaskService.Find(x => x.agv_taskstate == "Queue" && (x.agv_tasktype == "TaskType_OutsourceOutbound" || x.agv_tasktype == "TaskType_Outbound") && x.agv_toaddress == "").OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).FirstOrDefault();
                            if (task != null)
                            {
                                task.agv_taskstate = "Create";
                                task.agv_toaddress = Station.stationCode;
                                agvtaskService.Update(task, true);
                                WriteDBLog.Success("更新一个检测上料任务", $"任务编号:{task.agv_tasknum}", "PCS");
                            }
                        }
                        //Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context);
                        //if (!agvtaskService.Find(x => x.agv_toaddress == Station.stationCode).Any())
                        //{
                        //    var task = agvtaskService.Find(x => x.agv_taskstate == "Queue" && (x.agv_tasktype == "TaskType_OutsourceOutbound" || x.agv_tasktype == "TaskType_Outbound") && x.agv_toaddress == "").OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).FirstOrDefault();
                        //    if (task != null)
                        //    {
                        //        task.agv_taskstate = "Create";
                        //        task.agv_toaddress = Station.stationCode;
                        //        agvtaskService.Update(task, true);
                        //        WriteDBLog.Success("更新一个检测上料任务", $"任务编号:{task.agv_tasknum}", "PCS");
                        //    }
                        //}
                        #endregion
                    }
                }
@@ -411,40 +412,29 @@
                                agvtaskService.Update(task, true);
                                station.location_state = LocationStateEnum.Busy.ToString();
                                stationinfoRepository.Update(station, true);
                                WriteDBLog.Success("更新空托队列任务", $"任务编号:{task.agv_tasknum},托盘信号:{PalletSignal},货物信号:{MaterialSignal}", "PCS");
                                WriteDBLog.Success("更新补空托队列任务", $"任务编号:{task.agv_tasknum},托盘信号:{PalletSignal},货物信号:{MaterialSignal}", "PCS");
                                continue;
                            }
                            remark = "查询空托叠盘位";
                            #region ç©ºæ‰˜å ç›˜
                            if (stationCode.Contains("S"))
                            {
                                var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity < 5 && x.enable).ToList();
                                EmptyStation = EmptyStations.Where(x => x.tray_type == station.tray_type && x.location_state == LocationStateEnum.Stroge.ToString()).FirstOrDefault();
                                if (EmptyStation == null)
                                    EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Empty.ToString() && x.quantity == 0 && x.enable).FirstOrDefault();
                                if (EmptyStation == null)
                                {
                                    EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0 && x.enable).OrderByDescending(x => x.quantity).FirstOrDefault();
                                    if (EmptyStation != null) EmptyTray.CreateEmptyTrayIn(stationinfoRepository, EmptyStation);
                                }
                            }
                            #region æ£€æµ‹ä¸Šæ–™çš„空托叠盘
                            //remark = "查询空托叠盘位";
                            //var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.enable).ToList();
                            //if (stationCode.Contains("S"))
                            //{
                            //    //var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity < 5 && x.enable).ToList();
                            //    EmptyStation = EmptyStations.Where(x => x.tray_type == station.tray_type && x.quantity < 5 && x.location_state == LocationStateEnum.Stroge.ToString()).FirstOrDefault();
                            //    if (EmptyStation == null)
                            //        EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Empty.ToString() && x.quantity == 0).FirstOrDefault();
                            //    if (EmptyStation == null)
                            //    {
                            //        EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderByDescending(x => x.quantity).FirstOrDefault();
                            //        if (EmptyStation != null) EmptyTray.CreateEmptyTrayIn(stationinfoRepository, EmptyStation);
                            //    }
                            //}
                            //EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity == 5).FirstOrDefault();
                            //if (EmptyStation != null) EmptyTray.CreateEmptyTrayIn(stationinfoRepository, EmptyStation);
                            #endregion
                            else
                            {
                                remark = "查找库内空托位";
                                EmptyStation = GetStation.EmptyPalletStation(area);
                                if (EmptyStation != null)
                                    if (agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any()) return;
                            }
                            if (EmptyStation != null)
                            {
                                #region åŒä¸€ä¸ªç©ºæ‰˜ä½åªèƒ½åŒæ—¶ç”Ÿæˆä¸€ä¸ªç©ºæ‰˜ä»»åŠ¡
                                //remark = "查询空托位是否存在任务";
                                //if (agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any())
                                //    return;
                                #endregion
                            #region åˆ›å»ºå–空托队列任务
                                dt_agvtask agvtask = new dt_agvtask()
                                {
                                    agv_fromaddress = station.stationCode,
@@ -452,13 +442,13 @@
                                    agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                                    agv_grade = station.stationCode.Contains("S0100100") ? 3 : 1,
                                    agv_createtime = DateTime.Now,
                                    agv_taskstate = "Create",
                                agv_taskstate = AGVTaskStateEnum.Queue.ToString(),
                                    //agv_materielid = station.stationType,
                                    agv_qty = 1,
                                    StarQuantity = 0,
                                    EndQuantity = EmptyStation.quantity,
                                    agv_tasktype = "TaskType_EmptyPallet",
                                    agv_toaddress = EmptyStation.stationCode,
                                EndQuantity = 0,//EmptyStation.quantity,
                                agv_tasktype = AGVTaskTypeEnum.TaskType_EmptyPallet.ToString(),
                                agv_toaddress = "",//EmptyStation.stationCode,
                                    agv_userid = "系统",
                                    agv_TrayStatus = "EmptyTray",//station.tray_status,
                                    agv_Traytype = station.tray_type,
@@ -466,23 +456,61 @@
                                agvtaskService.Add(agvtask, true);
                                station.location_state = LocationStateEnum.Busy.ToString();
                                stationinfoRepository.Update(station, true);
                                EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                                stationinfoRepository.Update(EmptyStation, true);
                                WriteDBLog.Success("创建自动取空托任务", $"任务编号:{agvtask.agv_tasknum},托盘信号:{PalletSignal},货物信号:{MaterialSignal}", "PCS");
                            }
                            //EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                            //stationinfoRepository.Update(EmptyStation, true);
                            WriteDBLog.Success("创建自动取空托队列任务", $"任务编号:{agvtask.agv_tasknum},托盘信号:{PalletSignal},货物信号:{MaterialSignal}", "PCS");
                            #endregion
                            #region åˆ›å»ºå–空托新建任务
                            //else
                            //{
                            //    remark = "查找库内空托位";
                            //    EmptyStation = GetStation.EmptyPalletStation(area);
                            //    if (EmptyStation != null)
                            //        if (agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any()) return;
                            //}
                            //if (EmptyStation != null)
                            //{
                            //    dt_agvtask agvtask = new dt_agvtask()
                            //    {
                            //        agv_fromaddress = station.stationCode,
                            //        agv_id = Guid.NewGuid(),
                            //        agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                            //        agv_grade = station.stationCode.Contains("S0100100") ? 3 : 1,
                            //        agv_createtime = DateTime.Now,
                            //        agv_taskstate = AGVTaskStateEnum.Create.ToString(),
                            //        //agv_materielid = station.stationType,
                            //        agv_qty = 1,
                            //        StarQuantity = 0,
                            //        EndQuantity = EmptyStation.quantity,
                            //        agv_tasktype = "TaskType_EmptyPallet",
                            //        agv_toaddress = EmptyStation.stationCode,
                            //        agv_userid = "系统",
                            //        agv_TrayStatus = "EmptyTray",//station.tray_status,
                            //        agv_Traytype = station.tray_type,
                            //    };
                            //    agvtaskService.Add(agvtask, true);
                            //    station.location_state = LocationStateEnum.Busy.ToString();
                            //    stationinfoRepository.Update(station, true);
                            //    EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                            //    stationinfoRepository.Update(EmptyStation, true);
                            //    WriteDBLog.Success("创建自动取空托任务", $"任务编号:{agvtask.agv_tasknum},托盘信号:{PalletSignal},货物信号:{MaterialSignal}", "PCS");
                            //}
                            #endregion
                        }
                    }
                    catch (Exception ex)
                    {
                        //WriteDBLog.Error("创建自动取空托任务", $"{stationCode}:{remark}错误信息:{ex.Message}", "PCS");
                        WriteLog.Write_Log("报错日志", "创建自动取空托任务", "错误信息!", $"{stationCode}:{remark}错误信息:{ex.Message}");
                        WriteLog.Write_Log("报错日志", "创建自动取空托队列任务", "错误信息!", $"{stationCode}:{remark}错误信息:{ex.Message}");
                    }
                }
            }
            catch (Exception ex)
            {
                //WriteDBLog.Error("创建自动取空托任务", $"错误信息:{ex.Message}", "PCS");
                WriteLog.Write_Log("报错日志", "创建自动取空托任务", "错误信息!", $"错误信息:{ex.Message}");
                WriteLog.Write_Log("报错日志", "创建自动取空托队列任务", "错误信息!", $"错误信息:{ex.Message}");
            }
        }
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/Jobs/Task/AutoTaskJob.cs
@@ -30,7 +30,7 @@
        private void DoAction(IJobExecutionContext context)
        {
            EmptyTray.EmptyTrayIn();//空托叠盘入库
            //EmptyTray.EmptyTrayIn();//空托叠盘入库
            StationTask.CreateTask();//入库
            OutboundTask.CreateOutboundTask();//出库
            ReplaceTray.ReplaceTrayTask();//更换托盘
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/EmptyTrayTask.cs
@@ -6,6 +6,7 @@
using WIDESEA_Comm;
using WIDESEA_Comm.LogInfo;
using WIDESEA_Comm.TaskNo;
using WIDESEA_Common;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IRepositories;
@@ -43,6 +44,19 @@
                    var MaterialSignal = Pipeline_client.ReadByOrder<Int16>("R_MaterialSignal", station.stationCode);//读取货物信号:1:有,2无
                    if (PalletSignal == 2 && MaterialSignal == 2)
                    {
                        var agv_task = agvtaskRepository.Find(x => x.agv_taskstate == AGVTaskStateEnum.Queue.ToString() && x.agv_tasktype == AGVTaskTypeEnum.TaskType_EmptyPallet.ToString() && string.IsNullOrEmpty(x.agv_toaddress)).OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).FirstOrDefault();
                        if (agv_task != null)
                        {
                            agv_task.agv_taskstate = AGVTaskStateEnum.Create.ToString();
                            //agv_task.EndQuantity = EmptyStation.quantity;
                            agv_task.agv_toaddress = station.stationCode;
                            agvtaskRepository.Update(agv_task, true);
                            station.location_state = LocationStateEnum.Busy.ToString();
                            stationinfoRepository.Update(station, true);
                            WriteDBLog.Success("更新补空托任务", $"任务编号:{agv_task.agv_tasknum}", "PCS");
                        }
                        else
                        {
                        dt_agvtask taskPart = new dt_agvtask()
                        {
                            agv_fromaddress = "",
@@ -63,6 +77,8 @@
                        agvtaskRepository.Add(taskPart, true);
                        WriteDBLog.Success("创建补空托任务", $"任务编号:{taskPart.agv_tasknum}", "PCS");
                    }
                    }
                }
            }
            catch (Exception ex)
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs
@@ -7,6 +7,7 @@
using WIDESEA_Comm;
using WIDESEA_Comm.LogInfo;
using WIDESEA_Comm.TaskNo;
using WIDESEA_Common;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IRepositories;
@@ -61,47 +62,65 @@
                foreach (var station in stations)
                {
                    if (agvtaskRepository.Find(x => x.agv_fromaddress == station.stationCode || x.agv_toaddress == station.stationCode).Any()) continue;
                    #region MyRegion
                    var types = station.tray_type.Split('/');
                    var area = types[0] == "SmallTray" ? "11" : "10";
                    //找1库区的空托位
                    var EmptyStation = GetStation.EmptyPalletStation(area);
                    //var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") /*&& x.location_state == "Empty"*/ && x.enable)
                    //    .OrderBy(x => x.column).OrderBy(x => x.line).FirstOrDefault();
                    //if (EmptyStation == null)
                    //    EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") /*&& x.location_state == "Empty"*/ && x.enable)
                    //    .OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault();
                    if (EmptyStation != null)
                    {
                        dt_agvtask agvtask = new dt_agvtask()
                        {
                            agv_fromaddress = station.stationCode,
                            agv_id = Guid.NewGuid(),
                            agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                            agv_grade = 2,
                        agv_grade = 1,
                            agv_createtime = DateTime.Now,
                            agv_taskstate = "Create",
                            //agv_materielid = station.stationType,
                        agv_taskstate = AGVTaskStateEnum.Queue.ToString(),
                            agv_qty = 1,
                            StarQuantity = 0,
                            EndQuantity = EmptyStation.quantity,
                            agv_tasktype = "TaskType_EmptyPallet",
                            agv_toaddress = EmptyStation.stationCode,
                        EndQuantity = 0,//EmptyStation.quantity,
                        agv_tasktype = AGVTaskTypeEnum.TaskType_EmptyPallet.ToString(),
                        agv_toaddress = "",//EmptyStation.stationCode,
                            agv_userid = "系统",
                            agv_TrayStatus = station.tray_status,
                            //bindSN = station.bindSN,
                            //agv_worktype = Convert.ToInt32(mesinfo.processCode),
                            //agv_materbarcode = mesinfo.materialCode,
                            agv_Traytype = types[0]
                        };
                        agvtaskRepository.Add(agvtask, true);
                        station.location_state = LocationStateEnum.Busy.ToString();
                        stationinfoRepository.Update(EmptyStation, true);
                        EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                        stationinfoRepository.Update(EmptyStation, true);
                    stationinfoRepository.Update(station, true);
                        WriteDBLog.Success("创建更换空盘任务", $"任务编号:{agvtask.agv_tasknum}", "PCS");
                        CreatePartQueue(agvtaskRepository, agvtask, agvtask.agv_Traytype == "SmallTray" ? "LargeTray" : "SmallTray");
                        //CreatePartQueue(agvtaskRepository, agvtask, types[1]);
                    }
                    #endregion
                    #region MyRegion
                    //var types = station.tray_type.Split('/');
                    //var area = types[0] == "SmallTray" ? "11" : "10";
                    ////找1库区的空托位
                    //var EmptyStation = GetStation.EmptyPalletStation(area);
                    //if (EmptyStation != null)
                    //{
                    //    dt_agvtask agvtask = new dt_agvtask()
                    //    {
                    //        agv_fromaddress = station.stationCode,
                    //        agv_id = Guid.NewGuid(),
                    //        agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                    //        agv_grade = 2,
                    //        agv_createtime = DateTime.Now,
                    //        agv_taskstate = "Create",
                    //        agv_qty = 1,
                    //        StarQuantity = 0,
                    //        EndQuantity = EmptyStation.quantity,
                    //        agv_tasktype = "TaskType_EmptyPallet",
                    //        agv_toaddress = EmptyStation.stationCode,
                    //        agv_userid = "系统",
                    //        agv_TrayStatus = station.tray_status,
                    //        agv_Traytype = types[0]
                    //    };
                    //    agvtaskRepository.Add(agvtask, true);
                    //    station.location_state = LocationStateEnum.Busy.ToString();
                    //    stationinfoRepository.Update(station, true);
                    //    EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                    //    stationinfoRepository.Update(EmptyStation, true);
                    //    WriteDBLog.Success("创建更换空盘任务", $"任务编号:{agvtask.agv_tasknum}", "PCS");
                    //    CreatePartQueue(agvtaskRepository, agvtask, agvtask.agv_Traytype == "SmallTray" ? "LargeTray" : "SmallTray");
                    //}
                    #endregion
                }
            }
            catch (Exception ex)
´úÂë¹ÜÀí/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs
@@ -205,14 +205,15 @@
                    {
                        if (agvtask.agv_tasktype == AGVTaskTypeEnum.TaskType_Outbound.ToString())
                            if (GetStation.QueueStation(agvtask.agv_fromaddress)) return;//限制一行一次只能出一个任务
                        var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("S01001") && (x.tray_status == TrayStateEnum.EmptyTray.ToString() || x.location_state == LocationStateEnum.Empty.ToString()) && x.enable).ToList();
                        //var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("S01001") && (x.tray_status == TrayStateEnum.EmptyTray.ToString() || x.location_state == LocationStateEnum.Empty.ToString()) && x.enable).ToList();
                        var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("S01001") && x.enable).ToList();
                        foreach (var EmptyStation in EmptyStations)
                        {
                            if (agvtaskService.Find(x => x.agv_toaddress == EmptyStation.stationCode).Any()) continue;
                            agvtask.agv_taskstate = AGVTaskStateEnum.Create.ToString();
                            agvtask.agv_toaddress = EmptyStation.stationCode;
                            EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                            stationinfoRepository.Update(EmptyStation, true);
                            //EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                            //stationinfoRepository.Update(EmptyStation, true);
                            agvtaskService.Update(agvtask, true);
                            WriteDBLog.Success("更新出库队列任务", $"任务编号:{agvtask.agv_tasknum}", "PCS");
                            return;
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_Comm/StateEnum/TrayEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_Comm
{
    /// <summary>
    /// æ‰˜ç›˜çŠ¶æ€
    /// </summary>
    public enum TrayStateEnum
    {
        /// <summary>
        /// ç©ºæ‰˜ç›˜
        /// </summary>
        EmptyTray,
        /// <summary>
        /// æ»¡æ‰˜ç›˜
        /// </summary>
        StrogeTray
    }
    /// <summary>
    /// æ‰˜ç›˜ç±»åž‹
    /// </summary>
    public enum TrayTypeEnum
    {
        /// <summary>
        /// å°æ‰˜ç›˜
        /// </summary>
        SmallTray,
        /// <summary>
        /// å¤§æ‰˜ç›˜
        /// </summary>
        LargeTray,
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/EmptyPalletTask.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Comm;
using WIDESEA_Comm.LogInfo;
using WIDESEA_Common;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.JobsPart.Common;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
using static System.Collections.Specialized.BitVector32;
namespace WIDESEA_WMS.Common
{
    public partial class AGVServer
    {
        /// <summary>
        /// æ›´æ–°å–空托队列任务
        /// </summary>
        public static void UpdateEmptyPalletTask()
        {
            string tasknum = "";
            try
            {
                VOLContext Context = new VOLContext();
                Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(Context);
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                #region å ç›˜åŒºæ»¡5个入库
                var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.enable).ToList();
                var EmptyD = EmptyStations.Where(x => x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity == 5).FirstOrDefault();
                if (EmptyD != null) EmptyTray.CreateEmptyTrayIn(stationinfoRepository, EmptyD);
                #endregion
                var agv_task = agvtaskRepository.Find(x => x.agv_taskstate == AGVTaskStateEnum.Queue.ToString() && x.agv_tasktype == AGVTaskTypeEnum.TaskType_EmptyPallet.ToString() && string.IsNullOrEmpty(x.agv_toaddress)).OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).FirstOrDefault();
                if (agv_task != null)
                {
                    tasknum = agv_task.agv_tasknum;
                    #region MyRegion
                    //var task = agvtaskRepository.Find(x => (x.agv_toaddress.Contains("W") || x.agv_toaddress.Contains("X")) && x.agv_taskstate == AGVTaskStateEnum.Queue.ToString() && x.agv_tasktype == AGVTaskTypeEnum.TaskType_EmptyPallet.ToString() && x.agv_Traytype == agv_task.agv_Traytype).OrderByDescending(x => x.agv_grade).ThenBy(x => x.agv_createtime).FirstOrDefault();
                    //if (task != null)
                    //{
                    //    task.agv_fromaddress = station.stationCode;
                    //    task.StarQuantity = 0;
                    //    task.agv_taskstate = "Create";
                    //    if (station.stationCode.Contains("S0100100"))
                    //        task.agv_grade = 3;
                    //    agvtaskService.Update(task, true);
                    //    station.location_state = LocationStateEnum.Busy.ToString();
                    //    stationinfoRepository.Update(station, true);
                    //    WriteDBLog.Success("更新补空托队列任务", $"任务编号:{task.agv_tasknum},托盘信号:{PalletSignal},货物信号:{MaterialSignal}", "WMS");
                    //    return;
                    //}
                    #endregion
                    dt_stationinfo EmptyStation = null;
                    #region æ£€æµ‹ä¸Šæ–™çš„空托叠盘
                    if (agv_task.agv_fromaddress.Contains("S"))
                    {
                        //var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity < 5 && x.enable).ToList();
                        EmptyStation = EmptyStations.Where(x => x.tray_type == agv_task.agv_Traytype && x.quantity < 5 && x.location_state == LocationStateEnum.Stroge.ToString()).FirstOrDefault();
                        if (EmptyStation == null)
                            EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Empty.ToString() && x.quantity == 0).FirstOrDefault();
                        if (EmptyStation == null)
                        {
                            EmptyD = EmptyStations.Where(x => x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderByDescending(x => x.quantity).FirstOrDefault();
                            if (EmptyD != null) EmptyTray.CreateEmptyTrayIn(stationinfoRepository, EmptyD);
                        }
                    }
                    #endregion
                    else
                    {
                        EmptyStation = GetStation.EmptyPalletStation(agv_task.agv_Traytype == "SmallTray" ? "11" : "10");
                    }
                    if (EmptyStation != null)
                    {
                        agv_task.agv_taskstate = AGVTaskStateEnum.Create.ToString();
                        agv_task.EndQuantity = EmptyStation.quantity;
                        agv_task.agv_toaddress = EmptyStation.stationCode;
                        agvtaskRepository.Update(agv_task, true);
                        EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                        stationinfoRepository.Update(EmptyStation, true);
                        WriteDBLog.Success("更新自动取空托队列任务", $"任务编号:{agv_task.agv_tasknum}", "WMS");
                    }
                }
            }
            catch (Exception ex)
            {
                WriteLog.Write_Log("报错日志", "更新自动取空托队列任务", "错误信息!", $"{tasknum};错误信息:{ex.Message}");
            }
        }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/GetStation/EmptyPalletStation.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,204 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Comm;
using WIDESEA_Comm.LogInfo;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
using static System.Collections.Specialized.BitVector32;
namespace WIDESEA_WCS.JobsPart.Common
{
    public class GetStation
    {
        /// <summary>
        /// å½“前库位同一行是否存在入库占用
        /// true:是 false:否
        /// </summary>
        /// <param name="StationCode"></param>
        /// <returns></returns>
        public static bool InBusyStation(string StationCode)
        {
            bool OK = false;
            try
            {
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                var station = stationinfoRepository.Find(x => x.stationCode == StationCode).FirstOrDefault();
                OK = stationinfoRepository.Find(x => x.area == station.area && x.line == station.line && x.location_state == LocationStateEnum.InBusy.ToString()).Any();
            }
            catch (Exception ex)
            {
            }
            return OK;
        }
        /// <summary>
        /// å½“前库位同一行是否存在出库占用
        /// true:是 false:否
        /// </summary>
        /// <param name="StationCode"></param>
        /// <returns></returns>
        public static bool OutBusyStation(string StationCode)
        {
            bool OK = false;
            try
            {
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                var station = stationinfoRepository.Find(x => x.stationCode == StationCode).FirstOrDefault();
                OK = stationinfoRepository.Find(x => x.area == station.area && x.line == station.line && x.location_state == LocationStateEnum.OutBusy.ToString()).Any();
            }
            catch (Exception ex)
            {
            }
            return OK;
        }
        /// <summary>
        /// å½“前库位外边的货位是否都为空
        /// true:否 false:是
        /// </summary>
        /// <param name="StationCode"></param>
        /// <returns></returns>
        public static bool QueueStation(string StationCode)
        {
            bool OK = false;
            try
            {
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                var station = stationinfoRepository.Find(x => x.stationCode == StationCode).FirstOrDefault();
                OK = stationinfoRepository.Find(x => x.area == station.area && x.line == station.line && x.column > station.column && x.location_state != LocationStateEnum.Empty.ToString()).Any();
            }
            catch (Exception ex)
            {
            }
            return OK;
        }
        /// <summary>
        /// æ‰¾å¯å…¥åº“空托位
        /// </summary>
        public static void EmptyStation()
        {
            try
            {
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context);
                var Stations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity == 5 && x.enable).ToList();
                foreach (var Station in Stations)
                {
                    var area = Station.tray_type == "SmallTray" ? "11" : "10";
                }
            }
            catch (Exception ex)
            {
            }
        }
        public static dt_stationinfo Station(dt_stationinfo EmptyStation, Idt_stationinfoRepository stationinfoRepository)
        {
            dt_stationinfo stationinfo = null;
            try
            {
                if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.location_state.Contains("Busy")).Any()) return stationinfo;
                stationinfo = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.quantity > 0 && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                if (stationinfo != null)
                {
                    if (stationinfo.quantity < 5) return stationinfo;
                    else
                        stationinfo = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault();
                }
                else
                {
                    stationinfo = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault();
                }
                //if (stationinfo == null)
            }
            catch (Exception ex)
            {
            }
            return stationinfo;
        }
        /// <summary>
        /// ç©ºæ‰˜å¯å…¥åº“货位
        /// </summary>
        /// <param name="area"></param>
        /// <returns></returns>
        public static dt_stationinfo EmptyPalletStation(string area)
        {
            dt_stationinfo stationinfo = null;
            try
            {
                VOLContext Context = new VOLContext();
                Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context);
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                #region æŸ¥æ‰¾ç©ºæ‰˜ç›˜åº“区
                //if (stationinfoRepository.Find(x => x.area == area && x.location_state == LocationStateEnum.Busy.ToString()).Any() && area != "10")
                if (stationinfoRepository.Find(x => x.stationCode == "A01001001" && x.quantity == 5 && x.location_state == LocationStateEnum.Stroge.ToString()).Any())
                {
                    var EmptyStation = stationinfoRepository.Find(x => x.stationCode == "C01005002" && x.location_state == LocationStateEnum.Empty.ToString()).FirstOrDefault();
                    if (EmptyStation != null)
                    {
                        if (!stationinfoRepository.Find(x => x.line == EmptyStation.line && x.area == EmptyStation.area && x.location_state != LocationStateEnum.Empty.ToString()).Any())
                            return EmptyStation;
                    }
                    EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01005002" && x.location_state == "Stroge" && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault();
                    if (EmptyStation != null) stationinfo = Station(EmptyStation, stationinfoRepository);
                    if (stationinfo != null) return stationinfo;
                    EmptyStation = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                    if (EmptyStation.quantity == 5)
                    {
                        EmptyStation = stationinfoRepository.Find(x => x.stationCode == "C01004002" && x.location_state == LocationStateEnum.Empty.ToString()).FirstOrDefault();
                        if (EmptyStation != null)
                        {
                            if (!stationinfoRepository.Find(x => x.line == EmptyStation.line && x.area == EmptyStation.area && x.location_state != LocationStateEnum.Empty.ToString()).Any())
                                return EmptyStation;
                        }
                        EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01004002" && x.location_state == "Stroge" && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault();
                        if (EmptyStation != null) stationinfo = Station(EmptyStation, stationinfoRepository);
                    }
                }
                else
                {
                    if (stationinfoRepository.Find(x => x.area == area && x.location_state == LocationStateEnum.Busy.ToString()).Any()) return stationinfo;
                    stationinfo = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.enable).OrderBy(x => x.column).FirstOrDefault();
                    if (stationinfo != null)
                        if (stationinfo.quantity < 5) return stationinfo;
                    stationinfo = stationinfoRepository.Find(x => x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();
                }
                #endregion
                #region åˆ¤æ–­å½“前货位是否存在任务
                if (stationinfo != null)
                    if (agvtaskService.Find(x => /*x.agv_fromaddress == stationinfo.stationCode ||*/ x.agv_toaddress == stationinfo.stationCode).Any()) stationinfo = null;
                #endregion
            }
            catch (Exception ex)
            {
                throw;
            }
            return stationinfo;
        }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Common/GetStation/EmptyTrayIn.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Comm.LogInfo;
using WIDESEA_Comm.TaskNo;
using WIDESEA_Comm;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
namespace WIDESEA_WCS.JobsPart.Common
{
    public class EmptyTray
    {
        /// <summary>
        /// ç©ºæ‰˜å ç›˜å…¥åº“
        /// </summary>
        public static void EmptyTrayIn()
        {
            try
            {
                VOLContext Context = new VOLContext();
                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context);
                var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity == 5 && x.enable).ToList();
                foreach (var EmptyStation in EmptyStations)
                {
                    CreateEmptyTrayIn(stationinfoRepository, EmptyStation);
                }
            }
            catch (Exception ex)
            {
                WriteDBLog.Success("创建叠盘位空托入库任务", $"错误信息:{ex.Message}", "PCS");
            }
        }
        /// <summary>
        /// åˆ›å»ºç©ºæ‰˜å ç›˜å…¥åº“任务
        /// </summary>
        /// <param name="stationinfoRepository"></param>
        /// <param name="EmptyStation"></param>
        public static void CreateEmptyTrayIn(Idt_stationinfoRepository stationinfoRepository, dt_stationinfo EmptyStation)
        {
            VOLContext Context = new VOLContext();
            Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(Context);
            try
            {
                if (agvtaskRepository.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any()) return;
                var area = EmptyStation.tray_type == "SmallTray" ? "11" : "10";
                var toEmptyStation = GetStation.EmptyPalletStation(area);
                if (toEmptyStation != null)
                {
                    #region åŒä¸€ä¸ªç©ºæ‰˜ä½åªèƒ½åŒæ—¶ç”Ÿæˆä¸€ä¸ªç©ºæ‰˜ä»»åŠ¡
                    if (agvtaskRepository.Find(x => x.agv_fromaddress == toEmptyStation.stationCode || x.agv_toaddress == toEmptyStation.stationCode).Any()) return;
                    #endregion
                    dt_agvtask agvtask = new dt_agvtask()
                    {
                        agv_fromaddress = EmptyStation.stationCode,
                        agv_id = Guid.NewGuid(),
                        agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
                        agv_grade = 3,
                        agv_createtime = DateTime.Now,
                        agv_taskstate = "Create",
                        //agv_materielid = station.stationType,
                        agv_qty = EmptyStation.quantity - toEmptyStation.quantity,
                        StarQuantity = toEmptyStation.quantity,
                        EndQuantity = toEmptyStation.quantity,
                        agv_tasktype = "TaskType_EmptyPallet",
                        agv_toaddress = toEmptyStation.stationCode,
                        agv_userid = "系统",
                        agv_TrayStatus = "EmptyTray",//station.tray_status,
                        agv_Traytype = EmptyStation.tray_type,
                    };
                    agvtaskRepository.Add(agvtask, true);
                    EmptyStation.location_state = LocationStateEnum.Busy.ToString();
                    stationinfoRepository.Update(EmptyStation, true);
                    toEmptyStation.location_state = LocationStateEnum.Busy.ToString();
                    stationinfoRepository.Update(toEmptyStation, true);
                    WriteDBLog.Success("创建叠盘位空托入库任务", $"任务编号:{agvtask.agv_tasknum}", "PCS");
                }
            }
            catch (Exception ex)
            {
                WriteDBLog.Error("创建叠盘位空托入库任务", $"错误信息:{ex.Message}", "PCS");
            }
        }
    }
}
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WMS/Services/Taskinfo/Partial/dt_agvtaskService.cs
@@ -27,6 +27,9 @@
using StackExchange.Redis;
using WIDESEA_Comm;
using WIDESEA_Entity.DomainModels.Mes;
using WIDESEA_WMS.Common;
using System.Reflection.Emit;
using System.Threading.Tasks;
namespace WIDESEA_WMS.Services
{
@@ -47,7 +50,62 @@
            //多租户会用到这init代码,其他情况可以不用
            //base.Init(dbRepository);
        }
        public override WebResponseContent Del(object[] keys, bool delList = true)
        {
            #region æ‰¹é‡ä¿®æ”¹è´§ä½çŠ¶æ€
            //VOLContext context = new VOLContext();
            //Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
            //var fromaddress = repository.Find(x => keys.Contains(x.agv_id)).Select(x => x.agv_fromaddress).ToList();
            //var stations = stationinfoRepository.Find(x => fromaddress.Contains(x.stationCode)).ToList();
            //foreach (var station in stations)
            //{
            //    station.location_state = LocationStateEnum.Stroge.ToString();
            //    //station.tray_type= TrayTypeEnum.SmallTray.ToString();
            //    //station.tray_status= TrayStateEnum.StrogeTray.ToString();
            //}
            //stationinfoRepository.UpdateRange(stations, x => new { x.location_state }, true);
            #endregion
            VOLContext volContext = new VOLContext();
            Idt_agvtask_htyRepository agvtask_HtyRepository=new dt_agvtask_htyRepository(volContext);
            var agvtasks = repository.Find(x => keys.Contains(x.agv_id)).ToList();
            List<dt_agvtask_hty> dt_Agvtask_Hties = new List<dt_agvtask_hty>();
            foreach (var task in agvtasks)
            {
                dt_agvtask_hty agvtask_Hty = new dt_agvtask_hty()
                {
                    hty_pkid = Guid.NewGuid(),
                    agv_id = task.agv_id,
                    agv_tasknum = task.agv_tasknum,
                    agv_materielid = task.agv_materielid,
                    agv_qty = task.agv_qty,
                    agv_createtime = task.agv_createtime,
                    agv_realesstime = task.agv_realesstime,
                    agv_executingBeginTime = task.agv_executingBeginTime,
                    agv_executingEndTime = task.agv_executingEndTime,
                    agv_completeBeginTime = task.agv_completeBeginTime,
                    agv_finishedtime = task.agv_finishedtime,
                    agv_taskstate = task.agv_taskstate,
                    agv_tasktype = task.agv_tasktype,
                    agv_fromaddress = task.agv_fromaddress,
                    agv_toaddress = task.agv_toaddress,
                    agv_operatetype = "Del",
                    agv_compeletor = UserContext.Current.UserName,
                    agv_completedate = DateTime.Now,
                    agv_grade = task.agv_grade,
                    agv_userid = task.agv_userid,
                    agv_Traytype = task.agv_Traytype,
                    agv_TrayStatus = task.agv_TrayStatus,
                    agv_worktype = task.agv_worktype,
                    agv_remark = task.agv_remark,
                    bindSN = task.bindSN,
                    jobID = task.jobID,
                    agv_materbarcode = task.agv_materbarcode,
                };
                dt_Agvtask_Hties.Add(agvtask_Hty);
            }
            agvtask_HtyRepository.AddRange(dt_Agvtask_Hties,true);
            return base.Del(keys, delList);
        }
        public WebResponseContent addNgTask(MesRequestTemp requestTemp)
        {
            WebResponseContent content = new WebResponseContent();
@@ -102,6 +160,7 @@
            var agv_id = saveModel.MainData["agv_id"].ToString();
            var task = _repository.Find(x => x.agv_id.ToString() == agv_id).FirstOrDefault();
            if (task.agv_taskstate != AGVTaskStateEnum.Queue.ToString()) return content.Error("当前任务不可更改!");
            WriteDBLog.Success($"手动修改任务", new { æ•°æ® = saveModel }, "WMS", UserContext.Current.UserName);
            return base.Update(saveModel);
        }
        #region æ·»åŠ NG任务
´úÂë¹ÜÀí/WMS/WMS_Server/WIDESEA_WebApi/Controllers/JobTask.cs
@@ -12,6 +12,7 @@
        [Invoke(Begin = "2024-01-01 00:00", Interval = 1000 * 5, /*IsEnabled = true,*/ SkipWhileExecuting = true)]
        public void TaskTime()
        {
            AGVServer.UpdateEmptyPalletTask();
            AGVServer.SendAgvTask();
        }
    }