From f2b85c65234e0dcdd3fcce4dafbe16933b7f1b48 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期日, 30 十一月 2025 04:22:51 +0800
Subject: [PATCH] 出入库流程代码更新

---
 项目代码/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs |   46 +++++++++++++++++++++++++++++++---------------
 1 files changed, 31 insertions(+), 15 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
index dcc11dc..77d542c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
@@ -22,28 +22,21 @@
     {
         private readonly IHttpContextAccessor _httpContextAccessor;
         private readonly IRouterExtension _routerExtension;
-        //private readonly WebSocketServer _webSocketServer;
         private readonly IStationMangerRepository _stationMangerRepository;
 
-        public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension/*, WebSocketServer webSocketServer*/, IStationMangerRepository stationMangerRepository) : base(service)
+        public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension, IStationMangerRepository stationMangerRepository) : base(service)
         {
             _httpContextAccessor = httpContextAccessor;
             _routerExtension = routerExtension;
             _stationMangerRepository=stationMangerRepository;
-            //_webSocketServer = webSocketServer;
         }
 
         [HttpPost, Route("ReceiveTask"), AllowAnonymous]
-        public WebResponseContent ReceiveWMSTask([FromBody] List<WMSTaskDTO> taskDTOs)
+        public WebResponseContent ReceiveWMSTask([FromBody] WMSTaskDTO taskDTO)
         {
-            return Service.ReceiveWMSTask(taskDTOs);
+            return Service.ReceiveWMSTask(taskDTO);
         }
 
-        [HttpPost, HttpGet, Route("RequestAssignLocation"), AllowAnonymous]
-        public string? RequestAssignLocation(int taskNum, string roadwayNo)
-        {
-            return Service.RequestAssignLocation(taskNum, roadwayNo);
-        }
 
         [HttpPost, HttpGet, Route("UpdateTaskExceptionMessage")]
         public WebResponseContent UpdateTaskExceptionMessage(int taskNum, string message)
@@ -62,16 +55,39 @@
         {
             return Service.RollbackTaskStatusToLast(taskNum);
         }
+        /// <summary>
+        /// 瀹瑰櫒娴佸姩鎺ュ彛
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost, HttpGet, Route("ContainerFlow"), AllowAnonymous]
+        public WebResponseContent ContainerFlow([FromBody] ContainerFlowDTO containerFlowDTO)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x=>x.PickStationCode==containerFlowDTO.SlotCode) ?? throw new Exception($"{containerFlowDTO.SlotCode}鎷i�変綅缃笉瀛樺湪");
+                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
+                if (device == null)
+                {
+                    return WebResponseContent.Instance.Error($"鏈壘鍒板搴旇澶噞stationManger.StationDeviceCode}");
+                }
+                CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device;
+                string PickBarCode = commonConveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_PickBarCode, stationManger.StationCode).Replace("\0", "");
+                if (containerFlowDTO.ContainerCode!= PickBarCode) throw new Exception($"浼犲叆鏂欑鐮亄containerFlowDTO.ContainerCode}锛岃緭閫佹枡绠辩爜{PickBarCode}鏁版嵁閿欒");
+                commonConveyorLine.SetValue(ConveyorLineDBName.W_PickToHode,(short)containerFlowDTO.Direction.ObjToInt(), stationManger.StationCode);
+                content.OK();
+            }
+            catch (Exception ex)
+            {
+                content.Error(ex.Message);
+            }
+            return content;
+        }
 
         [HttpPost, HttpGet, Route("GetRouteEndPoint"), AllowAnonymous]
         public WebResponseContent GetRouteEndPoint(string startPoint, int routeType)
         {
             return WebResponseContent.Instance.OK(data: _routerExtension.GetEndPoint(startPoint, routeType));
-        }
-        [HttpPost, HttpGet, Route("AssignCPRoadwayNo"), AllowAnonymous]
-        public WebResponseContent AssignCPRoadwayNo()
-        {
-            return Service.AssignCPRoadwayNo();
         }
         /// <summary>
         /// WMS浠诲姟瀹屾垚鍚屾

--
Gitblit v1.9.3