From f5dbea2f9487db2337865151821dea8331387927 Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期五, 13 十二月 2024 10:25:36 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/HuaYiZhongHeng/BaiBuLiKu

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
index 3d35a4a..edccca3 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -188,10 +188,11 @@
 
                 object obj = new
                 {
+                    childDeviceCode,
                     command,
                     commandWrite
                 };
-                _noticeService.StackerData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj });
+                _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj });
 
                 #endregion 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
             }
@@ -271,9 +272,25 @@
                 ConsoleHelper.WriteWarningLine($"銆恵conveyorLine._deviceName}銆戜换鍔″彿锛氥�恵command.TaskNum}銆�,鎵樼洏鏉$爜锛氥�恵command.Barcode}銆戝凡鍒拌揪銆恵childDeviceCode}銆戣緭閫佺嚎鍏ュ簱瀹屾垚,涓嬩竴鐩爣鍦板潃銆愮瓑寰呭垎閰嶈揣浣嶃��");
                 ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
 
-                WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
+                if (task.TaskType == (int)TaskInboundTypeEnum.InNG)
+                {
+                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>();
 
-                Console.Out.WriteLine(content.Serialize());
+                    var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.SourceAddress);
+                    task.CurrentAddress = station.stationLocation;
+                    task.NextAddress = station.stationNGLocation;
+                    task.TargetAddress = task.NextAddress;
+                    task.TaskState = nextStatus; 
+                    task.ModifyDate = DateTime.Now;
+                    task.Modifier = "System";
+                    _taskRepository.UpdateData(task);
+                }
+                else
+                {
+                    WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
+                    Console.Out.WriteLine(content.ToJsonString());
+                }
+
             }
         }
 
@@ -417,7 +434,7 @@
                     taskOutboundTypeEnum = TaskOutboundTypeEnum.OutTray;
                 else
                     taskOutboundTypeEnum = TaskOutboundTypeEnum.Outbound;
-                await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform.Stacker);
+                await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform.Stacker, platform);
             }
             catch (Exception)
             {
@@ -427,7 +444,7 @@
         /// <summary>
         /// 妫�鏌ヤ换鍔″苟鍒涘缓鏂颁换鍔�
         /// </summary>
-        private async Task CheckAndCreateTask(TaskOutboundTypeEnum taskType, string childDeviceCode, int index, string roadWay, List<string> roadways = null)
+        private async Task CheckAndCreateTask(TaskOutboundTypeEnum taskType, string childDeviceCode, int index, string roadWay, Platform platform)
         {
             var tasks = _taskRepository.QueryData(x => x.TaskType == (int)taskType && x.TargetAddress == childDeviceCode);
             if (tasks.Count < index)
@@ -448,7 +465,7 @@
                 var wmsIpAddress = wmsBase + requestTrayOutTask;
 
 
-                var result = await HttpHelper.PostAsync(wmsIpAddress, new { position = childDeviceCode, tag = (int)taskType, areaCdoe = roadWay, roadways = roadways }.ToJsonString());
+                var result = await HttpHelper.PostAsync(wmsIpAddress, new { position = childDeviceCode, tag = (int)taskType, areaCdoe = roadWay, platform.ProductionLine }.ToJsonString());
                 //var result = await HttpHelper.PostAsync("http://localhost:5000/api/Task/RequestTrayOutTaskAsync", dynamic.ToJsonString());
 
                 WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);

--
Gitblit v1.9.3