From e3cfda747bd53f4550904d60cd13aa8f4e525739 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 01 十二月 2025 18:52:17 +0800
Subject: [PATCH] 更新WMS接口等
---
项目代码/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs | 46 ++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 44 insertions(+), 2 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
index 6a3c278..9dac38a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
@@ -1,10 +1,12 @@
-锘縰sing Microsoft.AspNetCore.Authorization;
+锘縰sing Autofac.Core;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Text;
using System.Text.RegularExpressions;
using WIDESEA_DTO.Agv;
using WIDESEA_External.Model;
+using WIDESEAWCS_Common;
using WIDESEAWCS_Common.APIEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
@@ -43,7 +45,47 @@
_taskRepository = taskRepository;
_routerRepository = routerRepository;
}
+ /// <summary>
+ /// AGV浠诲姟鏇存柊
+ /// </summary>
+ /// <returns></returns>
+ [HttpPost, HttpGet, Route("Callback"), AllowAnonymous]
+ public WebResponseContent? Callback([FromBody]AgvUpdateDTO 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, TaskStatusEnum.AGV_TakeFinish);
+ break;
+ case nameof(AGVStatusEnum.PICKER_SEND):
+ if (task == null) throw new Exception($"鏈壘鍒版枡绠便�恵agvUpdateDTO.ContainerCode}銆戜换鍔�");
+ _taskService.TaskCompleted(task.TaskNum);
+ break;
+ case nameof(AGVStatusEnum.WAITFEEDBACK):
+ //AGV鏀捐
+ List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x=>x.StationType==StationTypeEnum.StationType_OnlyInbound.ObjToInt());
+ if (!stationMangers.Select(x=>x.StationCode).Contains(agvUpdateDTO.CurrentPosition))
+ {
+ WebResponseContent responseContent = _taskService.AgvTaskFlow(agvUpdateDTO.MissionCode);
+ if (!responseContent.Status) throw new Exception($"{responseContent.Message}");
+ }
+ break;
+ default:
+ break;
+ }
+ content.OK();
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
-
}
}
--
Gitblit v1.9.3