From 73a9951bb6a5919ec481fa6fef37d5aa338b31db Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 20 四月 2026 10:03:15 +0800
Subject: [PATCH] 1
---
项目代码/WIDESEA_WCSServer/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs | 74 ++++++++++++++++++++++++++++++++----
1 files changed, 65 insertions(+), 9 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WCSServer/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WCSServer/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
index 2862c62..778fd4c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WCSServer/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WCSServer/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
@@ -1,29 +1,85 @@
-锘縰sing Microsoft.AspNetCore.Authorization;
+锘縰sing Autofac.Core;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
-using System.Reflection;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Information;
+using System.Text;
+using System.Text.RegularExpressions;
+using WIDESEAWCS_Common;
+using WIDESEAWCS_Common.APIEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
-using WIDESEAWCS_DTO.AGV;
+using WIDESEAWCS_Core.Enums;
+using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.LogHelper;
+using WIDESEAWCS_DTO;
+using WIDESEAWCS_DTO.Agv;
+using WIDESEAWCS_DTO.TaskInfo;
+using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
+using WIDESEAWCS_QuartzJob.DTO;
+using WIDESEAWCS_QuartzJob.Models;
+using WIDESEAWCS_QuartzJob.Repository;
+using WIDESEAWCS_TaskInfoService;
using WIDESEAWCS_Tasks;
-namespace WIDESEAWCS_Server.Controllers.AGV
+namespace WIDESEAWCS_Server.Controllers
{
- [Route("api/AGV")]
+ [Route("api/[controller]")]
[ApiController]
public class AGVController : ControllerBase
{
- private readonly ITaskRepository _taskRepository;
+ private readonly IDt_StationManagerRepository _stationMangerRepository;
private readonly ITaskService _taskService;
+ private readonly ITaskRepository _taskRepository;
+ private readonly IRouterRepository _routerRepository;
- public AGVController(ITaskRepository taskRepository,ITaskService taskService)
+ public AGVController(IDt_StationManagerRepository stationMangerRepository, ITaskService taskService, ITaskRepository taskRepository,IRouterRepository routerRepository)
{
- _taskRepository = taskRepository;
+ _stationMangerRepository = stationMangerRepository;
_taskService = taskService;
+ _taskRepository = taskRepository;
+ _routerRepository = routerRepository;
+ }
+ /// <summary>
+ /// AGV浠诲姟鏇存柊
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost, HttpGet, Route("Callback"), AllowAnonymous]
+ public WebResponseContent? Callback([FromBody]AgvStatusUpdateDTO agvUpdateDTO)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ var task = _taskRepository.QueryFirst(x => (agvUpdateDTO.ContainerCode ?? "") == x.PalletCode);
+ switch (agvUpdateDTO.MissionStatus)
+ {
+ case nameof(AGVStatusEnum.PICKER_RECEIVE):
+ if (task == null) throw new Exception($"鏈壘鍒版枡绠便�恵agvUpdateDTO.ContainerCode}銆戜换鍔�");
+ _taskService.UpdateTask(task, TaskAGVCarryStatusEnum.AGV_CarryTakeFinish);
+ break;
+ case nameof(AGVStatusEnum.PICKER_SEND):
+ if (task == null) throw new Exception($"鏈壘鍒版枡绠便�恵agvUpdateDTO.ContainerCode}銆戜换鍔�");
+ _taskService.UpdateTask(task, TaskAGVCarryStatusEnum.AGV_CarryReleaseFinish);
+ break;
+ case nameof(AGVStatusEnum.COMPLETED):
+ if (task == null) throw new Exception($"鏈壘鍒版枡绠便�恵agvUpdateDTO.ContainerCode}銆戜换鍔�");
+ _taskService.TaskCompleted(task.TaskNum);
+ break;
+ default:
+ break;
+ }
+
+ content.OK();
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
}
}
}
--
Gitblit v1.9.3