1
xiazhengtongxue
2026-03-27 5d55a31d8ce95e511ffb408f38ed06e81742b67e
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs
@@ -3,6 +3,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Information;
using Org.BouncyCastle.Asn1.Ocsp;
using System.Text;
using System.Text.RegularExpressions;
using WIDESEA_DTO.Agv;
@@ -25,6 +26,7 @@
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_TaskInfoService;
using WIDESEAWCS_Tasks;
using WIDESEAWCS_Tasks.DBNames;
using static Dm.net.buffer.ByteArrayBuffer;
@@ -57,6 +59,7 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                WriteLog.Write_Log("AGV任务更新接口", "AGV任务更新接口", "更新任务", $"任务:{agvUpdateDTO.ToJson()}");
                if (agvUpdateDTO.Message != null && agvUpdateDTO.Message == "ROBOT_ERROR-haiUnknownError")
                {
                    var task1 = _taskRepository.QueryFirst(x => (agvUpdateDTO.MissionCode ?? "") == x.GroupId);
@@ -98,6 +101,7 @@
                        break;
                    case nameof(AGVStatusEnum.PICKER_SEND):
                        if (task == null) throw new Exception($"未找到料箱【{agvUpdateDTO.ContainerCode}】任务");
                        if (task.TaskState <= TaskStatusEnum.AGV_Execute.ObjToInt()) throw new Exception($"料箱【{agvUpdateDTO.ContainerCode}】任务{task.TaskNum}状态{task.TaskState}");
                        Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.PickStationCode == task.NextAddress);
                        if (task.IsCancel > 0 && stationManger != null && stationManger.StationCode != agvUpdateDTO.CurrentPosition)
                        {
@@ -153,6 +157,7 @@
            AgvTaskReqContent content = new AgvTaskReqContent();
            try
            {
                WriteLog.Write_Log("AGV任务请求", "AGV任务请求接口", "任务", $"任务:{agvTaskRequestDTO.ToJson()}");
                //获取任务
                Dt_Task? taskExist = _taskRepository.QueryFirst(x=>x.PalletCode==agvTaskRequestDTO.ContainerCode) ?? throw new Exception($"未找到料箱{agvTaskRequestDTO.ContainerCode}任务");
                //获取站台
@@ -189,6 +194,7 @@
            AgvTaskReqContent content = new AgvTaskReqContent();
            try
            {
                WriteLog.Write_Log("AGV作业完成", "AGV作业完成接口", "任务", $"任务:{agvTaskRequestDTO.ToJson()}");
                //获取站台
                Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == agvTaskRequestDTO.PositionId) ?? throw new Exception($"未找到{agvTaskRequestDTO.PositionId}站台位置");
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode) ?? throw new Exception($"未找到对应设备{stationManger.StationDeviceCode}");